0001 BADD(3)
0002 =======
0003 :doctype: manpage
0004
0005
0006 NAME
0007 ----
0008 Badd - Add field to UBF buffer
0009
0010
0011 SYNOPSIS
0012 --------
0013
0014 #include <ubf.h>
0015
0016 int Badd (UBFH *'p_ub', BFLDID 'bfldid', char *'buf', BFLDLEN 'len');
0017
0018 Link with '-lubf -lnstd -lm -lpthread'
0019
0020 DESCRIPTION
0021 -----------
0022 Add field to UBF buffer. The UBF buffer pointer is passed by 'p_ub',
0023 field id in 'bfldid'. The user value is passed in 'buf'. The 'len' is used
0024 only if filed type is *BFLD_CARRAY*, for which length cannot be detected from
0025 passed data. The data type for 'buf' must match with 'bfldid' type.
0026
0027 Badd() requires double pointer in 'buf' if setting the *BFLD_PTR* field, i.e.
0028 pointer to pointer of XATMI buffer needs to be passed to the function.
0029 In case if using Fadd() or Fadd32() wrappers, 'buf' accepts direct pointer to XATMI
0030 buffer.
0031
0032 RETURN VALUE
0033 ------------
0034 On success, *Badd()* return zero; on error, -1 is returned, with *Berror*
0035 set to indicate the error.
0036
0037 ERRORS
0038 ------
0039 Note that *Bstrerror()* returns generic error message plus custom message
0040 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 EXAMPLE
0049 -------
0050 See *ubftest/test_get.c* for sample code.
0051
0052 BUGS
0053 ----
0054 Report bugs to support@mavimax.com
0055
0056 SEE ALSO
0057 --------
0058 *Baddfast(3)* *CBchg(3)* *Bdel(3)* *Badd(3)* *Bchg(3)* *CBadd(3)*
0059
0060 COPYING
0061 -------
0062 (C) Mavimax, Ltd
0063