[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.8

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