Fget, Fget32 - get copy and length of field occurrence
#include <stdio.h> #include "fml.h" int Fget(FBFR *fbfr, FLDID fieldid, FLDOCC oc, char *value, FLDLEN *maxlen) #include "fml32.h" int Fget32(FBFR32 *fbfr, FLDID32 fieldid, FLDOCC32 oc, char *value, FLDLEN32 *maxlen)
Fget(\|) should be used to retrieve a field from a fielded buffer when the value is to be modified. fbfr is a pointer to a fielded buffer. fieldid is a field identifier. oc is the occurrence number of the field. The caller provides Fget(\|) with a pointer to a private data area, loc, as well as the length of the data area, *maxlen, and the length of the field is returned in *maxlen. If maxlen is NULL when the function is called, then it is assumed that the data area for the field value loc is big enough to contain the field value and the length of the value is not returned. If loc is NULL, the value is not retrieved. Thus, the function call can be used to determine the existence of the field.
In the SYNOPSIS
section above the value argument to Fget(\|) is described as a character pointer data type (char * in C). Technically, this describes only one particular kind of value passable to Fget(\|). In fact, the type of the value argument should be a pointer to an object of the same type as the type of the fielded-buffer representation of the field being retrieved. For example, if the field is stored in the buffer as type FLD_LONG, then value should be of type pointer-to-long (long * in C). Similarly, if the field is stored as FLD_SHORT, then value should be of type pointer-to-short (short * in C). The important thing is that Fget(\|) assumes that the object pointed to by value has the same type as the stored type of the field being retrieved.
Fget32 is used with 32-bit FML.
This function returns \-1 on error and sets Ferror to indicate the error condition.
Under the following conditions, Fget() fails and sets Ferror to:
Fintro(3fml),
CFget(3c),
Fgetalloc(3fml),
Fgetlast(3fml),
Fgets(3fml),
Fgetsa(3fml)