]> git.ipfire.org Git - thirdparty/glibc.git/blame - wctype/wcfuncs_l.c
* include/rpc/auth.h: Use libc_hidden_proto for getnetname,
[thirdparty/glibc.git] / wctype / wcfuncs_l.c
CommitLineData
08f60074 1/* Copyright (C) 1996, 1997, 2000, 2001, 2002 Free Software Foundation, Inc.
c84142e8
UD
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
41bdb6e2
AJ
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.
c84142e8
UD
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
41bdb6e2 12 Lesser General Public License for more details.
c84142e8 13
41bdb6e2
AJ
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. */
c84142e8 18
c84142e8 19#include <wctype.h>
b02b9253 20#include <stdint.h>
6d6e4021 21#include <locale.h>
4c7d276e 22#include <locale/localeinfo.h>
b02b9253
UD
23
24#define USE_IN_EXTENDED_LOCALE_MODEL
ef446144 25#include "wchar-lookup.h"
c84142e8
UD
26
27/* Provide real-function versions of all the wctype macros. */
28
29#define func(name, type) \
30 int name (wint_t wc, __locale_t locale) \
ef446144 31 { \
4c7d276e
UD
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); \
08f60074 35 } \
a20d8dbe 36 libc_hidden_def (name)
ef446144
UD
37
38func (__iswalnum_l, __ISwalnum)
39func (__iswalpha_l, __ISwalpha)
4c7d276e 40func (__iswblank_l, __ISwblank)
ef446144
UD
41func (__iswcntrl_l, __ISwcntrl)
42func (__iswdigit_l, __ISwdigit)
43func (__iswlower_l, __ISwlower)
44func (__iswgraph_l, __ISwgraph)
45func (__iswprint_l, __ISwprint)
46func (__iswpunct_l, __ISwpunct)
47func (__iswspace_l, __ISwspace)
48func (__iswupper_l, __ISwupper)
49func (__iswxdigit_l, __ISwxdigit)
c84142e8
UD
50
51wint_t
52(__towlower_l) (wint_t wc, __locale_t locale)
53{
4c7d276e
UD
54 size_t i = locale->__locales[LC_CTYPE]->values[_NL_ITEM_INDEX (_NL_CTYPE_MAP_OFFSET)].word + __TOW_tolower;
55 const char *desc = locale->__locales[LC_CTYPE]->values[i].string;
56 return wctrans_table_lookup (desc, wc);
c84142e8 57}
a20d8dbe 58libc_hidden_def (__towlower_l)
c84142e8
UD
59
60wint_t
61(__towupper_l) (wint_t wc, __locale_t locale)
62{
4c7d276e
UD
63 size_t i = locale->__locales[LC_CTYPE]->values[_NL_ITEM_INDEX (_NL_CTYPE_MAP_OFFSET)].word + __TOW_toupper;
64 const char *desc = locale->__locales[LC_CTYPE]->values[i].string;
65 return wctrans_table_lookup (desc, wc);
c84142e8 66}
a20d8dbe 67libc_hidden_def (__towupper_l)