blob: 7219441640fe905ebc48c8384d419a488078150d [file] [log] [blame]
Theodore Ts'o3839e651997-04-26 13:21:57 +00001.\" Copyright (c) 1988 Massachusetts Institute of Technology,
2.\" Student Information Processing Board. All rights reserved.
3.\"
4.\" $Header$
5.\"
Theodore Ts'oe5fa0e31998-04-01 02:18:45 +00006.TH COMPILE_ET 1 "30 Mar 1998" SIPB
Theodore Ts'o3839e651997-04-26 13:21:57 +00007.SH NAME
8compile_et \- error table compiler
9.SH SYNOPSIS
10.B compile_et
11file
12.SH DESCRIPTION
13.B Compile_et
14converts a table listing error-code names and associated messages into
15a C source file suitable for use with the
16.IR com_err (3)
17library.
18
19The source file name must end with a suffix of ``.et''; the file
20consists of a declaration supplying the name (up to four characters
21long) of the error-code table:
22
23.B error_table
24.I name
25
26followed by up to 256 entries of the form:
27
28.B error_code
29.I name,
30"
31.I string
32"
33
34and a final
35
36.B end
37
38to indicate the end of the table.
39
40The name of the table is used to construct the name of a subroutine
41.I initialize_XXXX_error_table
42which must be called in order for the
43.I com_err
44library to recognize the error table.
45
46The various error codes defined are assigned sequentially increasing
47numbers (starting with a large number computed as a hash function of
48the name of the table); thus for compatibility it is suggested that
49new codes be added only to the end of an existing table, and that no
50codes be removed from tables.
51
52The names defined in the table are placed into a C header file with
53preprocessor directives defining them as integer constants of up to
5432 bits in magnitude.
55
56A C source file is also generated which should be compiled and linked
57with the object files which reference these error codes; it contains
58the text of the messages and the initialization subroutine. Both C
59files have names derived from that of the original source file, with
60the ``.et'' suffix replaced by ``.c'' and ``.h''.
61
62A ``#'' in the source file is treated as a comment character, and all
63remaining text to the end of the source line will be ignored.
64
65.SH BUGS
66
Theodore Ts'oe5fa0e31998-04-01 02:18:45 +000067Since the original
Theodore Ts'o3839e651997-04-26 13:21:57 +000068.B compile_et
69uses a very simple parser based on
Theodore Ts'of72df232000-12-04 23:49:07 +000070.IR yacc (1),
71and this current version of
Theodore Ts'oe5fa0e31998-04-01 02:18:45 +000072.B compile_et
73uses an awk/sed combination of scripts,
Theodore Ts'o3839e651997-04-26 13:21:57 +000074its error recovery leaves much to be desired.
75
76.\" .IR for manual entries
77.\" .PP for paragraph breaks
78
79.SH "SEE ALSO"
80com_err (3).
81
82Ken Raeburn, "A Common Error Description Library for UNIX".