/* Access to locale-dependent parameters.
- Copyright (C) 1995-1999, 2000, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1995-2002,2003,2004,2005,2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
#ifndef _LANGINFO_H
#define _LANGINFO_H 1
/* Get the type definition. */
#include <nl_types.h>
-#include <bits/locale.h> /* Define the __LC_* category names. */
+#include <bits/uClibc_locale.h> /* Define the __LC_* category names. */
__BEGIN_DECLS
(LC_*) and an item index within the category. Some code may depend on
the item values within a category increasing monotonically with the
indices. */
+#if 0
#define _NL_ITEM(category, index) (((category) << 16) | (index))
/* Extract the category and item index from a constructed `nl_item' value. */
#define _NL_ITEM_CATEGORY(item) ((int) (item) >> 16)
#define _NL_ITEM_INDEX(item) ((int) (item) & 0xffff)
+#else
+#define _NL_ITEM(category, index) \
+ (((category) << __NL_ITEM_CATEGORY_SHIFT) | (index))
+/* Extract the category and item index from a constructed `nl_item' value. */
+#define _NL_ITEM_CATEGORY(item) ((int) (item) >> __NL_ITEM_CATEGORY_SHIFT)
+#define _NL_ITEM_INDEX(item) ((int) (item) & __NL_ITEM_INDEX_MASK)
+#endif
/* Enumeration of locale items that can be queried with `nl_langinfo'. */
enum
ERA_T_FMT, /* Time in alternate era format. */
#define ERA_T_FMT ERA_T_FMT
+#if 0
_NL_TIME_ERA_NUM_ENTRIES, /* Number entries in the era arrays. */
_NL_TIME_ERA_ENTRIES, /* Structure with era entries in usable form.*/
_NL_W_DATE_FMT,
_NL_TIME_CODESET,
+#endif /* 0 */
_NL_NUM_LC_TIME, /* Number of indices in LC_TIME category. */
/* LC_COLLATE category: text sorting.
This information is accessed by the strcoll and strxfrm functions.
These `nl_langinfo' names are used only internally. */
+#if 0
_NL_COLLATE_NRULES = _NL_ITEM (__LC_COLLATE, 0),
_NL_COLLATE_RULESETS,
_NL_COLLATE_TABLEMB,
_NL_COLLATE_COLLSEQWC,
_NL_COLLATE_CODESET,
_NL_NUM_LC_COLLATE,
+#endif
/* LC_CTYPE category: character classification.
This information is accessed by the functions in <ctype.h>.
These `nl_langinfo' names are used only internally. */
+#if 0
_NL_CTYPE_CLASS = _NL_ITEM (__LC_CTYPE, 0),
_NL_CTYPE_TOUPPER,
_NL_CTYPE_GAP1,
_NL_CTYPE_INDIGITS8_WC,
_NL_CTYPE_INDIGITS9_WC,
_NL_CTYPE_OUTDIGIT0_MB,
+#else
+ _NL_CTYPE_OUTDIGIT0_MB = _NL_ITEM (__LC_CTYPE, 0),
+#endif
_NL_CTYPE_OUTDIGIT1_MB,
_NL_CTYPE_OUTDIGIT2_MB,
_NL_CTYPE_OUTDIGIT3_MB,
_NL_CTYPE_OUTDIGIT7_MB,
_NL_CTYPE_OUTDIGIT8_MB,
_NL_CTYPE_OUTDIGIT9_MB,
+#if 0
_NL_CTYPE_OUTDIGIT0_WC,
_NL_CTYPE_OUTDIGIT1_WC,
_NL_CTYPE_OUTDIGIT2_WC,
_NL_CTYPE_TRANSLIT_DEFAULT_MISSING,
_NL_CTYPE_TRANSLIT_IGNORE_LEN,
_NL_CTYPE_TRANSLIT_IGNORE,
+ _NL_CTYPE_MAP_TO_NONASCII,
+ _NL_CTYPE_NONASCII_CASE,
_NL_CTYPE_EXTRA_MAP_1,
_NL_CTYPE_EXTRA_MAP_2,
_NL_CTYPE_EXTRA_MAP_3,
_NL_CTYPE_EXTRA_MAP_12,
_NL_CTYPE_EXTRA_MAP_13,
_NL_CTYPE_EXTRA_MAP_14,
+#else /* 0 */
+ _NL_CTYPE_CODESET_NAME, /* uClibc note: MUST BE LAST ENTRY!!! */
+ CODESET = _NL_CTYPE_CODESET_NAME,
+#define CODESET CODESET
+#endif /* 0 */
_NL_NUM_LC_CTYPE,
/* LC_MONETARY category: formatting of monetary quantities.
#ifdef __USE_GNU
# define N_SIGN_POSN __N_SIGN_POSN
#endif
+#if 0 /* moved below for some reason on uClibc */
_NL_MONETARY_CRNCYSTR,
#define CRNCYSTR _NL_MONETARY_CRNCYSTR
+#endif
__INT_P_CS_PRECEDES,
#ifdef __USE_GNU
# define INT_P_CS_PRECEDES __INT_P_CS_PRECEDES
#ifdef __USE_GNU
# define INT_N_SIGN_POSN __INT_N_SIGN_POSN
#endif
+#if 1 /* moved here from above */
+ _NL_MONETARY_CRNCYSTR,
+#define CRNCYSTR _NL_MONETARY_CRNCYSTR
+#endif
+#if 0
_NL_MONETARY_DUO_INT_CURR_SYMBOL,
_NL_MONETARY_DUO_CURRENCY_SYMBOL,
_NL_MONETARY_DUO_INT_FRAC_DIGITS,
_NL_MONETARY_DECIMAL_POINT_WC,
_NL_MONETARY_THOUSANDS_SEP_WC,
_NL_MONETARY_CODESET,
+#endif /* 0 */
_NL_NUM_LC_MONETARY,
/* LC_NUMERIC category: formatting of numbers.
#ifdef __USE_GNU
# define GROUPING __GROUPING
#endif
+#if 0
_NL_NUMERIC_DECIMAL_POINT_WC,
_NL_NUMERIC_THOUSANDS_SEP_WC,
_NL_NUMERIC_CODESET,
+#endif
_NL_NUM_LC_NUMERIC,
__YESEXPR = _NL_ITEM (__LC_MESSAGES, 0), /* Regex matching ``yes'' input. */
#if defined __USE_GNU || (defined __USE_XOPEN && !defined __USE_XOPEN2K)
# define NOSTR __NOSTR
#endif
+#if 0
_NL_MESSAGES_CODESET,
+#endif
_NL_NUM_LC_MESSAGES,
+#if 0
_NL_PAPER_HEIGHT = _NL_ITEM (__LC_PAPER, 0),
_NL_PAPER_WIDTH,
_NL_PAPER_CODESET,
_NL_IDENTIFICATION_CATEGORY,
_NL_IDENTIFICATION_CODESET,
_NL_NUM_LC_IDENTIFICATION,
+#endif
/* This marks the highest value used. */
_NL_NUM
};
+/* This macro produces an item you can pass to `nl_langinfo' or
+ `nl_langinfo_l' to get the name of the locale in use for CATEGORY. */
+#define _NL_LOCALE_NAME(category) _NL_ITEM ((category), -1)
+#ifdef __USE_GNU
+# define NL_LOCALE_NAME(category) _NL_LOCALE_NAME (category)
+#endif
+
/* Return the current locale's value for ITEM.
If ITEM is invalid, an empty string is returned.
it is usually in read-only memory and cannot be modified. */
extern char *nl_langinfo (nl_item __item) __THROW;
+libc_hidden_proto(nl_langinfo)
-#if 0
-//#ifdef __USE_GNU
+#if defined __USE_XOPEN2K && defined __UCLIBC_HAS_XLOCALE__
/* This interface is for the extended locale model. See <locale.h> for
more information. */
# include <xlocale.h>
/* Just like nl_langinfo but get the information from the locale object L. */
-extern char *__nl_langinfo_l (nl_item __item, __locale_t l);
+extern char *nl_langinfo_l (nl_item __item, __locale_t __l);
+libc_hidden_proto(nl_langinfo_l)
#endif
__END_DECLS