Networking - Reworked route table management
[tpg/acess2.git] / Usermode / include / ctype.h
1 /*
2  * Acess2 C Library
3  * - By John Hodge (thePowersGang)
4  *
5  * ctype.h
6  * - Type manipulation?
7  */
8 #ifndef _CTYPE_H_
9 #define _CTYPE_H_
10
11 static inline int isalpha(int ch) {
12         if('A'<=ch&&ch<='Z')    return 1;
13         if('a'<=ch&&ch<='z')    return 1;
14         return 0;
15 }
16 static inline int isdigit(int ch) {
17         if('0'<=ch&&ch<='9')    return 1;
18         return 0;
19 }
20
21 static inline int isalnum(int ch) {
22         return isalpha(ch) || isdigit(ch);
23 }
24
25 static inline int toupper(int ch) {
26         if('a'<=ch && ch <='z')
27                 return ch - 'a' + 'A';
28         return ch;
29 }
30
31 static inline int isspace(int ch) {
32         if(ch == ' ')   return 1;
33         if(ch == '\t')  return 1;
34         if(ch == '\r')  return 1;
35         if(ch == '\n')  return 1;
36         return 0;
37 }
38
39 #endif

UCC git Repository :: git.ucc.asn.au