Back to home page

Enduro/X

 
 

    


0001 CBFIND(3)
0002 =========
0003 :doctype: manpage
0004 
0005 
0006 NAME
0007 ----
0008 CBfind - find field in UBF buffer and convert value to user specified type
0009 
0010 
0011 SYNOPSIS
0012 --------
0013 
0014 #include <ubf.h>
0015 
0016 char * CBfind (UBFH *'p_ub', BFLDID 'bfldid', BFLDOCC 'occ', BFLDLEN *'len', int 'usrtype');
0017 
0018 Link with '-lubf -lnstd -lm -lpthread'
0019 
0020 DESCRIPTION
0021 -----------
0022 Function on success returns pointer to data field present in UBF buffer, 
0023 converted to user type specified in 'usrtype'. 'p_ub' is pointer to UBF buffer, 
0024 'bfldid' is field id, 'occ' is field occurrence at buffer, which needs to be found. 
0025 'len' is output parameter for indicating the type length in bytes. 
0026 Then 'len' is optional. Returned pointer is valid only until next 
0027 UBF operation call, as the converted value is stored in thread 
0028 local storage used for various UBF operations.
0029 
0030 Function operations on field types *BFLD_UBF* and *BFLD_VIEW* 
0031 are not supported. This includes type of 'bfldid' or 'usrtype' having any 
0032 unsupported field types for this function.
0033 
0034 RETURN VALUE
0035 ------------
0036 On success, *CBfind()* return ptr to data found; on error, *NULL* is returned, with 
0037 *Berror* set to indicate the error.
0038 
0039 ERRORS
0040 ------
0041 Note that *Bstrerror()* returns generic error message plus custom message with 
0042 debug info from last function call.
0043 
0044 *BALIGNERR* Corrupted buffer or pointing to not aligned memory area.
0045 
0046 *BNOTFLD* Buffer not fielded, not correctly allocated or corrupted.
0047 
0048 *BNOTPRES* Field not present.
0049 
0050 *BMALLOC* Failed to allocate type conversion buffer.
0051 
0052 *BEBADOP* Operation not supported (e.g. work with *BFLD_UBF* 
0053 or *BFLD_VIEW* type fields).
0054 
0055 *BBADFLD* Invalid field id passed.
0056 
0057 EXAMPLE
0058 -------
0059 See *ubftest/test_find.c* for sample code.
0060 
0061 BUGS
0062 ----
0063 Report bugs to support@mavimax.com
0064 
0065 SEE ALSO
0066 --------
0067 *Bchg(3)* *Badd(3)* *CBadd(3)* *Bfind(3)* *CBfindocc(3)* *CBfindlast(3)*
0068 
0069 COPYING
0070 -------
0071 (C) Mavimax, Ltd
0072