PatchworkOS
Loading...
Searching...
No Matches
string.h
Go to the documentation of this file.
1#ifndef _STRING_H
2#define _STRING_H 1
3
4#if defined(__cplusplus)
5extern "C"
6{
7#endif
8
9#include "_internal/NULL.h"
10#include "_internal/config.h"
11#include "_internal/size_t.h"
12
13_PUBLIC void* memcpy(void* _RESTRICT s1, const void* _RESTRICT s2, size_t n);
14
15_PUBLIC void* memmove(void* _RESTRICT s1, const void* _RESTRICT s2, size_t n);
16
17_PUBLIC char* strcpy(char* _RESTRICT s1, const char* _RESTRICT s2);
18
19_PUBLIC char* strncpy(char* _RESTRICT s1, const char* _RESTRICT s2, size_t n);
20
21_PUBLIC char* strcat(char* _RESTRICT s1, const char* _RESTRICT s2);
22
23_PUBLIC char* strncat(char* _RESTRICT s1, const char* _RESTRICT s2, size_t n);
24
25_PUBLIC int memcmp(const void* s1, const void* s2, size_t n);
26
27_PUBLIC int strcmp(const char* s1, const char* s2);
28
29_PUBLIC int strcoll(const char* s1, const char* s2);
30
31_PUBLIC int strncmp(const char* s1, const char* s2, size_t n);
32
33_PUBLIC size_t strxfrm(char* _RESTRICT s1, const char* _RESTRICT s2, size_t n);
34
35_PUBLIC void* memchr(const void* s, int c, size_t n);
36
37_PUBLIC char* strchr(const char* s, int c);
38
39_PUBLIC size_t strcspn(const char* s1, const char* s2);
40
41_PUBLIC char* strpbrk(const char* s1, const char* s2);
42
43_PUBLIC char* strrchr(const char* s, int c);
44
45_PUBLIC size_t strspn(const char* s1, const char* s2);
46
47_PUBLIC char* strstr(const char* s1, const char* s2);
48
49_PUBLIC char* strtok(char* _RESTRICT s1, const char* _RESTRICT s2);
50
51_PUBLIC void* memset(void* s, int c, size_t n);
52_PUBLIC void* memset32(void* s, __UINT32_TYPE__ c, size_t n);
53
54_PUBLIC char* strerror(int errnum);
55
56_PUBLIC size_t strlen(const char* s);
57
58// Note: Technically this should not be here as we are using C11, and this is only available in C23, but its just to
59// useful to leave out.
60char* strdup(const char* src);
61
62#if (__STDC_WANT_LIB_EXT1__ + 0) != 0
63
64#include "_internal/errno_t.h"
65#include "_internal/rsize_t.h"
66
67_PUBLIC errno_t memcpy_s(void* _RESTRICT s1, rsize_t s1max, const void* _RESTRICT s2, rsize_t n);
68
69_PUBLIC errno_t memmove_s(void* _RESTRICT s1, rsize_t s1max, const void* _RESTRICT s2, rsize_t n);
70
71_PUBLIC errno_t strcpy_s(char* _RESTRICT s1, rsize_t s1max, const char* _RESTRICT s2);
72
73_PUBLIC errno_t strncpy_s(char* _RESTRICT s1, rsize_t s1max, const char* _RESTRICT s2, rsize_t n);
74
75_PUBLIC errno_t strcat_s(char* _RESTRICT s1, rsize_t s1max, const char* _RESTRICT s2);
76
77_PUBLIC errno_t strncat_s(char* _RESTRICT s1, rsize_t s1max, const char* _RESTRICT s2, rsize_t n);
78
79_PUBLIC char* strtok_s(char* _RESTRICT s1, rsize_t* _RESTRICT s1max, const char* _RESTRICT s2, char** _RESTRICT ptr);
80
81_PUBLIC errno_t memset_s(void* s, rsize_t smax, int c, rsize_t n);
82
83_PUBLIC errno_t strerror_s(char* s, rsize_t maxsize, errno_t errnum);
84
85_PUBLIC size_t strerrorlen_s(errno_t errnum);
86
87_PUBLIC size_t strnlen_s(const char* s, size_t maxsize);
88
89#endif
90
91#if defined(__cplusplus)
92}
93#endif
94
95#endif
int errno_t
Definition errno_t.h:4
#define _PUBLIC
Definition config.h:41
#define _RESTRICT
Definition config.h:17
errno_t memcpy_s(void *_RESTRICT s1, rsize_t s1max, const void *_RESTRICT s2, rsize_t n)
Definition memcpy_s.c:9
errno_t memmove_s(void *s1, rsize_t s1max, const void *s2, rsize_t n)
Definition memmove_s.c:9
errno_t memset_s(void *s, rsize_t smax, int c, rsize_t n)
Definition memset_s.c:9
__SIZE_TYPE__ rsize_t
Definition rsize_t.h:4
errno_t strcat_s(char *_RESTRICT s1, rsize_t s1max, const char *_RESTRICT s2)
Definition strcat_s.c:9
errno_t strcpy_s(char *_RESTRICT s1, rsize_t s1max, const char *_RESTRICT s2)
Definition strcpy_s.c:9
errno_t strerror_s(char *s, rsize_t maxsize, errno_t errnum)
Definition strerror_s.c:10
size_t strerrorlen_s(errno_t errnum)
_PUBLIC char * strerror(int errnum)
Definition strerror.c:6
_PUBLIC int strcoll(const char *s1, const char *s2)
Definition strcoll.c:3
_PUBLIC size_t strspn(const char *s1, const char *s2)
Definition strspn.c:3
_PUBLIC void * memmove(void *_RESTRICT s1, const void *_RESTRICT s2, size_t n)
_PUBLIC char * strtok(char *_RESTRICT s1, const char *_RESTRICT s2)
Definition strtok.c:4
_PUBLIC char * strncat(char *_RESTRICT s1, const char *_RESTRICT s2, size_t n)
Definition strncat.c:3
_PUBLIC void * memset32(void *s, __UINT32_TYPE__ c, size_t n)
Definition memset32.c:4
_PUBLIC char * strncpy(char *_RESTRICT s1, const char *_RESTRICT s2, size_t n)
Definition strncpy.c:3
_PUBLIC void * memchr(const void *s, int c, size_t n)
Definition memchr.c:3
_PUBLIC size_t strcspn(const char *s1, const char *s2)
Definition strcspn.c:3
char * strdup(const char *src)
Definition strdup.c:5
_PUBLIC int memcmp(const void *s1, const void *s2, size_t n)
Definition memcmp.c:3
_PUBLIC void * memcpy(void *_RESTRICT s1, const void *_RESTRICT s2, size_t n)
Definition memcpy.c:4
_PUBLIC char * strstr(const char *s1, const char *s2)
Definition strstr.c:3
_PUBLIC int strncmp(const char *s1, const char *s2, size_t n)
Definition strncmp.c:3
_PUBLIC size_t strlen(const char *s)
Definition strlen.c:3
_PUBLIC char * strpbrk(const char *s1, const char *s2)
Definition strpbrk.c:3
_PUBLIC char * strcat(char *_RESTRICT s1, const char *_RESTRICT s2)
Definition strcat.c:3
_PUBLIC char * strcpy(char *_RESTRICT s1, const char *_RESTRICT s2)
Definition strcpy.c:3
_PUBLIC char * strrchr(const char *s, int c)
Definition strrchr.c:3
_PUBLIC int strcmp(const char *s1, const char *s2)
Definition strcmp.c:3
_PUBLIC size_t strxfrm(char *_RESTRICT s1, const char *_RESTRICT s2, size_t n)
Definition strxfrm.c:3
_PUBLIC void * memset(void *s, int c, size_t n)
Definition memset.c:4
_PUBLIC char * strchr(const char *s, int c)
Definition strchr.c:3
errno_t strncat_s(char *_RESTRICT s1, rsize_t s1max, const char *_RESTRICT s2, rsize_t n)
Definition strncat_s.c:9
errno_t strncpy_s(char *_RESTRICT s1, rsize_t s1max, const char *_RESTRICT s2, rsize_t n)
Definition strncpy_s.c:9
size_t strnlen_s(const char *s, size_t maxsize)
Definition strnlen_s.c:4
char * strtok_s(char *_RESTRICT s1, rsize_t *_RESTRICT s1max, const char *_RESTRICT s2, char **_RESTRICT ptr)
Definition strtok_s.c:8