BEA Logo BEA Tuxedo Release 7.1

  Corporate Info  |  News  |  Solutions  |  Products  |  Partners  |  Services  |  Events  |  Download  |  How To Buy


   Tuxedo Doc Home   |   Reference   |   Topic List   |   Previous   |   Next   |   Contents

   BEA Tuxedo FML Function Reference

CFfindocc, CFfindocc32(3fml)


CFfindocc(), CFfindocc32() - find occurrence of converted value


#include <stdio.h> 
#include "fml.h"
CFfindocc(FBFR *fbfr, FLDID fieldid, char *value, FLDLEN len, int
#include "fml32.h"
CFfindocc32(FBFR32 *fbfr, FLDID32 fieldid, char *value, FLDLEN32
len, int type)


CFfindocc() acts like Ffindocc() but first converts the value from the user-specified type to the type of fieldid. CFfindocc() looks for an occurrence of the specified field in the buffer that matches a user-supplied value, length and type. CFfindocc() returns the occurrence number of the first field that matches. fbfr is a pointer to a fielded buffer. fieldid is a field identifier. value is a pointer to the value being sought. len is the length of the value to be compared to input value if type is carray. type is the data type of the field in value.

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 when CFfindocc() or CFfindocc32() is being used, Ferror is set to FEBADOP.

CFfindocc32() is used with 32-bit FML.

A thread in a multithreaded application may issue a call to CFfindocc() or CFfindocc32() while running in any context state, including TPINVALIDCONTEXT.

Return Values

If the field value is not found or if other errors are detected, -1 is returned and CFfindocc() sets Ferror to indicate the error condition.


Under the following conditions, CFfindocc() fails and sets Ferror to:


fielded buffer not aligned"
The buffer does not begin on the proper boundary.


"buffer not fielded"
The buffer is not a fielded buffer or has not been initialized by Finit().


"malloc failed"
Allocation of space dynamically using malloc() failed when converting from a carray to string.


"invalid argument to function"
One of the arguments to the function invoked was invalid (for example, a NULL value parameter was specified).


"field not present"
A field occurrence is requested but the specified field and/or occurrence was not found in the fielded buffer.


"unknown field number or type"
A field identifier is specified which is not valid.


"invalid field type"
A field identifier is specified which is not valid.


"invalid field type"
An invalid field type (such as FLD_PTR, FLD_FML32, and FLD_VIEW32) is specified.

See Also

Introduction to FML Functions, Ffindocc, Ffindocc32(3fml)