![]() |
![]() |
|
|
F32to16, F16to32(3fml)
Name
F32to16(), F16to32() - convert 16-bit FML to/from 32-bit FML buffer
Synopsis
#include <stdio.h>
#include "fml.h"
#include "fml32.h"
int
F32to16(FBFR *dest, FBFR32 *src)
int
F16to32(FBFR32 *dest, FBFR *src)
Description
F32to16() converts a 32-bit FML buffer to a 16-bit FML buffer. It does this by converting the buffer on a field-by-field basis and then creating the index for the fielded buffer. A field is converted by generating a FLDID from a FLDID32, and copying the field value (and field length for string and carray fields). dest and src are pointers to the destination and source fielded buffers respectively. The source buffer is not changed.
These functions can fail for lack of space; they can be reissued after allocating enough additional space to complete the operation.
F16to32() converts a 16-bit FML buffer to a 32-bit FML buffer. It lives in the fml32 library or shared object and sets Ferror32 on error.
F32to16() lives in the FML library or shared object and sets Ferror on error. Note that both fml.h and fml32.h must be included to use these functions; fml1632.h may not be included in the same file.
F32to16() fails with FBADFLD for the following field types: FLD_PTR, FLD_FML32, and FML_VIEW32. F16to32() has no impact when performed on these field types.
A thread in a multithreaded application may issue a call to F32to16() or F16to32() 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, F32to16()fails and sets Ferror to:
Either the source buffer or the destination buffer does not begin on the proper boundary.
Either the source buffer or the destination buffer is not a fielded buffer or has not been initialized by Finit().
A field value is to be copied to the destination fielded buffer but there is not enough space remaining in the buffer. This error is also returned if a 32-bit FML field is too long to fit into a 16-bit FML field. When this error is returned, the destination buffer will contain no fields.
This error occurs only for the F32to16() function. The source buffer has a field identifier for which the field type is not one of the eight types supported by 16-bit FML, or the field number is greater than 8191.
See Also
![]() |
![]() |
![]() |
|
Copyright © 2001 BEA Systems, Inc. All rights reserved.
|