summaryrefslogtreecommitdiff
path: root/sys/include/ctype.h
diff options
context:
space:
mode:
authorTaru Karttunen <taruti@taruti.net>2011-03-30 16:47:56 +0300
committerTaru Karttunen <taruti@taruti.net>2011-03-30 16:47:56 +0300
commitc558a99e0be506a9abdf677f0ca4490644e05fc1 (patch)
tree17aef678ad05a32ef96ce8385703cb3fe089a5c7 /sys/include/ctype.h
parente5888a1ffdae813d7575f5fb02275c6bb07e5199 (diff)
Import sources from 2011-03-30 iso image - sys/include
Diffstat (limited to 'sys/include/ctype.h')
-rwxr-xr-xsys/include/ctype.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/sys/include/ctype.h b/sys/include/ctype.h
new file mode 100755
index 000000000..2cc7f4f65
--- /dev/null
+++ b/sys/include/ctype.h
@@ -0,0 +1,29 @@
+#pragma src "/sys/src/libc/port"
+#pragma lib "libc.a"
+
+#define _U 01
+#define _L 02
+#define _N 04
+#define _S 010
+#define _P 020
+#define _C 040
+#define _B 0100
+#define _X 0200
+
+extern unsigned char _ctype[];
+
+#define isalpha(c) (_ctype[(unsigned char)(c)]&(_U|_L))
+#define isupper(c) (_ctype[(unsigned char)(c)]&_U)
+#define islower(c) (_ctype[(unsigned char)(c)]&_L)
+#define isdigit(c) (_ctype[(unsigned char)(c)]&_N)
+#define isxdigit(c) (_ctype[(unsigned char)(c)]&_X)
+#define isspace(c) (_ctype[(unsigned char)(c)]&_S)
+#define ispunct(c) (_ctype[(unsigned char)(c)]&_P)
+#define isalnum(c) (_ctype[(unsigned char)(c)]&(_U|_L|_N))
+#define isprint(c) (_ctype[(unsigned char)(c)]&(_P|_U|_L|_N|_B))
+#define isgraph(c) (_ctype[(unsigned char)(c)]&(_P|_U|_L|_N))
+#define iscntrl(c) (_ctype[(unsigned char)(c)]&_C)
+#define isascii(c) ((unsigned char)(c)<=0177)
+#define _toupper(c) ((c)-'a'+'A')
+#define _tolower(c) ((c)-'A'+'a')
+#define toascii(c) ((c)&0177)