The
compile_et utility reads the table describing error-code names and their associated messages in the file
file and generates a C source file suitable for use with the
com_err(3) library. The source file
file must end with a suffix of “.et” and
compile_et writes a C header file
file.h which contains definitions of the numerical values of the error codes defined in the error table and a C source file
file.c which should be compiled and linked with the executable.
The source file is a plain ASCII text file. A “#” in the source file is treated as a comment character, and all remaining text to the end of the source line will be ignored. The source file consists of the following declarations:
id [base] string
Defines an identification string (such as a version string) which is recorded in the generated files. It is mandatory and must be the first declaration in the source file.
et name
Specifies the name of the error table to be
name. It is mandatory and must be declared after the id declaration and before all other declarations. The name of table is limited to four ASCII characters. The optional argument
base specifies the base value of error codes the table.
The name of the table is used to construct the name of a function
initialize_<name>_error_table() which must be called to register the error table with the
com_err(3) library. A re-entrant (thread-safe) version called
initialize_<name>_error_table_r() is also defined.
prefix [string]
Defines a prefix to be applied to all error code names. If no string is specified, the prefix is not defined. It is an optional declaration and can appear more than once.
index val
Specifies the index val in the error table for the following error code declaration. Subsequent error codes are allocated sequentially from the same value. It is an optional declaration and can appear more than once.
ec cname, msg
Defines an error code with the name cname and its associated error message msg. The error codes are assigned sequentially increasing numbers. The name is placed into the C header file as an enumerated type.
end
Indicates the end of the error table.
To maintain compatibility, new codes should be added to the end of an existing table, and codes should not be removed from tables.