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
)
40 func (iswalpha
, __ISwalpha
)
41 libc_hidden_weak (iswalpha
)
43 func (iswblank
, __ISwblank
)
45 func (iswcntrl
, __ISwcntrl
)
47 func (iswdigit
, __ISwdigit
)
48 libc_hidden_weak (iswdigit
)
50 func (iswlower
, __ISwlower
)
51 libc_hidden_weak (iswlower
)
53 func (iswgraph
, __ISwgraph
)
55 func (iswprint
, __ISwprint
)
57 func (iswpunct
, __ISwpunct
)
59 func (iswspace
, __ISwspace
)
60 libc_hidden_weak (iswspace
)
62 func (iswupper
, __ISwupper
)
64 func (iswxdigit
, __ISwxdigit
)
65 libc_hidden_weak (iswxdigit
)
72 size_t i
= _NL_CURRENT_WORD (LC_CTYPE
, _NL_CTYPE_MAP_OFFSET
) + __TOW_tolower
;
73 const char *desc
= _NL_CURRENT (LC_CTYPE
, i
);
74 return wctrans_table_lookup (desc
, wc
);
76 libc_hidden_def (towlower
)
83 size_t i
= _NL_CURRENT_WORD (LC_CTYPE
, _NL_CTYPE_MAP_OFFSET
) + __TOW_toupper
;
84 const char *desc
= _NL_CURRENT (LC_CTYPE
, i
);
85 return wctrans_table_lookup (desc
, wc
);
87 libc_hidden_def (towupper
)