1 /* Copyright (C) 1996-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
20 #include <locale/localeinfo.h>
22 #include "wchar-lookup.h"
24 /* Provide real-function versions of all the wctype macros. */
26 #define func(name, type) \
27 extern int __##name (wint_t __wc); \
29 __##name (wint_t wc) \
31 size_t i = _NL_CURRENT_WORD (LC_CTYPE, _NL_CTYPE_CLASS_OFFSET) + type; \
32 const char *desc = _NL_CURRENT (LC_CTYPE, i); \
33 return wctype_table_lookup (desc, wc); \
35 weak_alias (__##name, name)
38 func (iswalnum
, __ISwalnum
)
39 libc_hidden_weak (iswalnum
)
41 func (iswalpha
, __ISwalpha
)
42 libc_hidden_weak (iswalpha
)
44 func (iswblank
, __ISwblank
)
46 func (iswcntrl
, __ISwcntrl
)
48 func (iswdigit
, __ISwdigit
)
49 libc_hidden_weak (iswdigit
)
51 func (iswlower
, __ISwlower
)
52 libc_hidden_weak (iswlower
)
54 func (iswgraph
, __ISwgraph
)
56 func (iswprint
, __ISwprint
)
58 func (iswpunct
, __ISwpunct
)
60 func (iswspace
, __ISwspace
)
61 libc_hidden_weak (iswspace
)
63 func (iswupper
, __ISwupper
)
65 func (iswxdigit
, __ISwxdigit
)
66 libc_hidden_weak (iswxdigit
)
73 size_t i
= _NL_CURRENT_WORD (LC_CTYPE
, _NL_CTYPE_MAP_OFFSET
) + __TOW_tolower
;
74 const char *desc
= _NL_CURRENT (LC_CTYPE
, i
);
75 return wctrans_table_lookup (desc
, wc
);
77 libc_hidden_def (towlower
)
84 size_t i
= _NL_CURRENT_WORD (LC_CTYPE
, _NL_CTYPE_MAP_OFFSET
) + __TOW_toupper
;
85 const char *desc
= _NL_CURRENT (LC_CTYPE
, i
);
86 return wctrans_table_lookup (desc
, wc
);
88 libc_hidden_def (towupper
)