cctype revision 288943
1// -*- C++ -*-
2//===---------------------------- cctype ----------------------------------===//
3//
4//                     The LLVM Compiler Infrastructure
5//
6// This file is dual licensed under the MIT and the University of Illinois Open
7// Source Licenses. See LICENSE.TXT for details.
8//
9//===----------------------------------------------------------------------===//
10
11#ifndef _LIBCPP_CCTYPE
12#define _LIBCPP_CCTYPE
13
14/*
15    cctype synopsis
16
17namespace std
18{
19
20int isalnum(int c);
21int isalpha(int c);
22int isblank(int c);  // C99
23int iscntrl(int c);
24int isdigit(int c);
25int isgraph(int c);
26int islower(int c);
27int isprint(int c);
28int ispunct(int c);
29int isspace(int c);
30int isupper(int c);
31int isxdigit(int c);
32int tolower(int c);
33int toupper(int c);
34
35}  // std
36*/
37
38#include <__config>
39#include <ctype.h>
40#if defined(_LIBCPP_MSVCRT)
41#include "support/win32/support.h"
42#include "support/win32/locale_win32.h"
43#endif // _LIBCPP_MSVCRT
44
45#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
46#pragma GCC system_header
47#endif
48
49_LIBCPP_BEGIN_NAMESPACE_STD
50
51#ifdef isalnum
52inline _LIBCPP_INLINE_VISIBILITY int __libcpp_isalnum(int __c) {return isalnum(__c);}
53#undef isalnum
54inline _LIBCPP_INLINE_VISIBILITY int isalnum(int __c) {return __libcpp_isalnum(__c);}
55#else  // isalnum
56using ::isalnum;
57#endif  // isalnum
58
59#ifdef isalpha
60inline _LIBCPP_INLINE_VISIBILITY int __libcpp_isalpha(int __c) {return isalpha(__c);}
61#undef isalpha
62inline _LIBCPP_INLINE_VISIBILITY int isalpha(int __c) {return __libcpp_isalpha(__c);}
63#else  // isalpha
64using ::isalpha;
65#endif  // isalpha
66
67#ifdef isblank
68inline _LIBCPP_INLINE_VISIBILITY int __libcpp_isblank(int __c) {return isblank(__c);}
69#undef isblank
70inline _LIBCPP_INLINE_VISIBILITY int isblank(int __c) {return __libcpp_isblank(__c);}
71#else  // isblank
72using ::isblank;
73#endif  // isblank
74
75#ifdef iscntrl
76inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iscntrl(int __c) {return iscntrl(__c);}
77#undef iscntrl
78inline _LIBCPP_INLINE_VISIBILITY int iscntrl(int __c) {return __libcpp_iscntrl(__c);}
79#else  // iscntrl
80using ::iscntrl;
81#endif  // iscntrl
82
83#ifdef isdigit
84inline _LIBCPP_INLINE_VISIBILITY int __libcpp_isdigit(int __c) {return isdigit(__c);}
85#undef isdigit
86inline _LIBCPP_INLINE_VISIBILITY int isdigit(int __c) {return __libcpp_isdigit(__c);}
87#else  // isdigit
88using ::isdigit;
89#endif  // isdigit
90
91#ifdef isgraph
92inline _LIBCPP_INLINE_VISIBILITY int __libcpp_isgraph(int __c) {return isgraph(__c);}
93#undef isgraph
94inline _LIBCPP_INLINE_VISIBILITY int isgraph(int __c) {return __libcpp_isgraph(__c);}
95#else  // isgraph
96using ::isgraph;
97#endif  // isgraph
98
99#ifdef islower
100inline _LIBCPP_INLINE_VISIBILITY int __libcpp_islower(int __c) {return islower(__c);}
101#undef islower
102inline _LIBCPP_INLINE_VISIBILITY int islower(int __c) {return __libcpp_islower(__c);}
103#else  // islower
104using ::islower;
105#endif  // islower
106
107#ifdef isprint
108inline _LIBCPP_INLINE_VISIBILITY int __libcpp_isprint(int __c) {return isprint(__c);}
109#undef isprint
110inline _LIBCPP_INLINE_VISIBILITY int isprint(int __c) {return __libcpp_isprint(__c);}
111#else  // isprint
112using ::isprint;
113#endif  // isprint
114
115#ifdef ispunct
116inline _LIBCPP_INLINE_VISIBILITY int __libcpp_ispunct(int __c) {return ispunct(__c);}
117#undef ispunct
118inline _LIBCPP_INLINE_VISIBILITY int ispunct(int __c) {return __libcpp_ispunct(__c);}
119#else  // ispunct
120using ::ispunct;
121#endif  // ispunct
122
123#ifdef isspace
124inline _LIBCPP_INLINE_VISIBILITY int __libcpp_isspace(int __c) {return isspace(__c);}
125#undef isspace
126inline _LIBCPP_INLINE_VISIBILITY int isspace(int __c) {return __libcpp_isspace(__c);}
127#else  // isspace
128using ::isspace;
129#endif  // isspace
130
131#ifdef isupper
132inline _LIBCPP_INLINE_VISIBILITY int __libcpp_isupper(int __c) {return isupper(__c);}
133#undef isupper
134inline _LIBCPP_INLINE_VISIBILITY int isupper(int __c) {return __libcpp_isupper(__c);}
135#else  // isupper
136using ::isupper;
137#endif  // isupper
138
139#ifdef isxdigit
140inline _LIBCPP_INLINE_VISIBILITY int __libcpp_isxdigit(int __c) {return isxdigit(__c);}
141#undef isxdigit
142inline _LIBCPP_INLINE_VISIBILITY int isxdigit(int __c) {return __libcpp_isxdigit(__c);}
143#else  // isxdigit
144using ::isxdigit;
145#endif  // isxdigit
146
147#ifdef tolower
148inline _LIBCPP_INLINE_VISIBILITY int __libcpp_tolower(int __c) {return tolower(__c);}
149#undef tolower
150inline _LIBCPP_INLINE_VISIBILITY int tolower(int __c) {return __libcpp_tolower(__c);}
151#else  // tolower
152using ::tolower;
153#endif  // tolower
154
155#ifdef toupper
156inline _LIBCPP_INLINE_VISIBILITY int __libcpp_toupper(int __c) {return toupper(__c);}
157#undef toupper
158inline _LIBCPP_INLINE_VISIBILITY int toupper(int __c) {return __libcpp_toupper(__c);}
159#else  // toupper
160using ::toupper;
161#endif  // toupper
162
163_LIBCPP_END_NAMESPACE_STD
164
165#endif  // _LIBCPP_CCTYPE
166