0001 CBVGETALLOC(3)
0002 ==============
0003 :doctype: manpage
0004
0005
0006 NAME
0007 ----
0008 CBvgetalloc - Allocate buffer space, get and convert to user type data from VIEW buffer field
0009
0010
0011 SYNOPSIS
0012 --------
0013
0014 #include <ubf.h>
0015
0016 char * CBvget(char *'cstruct', char *'view', char *'cname', BFLDOCC 'occ',
0017 int 'usrtype', long 'flags', BFLDLEN *'extralen');
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. 'usrtype' is user type indicating the data type to which data shall be converted
0027 before returning. If types are different, the automatic data conversion is performed.
0028 'flags' is either set to 0 in which case data is returned as is in the VIEW,
0029 does not matter if it matches the *NULL* value specified in VIEW file or not,
0030 the exact value is returned. If flag *BVACCESS_NOTNULL* is specified, then if
0031 value in field matches *NULL* column in view file, then error
0032 *BNOTPRES* is returned. *BNOTPRES* can be returned in case
0033 if 'C' flag was set in view file, and the count indicator is set to less than occurrence specified.
0034 Data is returned to allocated buffer. 'extralen' is optional field. On input it
0035 indicates additional space that shall be allocated with the data. On output it
0036 indicates actual bytes copied of the data.
0037
0038
0039 RETURN VALUE
0040 ------------
0041 On success, *CBvgetalloc()* ptr to data; on error, *NULL* is returned, with *Berror* set to
0042 indicate the error.
0043
0044 ERRORS
0045 ------
0046 Note that *Bstrerror()* returns generic error message plus custom message with debug info
0047 from last function call, stored in thread local storage (TLS).
0048
0049 *BEINVAL* 'view', 'cstruct' or 'buf' is NULL. 'view' or 'cname' is empty string (first byte
0050 0x00). Or occurrence is out of bounds of the array declaration.
0051
0052 *BBADVIEW* invalid view name (not found in view file).
0053
0054 *BNOCNAME* field name ('cname') not found in view structure.
0055
0056 *BNOSPACE* No space in 'buf'.
0057
0058 *BMALLOC* Failed to allocate type conversion buffer.
0059
0060 *BNOTPRES* Field not present (in case field value matches NULL in view file and *BVACCESS_NOTNULL*
0061 is set or count (C_) field is less than occurrence requested.
0062
0063 EXAMPLE
0064 -------
0065 See *atmitest/test040_typedview/vaccget.c* for sample code.
0066
0067 BUGS
0068 ----
0069 Report bugs to support@mavimax.com
0070
0071 SEE ALSO
0072 --------
0073 *CBvget(3)* *CBvchg(3)* *Bvnext(3)* *Bvsetoccur(3)*
0074
0075 COPYING
0076 -------
0077 (C) Mavimax, Ltd
0078