Back to index

glibc  2.9
xlocale.c
Go to the documentation of this file.
00001 /* C locale object.
00002    Copyright (C) 2001, 2002, 2005 Free Software Foundation, Inc.
00003    This file is part of the GNU C Library.
00004    Contributed by Ulrich Drepper <drepper@cygnus.com>, 2001.
00005 
00006    The GNU C Library is free software; you can redistribute it and/or
00007    modify it under the terms of the GNU Lesser General Public
00008    License as published by the Free Software Foundation; either
00009    version 2.1 of the License, or (at your option) any later version.
00010 
00011    The GNU C Library is distributed in the hope that it will be useful,
00012    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014    Lesser General Public License for more details.
00015 
00016    You should have received a copy of the GNU Lesser General Public
00017    License along with the GNU C Library; if not, write to the Free
00018    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00019    02111-1307 USA.  */
00020 
00021 #include <locale.h>
00022 #include "localeinfo.h"
00023 
00024 #define DEFINE_CATEGORY(category, category_name, items, a) \
00025 extern struct locale_data _nl_C_##category;
00026 #include "categories.def"
00027 #undef DEFINE_CATEGORY
00028 
00029 /* Defined in locale/C-ctype.c.  */
00030 extern const char _nl_C_LC_CTYPE_class[] attribute_hidden;
00031 extern const char _nl_C_LC_CTYPE_toupper[] attribute_hidden;
00032 extern const char _nl_C_LC_CTYPE_tolower[] attribute_hidden;
00033 
00034 
00035 const struct __locale_struct _nl_C_locobj attribute_hidden =
00036   {
00037     .__locales =
00038     {
00039 #define DEFINE_CATEGORY(category, category_name, items, a) \
00040       [category] = &_nl_C_##category,
00041 #include "categories.def"
00042 #undef DEFINE_CATEGORY
00043     },
00044     .__names =
00045     {
00046       [LC_ALL] = _nl_C_name,
00047 #define DEFINE_CATEGORY(category, category_name, items, a) \
00048       [category] = _nl_C_name,
00049 #include "categories.def"
00050 #undef DEFINE_CATEGORY
00051     },
00052     .__ctype_b = (const unsigned short int *) _nl_C_LC_CTYPE_class + 128,
00053     .__ctype_tolower = (const int *) _nl_C_LC_CTYPE_tolower + 128,
00054     .__ctype_toupper = (const int *) _nl_C_LC_CTYPE_toupper + 128
00055   };