Back to home page

Enduro/X

 
 

    


0001 CBVGET(3)
0002 =========
0003 :doctype: manpage
0004 
0005 
0006 NAME
0007 ----
0008 CBvget - Get and convert to user type data from VIEW buffer field
0009 
0010 
0011 SYNOPSIS
0012 --------
0013 
0014 #include <ubf.h>
0015 
0016 int CBvget(char *'cstruct', char *'view', char *'cname', BFLDOCC 'occ', char *'buf', 
0017 BFLDLEN *'len', int 'usrtype', long 'flags');
0018 
0019 Link with '-lubf -lnstd -lm -lpthread'
0020 
0021 DESCRIPTION
0022 -----------
0023 Function is used to get field data dynamically from VIEW buffer. 'cstruct' is pointer 
0024 to C structure instance (object), 'view' is name of the VIEW (must match the instance of the
0025 object), 'occ' is field array occurrence, if field is not an array or first array element must
0026 be read, then use occ=0. 'buf' is buffer where to output the data. 'len' is used on both
0027 directions, on *input* it is used for indicating the length of the bytes for the target buffer 
0028 ('buf'). If the data is larger than 'len' indicated, then error *BNOSPACE* is returned. 
0029 Then 'len' is optional. If set to NULL, then no such checks are made, and it is assumed 
0030 that buffer length is sufficient to store the data. 'len' is used only for *BFLD_STRING* 
0031 and *BFLD_CARRAY* fields. On output 'len' (if not NULL), indicates the length of data loaded in 'buf'. 
0032 Indicated in bytes. 'usrtype' is user type indicating the data type of the 'buf', 
0033 if types are different, the automatic data conversion is performed. 'flags' is either set to
0034 0 in which case data is returned as is in the VIEW, does not matter if it matches the *NULL*
0035 value specified in VIEW file or not, the exact value is returned. If flag *BVACCESS_NOTNULL*
0036 is specified, then if value in field matches *NULL* column in view file, then error 
0037 *BNOTPRES* is returned. *BNOTPRES* can be returned in case if 'C' flag was set in view file,
0038 and the count indicator is set to less than occurrence specified.
0039 
0040 
0041 RETURN VALUE
0042 ------------
0043 On success, *CBvget()* return zero; on error, -1 is returned, with *Berror* set to 
0044 indicate the error.
0045 
0046 ERRORS
0047 ------
0048 Note that *Bstrerror()* returns generic error message plus custom message with debug info 
0049 from last function call, stored in thread local storage (TLS).
0050 
0051 *BEINVAL* 'view', 'cstruct' or 'buf' is NULL. 'view' or 'cname' is empty string (first byte
0052 0x00). Or occurrence is out of bounds of the array declaration.
0053 
0054 *BBADVIEW* invalid view name (not found in view file).
0055 
0056 *BNOCNAME* field name ('cname') not found in view structure.
0057 
0058 *BNOSPACE* No space in 'buf'.
0059 
0060 *BMALLOC* Failed to allocate type conversion buffer.
0061 
0062 *BNOTPRES* Field not present (in case field value matches NULL in view file and *BVACCESS_NOTNULL*
0063 is set or count (C_) field is less than occurrence requested.
0064 
0065 EXAMPLE
0066 -------
0067 See *atmitest/test040_typedview/vaccget.c* for sample code.
0068 
0069 BUGS
0070 ----
0071 Report bugs to support@mavimax.com
0072 
0073 SEE ALSO
0074 --------
0075 *CBvgetalloc(3)* *CBvchg(3)* *Bvnext(3)* *Bvsetoccur(3)* 
0076 
0077 COPYING
0078 -------
0079 (C) Mavimax, Ltd
0080