|
|
Fnext, Fnext32(3fml)
Name
Fnext(), Fnext32() - get next field occurrence
Synopsis
#include <stdio.h>
#include "fml.h"
int
Fnext(FBFR *fbfr, FLDID *fieldid, FLDOCC *oc, char *value, FLDLEN *len)
#include "fml32.h"
int
Fnext32(FBFR32 *fbfr, FLDID32 *fieldid, FLDOCC32 *oc, char *value, FLDLEN32 *len)
Description
Fnext() finds the next field in the buffer after the specified field occurrence. fbfr is a pointer to a fielded buffer. fieldid is a pointer to a field identifier. oc is a pointer to the occurrence number of the field. value is a pointer to the value of the next field. len is the length of the next value.
The field identifier, FIRSTFLDID, should be specified to get the first field in the buffer (for example, on the first call to Fnext()). If value is not NULL, the next field value is copied into value; *len is used to determine if the buffer has enough space allocated to contain the value. The value's length is returned in *len. If len is NULL when the function is called, it is assumed that there is enough space and the new value length is not returned. If value is NULL, the value is not retrieved and only fieldid and oc are updated. The *fieldid and *oc parameters are respectively set to the next found field and occurrence. If no more fields are found, 0 is returned (end of buffer) and *fieldid, *oc, and *value are left unchanged. Fields are returned in field identifier order.
Although the type of value is char *, the value returned will be of the same type as the next field being retrieved.
When the type of the field to be retrieved is FLD_VIEW32, the value parameter points to a FVIEWFLD structure. The Fnext() function populates the vname and data fields in the structure.
Fnext32() is used with 32-bit FML.
A thread in a multithreaded application may issue a call to Fnext() or Fnext32() while running in any context state, including TPINVALIDCONTEXT.
Return Values
Fnext() returns 1 when the next occurrence is successfully found. It returns 0 when the end of the buffer is reached.
This function returns -1 on error and sets Ferror to indicate the error condition.
Errors
Under the following conditions, Fnext() 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().
The size of value, as specified in len, is not large enough to hold the field value.
One of the arguments to the function invoked was invalid (for example, specifying NULL for fieldid or oc).
See Also
Introduction to FML Functions, Fget, Fget32(3fml), Fnum, Fnum32(3fml)
|
Copyright © 2000 BEA Systems, Inc. All rights reserved.
|