jpayne@68: .\" Copyright (c) 1988 Massachusetts Institute of Technology, jpayne@68: .\" Student Information Processing Board. All rights reserved. jpayne@68: .\" jpayne@68: .\" util/et/compile_et.1 jpayne@68: .\" jpayne@68: .TH COMPILE_ET 1 "22 Nov 1988" SIPB jpayne@68: .SH NAME jpayne@68: compile_et \- error table compiler jpayne@68: .SH SYNOPSIS jpayne@68: .B compile_et jpayne@68: [ jpayne@68: .B \-\-textdomain jpayne@68: .I domain jpayne@68: [ jpayne@68: .B \-\-localedir jpayne@68: .I dir jpayne@68: ] ] jpayne@68: file jpayne@68: .SH DESCRIPTION jpayne@68: .B Compile_et jpayne@68: converts a table listing error-code names and associated messages into jpayne@68: a C source file suitable for use with the jpayne@68: .IR com_err (3) jpayne@68: library. jpayne@68: jpayne@68: The source file name must end with a suffix of ``.et''; the file jpayne@68: consists of a declaration supplying the name (up to four characters jpayne@68: long) of the error-code table: jpayne@68: jpayne@68: .B error_table jpayne@68: .I name jpayne@68: jpayne@68: followed by up to 256 entries of the form: jpayne@68: jpayne@68: .B error_code jpayne@68: .I name, jpayne@68: " jpayne@68: .I string jpayne@68: " jpayne@68: jpayne@68: and a final jpayne@68: jpayne@68: .B end jpayne@68: jpayne@68: to indicate the end of the table. jpayne@68: jpayne@68: The name of the table is used to construct the name of a subroutine jpayne@68: .I initialize_XXXX_error_table jpayne@68: which must be called in order for the jpayne@68: .I com_err jpayne@68: library to recognize the error table. jpayne@68: jpayne@68: The various error codes defined are assigned sequentially increasing jpayne@68: numbers (starting with a large number computed as a hash function of jpayne@68: the name of the table); thus for compatibility it is suggested that jpayne@68: new codes be added only to the end of an existing table, and that no jpayne@68: codes be removed from tables. jpayne@68: jpayne@68: The names defined in the table are placed into a C header file with jpayne@68: preprocessor directives defining them as integer constants of up to jpayne@68: 32 bits in magnitude. jpayne@68: jpayne@68: A C source file is also generated which should be compiled and linked jpayne@68: with the object files which reference these error codes; it contains jpayne@68: the text of the messages and the initialization subroutine. Both C jpayne@68: files have names derived from that of the original source file, with jpayne@68: the ``.et'' suffix replaced by ``.c'' and ``.h''. jpayne@68: jpayne@68: A ``#'' in the source file is treated as a comment character, and all jpayne@68: remaining text to the end of the source line will be ignored. jpayne@68: jpayne@68: If a text domain is provided with the jpayne@68: .B \-\-textdomain jpayne@68: option, error messages will be looked up in the specified domain with jpayne@68: .BR gettext . jpayne@68: If a locale directory is also provided with the jpayne@68: .B \-\-localedir jpayne@68: option, the text domain will be bound to the specified locale jpayne@68: directory with jpayne@68: .B bindtextdomain jpayne@68: when the error table is initialized. jpayne@68: jpayne@68: .SH BUGS jpayne@68: jpayne@68: Since jpayne@68: .B compile_et jpayne@68: uses a very simple parser based on jpayne@68: .IR yacc (1), jpayne@68: its error recovery leaves much to be desired. jpayne@68: jpayne@68: .\" .IR for manual entries jpayne@68: .\" .PP for paragraph breaks jpayne@68: jpayne@68: .SH "SEE ALSO" jpayne@68: com_err (3). jpayne@68: jpayne@68: Ken Raeburn, "A Common Error Description Library for UNIX".