diff options
Diffstat (limited to 'libk/string.h')
-rw-r--r-- | libk/string.h | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/libk/string.h b/libk/string.h index 30824b8..d0a0b32 100644 --- a/libk/string.h +++ b/libk/string.h @@ -1,14 +1,20 @@ #pragma once #include <types.h> +extern "C" { +void* memcpy(void* dstptr, const void* srcptr, const size_t n); +void* memset(void* bufptr, const int value, const size_t n); +void* memmove(void* dstptr, const void* srcptr, const size_t n); +int memcmp(const void* aptr, const void* bptr, const size_t n); +} + /** * Calculate the length of the string (in bytes) pointed to by str, excluding * the terminating null character. */ constexpr size_t strlen(const char* str) { size_t len = 0; - while (str[len] != '\0') - ++len; + while (str[len] != '\0') ++len; return len; } @@ -32,8 +38,7 @@ public: operator bool() const { return reverse ? (pos >= 0) : (pos < length); } explicit ViewIterator(const char* b, size_t l, bool r = false) : buffer(b), length(l), reverse(r) { - if (reverse) - pos = length - 1; + if (reverse) pos = length - 1; }; private: |