/** * @file CString.h * @author apio (cloudapio.eu) * @brief Implementations of C-string and memory manipulation functions. * * @copyright Copyright (c) 2022-2023, the Luna authors. * */ #pragma once #include extern "C" { void* memcpy(void* dest, const void* src, usize n); void* memset(void* buf, int c, usize n); int memcmp(const void* a, const void* b, usize n); void* memmove(void* dest, const void* src, usize n); void* memchr(const void* buf, int c, usize n); usize strlen(const char* str); usize strnlen(const char* str, usize max); int strcmp(const char* a, const char* b); int strncmp(const char* a, const char* b, usize max); usize strspn(const char* str, const char* accept); usize strcspn(const char* str, const char* reject); char* strtok(char* str, const char* delim); char* strtok_r(char* str, const char* delim, char** savep); usize wcslen(const wchar_t* str); int wcscmp(const wchar_t* a, const wchar_t* b); char* strdup(const char* str); char* strndup(const char* str, usize max); usize strlcpy(char* dest, const char* src, usize len); [[deprecated]] char* strcpy(char* dst, const char* src); [[deprecated]] char* strcat(char* dst, const char* src); char* strncpy(char* dest, const char* src, usize max); char* strncat(char* dest, const char* src, usize max); char* strchr(const char* str, int c); char* strrchr(const char* str, int c); char* strpbrk(const char* s, const char* accept); char* strstr(const char* haystack, const char* needle); int strcasecmp(const char* a, const char* b); int strncasecmp(const char* a, const char* b, usize max); }