* sysdeps/m68k/bits/byteswap.h (__bswap_32): Add cast to avoid
[glibc/pb-stable.git] / wctype / wcfuncs_l.c
bloba5528953169ab88a88c60a23e50671ea6bc448b1
1 /* Copyright (C) 1996, 1997, 2000 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 Library General Public License as
6 published by the Free Software Foundation; either version 2 of the
7 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 Library General Public License for more details.
14 You should have received a copy of the GNU Library General Public
15 License along with the GNU C Library; see the file COPYING.LIB. If not,
16 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 Boston, MA 02111-1307, USA. */
19 #include <wctype.h>
20 #include <stdint.h>
21 #include <locale/localeinfo.h>
23 #define USE_IN_EXTENDED_LOCALE_MODEL
24 #include "wchar-lookup.h"
26 /* Provide real-function versions of all the wctype macros. */
28 #define func(name, type) \
29 int name (wint_t wc, __locale_t locale) \
30 { \
31 size_t i = locale->__locales[LC_CTYPE]->values[_NL_ITEM_INDEX (_NL_CTYPE_CLASS_OFFSET)].word + type; \
32 const char *desc = locale->__locales[LC_CTYPE]->values[i].string; \
33 return wctype_table_lookup (desc, wc); \
36 func (__iswalnum_l, __ISwalnum)
37 func (__iswalpha_l, __ISwalpha)
38 func (__iswblank_l, __ISwblank)
39 func (__iswcntrl_l, __ISwcntrl)
40 func (__iswdigit_l, __ISwdigit)
41 func (__iswlower_l, __ISwlower)
42 func (__iswgraph_l, __ISwgraph)
43 func (__iswprint_l, __ISwprint)
44 func (__iswpunct_l, __ISwpunct)
45 func (__iswspace_l, __ISwspace)
46 func (__iswupper_l, __ISwupper)
47 func (__iswxdigit_l, __ISwxdigit)
49 wint_t
50 (__towlower_l) (wint_t wc, __locale_t locale)
52 size_t i = locale->__locales[LC_CTYPE]->values[_NL_ITEM_INDEX (_NL_CTYPE_MAP_OFFSET)].word + __TOW_tolower;
53 const char *desc = locale->__locales[LC_CTYPE]->values[i].string;
54 return wctrans_table_lookup (desc, wc);
57 wint_t
58 (__towupper_l) (wint_t wc, __locale_t locale)
60 size_t i = locale->__locales[LC_CTYPE]->values[_NL_ITEM_INDEX (_NL_CTYPE_MAP_OFFSET)].word + __TOW_toupper;
61 const char *desc = locale->__locales[LC_CTYPE]->values[i].string;
62 return wctrans_table_lookup (desc, wc);