]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - contrib/com_err/compile_et.1
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / contrib / com_err / compile_et.1
1 .\" Copyright (c) 1988 Massachusetts Institute of Technology,
2 .\" Student Information Processing Board.  All rights reserved.
3 .\"
4 .\" $FreeBSD$
5 .\"
6 .Dd November 22, 1988
7 .Dt COMPILE_ET 1
8 .Os
9 .Sh NAME
10 .Nm compile_et
11 .Nd error table compiler
12 .Sh SYNOPSIS
13 .Nm compile_et
14 .Ar file
15 .Sh DESCRIPTION
16 .Nm Compile_et
17 converts a table listing error-code names and associated messages into
18 a C source file suitable for use with the
19 .Xr com_err 3
20 library.
21 .Pp
22 The source file name must end with a suffix of ``.et''; the file
23 consists of a declaration supplying the name (up to four characters
24 long) of the error-code table:
25 .Pp
26 .Em error_table name
27 .Pp
28 followed by up to 256 entries of the form:
29 .Pp
30 .Em error_code name ,
31 .No \(dq Ns Em string Ns \(dq
32 .Pp
33 and a final
34 .Pp
35 .Em end
36 .Pp
37 to indicate the end of the table.
38 .Pp
39 The name of the table is used to construct the name of a subroutine
40 .Em initialize_XXXX_error_table
41 which must be called in order for the
42 .Xr com_err 3
43 library to recognize the error table.
44 .Pp
45 The various error codes defined are assigned sequentially increasing
46 numbers (starting with a large number computed as a hash function of
47 the name of the table); thus for compatibility it is suggested that
48 new codes be added only to the end of an existing table, and that no
49 codes be removed from tables.
50 .Pp
51 The names defined in the table are placed into a C header file with
52 preprocessor directives defining them as integer constants of up to
53 32 bits in magnitude.
54 .Pp
55 A C source file is also generated which should be compiled and linked
56 with the object files which reference these error codes; it contains
57 the text of the messages and the initialization subroutine.
58 Both C
59 files have names derived from that of the original source file, with
60 the ``.et'' suffix replaced by ``.c'' and ``.h''.
61 .Pp
62 A ``#'' in the source file is treated as a comment character, and all
63 remaining text to the end of the source line will be ignored.
64 .Sh SEE ALSO
65 .Xr yacc 1 ,
66 .Xr com_err 3
67 .Rs
68 .%A Ken Raeburn
69 .%T "A Common Error Description Library for UNIX"
70 .Re
71 .Sh BUGS
72 Since
73 .Nm compile_et
74 uses a very simple parser based on
75 .Xr yacc 1 ,
76 its error recovery leaves much to be desired.