jpayne@68
|
1 .\" Copyright (c) 1988 Massachusetts Institute of Technology,
|
jpayne@68
|
2 .\" Student Information Processing Board. All rights reserved.
|
jpayne@68
|
3 .\"
|
jpayne@68
|
4 .\" util/et/compile_et.1
|
jpayne@68
|
5 .\"
|
jpayne@68
|
6 .TH COMPILE_ET 1 "22 Nov 1988" SIPB
|
jpayne@68
|
7 .SH NAME
|
jpayne@68
|
8 compile_et \- error table compiler
|
jpayne@68
|
9 .SH SYNOPSIS
|
jpayne@68
|
10 .B compile_et
|
jpayne@68
|
11 [
|
jpayne@68
|
12 .B \-\-textdomain
|
jpayne@68
|
13 .I domain
|
jpayne@68
|
14 [
|
jpayne@68
|
15 .B \-\-localedir
|
jpayne@68
|
16 .I dir
|
jpayne@68
|
17 ] ]
|
jpayne@68
|
18 file
|
jpayne@68
|
19 .SH DESCRIPTION
|
jpayne@68
|
20 .B Compile_et
|
jpayne@68
|
21 converts a table listing error-code names and associated messages into
|
jpayne@68
|
22 a C source file suitable for use with the
|
jpayne@68
|
23 .IR com_err (3)
|
jpayne@68
|
24 library.
|
jpayne@68
|
25
|
jpayne@68
|
26 The source file name must end with a suffix of ``.et''; the file
|
jpayne@68
|
27 consists of a declaration supplying the name (up to four characters
|
jpayne@68
|
28 long) of the error-code table:
|
jpayne@68
|
29
|
jpayne@68
|
30 .B error_table
|
jpayne@68
|
31 .I name
|
jpayne@68
|
32
|
jpayne@68
|
33 followed by up to 256 entries of the form:
|
jpayne@68
|
34
|
jpayne@68
|
35 .B error_code
|
jpayne@68
|
36 .I name,
|
jpayne@68
|
37 "
|
jpayne@68
|
38 .I string
|
jpayne@68
|
39 "
|
jpayne@68
|
40
|
jpayne@68
|
41 and a final
|
jpayne@68
|
42
|
jpayne@68
|
43 .B end
|
jpayne@68
|
44
|
jpayne@68
|
45 to indicate the end of the table.
|
jpayne@68
|
46
|
jpayne@68
|
47 The name of the table is used to construct the name of a subroutine
|
jpayne@68
|
48 .I initialize_XXXX_error_table
|
jpayne@68
|
49 which must be called in order for the
|
jpayne@68
|
50 .I com_err
|
jpayne@68
|
51 library to recognize the error table.
|
jpayne@68
|
52
|
jpayne@68
|
53 The various error codes defined are assigned sequentially increasing
|
jpayne@68
|
54 numbers (starting with a large number computed as a hash function of
|
jpayne@68
|
55 the name of the table); thus for compatibility it is suggested that
|
jpayne@68
|
56 new codes be added only to the end of an existing table, and that no
|
jpayne@68
|
57 codes be removed from tables.
|
jpayne@68
|
58
|
jpayne@68
|
59 The names defined in the table are placed into a C header file with
|
jpayne@68
|
60 preprocessor directives defining them as integer constants of up to
|
jpayne@68
|
61 32 bits in magnitude.
|
jpayne@68
|
62
|
jpayne@68
|
63 A C source file is also generated which should be compiled and linked
|
jpayne@68
|
64 with the object files which reference these error codes; it contains
|
jpayne@68
|
65 the text of the messages and the initialization subroutine. Both C
|
jpayne@68
|
66 files have names derived from that of the original source file, with
|
jpayne@68
|
67 the ``.et'' suffix replaced by ``.c'' and ``.h''.
|
jpayne@68
|
68
|
jpayne@68
|
69 A ``#'' in the source file is treated as a comment character, and all
|
jpayne@68
|
70 remaining text to the end of the source line will be ignored.
|
jpayne@68
|
71
|
jpayne@68
|
72 If a text domain is provided with the
|
jpayne@68
|
73 .B \-\-textdomain
|
jpayne@68
|
74 option, error messages will be looked up in the specified domain with
|
jpayne@68
|
75 .BR gettext .
|
jpayne@68
|
76 If a locale directory is also provided with the
|
jpayne@68
|
77 .B \-\-localedir
|
jpayne@68
|
78 option, the text domain will be bound to the specified locale
|
jpayne@68
|
79 directory with
|
jpayne@68
|
80 .B bindtextdomain
|
jpayne@68
|
81 when the error table is initialized.
|
jpayne@68
|
82
|
jpayne@68
|
83 .SH BUGS
|
jpayne@68
|
84
|
jpayne@68
|
85 Since
|
jpayne@68
|
86 .B compile_et
|
jpayne@68
|
87 uses a very simple parser based on
|
jpayne@68
|
88 .IR yacc (1),
|
jpayne@68
|
89 its error recovery leaves much to be desired.
|
jpayne@68
|
90
|
jpayne@68
|
91 .\" .IR for manual entries
|
jpayne@68
|
92 .\" .PP for paragraph breaks
|
jpayne@68
|
93
|
jpayne@68
|
94 .SH "SEE ALSO"
|
jpayne@68
|
95 com_err (3).
|
jpayne@68
|
96
|
jpayne@68
|
97 Ken Raeburn, "A Common Error Description Library for UNIX".
|