Back to home page

Enduro/X

 
 

    


0001 BFINDOCC(3)
0002 ===========
0003 :doctype: manpage
0004 
0005 
0006 NAME
0007 ----
0008 Bfindocc - find field occurrence in buffer by given value
0009 
0010 
0011 SYNOPSIS
0012 --------
0013 
0014 #include <ubf.h>
0015 
0016 BFLDOCC Bfindocc (UBFH *'p_ub', BFLDID 'bfldid', char *'buf', BFLDLEN 'len');
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 which value matches the field value. 
0024 For *BFLD_STRING* typed fields value present in 'buf' is treated as 
0025 regular expression which is matched against field value in UBF buffer.
0026 'p_ub' is pointer to UBF buffer, 'bfldid' is field id to search for, 'len' is 
0027 input parameter for indicating the 'but' length in bytes. Then 'len' is 
0028 mandatory only for *BFLD_CARRAY* fields.
0029 
0030 In case if searching for *BFLD_VIEW* field, the 'buf' shall point to initialized
0031 *BVIEWFLD* structure where *vname* field shall be set to view name and *data* shall
0032 be set to pointer to actual view field to compare in search.
0033 
0034 RETURN VALUE
0035 ------------
0036 On success, *Bfindocc()* return occurrence where the value is found; on error, 
0037 -1 is returned, with *Berror* set to indicate the error.
0038 
0039 ERRORS
0040 ------
0041 Note that *Bstrerror()* returns generic error message plus custom message 
0042 with 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 *BEINVAL* 'buf' is NULL.
0051 
0052 *BBADFLD* invalid field passed in (type incorrect).
0053 
0054 EXAMPLE
0055 -------
0056 See *ubftest/test_find.c* for sample code.
0057 
0058 BUGS
0059 ----
0060 Report bugs to support@mavimax.com
0061 
0062 SEE ALSO
0063 --------
0064 *Bchg(3)* *Badd(3)* *CBadd(3)* *Bfind(3)* *CBfindocc(3)*
0065 
0066 COPYING
0067 -------
0068 (C) Mavimax, Ltd
0069