Ffindlast(), Ffindlast32() - find last occurrence of field in buffer
Ffindlast(FBFR *fbfr, FLDID fieldid, FLDOCC *oc, FLDLEN *len) #include "fml32.h"
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.
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:
The buffer does not begin on the proper boundary.
The buffer is not a fielded buffer or has not been initialized by Finit().
A field is requested but the specified field was not found in the fielded buffer.
A field identifier is specified which is not valid.
Introduction to FML Functions, CFfind, CFfind32(3fml), Fadd, Fadd32(3fml), Fchg, Fchg32(3fml), Ffind, Ffind32(3fml), Ffindocc, Ffindocc32(3fml), Ffinds, Ffinds32(3fml)
Copyright © 2000 BEA Systems, Inc. All rights reserved.