BEA Logo BEA Tuxedo Release 8.0

  BEA Home  |  Events  |  Solutions  |  Partners  |  Products  |  Services  |  Download  |  Developer Center  |  WebSUPPORT

 

   Tuxedo Documentation   |   Programming BEA Tuxedo ATMI Applications Using C   |   Local Topics   |   Previous Topic   |   Next Topic   |   Contents

 


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

Environment Variable

Description

FIELDTBLS or FIELDTBLS32

Comma-separated list of field table filenames for FML or FML32 typed buffers, respectively.

FLDTBLDIR or FLDTBLDIR32

Colon-separated list of directories to search for the field table files for FML and FML32, respectively. For Microsoft Windows, use a semicolon-separated list.

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:

$ /* FML structure */
*base value
name number type flags comments

The following table describes the fields that must be specified in the FML field table file for each FML field.

Field Table File Fields

Field

Description

*base value

Specifies a base for offsetting subsequent field numbers, providing an easy way to group and renumber sets of related fields. The *base option allows field numbers to be reused. For a 16-bit buffer, the base plus the relevant number must be greater than or equal to 100 and less than 8191. This field is optional.

Note: The BEA Tuxedo system reserves field numbers 1-100 and 6000-7000 for internal use. Field numbers 101-8191 are available for application-defined fields with FML; field numbers 101-33, 554, and 431, for FML32.

name

Identifier for the field. The value must be a string of up to 30 characters, consisting of alphanumeric and underscore characters only.

rel-number

Relative numeric value of the field. This value is added to the current base, if specified, to calculate the field number.

type

Type of the field. This value can be any of the following: char, string, short, long, float, double, or carray.

flag

Reserved for future use. A dash (-) should be included as a placeholder.

comment

Optional comment.

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

# 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 - -

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:

mkfldhdr myview.flds

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

/*       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 */

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

 

back to top previous page next page