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

CFfind, CFfind32(3fml)

Name

CFfind(), CFfind32() - find, convert, and return pointer

Synopsis

#include <stdio.h> 
#include "fml.h"
char * CFfind(FBFR *fbfr, FLDID fieldid, FLDOCC oc, FLDLEN *len,
int type)
#include "fml32.h"
char *
CFfind32(FBFR32 *fbfr, FLDID32 fieldid, FLDOCC32 oc, FLDLEN32 *len, int type)

Description

CFfind() finds a specified field in a buffer, converts it and returns a pointer to the converted value. fbfr is a pointer to a fielded buffer. fieldid is a field identifier. oc is the occurrence number of the field. len is used on output and is a pointer to the length of the converted value. type is the data type the user wants the field to be converted to.

Like Ffind(), the pointer returned by the function should be considered read only. The validity of the pointer returned by CFfind() is guaranteed only until the next buffer operation, even if that operation is non-destructive, since the converted value is retained in a single private buffer. This differs from the value returned by Ffins(), which is guaranteed until the next modification of the buffer. Unlike Ffind(), CFfind() aligns the converted value for immediate use by the caller.

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

CFfind32() is used with 32-bit FML.

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

Return Values

In the "Synopsis" section above the return value to CFfind() is described as a character pointer data type (char ** in C). Actually, the pointer returned points to an object that has the same type as the stored type of the field.

This function returns NULL on error and sets Ferror to indicate the error condition.

Errors

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

[FALIGNERR]

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

[FNOTFLD]

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

[FMALLOC]

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

[FNOTPRES]

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

[FBADFLD]

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

[FTYPERR]

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

[FEBADOP]

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

See Also

Introduction to FML Functions, Ffind, Ffind32(3fml)