2023-08-26 10:43:44 +00:00
|
|
|
/**
|
|
|
|
* @file CString.h
|
|
|
|
* @author apio (cloudapio.eu)
|
|
|
|
* @brief Implementations of C-string and memory manipulation functions.
|
|
|
|
*
|
|
|
|
* @copyright Copyright (c) 2022-2023, the Luna authors.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2022-11-13 09:30:10 +00:00
|
|
|
#pragma once
|
2022-12-04 11:42:43 +00:00
|
|
|
#include <luna/Types.h>
|
2022-11-13 09:30:10 +00:00
|
|
|
|
2022-11-13 11:20:53 +00:00
|
|
|
extern "C"
|
2022-11-13 09:30:10 +00:00
|
|
|
{
|
2022-11-20 17:29:23 +00:00
|
|
|
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);
|
2023-07-22 09:58:28 +00:00
|
|
|
void* memchr(const void* buf, int c, usize n);
|
2023-01-22 10:27:37 +00:00
|
|
|
|
2022-11-20 17:29:23 +00:00
|
|
|
usize strlen(const char* str);
|
2023-01-22 10:27:37 +00:00
|
|
|
usize strnlen(const char* str, usize max);
|
|
|
|
|
2022-12-19 11:20:56 +00:00
|
|
|
int strcmp(const char* a, const char* b);
|
2023-03-12 14:20:44 +00:00
|
|
|
int strncmp(const char* a, const char* b, usize max);
|
2022-12-16 19:37:57 +00:00
|
|
|
|
2023-03-10 20:32:18 +00:00
|
|
|
usize strspn(const char* str, const char* accept);
|
|
|
|
usize strcspn(const char* str, const char* reject);
|
|
|
|
|
|
|
|
char* strtok(char* str, const char* delim);
|
2023-05-20 14:37:07 +00:00
|
|
|
char* strtok_r(char* str, const char* delim, char** savep);
|
2023-03-10 20:32:18 +00:00
|
|
|
|
2022-12-18 13:33:13 +00:00
|
|
|
usize wcslen(const wchar_t* str);
|
2023-04-28 18:00:26 +00:00
|
|
|
int wcscmp(const wchar_t* a, const wchar_t* b);
|
2022-12-18 13:33:13 +00:00
|
|
|
|
2022-12-16 19:37:57 +00:00
|
|
|
char* strdup(const char* str);
|
2023-01-22 10:27:37 +00:00
|
|
|
char* strndup(const char* str, usize max);
|
2022-12-18 15:31:02 +00:00
|
|
|
|
2023-02-27 14:03:22 +00:00
|
|
|
usize strlcpy(char* dest, const char* src, usize len);
|
|
|
|
|
2023-01-06 15:20:35 +00:00
|
|
|
[[deprecated]] char* strcpy(char* dst, const char* src);
|
|
|
|
[[deprecated]] char* strcat(char* dst, const char* src);
|
|
|
|
|
2023-04-23 08:53:48 +00:00
|
|
|
char* strncpy(char* dest, const char* src, usize max);
|
|
|
|
char* strncat(char* dest, const char* src, usize max);
|
2023-03-12 14:20:44 +00:00
|
|
|
|
2023-01-06 15:20:35 +00:00
|
|
|
char* strchr(const char* str, int c);
|
2023-03-11 00:13:44 +00:00
|
|
|
char* strrchr(const char* str, int c);
|
2023-04-12 16:42:25 +00:00
|
|
|
|
|
|
|
char* strpbrk(const char* s, const char* accept);
|
2023-07-10 13:30:05 +00:00
|
|
|
|
|
|
|
char* strstr(const char* haystack, const char* needle);
|
2023-07-22 09:58:28 +00:00
|
|
|
|
|
|
|
int strcasecmp(const char* a, const char* b);
|
|
|
|
int strncasecmp(const char* a, const char* b, usize max);
|
2023-01-02 12:07:29 +00:00
|
|
|
}
|