![]() |
![]() |
|
|
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 same type 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:
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 the data area, as specified in maxlen, is not large enough to hold the field value.
A field occurrence is requested but the specified field and/or occurrence was not found in the fielded buffer.
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)
![]() |
![]() |
![]() |
|
Copyright © 2001 BEA Systems, Inc. All rights reserved.
|