Home | History | Annotate | Download | only in include
      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 
     17 namespace std
     18 {
     19 
     20 int isalnum(int c);
     21 int isalpha(int c);
     22 int isblank(int c);  // C99
     23 int iscntrl(int c);
     24 int isdigit(int c);
     25 int isgraph(int c);
     26 int islower(int c);
     27 int isprint(int c);
     28 int ispunct(int c);
     29 int isspace(int c);
     30 int isupper(int c);
     31 int isxdigit(int c);
     32 int tolower(int c);
     33 int toupper(int c);
     34 
     35 }  // std
     36 */
     37 
     38 #include <__config>
     39 #include <ctype.h>
     40 #if defined(_MSC_VER)
     41 #include "support/win32/support.h"
     42 #endif // _MSC_VER
     43 
     44 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
     45 #pragma GCC system_header
     46 #endif
     47 
     48 _LIBCPP_BEGIN_NAMESPACE_STD
     49 
     50 #ifdef isalnum
     51 inline _LIBCPP_INLINE_VISIBILITY int __libcpp_isalnum(int __c) {return isalnum(__c);}
     52 #undef isalnum
     53 inline _LIBCPP_INLINE_VISIBILITY int isalnum(int __c) {return __libcpp_isalnum(__c);}
     54 #else  // isalnum
     55 using ::isalnum;
     56 #endif  // isalnum
     57 
     58 #ifdef isalpha
     59 inline _LIBCPP_INLINE_VISIBILITY int __libcpp_isalpha(int __c) {return isalpha(__c);}
     60 #undef isalpha
     61 inline _LIBCPP_INLINE_VISIBILITY int isalpha(int __c) {return __libcpp_isalpha(__c);}
     62 #else  // isalpha
     63 using ::isalpha;
     64 #endif  // isalpha
     65 
     66 #ifdef isblank
     67 inline _LIBCPP_INLINE_VISIBILITY int __libcpp_isblank(int __c) {return isblank(__c);}
     68 #undef isblank
     69 inline _LIBCPP_INLINE_VISIBILITY int isblank(int __c) {return __libcpp_isblank(__c);}
     70 #else  // isblank
     71 using ::isblank;
     72 #endif  // isblank
     73 
     74 #ifdef iscntrl
     75 inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iscntrl(int __c) {return iscntrl(__c);}
     76 #undef iscntrl
     77 inline _LIBCPP_INLINE_VISIBILITY int iscntrl(int __c) {return __libcpp_iscntrl(__c);}
     78 #else  // iscntrl
     79 using ::iscntrl;
     80 #endif  // iscntrl
     81 
     82 #ifdef isdigit
     83 inline _LIBCPP_INLINE_VISIBILITY int __libcpp_isdigit(int __c) {return isdigit(__c);}
     84 #undef isdigit
     85 inline _LIBCPP_INLINE_VISIBILITY int isdigit(int __c) {return __libcpp_isdigit(__c);}
     86 #else  // isdigit
     87 using ::isdigit;
     88 #endif  // isdigit
     89 
     90 #ifdef isgraph
     91 inline _LIBCPP_INLINE_VISIBILITY int __libcpp_isgraph(int __c) {return isgraph(__c);}
     92 #undef isgraph
     93 inline _LIBCPP_INLINE_VISIBILITY int isgraph(int __c) {return __libcpp_isgraph(__c);}
     94 #else  // isgraph
     95 using ::isgraph;
     96 #endif  // isgraph
     97 
     98 #ifdef islower
     99 inline _LIBCPP_INLINE_VISIBILITY int __libcpp_islower(int __c) {return islower(__c);}
    100 #undef islower
    101 inline _LIBCPP_INLINE_VISIBILITY int islower(int __c) {return __libcpp_islower(__c);}
    102 #else  // islower
    103 using ::islower;
    104 #endif  // islower
    105 
    106 #ifdef isprint
    107 inline _LIBCPP_INLINE_VISIBILITY int __libcpp_isprint(int __c) {return isprint(__c);}
    108 #undef isprint
    109 inline _LIBCPP_INLINE_VISIBILITY int isprint(int __c) {return __libcpp_isprint(__c);}
    110 #else  // isprint
    111 using ::isprint;
    112 #endif  // isprint
    113 
    114 #ifdef ispunct
    115 inline _LIBCPP_INLINE_VISIBILITY int __libcpp_ispunct(int __c) {return ispunct(__c);}
    116 #undef ispunct
    117 inline _LIBCPP_INLINE_VISIBILITY int ispunct(int __c) {return __libcpp_ispunct(__c);}
    118 #else  // ispunct
    119 using ::ispunct;
    120 #endif  // ispunct
    121 
    122 #ifdef isspace
    123 inline _LIBCPP_INLINE_VISIBILITY int __libcpp_isspace(int __c) {return isspace(__c);}
    124 #undef isspace
    125 inline _LIBCPP_INLINE_VISIBILITY int isspace(int __c) {return __libcpp_isspace(__c);}
    126 #else  // isspace
    127 using ::isspace;
    128 #endif  // isspace
    129 
    130 #ifdef isupper
    131 inline _LIBCPP_INLINE_VISIBILITY int __libcpp_isupper(int __c) {return isupper(__c);}
    132 #undef isupper
    133 inline _LIBCPP_INLINE_VISIBILITY int isupper(int __c) {return __libcpp_isupper(__c);}
    134 #else  // isupper
    135 using ::isupper;
    136 #endif  // isupper
    137 
    138 #ifdef isxdigit
    139 inline _LIBCPP_INLINE_VISIBILITY int __libcpp_isxdigit(int __c) {return isxdigit(__c);}
    140 #undef isxdigit
    141 inline _LIBCPP_INLINE_VISIBILITY int isxdigit(int __c) {return __libcpp_isxdigit(__c);}
    142 #else  // isxdigit
    143 using ::isxdigit;
    144 #endif  // isxdigit
    145 
    146 #ifdef tolower
    147 inline _LIBCPP_INLINE_VISIBILITY int __libcpp_tolower(int __c) {return tolower(__c);}
    148 #undef tolower
    149 inline _LIBCPP_INLINE_VISIBILITY int tolower(int __c) {return __libcpp_tolower(__c);}
    150 #else  // tolower
    151 using ::tolower;
    152 #endif  // tolower
    153 
    154 #ifdef toupper
    155 inline _LIBCPP_INLINE_VISIBILITY int __libcpp_toupper(int __c) {return toupper(__c);}
    156 #undef toupper
    157 inline _LIBCPP_INLINE_VISIBILITY int toupper(int __c) {return __libcpp_toupper(__c);}
    158 #else  // toupper
    159 using ::toupper;
    160 #endif  // toupper
    161 
    162 _LIBCPP_END_NAMESPACE_STD
    163 
    164 #endif  // _LIBCPP_CCTYPE
    165