compile_et.1 2.5 KB

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