1f9ce010aSMark Murray.\" Copyright (c) 1988 Massachusetts Institute of Technology, 2f9ce010aSMark Murray.\" Student Information Processing Board. All rights reserved. 3f9ce010aSMark Murray.\" 4f9ce010aSMark Murray.\" $FreeBSD$ 5f9ce010aSMark Murray.\" 6f9ce010aSMark Murray.Dd November 22, 1988 7f9ce010aSMark Murray.Dt COMPILE_ET 1 8*aa12cea2SUlrich Spörlein.Os 9f9ce010aSMark Murray.Sh NAME 10f9ce010aSMark Murray.Nm compile_et 11f9ce010aSMark Murray.Nd error table compiler 12f9ce010aSMark Murray.Sh SYNOPSIS 13f9ce010aSMark Murray.Nm compile_et 14f9ce010aSMark Murray.Ar file 15f9ce010aSMark Murray.Sh DESCRIPTION 16f9ce010aSMark Murray.Nm Compile_et 17f9ce010aSMark Murrayconverts a table listing error-code names and associated messages into 18f9ce010aSMark Murraya C source file suitable for use with the 19f9ce010aSMark Murray.Xr com_err 3 20f9ce010aSMark Murraylibrary. 21f9ce010aSMark Murray.Pp 22f9ce010aSMark MurrayThe source file name must end with a suffix of ``.et''; the file 23f9ce010aSMark Murrayconsists of a declaration supplying the name (up to four characters 24f9ce010aSMark Murraylong) of the error-code table: 251d66272aSRuslan Ermilov.Pp 26f9ce010aSMark Murray.Em error_table name 271d66272aSRuslan Ermilov.Pp 28f9ce010aSMark Murrayfollowed by up to 256 entries of the form: 291d66272aSRuslan Ermilov.Pp 30f9ce010aSMark Murray.Em error_code name , 311d66272aSRuslan Ermilov.No \(dq Ns Em string Ns \(dq 321d66272aSRuslan Ermilov.Pp 33f9ce010aSMark Murrayand a final 341d66272aSRuslan Ermilov.Pp 35f9ce010aSMark Murray.Em end 361d66272aSRuslan Ermilov.Pp 37f9ce010aSMark Murrayto indicate the end of the table. 38f9ce010aSMark Murray.Pp 39f9ce010aSMark MurrayThe name of the table is used to construct the name of a subroutine 40f9ce010aSMark Murray.Em initialize_XXXX_error_table 41f9ce010aSMark Murraywhich must be called in order for the 42f9ce010aSMark Murray.Xr com_err 3 43f9ce010aSMark Murraylibrary to recognize the error table. 44f9ce010aSMark Murray.Pp 45f9ce010aSMark MurrayThe various error codes defined are assigned sequentially increasing 46f9ce010aSMark Murraynumbers (starting with a large number computed as a hash function of 47f9ce010aSMark Murraythe name of the table); thus for compatibility it is suggested that 48f9ce010aSMark Murraynew codes be added only to the end of an existing table, and that no 49f9ce010aSMark Murraycodes be removed from tables. 50f9ce010aSMark Murray.Pp 51f9ce010aSMark MurrayThe names defined in the table are placed into a C header file with 52f9ce010aSMark Murraypreprocessor directives defining them as integer constants of up to 53f9ce010aSMark Murray32 bits in magnitude. 54f9ce010aSMark Murray.Pp 55f9ce010aSMark MurrayA C source file is also generated which should be compiled and linked 56f9ce010aSMark Murraywith the object files which reference these error codes; it contains 57d429ea33SRuslan Ermilovthe text of the messages and the initialization subroutine. 58d429ea33SRuslan ErmilovBoth C 59f9ce010aSMark Murrayfiles have names derived from that of the original source file, with 60f9ce010aSMark Murraythe ``.et'' suffix replaced by ``.c'' and ``.h''. 61f9ce010aSMark Murray.Pp 62f9ce010aSMark MurrayA ``#'' in the source file is treated as a comment character, and all 63f9ce010aSMark Murrayremaining text to the end of the source line will be ignored. 64ee41f1b1SRuslan Ermilov.Sh SEE ALSO 65f9ce010aSMark Murray.Xr yacc 1 , 66f9ce010aSMark Murray.Xr com_err 3 67f9ce010aSMark Murray.Rs 68f9ce010aSMark Murray.%A Ken Raeburn 69f9ce010aSMark Murray.%T "A Common Error Description Library for UNIX" 70f9ce010aSMark Murray.Re 7199f3b482SRuslan Ermilov.Sh BUGS 7299f3b482SRuslan ErmilovSince 7399f3b482SRuslan Ermilov.Nm compile_et 7499f3b482SRuslan Ermilovuses a very simple parser based on 7599f3b482SRuslan Ermilov.Xr yacc 1 , 7699f3b482SRuslan Ermilovits error recovery leaves much to be desired. 77