|
|
Using an FML Typed Buffer
To use FML typed buffers, you must perform the following steps:
FML functions are used to manipulate typed buffers, including those that convert fielded buffers to C structures and vice versa. By using these functions, you can access and update data values without having to know how data is structured and stored. For more information on FML functions, refer to the BEA Tuxedo ATMI FML Function Reference.
Setting Environment Variables for an FML Typed Buffer
To use an FML typed buffer in an application program, you must set the following environment variables.
FML Typed Buffer Environment Variables
Creating a Field Table File Field table files are always required when FML buffers and/or FML-dependent VIEWs are used. A field table file maps the logical name of a field in an FML buffer to a string that uniquely identifies the field. The following format is used for the description of each field in the FML field table: The following table describes the fields that must be specified in the FML field table file for each FML field. Field Table File Fields
$ /* FML structure */
*base value
name number type flags comments
All fields are optional, and may be included more than once. The following example illustrates a field table file that may be used with the FML-dependent VIEW example. Field Table File for FML VIEW Creating an FML Header File In order to use an FML typed buffer in client programs or service subroutines, you must create an FML header file and specify it in the application #include statements. To create an FML header file from a field table file, use the mkfldhdr(1) command. For example, to create a file called myview.flds.h, enter the following command: For FML32 typed buffers, use the mkfldhdr32 command. The following listing shows the myview.flds.h header file that is created by the mkfldhdr command. myview.flds.h Header File Specify the new header file in the #include statement of your application. Once the header file is included, you can refer to fields by their symbolic names. See Also# name number type flags comments
FLOAT1 110 float - -
DOUBLE1 111 double - -
LONG1 112 long - -
SHORT1 113 short - -
INT1 114 long - -
DEC1 115 string - -
CHAR1 116 char - -
STRING1 117 string - -
CARRAY1 118 carray - -mkfldhdr myview.flds
/* fname fldid */
/* ----- ----- */
#define FLOAT1 ((FLDID)24686) /* number: 110 type: float */
#define DOUBLE1 ((FLDID)32879) /* number: 111 type: double */
#define LONG1 ((FLDID)8304) /* number: 112 type: long */
#define SHORT1 ((FLDID)113) /* number: 113 type: short */
#define INT1 ((FLDID)8306) /* number: 114 type: long */
#define DEC1 ((FLDID)41075) /* number: 115 type: string */
#define CHAR1 ((FLDID)16500) /* number: 116 type: char */
#define STRING1 ((FLDID)41077) /* number: 117 type: string */
#define CARRAY1 ((FLDID)49270) /* number: 118 type: carray */
|
Copyright © 2001 BEA Systems, Inc. All rights reserved.
|