BEA Logo BEA Tuxedo Release 7.1

  Corporate Info  |  News  |  Solutions  |  Products  |  Partners  |  Services  |  Events  |  Download  |  How To Buy

 

   Tuxedo Doc Home   |   Reference   |   Topic List   |   Previous   |   Next   |   Contents

   BEA Tuxedo FML Function Reference

Fget, Fget32(3fml)

Name

Fget(), Fget32() - get copy and length of field occurrence

Synopsis

#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)

Description

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.

A thread in a multithreaded application may issue a call to Fget() or Fget32() while running in any context state, including TPINVALIDCONTEXT.

Return Values

When Fget32() is used with the FLD_VIEW32 field type, a pointer to the FVIEWFLD structure is returned. This function returns -1 on error and sets Ferror to indicate the error condition.

Errors

Under the following conditions, Fget() fails and sets Ferror to:

[FALIGNERR]

"fielded buffer not aligned"
The buffer does not begin on the proper boundary.

[FNOTFLD]

"buffer not fielded"
The buffer is not a fielded buffer or has not been initialized by Finit().

[FNOSPACE]

"no space"
The size of the data area, as specified in maxlen, is not large enough to hold the field value.

[FNOTPRES]

"field not present"
A field occurrence is requested but the specified field and/or occurrence was not found in the fielded buffer.

[FBADFLD]

"unknown field number or type"
A field identifier is specified which is not valid.

See Also

Introduction to FML Functions, CFget, CFget32(3fml), Fgetalloc, Fgetalloc32(3fml), Fgetlast, Fgetlast32(3fml), Fgets, Fgets32(3fml), Fgetsa, Fgetsa32(3fml)