Command Reference
mkfldhdr
, mkfldhdr32
—Creates header files from field tables.
mkfldhdr
[-d
outdir] [ field_table... ]mkfldhdr32
[-d
outdir] [ field_table... ]
mkfldhdr
translates each field table file to a corresponding header file suitable for inclusion in C programs. The resulting header files provide #define
macros for converting from field names to field IDs. Header filenames are formed by concatenating a .h
to the simple filename for each file to be converted.
The field table names may be specified on the command line; each file is converted to a corresponding header file.
If the field table names are not given on the command line, the program uses the FIELDTBLS
environment variable as the list of field tables to be converted, and FLDTBLDIR
environment variable as a list of directories to be searched for the files. FIELDTBLS
specifies a comma-separated list of field table filenames. If FIELDTBLS
has no value, fld.tbl
is used as the name of the (only) field table file (in this case, the resulting header file will be (fld.tbl.h
).
The FLDTBLDIR
environment variable is a colon-separated list of directories in which to look for each field table whose name is not an absolute pathname; the search for field tables is very similar to the search for executable commands using the UNIX system PATH
variable. If FLDTBLDIR
is not defined, only the current directory is searched. Thus, if no field table names are specified on the command line and FIELDTBLS
and FLDTBLDIR
are not set, mkfldhdr
will convert the field table fld.tbl
in the current directory into the header file fld.tbl.h
.
mkfldhdr32
is used for 32-bit FML. It uses the FIELDTBLS32
and FLDTBLDIR32
environment variables.
Error messages are printed if the field table load fails or if an output file cannot be created.
FLDTBLDIR=/project/fldtbls
FIELDTBLS=maskftbl,DBftbl,miscftbl,
export FLDTBLDIR FIELDTBLS
mkfldhdr
produces the #include
files maskftbl.h
, DBftbl.h
, and miscftbl.h
in the current directory by processing the files maskftbl
, DBftbl
, and miscftbl
in directory /project/fldtbls
.
With environment variables set as in the example above, the command mkfldhdr -d$FLDTBLDIRprocesses
the same input field-table files, and produces the same output files, but places them in the directory given by the value of the environment variable FLDTBLDIR
.
The command mkfldhdr myfieldsprocesses
the input file myfields
and produces myfields.h
in the current directory.