Update to LGPL v2.1.
[platform/upstream/glibc.git] / ctype / ctype-info.c
1 /* Copyright (C) 1991, 92, 95, 96, 97, 99, 2000 Free Software Foundation, Inc.
2    This file is part of the GNU C Library.
3
4    The GNU C Library is free software; you can redistribute it and/or
5    modify it under the terms of the GNU Lesser General Public
6    License as published by the Free Software Foundation; either
7    version 2.1 of the License, or (at your option) any later version.
8
9    The GNU C Library is distributed in the hope that it will be useful,
10    but WITHOUT ANY WARRANTY; without even the implied warranty of
11    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12    Lesser General Public License for more details.
13
14    You should have received a copy of the GNU Lesser General Public
15    License along with the GNU C Library; if not, write to the Free
16    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
17    02111-1307 USA.  */
18
19 #include <ctype.h>
20 #include <locale/localeinfo.h>
21
22 /* Defined in locale/C-ctype.c.  */
23 extern const char _nl_C_LC_CTYPE_class[];
24 extern const char _nl_C_LC_CTYPE_class32[];
25 extern const char _nl_C_LC_CTYPE_toupper[];
26 extern const char _nl_C_LC_CTYPE_tolower[];
27 extern const char _nl_C_LC_CTYPE_class_upper[];
28 extern const char _nl_C_LC_CTYPE_class_lower[];
29 extern const char _nl_C_LC_CTYPE_class_alpha[];
30 extern const char _nl_C_LC_CTYPE_class_digit[];
31 extern const char _nl_C_LC_CTYPE_class_xdigit[];
32 extern const char _nl_C_LC_CTYPE_class_space[];
33 extern const char _nl_C_LC_CTYPE_class_print[];
34 extern const char _nl_C_LC_CTYPE_class_graph[];
35 extern const char _nl_C_LC_CTYPE_class_blank[];
36 extern const char _nl_C_LC_CTYPE_class_cntrl[];
37 extern const char _nl_C_LC_CTYPE_class_punct[];
38 extern const char _nl_C_LC_CTYPE_class_alnum[];
39 extern const char _nl_C_LC_CTYPE_map_toupper[];
40 extern const char _nl_C_LC_CTYPE_map_tolower[];
41 extern const char _nl_C_LC_CTYPE_width[];
42
43 #define b(t,x,o) (((const t *) _nl_C_LC_CTYPE_##x) + o)
44
45 const unsigned short int *__ctype_b = b (unsigned short int, class, 128);
46 const __uint32_t *__ctype32_b = b (__uint32_t, class32, 0);
47 const __int32_t *__ctype_tolower = b (__int32_t, tolower, 128);
48 const __int32_t *__ctype_toupper = b (__int32_t, toupper, 128);
49 const __uint32_t *__ctype32_tolower = b (__uint32_t, tolower, 128);
50 const __uint32_t *__ctype32_toupper = b (__uint32_t, toupper, 128);
51 const char *__ctype32_wctype[12] =
52 {
53   b(char, class_upper, 32),
54   b(char, class_lower, 32),
55   b(char, class_alpha, 32),
56   b(char, class_digit, 32),
57   b(char, class_xdigit, 32),
58   b(char, class_space, 32),
59   b(char, class_print, 32),
60   b(char, class_graph, 32),
61   b(char, class_blank, 32),
62   b(char, class_cntrl, 32),
63   b(char, class_punct, 32),
64   b(char, class_alnum, 32)
65 };
66 const char *__ctype32_wctrans[2] =
67 {
68   b(char, map_toupper, 0),
69   b(char, map_tolower, 0)
70 };
71 const char *__ctype32_width = b (char, width, 0);