0001 CBVCHG(3)
0002 =========
0003 :doctype: manpage
0004
0005
0006 NAME
0007 ----
0008 CBvchg - Convert from user type and change field value in VIEW field
0009
0010
0011 SYNOPSIS
0012 --------
0013
0014 #include <ubf.h>
0015
0016 int CBvchg(char *'cstruct', char *'view', char *'cname', BFLDOCC 'occ',
0017 char *'buf', BFLDLEN 'len', int 'usrtype');
0018
0019 Link with '-lubf -lnstd -lm -lpthread'
0020
0021 DESCRIPTION
0022 -----------
0023 Function is used to set field data dynamically to VIEW buffer field. '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 set, then use occ=0. 'buf' is buffer where to take user data from. 'len' is used for
0027 indicating the length of the bytes of the target buffer ('buf') size in bytes.
0028 If field size in VIEW is shorter than data putting to, then *BNOSPACE* error is returned.
0029 'len' is used only for *BFLD_CARRAY* fields.
0030 'usrtype' is user type indicating the data type of the 'buf',
0031 if types are different, the automatic data conversion is performed. And VIEW matched data
0032 is installed in the cstruct field offset. If current array C_ (count) field is less than
0033 occurrences, then C_ count field is adjusted accordingly to have the occurrence included in
0034 the count range.
0035
0036 RETURN VALUE
0037 ------------
0038 On success, *CBvchg()* return zero; on error, -1 is returned, with *Berror* set to
0039 indicate the error.
0040
0041 ERRORS
0042 ------
0043 Note that *Bstrerror()* returns generic error message plus custom message with debug info
0044 from last function call, stored in thread local storage (TLS).
0045
0046 *BEINVAL* 'view', 'cstruct' or 'buf' is NULL. 'view' or 'cname' is empty string (first byte
0047 0x00). Or occurrence is out of bounds of the array declaration.
0048
0049 *BBADVIEW* invalid view name (not found in view file).
0050
0051 *BNOCNAME* field name ('cname') not found in view structure.
0052
0053 *BNOSPACE* No space in view field to install data (data larger than field size).
0054
0055 *BMALLOC* Failed to allocate type conversion buffer.
0056
0057 EXAMPLE
0058 -------
0059 See *atmitest/test040_typedview/vaccset.c* for sample code.
0060
0061 BUGS
0062 ----
0063 Report bugs to support@mavimax.com
0064
0065 SEE ALSO
0066 --------
0067 *CBvget(3)* *Bvnext(3)* *Bvsetoccur(3)*
0068
0069 COPYING
0070 -------
0071 (C) Mavimax, Ltd
0072