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

Ffindlast, Ffindlast32(3fml)


Ffindlast(), Ffindlast32() - find last occurrence of field in buffer


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


Ffindlast() finds the last occurrence of a field in a buffer. fbfr is a pointer to a fielded buffer. fieldid is a field identifier. oc is a pointer to an integer that is used to receive the occurrence number of the field. len is the length of the value. If there are no occurrences of the field in the buffer, NULL is returned. Generally, Ffindlast() acts like Ffind(). The major difference is that with Ffindlast the user does not supply a field occurrence. Instead, both the value and occurrence number of the last occurrence of the field are returned. In order to return the occurrence number of the last field, the occurrence argument, oc, to Ffindlast() is a pointer-to-integer, and not an integer, as it is to Ffind(). If oc is specified to be NULL, the occurrence number of the last occurrence is not returned. If the value of len is NULL, then the field length is not returned.

In general, because proper alignment within a buffer is not guaranteed, the locations in which the values of types FLD_LONG, FLD_FLOAT, FLD_DOUBLE, FLD_PTR, FLD_FML32, and FLD_VIEW32 are stored prevents these values from being used directly as their stored type. Such values must be copied first to a suitably aligned memory location. Accessing such fields through the conversion function CFfind() does guarantee the proper alignment of the found converted value. Buffer modification should be done only by the Fadd()or Fchg() function. The values returned by Ffind()and Ffindlast() are valid only so long as the buffer remains unmodified.

Ffindlast32() does not check for occurrences of the specified field in embedded buffers as provided by the FLD_FML32 and FLD_VIEW32 field types.

Ffindlast32() is used with 32-bit FML.

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

Return Values

In the "Synopsis" section above the return value to Ffindlast() 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.


Under the following conditions, Ffindlast() 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().


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


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

See Also

Introduction to FML Functions, CFfind, CFfind32(3fml), Fadd, Fadd32(3fml), Fchg, Fchg32(3fml), Ffind, Ffind32(3fml), Ffindocc, Ffindocc32(3fml), Ffinds, Ffinds32(3fml)