]> git.ipfire.org Git - thirdparty/glibc.git/blame - include/wctype.h
Fix regex wctype namespace (bug 18495).
[thirdparty/glibc.git] / include / wctype.h
CommitLineData
390955cb
UD
1#ifndef _WCTYPE_H
2
31341567 3#ifndef _ISOMAC
5656e294
RM
4/* We try to get wint_t from <stddef.h>, but not all GCC versions define it
5 there. So define it ourselves if it remains undefined. */
6# define __need_wint_t
7# include <stddef.h>
8# ifndef _WINT_T
9/* Integral type unchanged by default argument promotions that can
10 hold any value corresponding to members of the extended character
11 set, as well as at least one value that does not correspond to any
12 member of the extended character set. */
13# define _WINT_T
14typedef unsigned int wint_t;
15# endif
16
17/* Need to repeat these prototypes here, as wctype/wctype.h defines all
18 these as macros and thus we couldn't add libc_hidden_proto. */
19
20extern int iswalpha (wint_t __wc);
13ece897 21extern int iswalnum (wint_t __wc);
5656e294
RM
22extern int iswdigit (wint_t __wc);
23extern int iswlower (wint_t __wc);
24extern int iswspace (wint_t __wc);
25extern int iswxdigit (wint_t __wc);
26extern wint_t towlower (wint_t __wc);
27extern wint_t towupper (wint_t __wc);
28
29libc_hidden_proto (iswalpha)
13ece897 30libc_hidden_proto (iswalnum)
5656e294
RM
31libc_hidden_proto (iswdigit)
32libc_hidden_proto (iswlower)
33libc_hidden_proto (iswspace)
34libc_hidden_proto (iswxdigit)
35libc_hidden_proto (towlower)
36libc_hidden_proto (towupper)
31341567 37#endif
5656e294 38
75cd5204 39#include <wctype/wctype.h>
390955cb 40
31341567 41#ifndef _ISOMAC
bd7f30a9 42/* Internal interfaces. */
fe559c5e 43extern int __iswspace (wint_t __wc);
bd7f30a9 44extern int __iswctype (wint_t __wc, wctype_t __desc);
a784e502 45extern wctype_t __wctype (const char *__property);
7be688b5 46extern wctrans_t __wctrans (const char *__property);
bd7f30a9
AJ
47extern wint_t __towctrans (wint_t __wc, wctrans_t __desc);
48
9dd6b779 49extern __typeof (iswalnum) __iswalnum __THROW __attribute_pure__;
da4cfe38
RM
50extern __typeof (iswalnum_l) __iswalnum_l;
51extern __typeof (iswalpha_l) __iswalpha_l;
52extern __typeof (iswblank_l) __iswblank_l;
53extern __typeof (iswcntrl_l) __iswcntrl_l;
54extern __typeof (iswdigit_l) __iswdigit_l;
9dd6b779 55extern __typeof (iswlower) __iswlower __THROW __attribute_pure__;
da4cfe38
RM
56extern __typeof (iswlower_l) __iswlower_l;
57extern __typeof (iswgraph_l) __iswgraph_l;
58extern __typeof (iswprint_l) __iswprint_l;
59extern __typeof (iswpunct_l) __iswpunct_l;
60extern __typeof (iswspace_l) __iswspace_l;
61extern __typeof (iswupper_l) __iswupper_l;
62extern __typeof (iswxdigit_l) __iswxdigit_l;
63extern __typeof (towlower_l) __towlower_l;
64extern __typeof (towupper_l) __towupper_l;
bb4acb52
JM
65extern __typeof (towlower) __towlower __THROW __attribute_pure__;
66extern __typeof (towupper) __towupper __THROW __attribute_pure__;
da4cfe38 67
58845a70 68libc_hidden_proto (__towctrans)
a20d8dbe 69libc_hidden_proto (__iswctype)
9dd6b779 70libc_hidden_proto (__iswalnum)
a20d8dbe
UD
71libc_hidden_proto (__iswalnum_l)
72libc_hidden_proto (__iswalpha_l)
73libc_hidden_proto (__iswblank_l)
74libc_hidden_proto (__iswcntrl_l)
75libc_hidden_proto (__iswdigit_l)
9dd6b779 76libc_hidden_proto (__iswlower)
a20d8dbe
UD
77libc_hidden_proto (__iswlower_l)
78libc_hidden_proto (__iswgraph_l)
79libc_hidden_proto (__iswprint_l)
80libc_hidden_proto (__iswpunct_l)
81libc_hidden_proto (__iswspace_l)
82libc_hidden_proto (__iswupper_l)
83libc_hidden_proto (__iswxdigit_l)
84libc_hidden_proto (__towlower_l)
85libc_hidden_proto (__towupper_l)
bb4acb52
JM
86libc_hidden_proto (__towlower)
87libc_hidden_proto (__towupper)
390955cb 88
f83aa16c
UD
89/* The spec says that isdigit must only match the decimal digits. We
90 can check this without a memory access. */
4f41c682 91# if IS_IN (libc)
f83aa16c
UD
92# undef iswdigit
93# define iswdigit(c) ({ wint_t __c = (c); __c >= L'0' && __c <= L'9'; })
94# undef iswdigit_l
95# define iswdigit_l(c, l) ({ wint_t __c = (c); __c >= L'0' && __c <= L'9'; })
96# undef __iswdigit_l
97# define __iswdigit_l(c, l) ({ wint_t __c = (c); __c >= L'0' && __c <= L'9'; })
98# endif
99
390955cb 100#endif
31341567 101#endif