blob: f2f4470a95fa7c627a32e1dbaf9dc02abfc01da3 [file] [log] [blame]
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001// -*- C++ -*-
2//===--------------------------- cwctype ----------------------------------===//
3//
Howard Hinnantf5256e12010-05-11 21:36:01 +00004// The LLVM Compiler Infrastructure
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00005//
Howard Hinnantb64f8b02010-11-16 22:09:02 +00006// This file is dual licensed under the MIT and the University of Illinois Open
7// Source Licenses. See LICENSE.TXT for details.
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00008//
9//===----------------------------------------------------------------------===//
10
11#ifndef _LIBCPP_CWCTYPE
12#define _LIBCPP_CWCTYPE
13
14/*
15 cwctype synopsis
16
17Macros:
18
19 WEOF
Howard Hinnant324bb032010-08-22 00:02:43 +000020
Howard Hinnantbc8d3f92010-05-11 19:42:16 +000021namespace std
22{
23
24Types:
25
26 wint_t
27 wctrans_t
28 wctype_t
29
30int iswalnum(wint_t wc);
31int iswalpha(wint_t wc);
32int iswblank(wint_t wc); // C99
33int iswcntrl(wint_t wc);
34int iswdigit(wint_t wc);
35int iswgraph(wint_t wc);
36int iswlower(wint_t wc);
37int iswprint(wint_t wc);
38int iswpunct(wint_t wc);
39int iswspace(wint_t wc);
40int iswupper(wint_t wc);
41int iswxdigit(wint_t wc);
42int iswctype(wint_t wc, wctype_t desc);
43wctype_t wctype(const char* property);
44wint_t towlower(wint_t wc);
45wint_t towupper(wint_t wc);
46wint_t towctrans(wint_t wc, wctrans_t desc);
47wctrans_t wctrans(const char* property);
48
49} // std
50
51*/
52
53#include <__config>
54#include <cctype>
55#include <wctype.h>
56
57#pragma GCC system_header
58
59_LIBCPP_BEGIN_NAMESPACE_STD
60
61using ::wint_t;
62using ::wctrans_t;
63using ::wctype_t;
64
65#ifdef iswalnum
66inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswalnum(wint_t __wc) {return iswalnum(__wc);}
67#undef iswalnum
68inline _LIBCPP_INLINE_VISIBILITY int iswalnum(wint_t __wc) {return __libcpp_iswalnum(__wc);}
Howard Hinnant324bb032010-08-22 00:02:43 +000069#else // iswalnum
Howard Hinnantbc8d3f92010-05-11 19:42:16 +000070using ::iswalnum;
71#endif
72
73#ifdef iswalpha
74inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswalpha(wint_t __wc) {return iswalpha(__wc);}
75#undef iswalpha
76inline _LIBCPP_INLINE_VISIBILITY int iswalpha(wint_t __wc) {return __libcpp_iswalpha(__wc);}
Howard Hinnant324bb032010-08-22 00:02:43 +000077#else // iswalpha
Howard Hinnantbc8d3f92010-05-11 19:42:16 +000078using ::iswalpha;
79#endif
80
81#ifdef iswblank
82inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswblank(wint_t __wc) {return iswblank(__wc);}
83#undef iswblank
84inline _LIBCPP_INLINE_VISIBILITY int iswblank(wint_t __wc) {return __libcpp_iswblank(__wc);}
Howard Hinnant324bb032010-08-22 00:02:43 +000085#else // iswblank
Howard Hinnantbc8d3f92010-05-11 19:42:16 +000086using ::iswblank;
87#endif
88
89#ifdef iswcntrl
90inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswcntrl(wint_t __wc) {return iswcntrl(__wc);}
91#undef iswcntrl
92inline _LIBCPP_INLINE_VISIBILITY int iswcntrl(wint_t __wc) {return __libcpp_iswcntrl(__wc);}
Howard Hinnant324bb032010-08-22 00:02:43 +000093#else // iswcntrl
Howard Hinnantbc8d3f92010-05-11 19:42:16 +000094using ::iswcntrl;
95#endif
96
97#ifdef iswdigit
98inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswdigit(wint_t __wc) {return iswdigit(__wc);}
99#undef iswdigit
100inline _LIBCPP_INLINE_VISIBILITY int iswdigit(wint_t __wc) {return __libcpp_iswdigit(__wc);}
Howard Hinnant324bb032010-08-22 00:02:43 +0000101#else // iswdigit
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000102using ::iswdigit;
103#endif
104
105#ifdef iswgraph
106inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswgraph(wint_t __wc) {return iswgraph(__wc);}
107#undef iswgraph
108inline _LIBCPP_INLINE_VISIBILITY int iswgraph(wint_t __wc) {return __libcpp_iswgraph(__wc);}
Howard Hinnant324bb032010-08-22 00:02:43 +0000109#else // iswgraph
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000110using ::iswgraph;
111#endif
112
113#ifdef iswlower
114inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswlower(wint_t __wc) {return iswlower(__wc);}
115#undef iswlower
116inline _LIBCPP_INLINE_VISIBILITY int iswlower(wint_t __wc) {return __libcpp_iswlower(__wc);}
Howard Hinnant324bb032010-08-22 00:02:43 +0000117#else // iswlower
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000118using ::iswlower;
119#endif
120
121#ifdef iswprint
122inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswprint(wint_t __wc) {return iswprint(__wc);}
123#undef iswprint
124inline _LIBCPP_INLINE_VISIBILITY int iswprint(wint_t __wc) {return __libcpp_iswprint(__wc);}
Howard Hinnant324bb032010-08-22 00:02:43 +0000125#else // iswprint
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000126using ::iswprint;
127#endif
128
129#ifdef iswpunct
130inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswpunct(wint_t __wc) {return iswpunct(__wc);}
131#undef iswpunct
132inline _LIBCPP_INLINE_VISIBILITY int iswpunct(wint_t __wc) {return __libcpp_iswpunct(__wc);}
Howard Hinnant324bb032010-08-22 00:02:43 +0000133#else // iswpunct
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000134using ::iswpunct;
135#endif
136
137#ifdef iswspace
138inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswspace(wint_t __wc) {return iswspace(__wc);}
139#undef iswspace
140inline _LIBCPP_INLINE_VISIBILITY int iswspace(wint_t __wc) {return __libcpp_iswspace(__wc);}
Howard Hinnant324bb032010-08-22 00:02:43 +0000141#else // iswspace
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000142using ::iswspace;
143#endif
144
145#ifdef iswupper
146inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswupper(wint_t __wc) {return iswupper(__wc);}
147#undef iswupper
148inline _LIBCPP_INLINE_VISIBILITY int iswupper(wint_t __wc) {return __libcpp_iswupper(__wc);}
Howard Hinnant324bb032010-08-22 00:02:43 +0000149#else // iswupper
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000150using ::iswupper;
151#endif
152
153#ifdef iswxdigit
154inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswxdigit(wint_t __wc) {return iswxdigit(__wc);}
155#undef iswxdigit
156inline _LIBCPP_INLINE_VISIBILITY int iswxdigit(wint_t __wc) {return __libcpp_iswxdigit(__wc);}
Howard Hinnant324bb032010-08-22 00:02:43 +0000157#else // iswxdigit
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000158using ::iswxdigit;
159#endif
160
161#ifdef iswctype
162inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswctype(wint_t __w, wctype_t __d) {return iswctype(__w, __d);}
163#undef iswctype
164inline _LIBCPP_INLINE_VISIBILITY int iswctype(wint_t __w, wctype_t __d) {return __libcpp_iswctype(__w, __d);}
Howard Hinnant324bb032010-08-22 00:02:43 +0000165#else // iswctype
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000166using ::iswctype;
167#endif
168
169#ifdef wctype
170inline _LIBCPP_INLINE_VISIBILITY wctype_t __libcpp_wctype(const char* __p) {return wctype(__p);}
171#undef wctype
172inline _LIBCPP_INLINE_VISIBILITY wctype_t wctype(const char* __p) {return __libcpp_wctype(__p);}
Howard Hinnant324bb032010-08-22 00:02:43 +0000173#else // wctype
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000174using ::wctype;
175#endif
176
177#ifdef towlower
178inline _LIBCPP_INLINE_VISIBILITY wint_t __libcpp_towlower(wint_t __wc) {return towlower(__wc);}
179#undef towlower
180inline _LIBCPP_INLINE_VISIBILITY wint_t towlower(wint_t __wc) {return __libcpp_towlower(__wc);}
Howard Hinnant324bb032010-08-22 00:02:43 +0000181#else // towlower
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000182using ::towlower;
183#endif
184
185#ifdef towupper
186inline _LIBCPP_INLINE_VISIBILITY wint_t __libcpp_towupper(wint_t __wc) {return towupper(__wc);}
187#undef towupper
188inline _LIBCPP_INLINE_VISIBILITY wint_t towupper(wint_t __wc) {return __libcpp_towupper(__wc);}
Howard Hinnant324bb032010-08-22 00:02:43 +0000189#else // towupper
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000190using ::towupper;
191#endif
192
193#ifdef towctrans
194inline _LIBCPP_INLINE_VISIBILITY wint_t __libcpp_towctrans(wint_t __wc, wctype_t __d) {return towctrans(__wc, __d);}
195#undef towctrans
196inline _LIBCPP_INLINE_VISIBILITY wint_t towctrans(wint_t __wc, wctype_t __d) {return __libcpp_towctrans(__wc, __d);}
Howard Hinnant324bb032010-08-22 00:02:43 +0000197#else // towctrans
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000198using ::towctrans;
199#endif
200
201#ifdef wctrans
202inline _LIBCPP_INLINE_VISIBILITY wctrans_t __libcpp_wctrans(const char* __p) {return wctrans(__p);}
203#undef wctrans
204inline _LIBCPP_INLINE_VISIBILITY wctrans_t wctrans(const char* __p) {return __libcpp_wctrans(__p);}
Howard Hinnant324bb032010-08-22 00:02:43 +0000205#else // wctrans
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000206using ::wctrans;
207#endif
208
209_LIBCPP_END_NAMESPACE_STD
210
211#endif // _LIBCPP_CWCTYPE