1 /* Copyright (C) 1992, 1993, 1994, 1997 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
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.
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.
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
19 /* Different systems have different names for the array.
20 This order is important for some systems. */
22 #if !defined(TABLE) && defined(HAVE__LOCP)
23 /* OSF/1 has the name _ctype defined as a macro, which points down into
24 the _locp structure. Jesus. We'll hope this works. We need to
25 check for LOCP first, since there is no symbol actually named _ctype
27 #include <sys/types.h> /* for wchar_t used by localdef.h */
28 #include <sys/localedef.h>
30 #define TABLE (_locp->lc_chrtbl)->lc_ctype
32 #define TABLE_NAME _ctype
35 #define TABLE _ctype__
37 #if !defined(TABLE) && defined(HAVE__CTYPE)
40 #if !defined(TABLE) && defined(HAVE__CTYPE_)
43 #if !defined(TABLE) && defined(HAVE___CTYPE_)
44 #define TABLE __ctype_
46 #if !defined(TABLE) && defined(HAVE___CTYPE)
50 #if defined (__STDC__) && __STDC__
51 #define STRINGIFY(arg) #arg
53 #define STRINGIFY(arg) "arg"
56 #define EVALLED_STRINGIFY(x) STRINGIFY (x)
66 /* This won't work for the define to look into _locp. */
67 extern unsigned char TABLE
[];
71 printf ("const unsigned char %s[] =\n {\n", EVALLED_STRINGIFY (TABLE_NAME
));
73 printf ("const unsigned char %s[] =\n {\n", EVALLED_STRINGIFY (TABLE
));
76 for (i
= -1; i
< 256; ++i
)
77 printf (" %d,\n", (int) ((TABLE
+1)[i
]));
83 puts ("/* I don't know what the ctype table is called on this system.");
84 puts (" If there is a table, and you want the ctype glue to work,");
85 puts (" edit configure.in and glue-ctype.c in sysdeps/unix/common/");
86 puts (" to check for the right name. */");