![]() |
![]() |
|
|
CFgetalloc, CFgetalloc32(3fml)
Name
CFgetalloc(), CFgetalloc32() - get field, allocate space, convert
Synopsis
#include <stdio.h>
#include "fml.h"
char *
CFgetalloc(FBFR *fbfr, FLDID fieldid, FLDOCC oc, int type, FLDLEN
*extralen)
#include "fml32.h"
char *
CFgetalloc32(FBFR32 *fbfr, FLDID32 fieldid, FLDOCC32 oc, int type,
FLDLEN32 *extralen)
Description
CFgetalloc() gets a specified field from a buffer, allocates space, converts the field to the type specified by the user and returns a pointer to its location. fbfr is a pointer to a fielded buffer. fieldid is a field identifier. oc is the occurrence number of the field. type is the data type the user wants the field to be converted to. On call, extralen is a pointer to the length of additional space that may be allocated to receive the value; on return, it is a pointer actual amount of space used. If extralen is NULL, then no additional space is allocated and the actual length is not returned. The user is responsible for freeing the returned (converted) value.
This function fails if any of the following field types is used: FLD_PTR, FLD_FML32, or FLD_VIEW32. If one of these field types is encountered when CFgetalloc() or CFgetalloc32() is being used, Ferror is set to FEBADOP.
CFgetalloc32() is used with 32-bit FML.
A thread in a multithreaded application may issue a call to CFgetalloc() or CFgetalloc32() while running in any context state, including TPINVALIDCONTEXT.
Return Values
On success, CFgetalloc() returns a pointer to the converted value. On error, the function returns NULL and sets Ferror to indicate the error condition.
Errors
Under the following conditions, CFgetalloc() 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().
Allocation of space dynamically using malloc() failed.
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.
A field identifier is specified which is not valid.
An invalid field type (such as FLD_PTR, FLD_FML32, and FLD_VIEW32) is specified.
See Also
Introduction to FML Functions, Fgetalloc, Fgetalloc32(3fml)
![]() |
![]() |
![]() |
|
Copyright © 2001 BEA Systems, Inc. All rights reserved.
|