OSDN Git Service

ldso: ARC: tweak whitespace some more
[uclinux-h8/uClibc.git] / include / langinfo.h
index 21d16cd..94a4d7e 100644 (file)
@@ -1,5 +1,5 @@
 /* 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
@@ -13,9 +13,8 @@
    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
@@ -23,7 +22,7 @@
 /* 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
@@ -32,12 +31,20 @@ __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
@@ -157,6 +164,7 @@ 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.*/
 
@@ -232,12 +240,14 @@ enum
   _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,
@@ -258,10 +268,12 @@ enum
   _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,
@@ -306,6 +318,9 @@ enum
   _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,
@@ -315,6 +330,7 @@ enum
   _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,
@@ -334,6 +350,8 @@ enum
   _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,
@@ -348,6 +366,11 @@ enum
   _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.
@@ -413,8 +436,10 @@ enum
 #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
@@ -439,6 +464,11 @@ enum
 #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,
@@ -463,6 +493,7 @@ enum
   _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.
@@ -483,9 +514,11 @@ enum
 #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.  */
@@ -500,9 +533,12 @@ enum
 #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,
@@ -560,11 +596,19 @@ enum
   _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.
@@ -573,10 +617,10 @@ enum
    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.  */
 
@@ -584,7 +628,8 @@ extern char *nl_langinfo (nl_item __item) __THROW;
 # 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