![]() |
![]() |
|
|
Converting Field Tables to Header Files
The mkfldhdr (or mkfldhdr32) command converts a field table, as described earlier, into a header file suitable for processing by the C compiler. Each line of the generated header file is of the following form:
#define fname fieldid
where fname is the name of the field, and fieldid is its field-ID. The field-ID has both the field type and field number encoded in it. The field number is an absolute number, that is, base plus rel-number. The resulting file is suitable for inclusion in a C program.
It is not necessary to use the header file if the run-time mapping functions are used as described in Mapping Fields to C Structures and COBOL Records.
The advantage of compile-time mapping of names to identifiers is speed and a decrease of data space requirements. The disadvantage is that changes made to field name/identifier mappings after, for instance, a service routine has been compiled, are not propagated to the service routine. (Under such circumstances, the service routine uses the mappings it has already compiled.)
mkfldhdr translates each field table specified in the FIELDTBLS environment variable to a corresponding header file, the name of which is formed by adding a .h suffix to the field table name. The resulting files are created, by default, in the current directory. If you want your header files to be created in another directory, you may specify that directory with the -d option on the mkfldhdr command line. For more information, refer to mkfldhdr, mkfldhdr32(1) in the BEA Tuxedo Command Reference.
Examples of Converting Field Tables to Header Files
Examples 1 and 2 show how to set your environment variables and run the mkfldhdr(1) command so that three field table files—${FLDTBLDIR}/maskftbl, ${FLDTBLDIR}/DBftbl, and ${FLDTBLDIR}/miscftbl—are processed, and three include files—maskftbl.h, DBftbl.h and miscftbl.h—are generated in the current directory. For more information, refer to mkfldhdr, mkfldhdr32(1) in the BEA Tuxedo Command Reference.
Example 1
FLDTBLDIR=/project/fldtbls
FIELDTBLS=maskftbl,DBftbl,miscftbl
export FLDTBLDIR FIELDTBLS
mkfldhdr
Example 2
FLDTBLDIR32=/project/fldtbls
FIELDTBLS32=maskftbl,DBftbl,miscftbl
export FLDTBLDIR32 FIELDTBLS32
mkfldhdr32
Example 3
Example 3 is the same as Example 1 with one exception: the output files—maskftbl.h, DBftbl.h and miscftbl.h—are generated in the directory indicated by ${FLDTBLDIR}.
FLDTBLDIR=/project/fldtbls
FIELDTBLS=maskftbl,DBftbl,miscftbl
export FLDTBLDIR FIELDTBLS
mkfldhdr -d${FLDTBLDIR}
mkfldhdr -d${FLDTBLDIR}
Overriding Environment Variables to Run mkfldhdr
You may override the environment variables (or avoid setting them) when using mkfldhdr by specifying, on the command line, the names of the field tables to be converted.
This method does not apply to run-time mapping functions, however. When run-time mapping functions are being used, FLDTBLDIR is assumed to be the current directory and FIELDTBLS is assumed to be the list of parameters that the user specified on the command line. For example, the command:
mkfldhdr myfields
converts the field table file called myfields to a field header file called myfields.h, and puts the new file in the current directory.
For more information, refer to mkfldhdr, mkfldhdr32(1) in the BEA Tuxedo Command Reference.
![]() |
![]() |
![]() |
|
Copyright © 2001 BEA Systems, Inc. All rights reserved.
|