diff options
author | Benji Dial <benji6283@gmail.com> | 2021-01-24 12:00:11 -0500 |
---|---|---|
committer | Benji Dial <benji6283@gmail.com> | 2021-01-24 12:00:11 -0500 |
commit | bce944d1498eaa3b6940ee234c863b3548a66b37 (patch) | |
tree | ea40c087ab4f0f236aee8d158cf68550f5209f72 /src/user/knob/block.c | |
parent | ca731aa747214919df7b3dfe3478dbe787ce5b68 (diff) | |
download | portland-os-bce944d1498eaa3b6940ee234c863b3548a66b37.tar.gz |
graphics!
Diffstat (limited to 'src/user/knob/block.c')
-rw-r--r-- | src/user/knob/block.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/user/knob/block.c b/src/user/knob/block.c index 94bd073..90f79e3 100644 --- a/src/user/knob/block.c +++ b/src/user/knob/block.c @@ -33,4 +33,28 @@ char *strdup(const char *from) { char *buf = get_block(end - from); blockcpy(buf, from, end - from); return buf; +} + +__attribute__ ((pure)) +bool strequ(const char *a, const char *b) { + while (true) { + if ((*a == '\0') != (*b == '\0')) + return false; + if (*a == '\0') + return true; + if (*a != *b) + return false; + ++a; + ++b; + } +} + +__attribute__ ((pure)) +uint32_t strlen(const char *str) { + uint32_t len = 0; + while (*str) { + ++len; + ++str; + } + return len; }
\ No newline at end of file |