summaryrefslogtreecommitdiff
path: root/tnslc/utils.tnsl
diff options
context:
space:
mode:
authorKyle Gunger <kgunger12@gmail.com>2023-08-06 03:00:18 -0400
committerKyle Gunger <kgunger12@gmail.com>2023-08-06 03:00:18 -0400
commitd3dfc56318829e212a87da6874011d8304be31b0 (patch)
tree3e62dd637c5aa64f3ba51c3c08f35e1363efad97 /tnslc/utils.tnsl
parent8535ee80ebccb81cebd61d1f33992aaf682e455a (diff)
Frame out port of compiler
Diffstat (limited to 'tnslc/utils.tnsl')
-rw-r--r--tnslc/utils.tnsl10
1 files changed, 10 insertions, 0 deletions
diff --git a/tnslc/utils.tnsl b/tnslc/utils.tnsl
index 9fe113a..54f01aa 100644
--- a/tnslc/utils.tnsl
+++ b/tnslc/utils.tnsl
@@ -71,6 +71,16 @@
return false
;/
+/; cstr_contains (~uint8 cstr, uint8 c) [bool]
+ int j = cstr_len(cstr)
+ /; loop (int i = 0; i < j) [i++]
+ /; if (cstr{i} == c)
+ return true
+ ;/
+ ;/
+ return false
+;/
+
/; write_to_file(~void file, ~uint8 string)
int ln = cstr_len(string)
/; loop (int i = 0; i < ln) [i++]