Blame src/util/et/compile_et.1

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