compile_et - error table compiler
compile_et converts a table listing error-code names and associated messages
into a C source file suitable for use with the
The source file name must end with a suffix of ``.et''; the
of headers and declarations supplying the name (up to four
long) of the error-code table.
The file may have these declarations:
Specify string as a revision control system tag.
Prepends string to all error codes specified in the
Specifies the name of the error table.
Sets the assigned error number for the next entry.
error_code name, "string"
Declares an error code called name with description
string; up to
256 error codes are allowed.
end Indicates the end of the table.
The name of the table is used to construct the name of a
initialize_XXXX_error_table which must be called in order
com_err(3) library to recognize the error table.
The various error codes defined are assigned sequentially
(starting with a large number computed as a hash function of the
name of the table); thus for compatibility it is suggested
that new codes
be added only to the end of an existing table, and that no
codes be removed
The names defined in the table are placed into a C header
file with preprocessor
directives defining them as integer constants of
up to 32 bits
A C source file is also generated which should be compiled
with the object files which reference these error codes; it
text of the messages and the initialization subroutine.
Both C files
have names derived from that of the original source file,
``.et'' suffix replaced by ``.c'' and ``.h''.
A hash mark (`#') in the source file is treated as a comment
subsequent characters to the end of the source line will be
Ken Raeburn, A Common Error Description Library for UNIX.
Since compile_et uses a very simple parser based on yacc(1),
recovery leaves much to be desired.
OpenBSD 3.6 November 22, 1988
[ Back ]