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

Fgetlast, Fgetlast32(3fml)

Name

Fgetlast(), Fgetlast32() - get copy of last occurrence

Synopsis

#include <stdio.h> 
#include "fml.h"
int
Fgetlast(FBFR *fbfr, FLDID fieldid, FLDOCC *oc, char *value, FLDLEN
*maxlen)
#include "fml32.h"
int
Fgetlast32(FBFR32 *fbfr, FLDID32 fieldid, FLDOCC32 *oc, char
*value, FLDLEN32 *maxlen)

Description

Fgetlast() is used to retrieve both the value and occurrence number of the last occurrence of the field identified by fieldid. fbfr is a pointer to a fielded buffer. In order to return the occurrence number of the last field, the occurrence argument, oc, is a pointer-to-integer, not an integer.

The caller provides Fgetlast() with a pointer to a private buffer, loc, as well as the length of the buffer, *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 buffer for the field value 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 returned. If oc is NULL, the occurrence is not returned.

In the "Synopsis" section above the value argument to Fgetlast() is described as a character pointer data type (char * in C). Technically, this describes only one particular kind of value passable to Fgetlast(). 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 Fgetlast()assumes that the object pointed to by value has the sametype as the stored type of the field being retrieved.

Fgetlast32() is used with 32-bit FML.

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

Return Values

This function returns -1 on error and sets Ferror to indicate the error condition.

Errors

Under the following conditions, Fgetlast() 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, Fget, Fget32(3fml), Fgetalloc, Fgetalloc32(3fml), Fgets, Fgets32(3fml), Fgetsa, Fgetsa32(3fml)