2.9.3 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.

Listing 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 */
#define       BOOL1
#define       SIGNEDCHAR1
#define       UNSIGNEDCHAR1
#define       WCHAR_T1
#define       UNSIGNEDINT1
#define       UNSIGNEDLONG1
#define       LONGLONG1
#define       UNSIGNEDLONGLONG1
#define       LONGDOUBLE1
#define       STRUCT1

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.