summaryrefslogtreecommitdiff
path: root/src/user/lib/ctype.c
diff options
context:
space:
mode:
authordzwdz2022-08-26 14:16:16 +0200
committerdzwdz2022-08-26 14:16:16 +0200
commite6584db26da34572fb13aa236e16e19f71c8e976 (patch)
tree055c528765e986bc8ed6706cec84289e50b46ed6 /src/user/lib/ctype.c
parentffdf0e8d93f8e98ed9d5a8270feb2a19eb9659e3 (diff)
user/libc: prepare for OpenED port
Diffstat (limited to 'src/user/lib/ctype.c')
-rw-r--r--src/user/lib/ctype.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/user/lib/ctype.c b/src/user/lib/ctype.c
index b702703..7d3a707 100644
--- a/src/user/lib/ctype.c
+++ b/src/user/lib/ctype.c
@@ -29,3 +29,12 @@ int isupper(int c) {
return 'A' <= c && c <= 'Z';
}
+int tolower(int c) {
+ if (isupper(c)) return c - 'A' + 'a';
+ return c;
+}
+
+int toupper(int c) {
+ if (islower(c)) return c - 'a' + 'A';
+ return c;
+}