CFgetalloc, CFgetalloc32 - get field, space, & convert
#include <stdio.h> #include "fml.h" char * CFgetalloc(FBFR *fbfr, FLDID fieldid, FLDOCC oc, int type, FLDLEN *extralen) #include "fml32.h" char * CFgetalloc32(FBFR32 *fbfr, FLDID32 fieldid, FLDOCC32 oc, int type, FLDLEN32 *extralen)
CFgetalloc(|) gets a specified field from a buffer, allocates space, converts the field to the type specified by the user and returns a pointer to its location. fbfr is a pointer to a fielded buffer. fieldid is a field identifier. oc is the occurrence number of the field. type is the data type the user wants the field to be converted to. On call, extralen is a pointer to the length of additional space that may be allocated to receive the value; on return, it is a pointer actual amount of space used. If extralen is NULL, then no additional space is allocated and the actual length is not returned. The user is responsible for freeing the returned (converted) value.
CFgetalloc32 is used with 32-bit FML.
On success, CFgetalloc() returns a pointer to the converted value. On error, the function returns NULL and sets Ferror to indicate the error condition.
Under the following conditions, CFgetalloc() fails and sets Ferror to: