categories.c 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. /* Definition of all available locale categories and their items. -*- C -*-
  2. Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
  3. The GNU C Library is free software; you can redistribute it and/or
  4. modify it under the terms of the GNU Library General Public License as
  5. published by the Free Software Foundation; either version 2 of the
  6. License, or (at your option) any later version.
  7. The GNU C Library is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  10. Library General Public License for more details.
  11. You should have received a copy of the GNU Library General Public
  12. License along with the GNU C Library; see the file COPYING.LIB. If not,
  13. write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  14. Boston, MA 02111-1307, USA. */
  15. /* These definitions are used by the locale-related files in the C library
  16. and the programs `localedef' and `locale'.
  17. The general format of the descriptions is like this:
  18. DEFINE_CATEGORY (ID, name, ( items ), setlocale-postload,
  19. locale-input, locale-check, locale-output)
  20. where items itself is an array of entries in the form
  21. { ID, name, standard, value-type, min, max }
  22. The usage of the load, check, output functions depends on the individual
  23. program code which loads this file.
  24. The various value types for the items are `string', `stringarray', `byte'
  25. `bytearray', and `word'. These cover all possible values in the current
  26. locale definitions. `min' and `max' can be individually used again. */
  27. #ifndef NO_POSTLOAD
  28. #define NO_POSTLOAD NULL
  29. #endif
  30. DEFINE_CATEGORY
  31. (
  32. LC_COLLATE, "LC_COLLATE",
  33. (
  34. DEFINE_ELEMENT (_NL_COLLATE_NRULES, "collate-nrules", std, word)
  35. DEFINE_ELEMENT (_NL_COLLATE_RULES, "collate-rules", std, string)
  36. DEFINE_ELEMENT (_NL_COLLATE_HASH_SIZE, "collate-hash-size", std, word)
  37. DEFINE_ELEMENT (_NL_COLLATE_HASH_LAYERS, "collate-hash-layers", std, word)
  38. DEFINE_ELEMENT (_NL_COLLATE_TABLE_EB, "collate-table-eb", std, string)
  39. DEFINE_ELEMENT (_NL_COLLATE_TABLE_EL, "collate-table-el", std, string)
  40. DEFINE_ELEMENT (_NL_COLLATE_UNDEFINED, "collate-undefined", std, word)
  41. DEFINE_ELEMENT (_NL_COLLATE_EXTRA_EB, "collate-extra-eb", std, string)
  42. DEFINE_ELEMENT (_NL_COLLATE_EXTRA_EL, "collate-extra-el", std, string)
  43. DEFINE_ELEMENT (_NL_COLLATE_ELEM_HASH_SIZE, "collate-elem-hash-size", std, word)
  44. DEFINE_ELEMENT (_NL_COLLATE_ELEM_HASH_EB, "collate-elem-hash-eb", std, string)
  45. DEFINE_ELEMENT (_NL_COLLATE_ELEM_HASH_EL, "collate-elem-hash-el", std, string)
  46. DEFINE_ELEMENT (_NL_COLLATE_ELEM_STR_POOL, "collate-elem-str-pool", std, string)
  47. DEFINE_ELEMENT (_NL_COLLATE_ELEM_VAL_EB, "collate-elem-val-eb", std, string)
  48. DEFINE_ELEMENT (_NL_COLLATE_ELEM_VAL_EL, "collate-elem-val-el", std, string)
  49. DEFINE_ELEMENT (_NL_COLLATE_SYMB_HASH_SIZE, "collate-symb-hash-size", std, word)
  50. DEFINE_ELEMENT (_NL_COLLATE_SYMB_HASH_EB, "collate-symb-hash-eb", std, string)
  51. DEFINE_ELEMENT (_NL_COLLATE_SYMB_HASH_EL, "collate-symb-hash-el", std, string)
  52. DEFINE_ELEMENT (_NL_COLLATE_SYMB_STR_POOL, "collate-symb-str-pool", std, string)
  53. DEFINE_ELEMENT (_NL_COLLATE_SYMB_CLASS_EB, "collate-symb-class-eb", std, string)
  54. DEFINE_ELEMENT (_NL_COLLATE_SYMB_CLASS_EL, "collate-symb-class-el", std, string)
  55. ), _nl_postload_collate, collate_input, NULL, NULL)
  56. /* The actual definition of ctype is meaningless here. It is hard coded in
  57. the code because it has to be handled very specially. Only the names of
  58. the functions and the value types are important. */
  59. DEFINE_CATEGORY
  60. (
  61. LC_CTYPE, "LC_CTYPE",
  62. (
  63. DEFINE_ELEMENT (_NL_CTYPE_CLASS, "ctype-class", std, string)
  64. DEFINE_ELEMENT (_NL_CTYPE_TOUPPER_EB, "ctype-toupper-eb", std, string)
  65. DEFINE_ELEMENT (_NL_CTYPE_TOLOWER_EB, "ctype-tolower-eb", std, string)
  66. DEFINE_ELEMENT (_NL_CTYPE_TOUPPER_EL, "ctype-toupper-el", std, string)
  67. DEFINE_ELEMENT (_NL_CTYPE_TOLOWER_EL, "ctype-tolower-el", std, string)
  68. DEFINE_ELEMENT (_NL_CTYPE_CLASS32, "ctype-class32", std, string)
  69. DEFINE_ELEMENT (_NL_CTYPE_NAMES_EB, "ctype-names-eb", std, string)
  70. DEFINE_ELEMENT (_NL_CTYPE_NAMES_EL, "ctype-names-el", std, string)
  71. DEFINE_ELEMENT (_NL_CTYPE_HASH_SIZE, "ctype-hash-size", std, word)
  72. DEFINE_ELEMENT (_NL_CTYPE_HASH_LAYERS, "ctype-hash-layers", std, word)
  73. DEFINE_ELEMENT (_NL_CTYPE_CLASS_NAMES, "ctype-class-names", std, stringlist)
  74. DEFINE_ELEMENT (_NL_CTYPE_MAP_NAMES, "ctype-map-names", std, stringlist)
  75. DEFINE_ELEMENT (_NL_CTYPE_WIDTH, "ctype-width", std, bytearray)
  76. DEFINE_ELEMENT (_NL_CTYPE_MB_CUR_MAX, "ctype-mb-cur-max", std, word)
  77. DEFINE_ELEMENT (_NL_CTYPE_CODESET_NAME, "charmap", std, string)
  78. ), _nl_postload_ctype, ctype_input, ctype_check, ctype_output)
  79. DEFINE_CATEGORY
  80. (
  81. LC_MONETARY, "LC_MONETARY",
  82. (
  83. DEFINE_ELEMENT (INT_CURR_SYMBOL, "int_curr_symbol", std, string)
  84. DEFINE_ELEMENT (CURRENCY_SYMBOL, "currency_symbol", std, string)
  85. DEFINE_ELEMENT (MON_DECIMAL_POINT, "mon_decimal_point", std, string)
  86. DEFINE_ELEMENT (MON_THOUSANDS_SEP, "mon_thousands_sep", std, string)
  87. DEFINE_ELEMENT (MON_GROUPING, "mon_grouping", std, bytearray)
  88. DEFINE_ELEMENT (POSITIVE_SIGN, "positive_sign", std, string)
  89. DEFINE_ELEMENT (NEGATIVE_SIGN, "negative_sign", std, string)
  90. DEFINE_ELEMENT (INT_FRAC_DIGITS, "int_frac_digits", std, byte)
  91. DEFINE_ELEMENT (FRAC_DIGITS, "frac_digits", std, byte)
  92. DEFINE_ELEMENT (P_CS_PRECEDES, "p_cs_precedes", std, byte, 0, 1)
  93. DEFINE_ELEMENT (P_SEP_BY_SPACE, "p_sep_by_space", std, byte, 0, 2)
  94. DEFINE_ELEMENT (N_CS_PRECEDES, "n_cs_precedes", std, byte, 0, 1)
  95. DEFINE_ELEMENT (N_SEP_BY_SPACE, "n_sep_by_space", std, byte, 0, 2)
  96. DEFINE_ELEMENT (P_SIGN_POSN, "p_sign_posn", std, byte, 0, 4)
  97. DEFINE_ELEMENT (N_SIGN_POSN, "n_sign_posn", std, byte, 0, 4)
  98. ), NO_POSTLOAD, NULL, monetary_check, NULL)
  99. DEFINE_CATEGORY
  100. (
  101. LC_NUMERIC, "LC_NUMERIC",
  102. (
  103. DEFINE_ELEMENT (DECIMAL_POINT, "decimal_point", std, string)
  104. DEFINE_ELEMENT (THOUSANDS_SEP, "thousands_sep", std, string)
  105. DEFINE_ELEMENT (GROUPING, "grouping", std, bytearray)
  106. ), NO_POSTLOAD, NULL, numeric_check, NULL)
  107. DEFINE_CATEGORY
  108. (
  109. LC_TIME, "LC_TIME",
  110. (
  111. DEFINE_ELEMENT (ABDAY_1, "abday", std, stringarray, 7, 7)
  112. DEFINE_ELEMENT (DAY_1, "day", std, stringarray, 7, 7)
  113. DEFINE_ELEMENT (ABMON_1, "abmon", std, stringarray, 12, 12)
  114. DEFINE_ELEMENT (MON_1, "mon", std, stringarray, 12, 12)
  115. DEFINE_ELEMENT (AM_STR, "am_pm", std, stringarray, 2, 2)
  116. DEFINE_ELEMENT (D_T_FMT, "d_t_fmt", std, string)
  117. DEFINE_ELEMENT (D_FMT, "d_fmt", std, string)
  118. DEFINE_ELEMENT (T_FMT, "t_fmt", std, string)
  119. DEFINE_ELEMENT (T_FMT_AMPM, "t_fmt_ampm", std, string)
  120. DEFINE_ELEMENT (ERA, "era", opt, stringarray)
  121. DEFINE_ELEMENT (ERA_YEAR, "era_year", opt, string)
  122. DEFINE_ELEMENT (ERA_D_FMT, "era_d_fmt", opt, string)
  123. DEFINE_ELEMENT (ALT_DIGITS, "alt_digits", opt, stringarray, 0, 100)
  124. DEFINE_ELEMENT (ERA_D_T_FMT, "era_d_t_fmt", opt, string)
  125. DEFINE_ELEMENT (ERA_T_FMT, "era_t_fmt", opt, string)
  126. DEFINE_ELEMENT (_NL_TIME_NUM_ALT_DIGITS, "time-num-alt-digits", opt, word)
  127. DEFINE_ELEMENT (_NL_TIME_ERA_NUM_ENTRIES, "time-era-num-entries", opt, word)
  128. DEFINE_ELEMENT (_NL_TIME_ERA_ENTRIES_EB, "time-era-entries-eb", opt, string)
  129. DEFINE_ELEMENT (_NL_TIME_ERA_ENTRIES_EL, "time-era-entries-el", opt, string)
  130. ), _nl_postload_time, NULL, NULL, NULL)
  131. DEFINE_CATEGORY
  132. (
  133. LC_MESSAGES, "LC_MESSAGES",
  134. (
  135. DEFINE_ELEMENT (YESEXPR, "yesexpr", std, string)
  136. DEFINE_ELEMENT (NOEXPR, "noexpr", std, string)
  137. DEFINE_ELEMENT (YESSTR, "yesstr", opt, string)
  138. DEFINE_ELEMENT (NOSTR, "nostr", opt, string)
  139. ), NO_POSTLOAD, NULL, messages_check, NULL)