]> git.buserror.net Git - polintos/scott/priv.git/blob - include/c++/stl/ctype.h
Add STLport 5.1.4
[polintos/scott/priv.git] / include / c++ / stl / ctype.h
1 /*
2  * Copyright (c) 1999
3  * Boris Fomitchev
4  *
5  * This material is provided "as is", with absolutely no warranty expressed
6  * or implied. Any use is at your own risk.
7  *
8  * Permission to use or copy this software for any purpose is hereby granted
9  * without fee, provided the above notices are retained on all copies.
10  * Permission to modify the code and to distribute modified code is granted,
11  * provided the above notices are retained, and a notice that the code was
12  * modified is included with the above copyright notice.
13  *
14  */
15
16 #ifndef _STLP_CTYPE_H
17
18 /* Workaround for a "misbehaviour" when compiling resource scripts using
19  * eMbedded Visual C++. The standard .rc file includes windows header files,
20  * which in turn include ctype.h, which results in warnings and errors
21  */
22 #if !defined(RC_INVOKED)
23
24 #  if !defined (_STLP_OUTERMOST_HEADER_ID)
25 #    define _STLP_OUTERMOST_HEADER_ID 0x219
26 #    include <stl/_prolog.h>
27 #  elif (_STLP_OUTERMOST_HEADER_ID == 0x219)
28 #    define _STLP_DONT_POP_HEADER_ID
29 #    define _STLP_CTYPE_H
30 #  endif
31
32 #  if defined(_STLP_WCE_EVC3)
33 struct _exception;
34 #  endif
35
36 #  include _STLP_NATIVE_C_HEADER(ctype.h)
37
38 /* on evc4 including ctype.h also defines setjmp macro */
39 #  if defined (_STLP_WCE)
40 #    define _STLP_NATIVE_SETJMP_H_INCLUDED
41 #  endif
42
43 #  ifndef _STLP_CTYPE_H_SEEN
44 #    define _STLP_CTYPE_H_SEEN
45
46 /* Undef convenience interfaces */
47 #    undef isspace
48 #    undef isprint
49 #    undef iscntrl
50 #    undef isupper
51 #    undef islower
52 #    undef isalpha
53 #    undef isdigit
54 #    undef ispunct
55 #    undef isxdigit
56 #    undef isalnum
57 #    undef isgraph
58 #    undef toupper
59 #    undef tolower
60
61 #    if defined (UNDER_CE)
62
63 #      if (_WIN32_WCE < 300)     /* Only wide chars for older versions */
64 #        define _isctype iswctype
65 #      endif
66
67 __inline int (isalpha)(int c) { return _isctype(c, _ALPHA); }
68 __inline int (isupper)(int c) { return _isctype(c, _UPPER); }
69 __inline int (islower)(int c) { return _isctype(c, _LOWER); }
70 __inline int (isdigit)(int c) { return _isctype(c, _DIGIT); }
71 __inline int (isxdigit)(int c) { return _isctype(c, _HEX); }
72 __inline int (isspace)(int c) { return _isctype(c, _SPACE); }
73 __inline int (ispunct)(int c) { return _isctype(c, _PUNCT); }
74 __inline int (isalnum)(int c) { return _isctype(c, _ALPHA|_DIGIT); }
75 __inline int (isprint)(int c) { return _isctype(c, _BLANK|_PUNCT|_ALPHA|_DIGIT); }
76 __inline int (isgraph)(int c) { return _isctype(c, _PUNCT|_ALPHA|_DIGIT); }
77 __inline int (iscntrl)(int c) { return _isctype(c, _CONTROL); }
78 __inline int (isascii)(int c) { return ((unsigned)(c) < 0x80); }
79
80 #      undef _isctype
81
82 __inline int (iswalpha)(int c) { return iswctype(c, _ALPHA); }
83 __inline int (iswupper)(int c) { return iswctype(c, _UPPER); }
84 __inline int (iswlower)(int c) { return iswctype(c, _LOWER); }
85 __inline int (iswdigit)(int c) { return iswctype(c, _DIGIT); }
86 __inline int (iswxdigit)(int c) { return iswctype(c, _HEX); }
87 __inline int (iswspace)(int c) { return iswctype(c, _SPACE); }
88 __inline int (iswpunct)(int c) { return iswctype(c, _PUNCT); }
89 __inline int (iswalnum)(int c) { return iswctype(c, _ALPHA|_DIGIT); }
90 __inline int (iswprint)(int c) { return iswctype(c, _BLANK|_PUNCT|_ALPHA|_DIGIT); }
91 __inline int (iswgraph)(int c) { return iswctype(c, _PUNCT|_ALPHA|_DIGIT); }
92 __inline int (iswcntrl)(int c) { return iswctype(c, _CONTROL); }
93 __inline int (iswascii)(int c) { return ((unsigned)(c) < 0x80); }
94
95 #    endif /* UNDER_CE */
96
97 #  endif /* _STLP_CTYPE_H_SEEN */
98
99 #  if (_STLP_OUTERMOST_HEADER_ID == 0x219)
100 #    if ! defined (_STLP_DONT_POP_HEADER_ID)
101 #      include <stl/_epilog.h>
102 #      undef  _STLP_OUTERMOST_HEADER_ID
103 #    else
104 #      undef  _STLP_DONT_POP_HEADER_ID
105 #    endif
106 #  endif
107
108 #endif /* RC_INVOKED */
109
110 #endif /* _STLP_CTYPE_H */