aboutsummaryrefslogtreecommitdiff
path: root/libc/stdlib.c
diff options
context:
space:
mode:
authorFranklin Wei <frankhwei536@gmail.com>2015-03-01 13:05:04 -0500
committerFranklin Wei <frankhwei536@gmail.com>2015-03-01 13:05:04 -0500
commit6e86a3abee2d9b2c03452cd62997c2152a3332aa (patch)
treeef868a5a58b59fb0fbc215a4dd4367d5fcb4125e /libc/stdlib.c
parentd532ad93a42ea95460765d4527b3fb1e4544c154 (diff)
downloadkappa-6e86a3abee2d9b2c03452cd62997c2152a3332aa.zip
kappa-6e86a3abee2d9b2c03452cd62997c2152a3332aa.tar.gz
kappa-6e86a3abee2d9b2c03452cd62997c2152a3332aa.tar.bz2
kappa-6e86a3abee2d9b2c03452cd62997c2152a3332aa.tar.xz
lots of stuff
Diffstat (limited to 'libc/stdlib.c')
-rw-r--r--libc/stdlib.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/libc/stdlib.c b/libc/stdlib.c
index 4301618..d1d357e 100644
--- a/libc/stdlib.c
+++ b/libc/stdlib.c
@@ -161,3 +161,17 @@ void assert_fail(const char *func, const char *file, int line)
printf("\nAssertion failed in function %s in file %s, line %d\n", func, file, line);
panic("assertion failed!\n");
}
+
+int toupper(int ch)
+{
+ if('a' <= ch && ch <= 'z')
+ return ch ^ (1<<5);
+ return ch;
+}
+
+int tolower(int ch)
+{
+ if('A' <= ch && ch <= 'Z')
+ return ch ^ (1<<5);
+ return ch;
+}