0001 CBADD(3)
0002 ========
0003 :doctype: manpage
0004
0005
0006 NAME
0007 ----
0008 CBadd - Convert and add field to UBF buffer
0009
0010
0011 SYNOPSIS
0012 --------
0013
0014 #include <ubf.h>
0015
0016 int CBadd (UBFH *'p_ub', BFLDID 'bfldid', char *'buf', BFLDLEN 'len', int 'usrtype');
0017
0018 Link with '-lubf -lnstd -lm -lpthread'
0019
0020 DESCRIPTION
0021 -----------
0022 Add field to UBF buffer by converting given user type 'usrtype' to buffer
0023 field's type (see BFLD_* types). The UBF buffer pointer is passed by 'p_ub',
0024 field id in 'bfldid'. The user field value is passed in 'buf'.
0025 The 'len' is used only if 'usrtype' is *BFLD_CARRAY*, for which length
0026 cannot be detected from passed data.
0027
0028 Function operations on field types *BFLD_UBF* and *BFLD_VIEW*
0029 are not supported. This includes type of 'bfldid' or 'usrtype' having any
0030 unsupported field types for this function.
0031
0032 RETURN VALUE
0033 ------------
0034 On success, *CBadd()* return zero; on error, -1 is returned,
0035 with *Berror* set to indicate the error.
0036
0037 ERRORS
0038 ------
0039 Note that *Bstrerror()* returns generic error message plus custom
0040 message with debug info from last function call.
0041
0042 *BALIGNERR* Corrupted buffer or pointing to not aligned memory area.
0043
0044 *BNOTFLD* Buffer not fielded, not correctly allocated or corrupted.
0045
0046 *BNOSPACE* No space in buffer for string data.
0047
0048 *BMALLOC* Failed to allocate type conversion buffer.
0049
0050 *BEBADOP* Operation not supported (e.g. work with *BFLD_UBF*
0051 or *BFLD_VIEW* type fields).
0052
0053 EXAMPLE
0054 -------
0055 See *ubftest/ubfunit1.c* for sample code.
0056
0057 BUGS
0058 ----
0059 Report bugs to support@mavimax.com
0060
0061 SEE ALSO
0062 --------
0063 *CBchg(3)* *Bdel(3)* *Badd(3)* *Bchg(3)*
0064
0065 COPYING
0066 -------
0067 (C) Mavimax, Ltd
0068