diff options
author | Alex AUVOLAT <alexis211@gmail.com> | 2013-06-08 23:09:52 +0200 |
---|---|---|
committer | Alex AUVOLAT <alexis211@gmail.com> | 2013-06-08 23:09:52 +0200 |
commit | 4d65fcb9a8b6c7c6fd5a3390c46a96d11b6a80d4 (patch) | |
tree | c193acf64ff2db985f6664f161cf586c3caeb684 /src/user/lib/libc/std/ctype.c | |
parent | eae9997d3c2dbaef53022ddabe61c1800a619499 (diff) | |
download | TCE-4d65fcb9a8b6c7c6fd5a3390c46a96d11b6a80d4.tar.gz TCE-4d65fcb9a8b6c7c6fd5a3390c46a96d11b6a80d4.zip |
All FWIK is deleted. YOSH is now pure C. Not-working KBASIC included.
Diffstat (limited to 'src/user/lib/libc/std/ctype.c')
-rw-r--r-- | src/user/lib/libc/std/ctype.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/user/lib/libc/std/ctype.c b/src/user/lib/libc/std/ctype.c new file mode 100644 index 0000000..f0e7750 --- /dev/null +++ b/src/user/lib/libc/std/ctype.c @@ -0,0 +1,28 @@ +#include <ctype.h> + + +int isalpha(int c) { + return (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z'); +} + +int isdigit(int c) { + return (c >= '0' && c <= '9'); +} + +int isalnum(int c) { + return (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || (c >= '0' && c <= '9'); +} + +int tolower(int c) { + if (c >= 'A' && c <= 'Z') { + return c + ('a' - 'A'); + } + return c; +} + +int toupper(int c) { + if (c >= 'a' && c <= 'z') { + return c - ('a' - 'A'); + } + return c; +} |