[BACK]Return to compile_et.1 CVS log [TXT][DIR] Up to [local] / src / usr.bin / compile_et

Annotation of src/usr.bin/compile_et/compile_et.1, Revision 1.10

1.1       downsj      1: .\" Copyright (c) 1988 Massachusetts Institute of Technology,
                      2: .\" Student Information Processing Board.  All rights reserved.
                      3: .\"
1.10    ! aaron       4: .\" $OpenBSD: compile_et.1,v 1.9 2000/03/05 20:09:21 aaron Exp $
        !             5: .\" $Header: /cvs/src/usr.bin/compile_et/compile_et.1,v 1.9 2000/03/05 20:09:21 aaron Exp $
1.1       downsj      6: .\"
1.10    ! aaron       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.9       aaron      23: The source file name must end with a suffix of
                     24: .Dq .et ;
                     25: the file
1.8       hin        26: consists of headers and declarations supplying the name (up to four characters
                     27: long) of the error-code table.
1.9       aaron      28: .Pp
1.8       hin        29: The file may have these declarations:
1.9       aaron      30: .Bl -tag -width Ds
                     31: .It Sy id Ar string
                     32: Specify
                     33: .Ar string
                     34: as a revision control system tag.
                     35: .It Sy prefix Ar string
                     36: Prepends
                     37: .Ar string
                     38: to all error codes specified in the file.
                     39: .It Sy error_table Ar name
                     40: Specifies the name of the error table.
                     41: .It Sy index Ar number
                     42: Sets the assigned error number for the next entry.
                     43: .It Xo Sy error_code
                     44: .Ar name ,
                     45: .Qq Ar string
                     46: .Xc
                     47: Declares an error code called
                     48: .Ar name
                     49: with description
                     50: .Ar string ;
                     51: up to 256 error codes are allowed.
                     52: .It Sy end
                     53: Indicates the end of the table.
                     54: .El
1.3       grr        55: .Pp
1.1       downsj     56: The name of the table is used to construct the name of a subroutine
1.3       grr        57: .Em initialize_XXXX_error_table
1.1       downsj     58: which must be called in order for the
1.3       grr        59: .Xr com_err 3
1.1       downsj     60: library to recognize the error table.
1.3       grr        61: .Pp
1.1       downsj     62: The various error codes defined are assigned sequentially increasing
                     63: numbers (starting with a large number computed as a hash function of
                     64: the name of the table); thus for compatibility it is suggested that
                     65: new codes be added only to the end of an existing table, and that no
                     66: codes be removed from tables.
1.3       grr        67: .Pp
1.1       downsj     68: The names defined in the table are placed into a C header file with
                     69: preprocessor directives defining them as integer constants of up to
                     70: 32 bits in magnitude.
1.3       grr        71: .Pp
1.1       downsj     72: A C source file is also generated which should be compiled and linked
                     73: with the object files which reference these error codes; it contains
1.10    ! aaron      74: the text of the messages and the initialization subroutine.
        !            75: Both C files have names derived from that of the original source file, with
1.9       aaron      76: the
                     77: .Dq .et
                     78: suffix replaced by
                     79: .Dq \&.c
                     80: and
                     81: .Dq \&.h .
                     82: .Pp
                     83: A hash mark
                     84: .Pq Ql #
                     85: in the source file is treated as a comment character; subsequent
                     86: characters to the end of the source line will be ignored.
1.3       grr        87: .Sh BUGS
1.1       downsj     88: Since
1.5       aaron      89: .Nm
1.1       downsj     90: uses a very simple parser based on
1.3       grr        91: .Xr yacc 1 ,
1.1       downsj     92: its error recovery leaves much to be desired.
1.7       aaron      93: .Sh SEE ALSO
1.3       grr        94: .Xr yacc 1 ,
                     95: .Xr com_err 3
1.9       aaron      96: .\" XXX - use .br here to work-around apparent bug in mdoc
                     97: .br
1.3       grr        98: .Pp
                     99: .Rs
                    100: .%A Ken Raeburn
                    101: .%T "A Common Error Description Library for UNIX"
                    102: .Re