89
81
names. Normalization allows the user to use any of the common
90
82
names. The return value is dynamically allocated and has to be
91
83
freed by the caller. */
92
extern const char *_nl_normalize_codeset PARAMS ((const char *codeset,
84
extern const char *_nl_normalize_codeset (const char *codeset,
87
/* Lookup a locale dependent file.
88
*L10NFILE_LIST denotes a pool of lookup results of locale dependent
89
files of the same kind, sorted in decreasing order of ->filename.
90
DIRLIST and DIRLIST_LEN are an argz list of directories in which to
91
look, containing at least one directory (i.e. DIRLIST_LEN > 0).
92
MASK, LANGUAGE, TERRITORY, CODESET, NORMALIZED_CODESET, MODIFIER,
93
SPECIAL, SPONSOR, REVISION are the pieces of the locale name, as
94
produced by _nl_explode_name(). FILENAME is the filename suffix.
95
The return value is the lookup result, either found in *L10NFILE_LIST,
96
or - if DO_ALLOCATE is nonzero - freshly allocated, or possibly NULL.
97
If the return value is non-NULL, it is added to *L10NFILE_LIST, and
98
its ->next field denotes the chaining inside *L10NFILE_LIST, and
99
furthermore its ->successor[] field contains a list of other lookup
100
results from which this lookup result inherits. */
95
101
extern struct loaded_l10nfile *
96
_nl_make_l10nflist PARAMS ((struct loaded_l10nfile **l10nfile_list,
97
const char *dirlist, size_t dirlist_len, int mask,
98
const char *language, const char *territory,
100
const char *normalized_codeset,
101
const char *modifier, const char *special,
102
const char *sponsor, const char *revision,
103
const char *filename, int do_allocate));
106
extern const char *_nl_expand_alias PARAMS ((const char *name));
108
/* normalized_codeset is dynamically allocated and has to be freed by
110
extern int _nl_explode_name PARAMS ((char *name, const char **language,
111
const char **modifier,
112
const char **territory,
113
const char **codeset,
114
const char **normalized_codeset,
115
const char **special,
116
const char **sponsor,
117
const char **revision));
119
extern char *_nl_find_language PARAMS ((const char *name));
102
_nl_make_l10nflist (struct loaded_l10nfile **l10nfile_list,
103
const char *dirlist, size_t dirlist_len, int mask,
104
const char *language, const char *territory,
105
const char *codeset, const char *normalized_codeset,
106
const char *modifier, const char *special,
107
const char *sponsor, const char *revision,
108
const char *filename, int do_allocate);
110
/* Lookup the real locale name for a locale alias NAME, or NULL if
111
NAME is not a locale alias (but possibly a real locale name).
112
The return value is statically allocated and must not be freed. */
113
extern const char *_nl_expand_alias (const char *name);
115
/* Split a locale name NAME into its pieces: language, modifier,
116
territory, codeset, special, sponsor, revision.
117
NAME gets destructively modified: NUL bytes are inserted here and
118
there. *LANGUAGE gets assigned NAME. Each of *MODIFIER, *TERRITORY,
119
*CODESET, *SPECIAL, *SPONSOR, *REVISION gets assigned either a
120
pointer into the old NAME string, or NULL. *NORMALIZED_CODESET
121
gets assigned the expanded *CODESET, if it is different from *CODESET;
122
this one is dynamically allocated and has to be freed by the caller.
123
The return value is a bitmask, where each bit corresponds to one
125
XPG_MODIFIER, CEN_AUDIENCE for *MODIFIER,
126
TERRITORY for *TERRITORY,
127
XPG_CODESET for *CODESET,
128
XPG_NORM_CODESET for *NORMALIZED_CODESET,
129
CEN_SPECIAL for *SPECIAL,
130
CEN_SPONSOR for *SPONSOR,
131
CEN_REVISION for *REVISION.
133
extern int _nl_explode_name (char *name, const char **language,
134
const char **modifier, const char **territory,
135
const char **codeset,
136
const char **normalized_codeset,
137
const char **special, const char **sponsor,
138
const char **revision);
140
/* Split a locale name NAME into a leading language part and all the
141
rest. Return a pointer to the first character after the language,
142
i.e. to the first byte of the rest. */
143
extern char *_nl_find_language (const char *name);
121
145
#endif /* loadinfo.h */