diff options
author | Roland McGrath <roland@gnu.org> | 2002-08-08 01:33:05 +0000 |
---|---|---|
committer | Roland McGrath <roland@gnu.org> | 2002-08-08 01:33:05 +0000 |
commit | 78323b5b80225fb88f783c8f74fc8ce86d0fbf23 (patch) | |
tree | c1838c8477dd8c474c50ca1680e28b9392944b51 /locale/locale.h | |
parent | 2a54ad77a156e9df608c7964a4a1ef042df6b9d4 (diff) | |
download | glibc-78323b5b80225fb88f783c8f74fc8ce86d0fbf23.zip glibc-78323b5b80225fb88f783c8f74fc8ce86d0fbf23.tar.gz glibc-78323b5b80225fb88f783c8f74fc8ce86d0fbf23.tar.bz2 |
* inet/getnetgrent_r.c (endnetgrent, __getnetgrent_r): Actually call
the static symbols added in the last change (doofus is me).
* locale/newlocale.c (__newlocale): Use a bit mask instead of a second
loop to notice missing categories in a composite name.
* locale/locale.h (LC_CTYPE_MASK, LC_NUMERIC_MASK, LC_TIME_MASK,
LC_COLLATE_MASK, LC_MONETARY_MASK, LC_MESSAGES_MASK, LC_ALL_MASK,
LC_PAPER_MASK, LC_NAME_MASK, LC_ADDRESS_MASK, LC_TELEPHONE_MASK,
LC_MEASUREMENT_MASK, LC_IDENTIFICATION_MASK, LC_ALL_MASK): New macros.
* malloc/tst-calloc.c: Add tests for one or both parameters being zero.
Diffstat (limited to 'locale/locale.h')
-rw-r--r-- | locale/locale.h | 36 |
1 files changed, 32 insertions, 4 deletions
diff --git a/locale/locale.h b/locale/locale.h index 34463fd..c84eb01 100644 --- a/locale/locale.h +++ b/locale/locale.h @@ -144,15 +144,43 @@ typedef __locale_t locale_t; /* Return a reference to a data structure representing a set of locale datasets. Unlike for the CATEGORY parameter for `setlocale' the - CATEGORY_MASK parameter here uses a single bit for each category. - I.e., 1 << LC_CTYPE means to load data for this category. If - BASE is non-null the appropriate category information in the BASE - record is replaced. */ + CATEGORY_MASK parameter here uses a single bit for each category, + made by OR'ing together LC_*_MASK bits above. */ extern __locale_t __newlocale (int __category_mask, __const char *__locale, __locale_t __base) __THROW; extern __locale_t newlocale (int __category_mask, __const char *__locale, __locale_t __base) __THROW; +/* These are the bits that can be set in the CATEGORY_MASK argument to + `newlocale'. In the GNU implementation, LC_FOO_MASK has the value + of (1 << LC_FOO), but this is not a part of the interface that + callers can assume will be true. */ +# define LC_CTYPE_MASK (1 << __LC_CTYPE) +# define LC_NUMERIC_MASK (1 << __LC_NUMERIC) +# define LC_TIME_MASK (1 << __LC_TIME) +# define LC_COLLATE_MASK (1 << __LC_COLLATE) +# define LC_MONETARY_MASK (1 << __LC_MONETARY) +# define LC_MESSAGES_MASK (1 << __LC_MESSAGES) +# define LC_PAPER_MASK (1 << __LC_PAPER) +# define LC_NAME_MASK (1 << __LC_NAME) +# define LC_ADDRESS_MASK (1 << __LC_ADDRESS) +# define LC_TELEPHONE_MASK (1 << __LC_TELEPHONE) +# define LC_MEASUREMENT_MASK (1 << __LC_MEASUREMENT) +# define LC_IDENTIFICATION_MASK (1 << __LC_IDENTIFICATION) +# define LC_ALL_MASK (LC_CTYPE_MASK \ + | LC_NUMERIC_MASK \ + | LC_TIME_MASK \ + | LC_COLLATE_MASK \ + | LC_MONETARY_MASK \ + | LC_MESSAGES_MASK \ + | LC_PAPER_MASK \ + | LC_NAME_MASK \ + | LC_ADDRESS_MASK \ + | LC_TELEPHONE_MASK \ + | LC_MEASUREMENT_MASK \ + | LC_IDENTIFICATION_MASK \ + ) + /* Return a duplicate of the set of locale in DATASET. All usage counters are increased if necessary. */ extern __locale_t __duplocale (__locale_t __dataset) __THROW; |