00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef _LOCALEINFO_H
00021 #define _LOCALEINFO_H 1
00022
00023 #include <stddef.h>
00024 #include <langinfo.h>
00025 #include <time.h>
00026 #include <sys/types.h>
00027
00028
00029
00030
00031 #ifndef PARAMS
00032 # if __STDC__
00033 # define PARAMS(args) args
00034 # else
00035 # define PARAMS(args) ()
00036 # endif
00037 #endif
00038
00039
00040 #define CEN_REVISION 1
00041 #define CEN_SPONSOR 2
00042 #define CEN_SPECIAL 4
00043 #define XPG_NORM_CODESET 8
00044 #define XPG_CODESET 16
00045 #define TERRITORY 32
00046 #define CEN_AUDIENCE 64
00047 #define XPG_MODIFIER 128
00048
00049 #define CEN_SPECIFIC (CEN_REVISION|CEN_SPONSOR|CEN_SPECIAL|CEN_AUDIENCE)
00050 #define XPG_SPECIFIC (XPG_CODESET|XPG_NORM_CODESET|XPG_MODIFIER)
00051
00052
00053 struct loaded_l10nfile
00054 {
00055 const char *filename;
00056 int decided;
00057
00058 const void *data;
00059
00060 struct loaded_l10nfile *next;
00061 struct loaded_l10nfile *successor[1];
00062 };
00063
00064
00065 extern const char *_nl_normalize_codeset PARAMS ((const char *codeset,
00066 size_t name_len));
00067
00068 extern struct loaded_l10nfile *
00069 _nl_make_l10nflist PARAMS ((struct loaded_l10nfile **l10nfile_list,
00070 const char *dirlist, size_t dirlist_len, int mask,
00071 const char *language, const char *territory,
00072 const char *codeset,
00073 const char *normalized_codeset,
00074 const char *modifier, const char *special,
00075 const char *sponsor, const char *revision,
00076 const char *filename, int do_allocate));
00077
00078
00079 extern const char *_nl_expand_alias PARAMS ((const char *name));
00080
00081 extern int _nl_explode_name PARAMS ((char *name, const char **language,
00082 const char **modifier,
00083 const char **territory,
00084 const char **codeset,
00085 const char **normalized_codeset,
00086 const char **special,
00087 const char **sponsor,
00088 const char **revision));
00089
00090
00091
00092
00093 #define LIMAGIC(category) (0x960617de ^ (category))
00094
00095
00096 #define FORWARD_CHAR ((wchar_t) 0xfffffffd)
00097 #define ELLIPSIS_CHAR ((wchar_t) 0xfffffffe)
00098 #define IGNORE_CHAR ((wchar_t) 0xffffffff)
00099
00100 #define MAX_USAGE_COUNT (UINT_MAX - 1)
00101 #define UNDELETABLE UINT_MAX
00102
00103
00104 struct locale_data
00105 {
00106 const char *name;
00107 const char *filedata;
00108 off_t filesize;
00109
00110
00111
00112
00113 unsigned int nstrings;
00114 union locale_data_value
00115 {
00116 const wchar_t *wstr;
00117 const char *string;
00118 unsigned int word;
00119 }
00120 values[0];
00121 };
00122
00123
00124 enum coll_sort_rule
00125 {
00126 illegal_0__,
00127 sort_forward,
00128 sort_backward,
00129 illegal_3__,
00130 sort_position,
00131 sort_forward_position,
00132 sort_backward_position,
00133 sort_mask
00134 };
00135
00136
00137 enum value_type
00138 {
00139 none,
00140 string,
00141 stringarray,
00142 byte,
00143 bytearray,
00144 word
00145 };
00146
00147
00148
00149 struct era_entry
00150 {
00151 u_int32_t direction;
00152 int32_t offset;
00153 int32_t start_date[3];
00154 int32_t stop_date[3];
00155 const char name_fmt[0];
00156 };
00157
00158 extern const char *const _nl_category_names[LC_ALL + 1];
00159 extern const size_t _nl_category_name_sizes[LC_ALL + 1];
00160 extern const struct locale_data * *const _nl_current[LC_ALL];
00161
00162
00163 extern const char _nl_C_name[];
00164
00165
00166 #define _NL_CURRENT(category, item) \
00167 (_nl_current_##category->values[_NL_ITEM_INDEX (item)].string)
00168
00169
00170 #define _NL_CURRENT_WORD(category, item) \
00171 (_nl_current_##category->values[_NL_ITEM_INDEX (item)].word)
00172
00173
00174 #define _NL_CURRENT_DEFINE(category) \
00175 extern const struct locale_data _nl_C_##category; \
00176 const struct locale_data *_nl_current_##category = &_nl_C_##category
00177
00178
00179
00180
00181
00182 extern const struct locale_data *_nl_find_locale (const char *locale_path,
00183 size_t locale_path_len,
00184 int category, char **name);
00185
00186
00187 extern void _nl_load_locale (struct loaded_l10nfile *file, int category);
00188
00189
00190
00191 struct era_entry *_nl_get_era_entry (const struct tm *tp);
00192
00193
00194 const char *_nl_get_alt_digit (unsigned int number);
00195
00196
00197
00198 extern const u_int32_t *__collate_table;
00199 extern const u_int32_t *__collate_extra;
00200 extern const u_int32_t *__collate_element_hash;
00201 extern const char *__collate_element_strings;
00202 extern const wchar_t *__collate_element_values;
00203 extern const u_int32_t *__collate_symbol_hash;
00204 extern const char *__collate_symbol_strings;
00205 extern const u_int32_t *__collate_symbol_classes;
00206
00207 #endif