summaryrefslogtreecommitdiffstats
path: root/lib/toupper.c
diff options
context:
space:
mode:
authorJon Santmyer <jon@jonsantmyer.com>2024-03-11 21:30:31 -0400
committerJon Santmyer <jon@jonsantmyer.com>2024-03-11 21:30:31 -0400
commitd1ff7bcc91886626dc9060ec5fb67ee102ab7c1d (patch)
tree8f0b5cd8aad31089131785dc6e37b659490f9955 /lib/toupper.c
downloadjove-kernel-d1ff7bcc91886626dc9060ec5fb67ee102ab7c1d.tar.gz
jove-kernel-d1ff7bcc91886626dc9060ec5fb67ee102ab7c1d.tar.bz2
jove-kernel-d1ff7bcc91886626dc9060ec5fb67ee102ab7c1d.zip
usermode capable kernel with logging syscall
Diffstat (limited to 'lib/toupper.c')
-rw-r--r--lib/toupper.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/lib/toupper.c b/lib/toupper.c
new file mode 100644
index 0000000..807eb38
--- /dev/null
+++ b/lib/toupper.c
@@ -0,0 +1,26 @@
+#include "string.h"
+
+int
+toupper(int c)
+{
+ if(c >= 'a' && c <= 'z')
+ c -= ('a' - 'A');
+ return c;
+}
+
+char*
+stoupper(char *s)
+{
+ char *o = s;
+ for(; *s != 0; s++)
+ *s = toupper(*s);
+ return o;
+}
+
+char*
+sntoupper(char *s, size_t limit)
+{
+ for(size_t i = 0; i < limit; i++)
+ s[i] = toupper(s[i]);
+ return s;
+}