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