blob: 4f89b52db27cef4707c9d5c8103710f8f122080b [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
Howard Hinnant08e17472011-10-17 20:05:10 +000057#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
Howard Hinnantbc8d3f92010-05-11 19:42:16 +000058#pragma GCC system_header
Howard Hinnant08e17472011-10-17 20:05:10 +000059#endif
Howard Hinnantbc8d3f92010-05-11 19:42:16 +000060
61_LIBCPP_BEGIN_NAMESPACE_STD
62
63using ::wint_t;
64using ::wctrans_t;
65using ::wctype_t;
Dan Albert1d4a1ed2016-05-25 22:36:09 -070066
67#ifdef iswalnum
68inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswalnum(wint_t __wc) {return iswalnum(__wc);}
69#undef iswalnum
70inline _LIBCPP_INLINE_VISIBILITY int iswalnum(wint_t __wc) {return __libcpp_iswalnum(__wc);}
71#else // iswalnum
Howard Hinnantbc8d3f92010-05-11 19:42:16 +000072using ::iswalnum;
Dan Albert1d4a1ed2016-05-25 22:36:09 -070073#endif
74
75#ifdef iswalpha
76inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswalpha(wint_t __wc) {return iswalpha(__wc);}
77#undef iswalpha
78inline _LIBCPP_INLINE_VISIBILITY int iswalpha(wint_t __wc) {return __libcpp_iswalpha(__wc);}
79#else // iswalpha
Howard Hinnantbc8d3f92010-05-11 19:42:16 +000080using ::iswalpha;
Dan Albert1d4a1ed2016-05-25 22:36:09 -070081#endif
82
83#ifdef iswblank
84inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswblank(wint_t __wc) {return iswblank(__wc);}
85#undef iswblank
86inline _LIBCPP_INLINE_VISIBILITY int iswblank(wint_t __wc) {return __libcpp_iswblank(__wc);}
87#else // iswblank
Howard Hinnantbc8d3f92010-05-11 19:42:16 +000088using ::iswblank;
Dan Albert1d4a1ed2016-05-25 22:36:09 -070089#endif
90
91#ifdef iswcntrl
92inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswcntrl(wint_t __wc) {return iswcntrl(__wc);}
93#undef iswcntrl
94inline _LIBCPP_INLINE_VISIBILITY int iswcntrl(wint_t __wc) {return __libcpp_iswcntrl(__wc);}
95#else // iswcntrl
Howard Hinnantbc8d3f92010-05-11 19:42:16 +000096using ::iswcntrl;
Dan Albert1d4a1ed2016-05-25 22:36:09 -070097#endif
98
99#ifdef iswdigit
100inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswdigit(wint_t __wc) {return iswdigit(__wc);}
101#undef iswdigit
102inline _LIBCPP_INLINE_VISIBILITY int iswdigit(wint_t __wc) {return __libcpp_iswdigit(__wc);}
103#else // iswdigit
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000104using ::iswdigit;
Dan Albert1d4a1ed2016-05-25 22:36:09 -0700105#endif
106
107#ifdef iswgraph
108inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswgraph(wint_t __wc) {return iswgraph(__wc);}
109#undef iswgraph
110inline _LIBCPP_INLINE_VISIBILITY int iswgraph(wint_t __wc) {return __libcpp_iswgraph(__wc);}
111#else // iswgraph
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000112using ::iswgraph;
Dan Albert1d4a1ed2016-05-25 22:36:09 -0700113#endif
114
115#ifdef iswlower
116inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswlower(wint_t __wc) {return iswlower(__wc);}
117#undef iswlower
118inline _LIBCPP_INLINE_VISIBILITY int iswlower(wint_t __wc) {return __libcpp_iswlower(__wc);}
119#else // iswlower
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000120using ::iswlower;
Dan Albert1d4a1ed2016-05-25 22:36:09 -0700121#endif
122
123#ifdef iswprint
124inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswprint(wint_t __wc) {return iswprint(__wc);}
125#undef iswprint
126inline _LIBCPP_INLINE_VISIBILITY int iswprint(wint_t __wc) {return __libcpp_iswprint(__wc);}
127#else // iswprint
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000128using ::iswprint;
Dan Albert1d4a1ed2016-05-25 22:36:09 -0700129#endif
130
131#ifdef iswpunct
132inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswpunct(wint_t __wc) {return iswpunct(__wc);}
133#undef iswpunct
134inline _LIBCPP_INLINE_VISIBILITY int iswpunct(wint_t __wc) {return __libcpp_iswpunct(__wc);}
135#else // iswpunct
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000136using ::iswpunct;
Dan Albert1d4a1ed2016-05-25 22:36:09 -0700137#endif
138
139#ifdef iswspace
140inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswspace(wint_t __wc) {return iswspace(__wc);}
141#undef iswspace
142inline _LIBCPP_INLINE_VISIBILITY int iswspace(wint_t __wc) {return __libcpp_iswspace(__wc);}
143#else // iswspace
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000144using ::iswspace;
Dan Albert1d4a1ed2016-05-25 22:36:09 -0700145#endif
146
147#ifdef iswupper
148inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswupper(wint_t __wc) {return iswupper(__wc);}
149#undef iswupper
150inline _LIBCPP_INLINE_VISIBILITY int iswupper(wint_t __wc) {return __libcpp_iswupper(__wc);}
151#else // iswupper
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000152using ::iswupper;
Dan Albert1d4a1ed2016-05-25 22:36:09 -0700153#endif
154
155#ifdef iswxdigit
156inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswxdigit(wint_t __wc) {return iswxdigit(__wc);}
157#undef iswxdigit
158inline _LIBCPP_INLINE_VISIBILITY int iswxdigit(wint_t __wc) {return __libcpp_iswxdigit(__wc);}
159#else // iswxdigit
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000160using ::iswxdigit;
Dan Albert1d4a1ed2016-05-25 22:36:09 -0700161#endif
162
163#ifdef iswctype
164inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswctype(wint_t __w, wctype_t __d) {return iswctype(__w, __d);}
165#undef iswctype
166inline _LIBCPP_INLINE_VISIBILITY int iswctype(wint_t __w, wctype_t __d) {return __libcpp_iswctype(__w, __d);}
167#else // iswctype
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000168using ::iswctype;
Dan Albert1d4a1ed2016-05-25 22:36:09 -0700169#endif
170
171#ifdef wctype
172inline _LIBCPP_INLINE_VISIBILITY wctype_t __libcpp_wctype(const char* __p) {return wctype(__p);}
173#undef wctype
174inline _LIBCPP_INLINE_VISIBILITY wctype_t wctype(const char* __p) {return __libcpp_wctype(__p);}
175#else // wctype
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000176using ::wctype;
Dan Albert1d4a1ed2016-05-25 22:36:09 -0700177#endif
178
179#ifdef towlower
180inline _LIBCPP_INLINE_VISIBILITY wint_t __libcpp_towlower(wint_t __wc) {return towlower(__wc);}
181#undef towlower
182inline _LIBCPP_INLINE_VISIBILITY wint_t towlower(wint_t __wc) {return __libcpp_towlower(__wc);}
183#else // towlower
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000184using ::towlower;
Dan Albert1d4a1ed2016-05-25 22:36:09 -0700185#endif
186
187#ifdef towupper
188inline _LIBCPP_INLINE_VISIBILITY wint_t __libcpp_towupper(wint_t __wc) {return towupper(__wc);}
189#undef towupper
190inline _LIBCPP_INLINE_VISIBILITY wint_t towupper(wint_t __wc) {return __libcpp_towupper(__wc);}
191#else // towupper
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000192using ::towupper;
Dan Albert1d4a1ed2016-05-25 22:36:09 -0700193#endif
194
195#ifdef towctrans
196inline _LIBCPP_INLINE_VISIBILITY wint_t __libcpp_towctrans(wint_t __wc, wctype_t __d) {return towctrans(__wc, __d);}
197#undef towctrans
198inline _LIBCPP_INLINE_VISIBILITY wint_t towctrans(wint_t __wc, wctype_t __d) {return __libcpp_towctrans(__wc, __d);}
199#else // towctrans
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000200using ::towctrans;
Dan Albert1d4a1ed2016-05-25 22:36:09 -0700201#endif
202
203#ifdef wctrans
204inline _LIBCPP_INLINE_VISIBILITY wctrans_t __libcpp_wctrans(const char* __p) {return wctrans(__p);}
205#undef wctrans
206inline _LIBCPP_INLINE_VISIBILITY wctrans_t wctrans(const char* __p) {return __libcpp_wctrans(__p);}
207#else // wctrans
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000208using ::wctrans;
Dan Albert1d4a1ed2016-05-25 22:36:09 -0700209#endif
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000210
211_LIBCPP_END_NAMESPACE_STD
212
213#endif // _LIBCPP_CWCTYPE