aboutsummaryrefslogtreecommitdiffstats
path: root/drhstrings.c
diff options
context:
space:
mode:
authordan <[email protected]>2023-06-02 16:22:29 -0400
committerdan <[email protected]>2023-06-02 16:22:29 -0400
commitac8a2fd77f7661b60cf2b272090ece67f65951db (patch)
treed45442d8bcf5c40febb85fc35d02c6c4f1d3684e /drhstrings.c
parent558b0646c5580454dd35a6bdee07bcc711db134e (diff)
downloadforth-ac8a2fd77f7661b60cf2b272090ece67f65951db.tar.gz
forth-ac8a2fd77f7661b60cf2b272090ece67f65951db.tar.bz2
forth-ac8a2fd77f7661b60cf2b272090ece67f65951db.zip
refactor: always output via buffer
Diffstat (limited to 'drhstrings.c')
-rw-r--r--drhstrings.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drhstrings.c b/drhstrings.c
new file mode 100644
index 0000000..7585149
--- /dev/null
+++ b/drhstrings.c
@@ -0,0 +1,15 @@
+#include <string.h>
+#include <stdbool.h>
+
+bool isnumber(char* text) {
+ for(int j = strlen(text); j > 0; j--) {
+ if(text[j] < '0' && text[j] > '9') {
+ return false;
+ }
+ }
+ return true;
+}
+
+bool notdelim(char c) {
+ return c != ' ' && c != '\n' && c != '\t' && c != '\0';
+}