CFfind, CFfind32 - find, convert and return pointer
#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)
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(3fml), 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 Ffind(3fml), which is guaranteed until the next modification of the buffer. Unlike Ffind(3fml), CFfind(|) aligns the converted value for immediate use by the caller.
CFfind32 is used with 32-bit FML.
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.
Under the following conditions, CFfind() fails and sets Ferror to: