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

CFadd, CFadd32(3fml)

Name

CFadd(), CFadd32() - convert and add field

Synopsis

#include <stdio.h>
#include "fml.h"
int CFadd(FBFR *fbfr, FLDID fieldid, char *value, FLDLEN len, int type)
#include fml32.h>
int
CFadd32(FBFR32 *fbfr, FLDID32 fieldid, char *value, FLDLEN32 len, int type)

Description

CFadd() acts like Fadd() but first converts the value from the user-specified type to the type of the fieldid for which the field is added to the fielded buffer. fbfr is a pointer to a fielded buffer. fieldid is a field identifier. value is a pointer to the value to be added. len is the length of the value to be added; it is required only if type is FLD_CARRAY. type is the data type of the field in value.

Before the field is added to the buffer, the type of the data item is converted from the type supplied by the user to the type specified in fieldid. If the source type is FLD_CARRAY (arbitrary character array), the len argument should be set to the length of the array; the length is ignored in all other cases. The value for the field to be converted and added must first be put in a variable, value, since C does not permit constructs such as 12345L.

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 CFadd() or CFadd32() is being used, Ferror is set to FEBADOP.

CFadd32() is used with 32-bit FML.

A thread in a multithreaded application may issue a call to CFadd() or CFadd32() 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, CFadd() 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().

[FMALLOC]

"malloc failed"
Allocation of space dynamically using malloc() failed when converting from a carray to string.

[FEINVAL]

"invalid argument to function"
One of the arguments to the function invoked was invalid (for example, a NULL value parameter was specified).

[FNOSPACE]

"no space in fielded buffer"
A field value is to be added or changed in a field buffer, but there is not enough space remaining in the buffer.

[FBADFLD]

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

[FTYPERR]

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

[FEBADOP]

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

See Also

Introduction to FML Functions, Fadd, Fadd32(3fml)