This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
intl patches (14)
- From: Bruno Haible <bruno at clisp dot org>
- To: libc-alpha at sources dot redhat dot com
- Date: Mon, 28 Apr 2003 13:14:52 +0200 (CEST)
- Subject: intl patches (14)
Hi Ulrich,
Please add these comments to some function declarations. I don't like to
work in piles of uncommented code. (Actually that's one of the reasons
why I stopped working on XFree86 code a few years ago.)
2003-04-27 Bruno Haible <bruno at clisp dot org>
* intl/loadinfo.h: Add comments.
* intl/explodename.c: Likewise.
diff -r -c3 glibc-20030425.orig/intl/explodename.c glibc-20030425/intl/explodename.c
--- glibc-20030425.orig/intl/explodename.c Fri Jan 10 15:21:04 2003
+++ glibc-20030425/intl/explodename.c Sun Apr 27 13:00:07 2003
@@ -40,6 +40,9 @@
static char *_nl_find_language PARAMS ((const char *name));
+/* Split a locale name NAME into a leading language part and all the
+ rest. Return a pointer to the first character after the language,
+ i.e. to the first byte of the rest. */
static char *
_nl_find_language (name)
const char *name;
diff -r -c3 glibc-20030425.orig/intl/loadinfo.h glibc-20030425/intl/loadinfo.h
--- glibc-20030425.orig/intl/loadinfo.h Fri Jan 10 15:21:04 2003
+++ glibc-20030425/intl/loadinfo.h Sun Apr 27 13:03:27 2003
@@ -76,6 +76,20 @@
extern const char *_nl_normalize_codeset PARAMS ((const char *codeset,
size_t name_len));
+/* Lookup a locale dependent file.
+ *L10NFILE_LIST denotes a pool of lookup results of locale dependent
+ files of the same kind, sorted in decreasing order of ->filename.
+ DIRLIST and DIRLIST_LEN are an argz list of directories in which to
+ look, containing at least one directory (i.e. DIRLIST_LEN > 0).
+ MASK, LANGUAGE, TERRITORY, CODESET, NORMALIZED_CODESET, MODIFIER,
+ are the pieces of the locale name, as produced by _nl_explode_name().
+ FILENAME is the filename suffix. The return value is the lookup
+ result, either found in *L10NFILE_LIST, or - if DO_ALLOCATE is nonzero -
+ freshly allocated, or possibly NULL. If the return value is non-NULL,
+ it is added to *L10NFILE_LIST, and its ->next field denotes the
+ chaining inside *L10NFILE_LIST, and furthermore its ->successor[] field
+ contains a list of other lookup results from which this lookup result
+ inherits. */
extern struct loaded_l10nfile *
_nl_make_l10nflist PARAMS ((struct loaded_l10nfile **l10nfile_list,
const char *dirlist, size_t dirlist_len, int mask,
@@ -86,10 +100,25 @@
int do_allocate));
+/* Lookup the real locale name for a locale alias NAME, or NULL if
+ NAME is not a locale alias (but possibly a real locale name).
+ The return value is statically allocated and must not be freed. */
extern const char *_nl_expand_alias PARAMS ((const char *name));
-/* normalized_codeset is dynamically allocated and has to be freed by
- the caller. */
+/* Split a locale name NAME into its pieces: language, modifier,
+ territory, codeset, special, sponsor, revision.
+ NAME gets destructively modified: NUL bytes are inserted here and
+ there. *LANGUAGE gets assigned NAME. Each of *MODIFIER, *TERRITORY,
+ *CODESET gets assigned either a pointer into the old NAME string, or NULL.
+ *NORMALIZED_CODESET gets assigned the expanded *CODESET, if it is
+ different from *CODESET; this one is dynamically allocated and has to be
+ freed by the caller. The return value is a bitmask, where each bit
+ corresponds to one filled-in value:
+ XPG_MODIFIER for *MODIFIER,
+ XPG_TERRITORY for *TERRITORY,
+ XPG_CODESET for *CODESET,
+ XPG_NORM_CODESET for *NORMALIZED_CODESET.
+ */
extern int _nl_explode_name PARAMS ((char *name, const char **language,
const char **modifier,
const char **territory,