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