![]() |
![]() |
|
|
Supported Field Types
The supported field types are short, long, float, double, character, string, carray (character array), ptr (pointer to a buffer), FML32 (an embedded FML32 buffer), and VIEW32 (an embedded VIEW32 buffer). The ptr, FML32, and VIEW32 types are supported only for the FML32 interface. These types are included as #define statements in fml.h (or fml32.h), as shown in the following listing.
Definitions of FML Field Types in fml.h and fml32.h
#define FLD_SHORT 0 /* short int */
#define FLD_LONG 1 /* long int */
#define FLD_CHAR 2 /* character */
#define FLD_FLOAT 3 /* single-precision float */
#define FLD_DOUBLE 4 /* double-precision float */
#define FLD_STRING 5 /* string - null terminated */
#define FLD_CARRAY 6 /* character array */
#define FLD_PTR 9 /* pointer to a buffer */
#define FLD_FML32 10 /* embedded FML32 buffer */
#define FLD_VIEW32 11 /* embedded VIEW32 buffer */
FLD_STRING and FLD_CARRAY are both arrays, but differ in the following way:
Functions that add or change a field have a FLDLEN argument that must be filled in when you are dealing with FLD_CARRAY fields. The size of a string or carray is limited to 65,535 characters in FML, and 2 billion bytes for FML32.
It is not a good idea to store unsigned data types in fielded buffers. You should either convert all unsigned short data to long or cast the data into the proper unsigned data type whenever you retrieve data from fielded buffers (using the FML conversion functions).
Most FML functions do not perform type checking; they expect that the value you update or retrieve from a fielded buffer matches its native type. For example, if a buffer field is defined to be a FLD_LONG, you should always pass the address of a long value. The FML conversion functions convert data from a user specified type to the native field type (and from the field type to a user specified type) in addition to placing the data in (or retrieving the data from) the fielded buffer.
The FLD_PTR field type makes it possible to embed pointers to application data in an FML32 buffer. Applications can add, change, access, and delete pointers to data buffers. The buffer pointed to by a FLD_PTR field must be allocated using the tpalloc(3c) call. The FLD_PTR field type is supported only in FML32.
The FLD_FML32 field type makes it possible to store an entire record as a single field in an FML32 buffer. Likewise, the FLD_VIEW32 field type allows an entire C structure to be stored as a single field in an FML32 buffer. The FLD_FML32 and FLD_VIEW32 field types are supported only in FML32.
Type int in VIEWS
In addition to the data types supported by most FML functions, VIEWS indirectly supports type int in source view descriptions. When the view description is compiled, the view compiler automatically converts any int types to either short or long types, depending on your machine. For more information, refer to VIEWS Features.
Type dec_t in VIEWS
VIEWS also supports the dec_t packed decimal type in source view descriptions. This data type is useful for transferring VIEW structures to COBOL programs. In a C program using the dec_t type, the field must be initialized and accessed using the functions described in decimal(3c) in the BEA Tuxedo C Function Reference. Within the COBOL program, the field can be accessed directly using a packed decimal (COMP-3) definition. Because FML does not support a dec_t field, this field is automatically converted to the data type of the corresponding FML field in the fielded buffer (for example, a string field) when converting from a VIEW to FML.
![]() |
![]() |
![]() |
|
Copyright © 2001 BEA Systems, Inc. All rights reserved.
|