1 | // SPDX-License-Identifier: GPL-3.0-or-later |
2 | #pragma once |
3 | |
4 | #include <mos/moslib_global.h> |
5 | #include <mos/types.h> |
6 | |
7 | /** |
8 | * @defgroup libs_std_string libs.String |
9 | * @ingroup libs |
10 | * @brief String manipulation functions, similar to the ones in the C standard library. |
11 | * @{ |
12 | */ |
13 | |
14 | MOSAPI size_t strlen(const char *str) __pure; |
15 | MOSAPI size_t strnlen(const char *, size_t); |
16 | MOSAPI s32 strcmp(const char *str1, const char *str2); |
17 | MOSAPI s32 strncmp(const char *str1, const char *str2, size_t n); |
18 | MOSAPI s32 strncasecmp(const char *str1, const char *str2, size_t n); |
19 | |
20 | // ! The memory areas must not overlap. |
21 | MOSAPI void *memcpy(void *__restrict dest, const void *__restrict src, size_t n); |
22 | MOSAPI void *memmove(void *dest, const void *src, size_t n); |
23 | MOSAPI void *memset(void *s, int c, size_t n); |
24 | MOSAPI int memcmp(const void *s1, const void *s2, size_t n); |
25 | MOSAPI void memzero(void *s, size_t n); |
26 | MOSAPI void *memchr(const void *m, int c, size_t n); |
27 | |
28 | MOSAPI char *strcpy(char *__restrict dest, const char *__restrict src); |
29 | MOSAPI char *strcat(char *__restrict dest, const char *__restrict src); |
30 | |
31 | MOSAPI char *strncpy(char *__restrict dest, const char *__restrict src, size_t n); |
32 | |
33 | MOSAPI char *strdup(const char *src); |
34 | MOSAPI char *strndup(const char *src, size_t n); |
35 | |
36 | MOSAPI char *strchr(const char *s, int c); |
37 | MOSAPI char *strrchr(const char *s, int c); |
38 | |
39 | MOSAPI size_t strspn(const char *s, const char *accept); |
40 | MOSAPI char *strpbrk(const char *s, const char *accept); |
41 | MOSAPI char *strtok(char *str, const char *delim); |
42 | MOSAPI char *strtok_r(char *str, const char *delim, char **saveptr); |
43 | /** @} */ |
44 | |