Fboolco, Fboolco32, Fvboolco, Fvboolco32-compile expression, return evaluation tree
#include <stdio.h>
#include "fml.h"
char *
Fboolco(char *expression)
char *
Fvboolco(char *expression, char *viewname)
#include "fml32.h"
char *
Fboolco32(char *expression)
char *
Fvboolco32(char *expression, char *viewname)
Fboolco() compiles a Boolean expression, pointed to by expression, and returns a pointer to the evaluation tree. The expressions recognized are close to the expressions recognized in C. A description of the grammer can be found in the FML Programmer's Guide.
The evaluation tree produced by Fboolco() is used by the other boolean functions listed under SEE ALSO; this avoids having to recompile the expression.
Fboolco32 is used with 32-bit FML.
Fvboolco and Fvboolco32 provide the same functionallity for views. The viewname parameter indicates the view from which the field offsets are taken.
These functions are not supported on Workstation platforms.
This function returns NULL on error and sets Ferror to indicate the error condition.
Under the following conditions, Fboolco() fails and sets Ferror to:
[FMALLOC]
malloc failed" malloc(3) failed.
[FSYNTAX]
[FBADNAME]
[FEINVAL]
NULL).
[FBADVIEW]
VIEWDIR or VIEWFILES.
[FVFOPEN]
VIEWDIR or VIEWFILES.
[EUNIX]
VIEWDIR or VIEWFILES for reading.
[FVFSYNTAX]
VIEWDIR or VIEWFILES was corrupted or not a view file.
[FMALLOC]
malloc failed" malloc() failed while allocating space to hold the view information.
#include "stdio.h"
#include "fml.h"
extern char *Fboolco(\|);
char *tree;
...
if((tree=Fboolco("FIRSTNAME %% 'J.*n' & SEX = 'M'")) == NULL)
F_error("pgm_name");
compiles a boolean expression that checks if the FIRSTNAME field is in the buffer, begins with 'J' and ends with 'n' (for example, John, Jean, Jurgen, etc.) and the SEX field equal to 'M'.
The first and second characters of the tree array form the least significant byte and the most significant byte, respectively, of an unsigned 16 bit quantity that gives the length, in bytes, of the entire array. This value is useful for copying or otherwise manipulating the array.
Fboolev(3)Fboolpr(3)Fldid(3)