Make curl library use the tinycrt <sys/socket.h> instead of winsock2
[git-build-vc9.git] / tcrt / inc / ctype.h
blob38d27994528b69ed6209b8104338d92c36477d2e
1 /*=============================================================================
2 stdlib.h :
4 Copyright © 2008 Bruno Santos <nayart3@gmail.com>
5 =============================================================================*/
7 #ifndef TCRT_CTYPE__H_
8 #define TCRT_CTYPE__H_
10 ///////////////////////////////////////////////////////////////////////////////
11 #include "tcrt.h"
13 ///////////////////////////////////////////////////////////////////////////////
14 TCRT_BEGIN_EXTERN_C
16 ///////////////////////////////////////////////////////////////////////////////
17 enum tcrt_ctype_flags {
18 tcrt_ctype_flag_upper = 0x01,
19 tcrt_ctype_flag_lower = 0x02,
20 tcrt_ctype_flag_cntrl = 0x04,
21 tcrt_ctype_flag_digit = 0x08,
22 tcrt_ctype_flag_punct = 0x10,
23 tcrt_ctype_flag_xdigit = 0x20,
24 tcrt_ctype_flag_space = 0x40,
25 tcrt_ctype_flag_alpha = (tcrt_ctype_flag_upper | tcrt_ctype_flag_lower),
26 tcrt_ctype_flag_alnum = (tcrt_ctype_flag_alpha | tcrt_ctype_flag_digit),
27 tcrt_ctype_flag_graph = (tcrt_ctype_flag_alnum | tcrt_ctype_flag_punct),
28 tcrt_ctype_flag_print = (tcrt_ctype_flag_space | tcrt_ctype_flag_graph),
31 ///////////////////////////////////////////////////////////////////////////////
32 #undef tolower
33 #undef toupper
34 #undef isalpha
35 #undef isdigit
36 #undef isalnum
37 #undef isxdigit
38 #undef iscntrl
39 #undef isgraph
40 #undef isprint
41 #undef ispunct
42 #undef isspace
43 #undef islower
44 #undef isupper
46 ///////////////////////////////////////////////////////////////////////////////
47 int tolower(int c);
48 int toupper(int c);
49 int tcrt_ctype(int c);
51 ///////////////////////////////////////////////////////////////////////////////
52 static __inline int isalpha(int c)
54 return (tcrt_ctype(c) & tcrt_ctype_flag_alpha);
57 static __inline int isdigit(int c)
59 return (tcrt_ctype(c) & tcrt_ctype_flag_digit);
62 static __inline int isalnum(int c)
64 return (tcrt_ctype(c) & tcrt_ctype_flag_alnum);
67 static __inline int isxdigit(int c)
69 return (tcrt_ctype(c) & tcrt_ctype_flag_xdigit);
72 static __inline int iscntrl(int c)
74 return (tcrt_ctype(c) & tcrt_ctype_flag_cntrl);
77 static __inline int isgraph(int c)
79 return (tcrt_ctype(c) & tcrt_ctype_flag_graph);
82 static __inline int isprint(int c)
84 return (tcrt_ctype(c) & tcrt_ctype_flag_print);
87 static __inline int ispunct(int c)
89 return (tcrt_ctype(c) & tcrt_ctype_flag_punct);
92 static __inline int isspace(int c)
94 return (tcrt_ctype(c) & tcrt_ctype_flag_space);
97 static __inline int islower(int c)
99 return (tcrt_ctype(c) & tcrt_ctype_flag_lower);
102 static __inline int isupper(int c)
104 return (tcrt_ctype(c) & tcrt_ctype_flag_upper);
107 ///////////////////////////////////////////////////////////////////////////////
108 TCRT_END_EXTERN_C
110 // EOF ////////////////////////////////////////////////////////////////////////
111 #endif /* TCRT_CTYPE__H_ */