summaryrefslogtreecommitdiff
path: root/userland/libc/ctype
diff options
context:
space:
mode:
Diffstat (limited to 'userland/libc/ctype')
-rw-r--r--userland/libc/ctype/isblank.c5
-rw-r--r--userland/libc/ctype/iscntrl.c6
-rw-r--r--userland/libc/ctype/isgraph.c5
-rw-r--r--userland/libc/ctype/islower.c5
-rw-r--r--userland/libc/ctype/isupper.c5
5 files changed, 26 insertions, 0 deletions
diff --git a/userland/libc/ctype/isblank.c b/userland/libc/ctype/isblank.c
new file mode 100644
index 0000000..488fa88
--- /dev/null
+++ b/userland/libc/ctype/isblank.c
@@ -0,0 +1,5 @@
+#include <ctype.h>
+
+int isblank(int c) {
+ return (c == ' ' || c == '\t');
+}
diff --git a/userland/libc/ctype/iscntrl.c b/userland/libc/ctype/iscntrl.c
new file mode 100644
index 0000000..92ed7f0
--- /dev/null
+++ b/userland/libc/ctype/iscntrl.c
@@ -0,0 +1,6 @@
+#include <ctype.h>
+
+int iscntrl(int c)
+{
+ return (unsigned)c < 0x20 || c == 0x7f;
+}
diff --git a/userland/libc/ctype/isgraph.c b/userland/libc/ctype/isgraph.c
new file mode 100644
index 0000000..28bf695
--- /dev/null
+++ b/userland/libc/ctype/isgraph.c
@@ -0,0 +1,5 @@
+#include <ctype.h>
+
+int isgraph(int c) {
+ return (unsigned)c - 0x21 < 0x5e;
+}
diff --git a/userland/libc/ctype/islower.c b/userland/libc/ctype/islower.c
new file mode 100644
index 0000000..d3bed82
--- /dev/null
+++ b/userland/libc/ctype/islower.c
@@ -0,0 +1,5 @@
+#include <ctype.h>
+
+int islower(int c) {
+ return (c >= 'a' && c <= 'z');
+}
diff --git a/userland/libc/ctype/isupper.c b/userland/libc/ctype/isupper.c
new file mode 100644
index 0000000..9df4fb5
--- /dev/null
+++ b/userland/libc/ctype/isupper.c
@@ -0,0 +1,5 @@
+#include <ctype.h>
+
+int isupper(int c) {
+ return (c >= 'A' && c <= 'Z');
+}