Use INTERNAL_SYSCALL.
[glibc.git] / wctype / wcfuncs_l.c
blob5556dc4adc91ae0201b593a39806733242307da0
1 /* Copyright (C) 1996, 1997, 2000, 2001, 2002 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
17 02111-1307 USA. */
19 #include <wctype.h>
20 #include <stdint.h>
21 #include <locale.h>
22 #include <locale/localeinfo.h>
24 #define USE_IN_EXTENDED_LOCALE_MODEL
25 #include "wchar-lookup.h"
27 /* Provide real-function versions of all the wctype macros. */
29 #define func(name, type) \
30 int __##name (wint_t wc, __locale_t locale) \
31 { \
32 size_t i = locale->__locales[LC_CTYPE]->values[_NL_ITEM_INDEX (_NL_CTYPE_CLASS_OFFSET)].word + type; \
33 const char *desc = locale->__locales[LC_CTYPE]->values[i].string; \
34 return wctype_table_lookup (desc, wc); \
35 } \
36 libc_hidden_def (__##name) \
37 weak_alias (__##name, name)
39 func (iswalnum_l, __ISwalnum)
40 func (iswalpha_l, __ISwalpha)
41 func (iswblank_l, __ISwblank)
42 func (iswcntrl_l, __ISwcntrl)
43 func (iswdigit_l, __ISwdigit)
44 func (iswlower_l, __ISwlower)
45 func (iswgraph_l, __ISwgraph)
46 func (iswprint_l, __ISwprint)
47 func (iswpunct_l, __ISwpunct)
48 func (iswspace_l, __ISwspace)
49 func (iswupper_l, __ISwupper)
50 func (iswxdigit_l, __ISwxdigit)
52 wint_t
53 (__towlower_l) (wint_t wc, __locale_t locale)
55 size_t i = locale->__locales[LC_CTYPE]->values[_NL_ITEM_INDEX (_NL_CTYPE_MAP_OFFSET)].word + __TOW_tolower;
56 const char *desc = locale->__locales[LC_CTYPE]->values[i].string;
57 return wctrans_table_lookup (desc, wc);
59 libc_hidden_def (__towlower_l)
60 weak_alias (__towlower_l, towlower_l)
62 wint_t
63 (__towupper_l) (wint_t wc, __locale_t locale)
65 size_t i = locale->__locales[LC_CTYPE]->values[_NL_ITEM_INDEX (_NL_CTYPE_MAP_OFFSET)].word + __TOW_toupper;
66 const char *desc = locale->__locales[LC_CTYPE]->values[i].string;
67 return wctrans_table_lookup (desc, wc);
69 libc_hidden_def (__towupper_l)
70 weak_alias (__towupper_l, towupper_l)