Fvftos, Fvftos32 - copy from fielded buffer to C structure
#include <stdio.h> #include "fml.h" int Fvftos(FBFR *fbfr, char *cstruct, char *view) #include "fml32.h" int Fvftos32(FBFR32 *fbfr, char *cstruct, char *view)
The Fvftos() function transfers data from a fielded buffer to a C structure. fbfr is a pointer to a fielded buffer. cstruct is a pointer to a C structure. view is a pointer to the name of a compiled view description.
Fields are copied from the fielded buffer into the structure based on the member descriptions in the view. If a field in the fielded buffer has no corresponding member in the C structure, it is ignored. If a member specified in the C structure has no corresponding field in the fielded buffer, a null value is copied into the member. The null value used is definable for each member in the view description.
To store multiple occurrences in the C structure, the structure member should be an array (for example, int zip[4] can store 4 occurrences of zip). If the buffer has fewer occurrences of the field than there are elements in the array, the extra element slots are assigned null values. On the other hand, if the buffer has more occurrences of the field than there are elements in the array, the surplus occurrences are ignored.
There are view description options that inhibit mappings even though a mapping entry exists for a fldid and a member. These options are initially specified in the view file, but can be changed at runtime using Fvopt(3fml).
Fvftos32 is used with 32-bit FML.
This function returns -1 on error and sets Ferror to indicate the error condition.
Under the following conditions, Fvftos() fails and sets Ferror to: