0001 BBOOLCO(3)
0002 ==========
0003 :doctype: manpage
0004
0005
0006 NAME
0007 ----
0008 Bboolco - Compile Boolean expression, return evaluation handler
0009
0010
0011 SYNOPSIS
0012 --------
0013
0014 #include <ubf.h>
0015
0016 char * Bboolco (char *'expr');
0017
0018 Link with '-lubf -lnstd -lm -lpthread'
0019
0020 DESCRIPTION
0021 -----------
0022 Compile Boolean expression (in parameter 'expr') and returns the evaluation
0023 tree handler. Following operators are available for expressions:
0024
0025 '%%, !%' - regular expression testing e.g. "T_STRING_2_FLD %% '58.*'"-
0026 will match if T_STRING_2_FLD is set to "58ABC" for example.
0027
0028 '==, !=, <, <=, >, >=' - compare operations
0029
0030 '!, ~, ^' - bitwise operations
0031
0032 '+, -, *, %, /' - mathematical operations
0033
0034 '&&, ||' - logical operations
0035
0036 Enduro/X expressions allows to access sub-ubf buffers or access to *BFLD_VIEW*
0037 particular view fields. Access to sub-fields are made via dot notation.
0038
0039 For example having following UBF buffer:
0040
0041 --------------------------------------------------------------------------------
0042
0043 T_CARRAY_2_FLD TEST CARRAY
0044 T_PTR_3_FLD 0xc7
0045 T_PTR_3_FLD 0x12b
0046 T_UBF_FLD
0047 T_UBF_FLD
0048 T_LONG_3_FLD 88
0049 T_LONG_3_FLD 0
0050 T_LONG_3_FLD 0
0051 T_LONG_3_FLD 889991
0052 T_VIEW_3_FLD
0053 T_VIEW_3_FLD UBTESTVIEW2
0054 tshort1 100
0055 tlong1 200
0056 tchar1 Z
0057 tfloat1 400.00000
0058 tdouble1 500.000000
0059 tstring1 6YY
0060 tstring1 6ZZ
0061 tcarray1 7YY\00\00\00\00\00\00\00
0062
0063 --------------------------------------------------------------------------------
0064
0065
0066 To access sub-ubf buffer field:
0067
0068 --------------------------------------------------------------------------------
0069
0070 T_UBF_FLD[1].T_LONG_3_FLD //this reads value "88"
0071
0072 T_UBF_FLD[1].T_LONG_3_FLD[3] //this reads value "889991"
0073
0074 --------------------------------------------------------------------------------
0075
0076 To access view filed:
0077
0078 --------------------------------------------------------------------------------
0079
0080 T_UBF_FLD[1].T_VIEW_3_FLD[1].tstring1 // This read value "6YY"
0081
0082 T_UBF_FLD[1].T_VIEW_3_FLD[1].tstring1[1] // This read value "6ZZ"
0083
0084 --------------------------------------------------------------------------------
0085
0086
0087 RETURN VALUE
0088 ------------
0089 On success, *Bboolco()* return pointer to evaluation tree; on error,
0090 NULL is returned, with *Berror* set to indicate the error.
0091
0092 ERRORS
0093 ------
0094 Note that *Bstrerror()* returns generic error message plus custom message
0095 with debug info from last function call.
0096
0097 *BALIGNERR* Corrupted buffer or pointing to not aligned memory area.
0098
0099 *BNOTFLD* Buffer not fielded, not correctly allocated or corrupted.
0100
0101 *BBADNAME* Field name not found in field tables.
0102
0103 *BMALLOC* Malloc failed.
0104
0105 *BSYNTAX* Syntax error in script.
0106
0107 *BBADNAME* Bad field name specified.
0108
0109 *BEBADOP* Direct field types (i.e with out sub-fields) *BFLD_UBF*
0110 and *BFLD_VIEW* are not supported in expressions.
0111
0112 EXAMPLE
0113 -------
0114 See *ubftest/test_expr.c* for sample code.
0115
0116 BUGS
0117 ----
0118 Report bugs to support@mavimax.com
0119
0120 SEE ALSO
0121 --------
0122 *Bboolev(3)* *Bfloatev(3)* *Btreefree(3)*
0123
0124 COPYING
0125 -------
0126 (C) Mavimax, Ltd
0127