|
|
Fboolco, Fboolco32, Fvboolco, Fvboolco32(3fml)
Name
Fboolco(), Fboolco32(), Fvboolco(), Fvboolco32() - compile expression, return evaluation tree
Synopsis
#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)
Description
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 grammar can be found in the Programming a BEA Tuxedo Application Using FML.
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.
This function fails if any of the following field types is used: FLD_PTR, FLD_FML32, or FLD_VIEW32. If one of these field types is encountered, Ferror is set to FEBADOP.
These functions are not supported on Workstation platforms.
A thread in a multithreaded application may issue a call to any of the functions documented here-Fboolco(), Fboolco32(), Fvboolco(), or Fvboolco32()-while running in any context state, including TPINVALIDCONTEXT.
Return Values
This function returns NULL on error and sets Ferror to indicate the error condition.
Errors
Under the following conditions, Fboolco() fails and sets Ferror to:
Allocation of space dynamically using malloc() failed.
A syntax error was found in a Boolean expression by Fboolco() other than an unrecognized field name.
A field name is specified which cannot be found in the field tables or view files.
One of the arguments to the function invoked was invalid (for example, expression is NULL).
viewname was not found in the files specified by VIEWDIR or VIEWFILES.
While trying to find viewname, the program failed to find one of the files specified by VIEWDIR or VIEWFILES.
While trying to find viewname, the program failed to open one of the files specified by VIEWDIR or VIEWFILES for reading.
While trying to find viewname, one of the files specified by VIEWDIR or VIEWFILES was corrupted or not a view file.
While trying to find viewname, malloc() failed while allocating space to hold the view information.
An invalid field type (such as FLD_PTR, FLD_FML32, and FLD_VIEW32) is specified.
Example
#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.
See Also
Fboolev, Fboolev32, Fvboolev, Fvboolev32(3fml), Fboolpr, Fboolpr32, Fvboolpr, Fvboolpr32(3fml), Fldid, Fldid32(3fml)
|
Copyright © 2000 BEA Systems, Inc. All rights reserved.
|