|
|
Fgetalloc, Fgetalloc32(3fml)
Name
Fgetalloc(), Fgetalloc32() - allocate space and get copy of field occurrence
Synopsis
#include <stdio.h>
#include "fml.h"
char *
Fgetalloc(FBFR *fbfr, FLDID fieldid, FLDOCC oc, FLDLEN *extralen)
#include "fml32.h"
char *
Fgetalloc32(FBFR32 *fbfr, FLDID32 fieldid, FLDOCC32 oc, FLDLEN32
*extralen)
Description
Like Fget(), Fgetalloc() finds and makes a copy of a buffer field, but it acquires space for the field via a call to malloc() (in UNIX System programmer's reference manuals). fbfr is a pointer to a fielded buffer. fieldid is a field identifier. oc is the occurrence number of the field. The last argument to Fgetalloc(), extralen, provides an extra amount of space to be acquired in addition to the field value size. It can be used if the retrieved value is to be expanded before re-insertion into the fielded-buffer. If extralen is NULL, then no additional space is allocated and the actual length is not returned. It is the caller's responsibility to free() space acquired by Fgetalloc(). The buffer will be aligned properly for any field type.
Fgetalloc32() is used with 32-bit FML.
A thread in a multithreaded application may issue a call to Fgetalloc() or Fgetalloc32() while running in any context state, including TPINVALIDCONTEXT.
Return Values
In the "Synopsis" section above the return value to Fgetalloc() is described as a character pointer data type (char * in C). Actually, the pointer returned points to an object that has the same type as the stored type of the field. When Fgetalloc32() is used with the FLD_VIEW32 field type, a pointer to the FVIEWFLD structure is returned. This function returns NULL on error and sets Ferror to indicate the error condition.
Errors
Under the following conditions, Fgetalloc() 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().
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.
Allocation of space dynamically using malloc() failed.
See Also
Introduction to FML Functions, CFget, CFget32(3fml), Fget, Fget32(3fml), Fgetlast, Fgetlast32(3fml), Fgets, Fgets32(3fml), Fgetsa, Fgetsa32(3fml)
free(3), malloc(3) in a UNIX system reference manual
|
Copyright © 2000 BEA Systems, Inc. All rights reserved.
|