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

CFgetalloc, CFgetalloc32(3fml)


CFgetalloc(), CFgetalloc32() - get field, allocate space, convert


#include <stdio.h> 
#include "fml.h"
char *
CFgetalloc(FBFR *fbfr, FLDID fieldid, FLDOCC oc, int type, FLDLEN
#include "fml32.h"
char *
CFgetalloc32(FBFR32 *fbfr, FLDID32 fieldid, FLDOCC32 oc, int type,
FLDLEN32 *extralen)


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.


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


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


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


"malloc failed"
Allocation of space dynamically using malloc() failed.


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


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


"invalid field type"
A field identifier is specified which is not valid.


"invalid field type"
An invalid field type (such as FLD_PTR, FLD_FML32, and FLD_VIEW32) is specified.

See Also

Introduction to FML Functions, Fgetalloc, Fgetalloc32(3fml)