Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

compile_et(1) [freebsd man page]

COMPILE_ET(1)						    BSD General Commands Manual 					     COMPILE_ET(1)

compile_et -- error table compiler SYNOPSIS
compile_et file DESCRIPTION
Compile_et converts a table listing error-code names and associated messages into a C source file suitable for use with the com_err(3) library. The source file name must end with a suffix of ``.et''; the file consists of a declaration supplying the name (up to four characters long) of the error-code table: error_table name followed by up to 256 entries of the form: error_code name, "string" and a final end to indicate the end of the table. The name of the table is used to construct the name of a subroutine initialize_XXXX_error_table which must be called in order for the com_err(3) library to recognize the error table. The various error codes defined are assigned sequentially increasing numbers (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 from tables. 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 in magnitude. A C source file is also generated which should be compiled and linked with the object files which reference these error codes; it contains the text of the messages and the initialization subroutine. Both C files have names derived from that of the original source file, with the ``.et'' suffix replaced by ``.c'' and ``.h''. 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. SEE ALSO
yacc(1), com_err(3) Ken Raeburn, A Common Error Description Library for UNIX. BUGS
Since compile_et uses a very simple parser based on yacc(1), its error recovery leaves much to be desired. BSD
November 22, 1988 BSD

Check Out this Related Man Page

COM_ERR(3)						     Library Functions Manual							COM_ERR(3)

com_err - common error display routine SYNOPSIS
#include <et/com_err.h> void (*proc) (const char *, long, const char *, va_list); void com_err (const char *whoami, long code, const char *format, ...); proc = set_com_err_hook (proc); proc = reset_com_err_hook (); void initialize_XXXX_error_table (); DESCRIPTION
Com_err displays an error message on the standard error stream stderr (see stdio(3S)) composed of the whoami string, which should specify the program name or some subportion of a program, followed by an error message generated from the code value (derived from compile_et(1)), and a string produced using the format string and any following arguments, in the same style as fprintf(3). The behavior of com_err can be modified using set_com_err_hook; this defines a procedure which is called with the arguments passed to com_err, instead of the default internal procedure which sends the formatted text to error output. Thus the error messages from a program can all easily be diverted to another form of diagnostic logging, such as syslog(3). Reset_com_err_hook may be used to restore the behav- ior of com_err to its default form. Both procedures return the previous ``hook'' value. These ``hook'' procedures must have the declara- tion given for proc above in the synopsis. The initialize_XXXX_error_table routine is generated mechanically by compile_et(1) from a source file containing names and associated strings. Each table has a name of up to four characters, which is used in place of the XXXX in the name of the routine. These routines should be called before any of the corresponding error codes are used, so that the com_err library will recognize error codes from these tables when they are used. The com_err.h header file should be included in any source file that uses routines from the com_err library; executable files must be linked using ``-lcom_err'' in order to cause the com_err library to be included. SEE ALSO
compile_et(1), syslog(3). Ken Raeburn, "A Common Error Description Library for UNIX". SIPB
22 Nov 1988 COM_ERR(3)
Man Page