![]() |
![]() |
|
|
CFchg, CFchg32(3fml)
Name
CFchg(), CFchg32() - convert and change field
Synopsis
#include <stdio.h>
#include "fml.h"
int CFchg(FBFR *fbfr, FLDID fieldid, FLDOCC oc, char *value,
FLDLEN len, int type)
#include "fml32.h"
int CFchg32(FBFR32 *fbfr, FLDID32 fieldid, FLDOCC32 oc,
char *value,
FLDLEN32 len, int type)
Description
CFchg() acts like Fchg() but first converts the value from the user-specified type to the type of the fieldid for which the field is changed in the fielded buffer. fbfr is a pointer to a fielded buffer. fieldid is a field identifier. oc is the occurrence number of the field. value is a pointer to a new value. len is the length of the value to be changed; it is required only if type is FLD_CARRAY. type is the data type of value.
If a field occurrence is specified that does not exist, then NULL values are added for the missing occurrences until the desired value can be added (for example, changing field occurrence 4 for a field that does not exist in a buffer will cause 3 NULL values to be added followed by the specified field 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 CFchg() or CFchg32() is being used, Ferror is set to FEBADOP.
CFchg32() is used with 32-bit FML.
A thread in a multithreaded application may issue a call to CFchg() or CFchg32() 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, CFchg() 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().
[FMALLOC]
Allocation of space dynamically using malloc() failed when converting from a carray to string.
One of the arguments to the function invoked was invalid (for example, a NULL value parameter was specified).
A field value is to be added or changed in a field buffer but there is not enough space remaining in the buffer.
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, CFadd, CFadd32(3fml), Fchg, Fchg32(3fml)
![]() |
![]() |
![]() |
|
Copyright © 2000 BEA Systems, Inc. All rights reserved.
|