llvm-mos-sdk
string.h
Go to the documentation of this file.
1 
2 #ifndef _STRING_H_
3 #define _STRING_H_
4 
5 #include <stddef.h>
6 
7 #ifdef __cplusplus
8 extern "C" {
9 #endif
10 
11 // Copying functions
12 void *memcpy(void *__restrict__ s1, const void *__restrict__ s2, size_t n);
13 void *memmove(void *s1, const void *s2, size_t n);
14 char *strcpy(char *__restrict__ s1, const char *__restrict__ s2);
15 char *strncpy(char *__restrict__ s1, const char *__restrict__ s2, size_t n);
16 
17 // Concatenation functions
18 
19 char *strcat(char *__restrict__ s1, const char *__restrict__ s2);
20 char *strncat(char *__restrict__ s1, const char *__restrict__ s2, size_t n);
21 
22 // Comparison functions
23 
24 int memcmp(const void *s1, const void *s2, size_t n);
25 int strcmp(const char *s1, const char *s2);
26 int strncmp(const char *s1, const char *s2, size_t n);
27 
28 // Search functions
29 
30 void *memchr(const void *s, int c, size_t n);
31 char *strchr(const char *s, int c);
32 size_t strcspn(const char *s1, const char *s2);
33 char *strpbrk(const char *s1, const char *s2);
34 char *strrchr(const char *s, int c);
35 size_t strspn(const char *s1, const char *s2);
36 char *strstr(const char *s1, const char *s2);
37 char *strtok(char *__restrict__ s1, const char *__restrict__ s2);
38 
39 // Miscellaneous functions
40 
41 void *memset(void *ptr, int value, size_t num);
42 const char *strerror(int n);
43 
44 size_t strlen(const char *s);
45 
46 char *_strrev(char *str);
47 
48 // Version of memset with better arguments for MOS. All non-pointer arguments
49 // can fit in registers, and there is no superfluous return value. Compiler
50 // intrinsic memset calls use this version, and user code is free to as well.
51 void __memset(char *ptr, char value, size_t num);
52 
53 #ifdef __cplusplus
54 }
55 #endif
56 
57 #endif // not _STRING_H_
strcpy
char * strcpy(char *__restrict__ s1, const char *__restrict__ s2)
strlen
size_t strlen(const char *s)
strcmp
int strcmp(const char *s1, const char *s2)
strchr
char * strchr(const char *s, int c)
memchr
void * memchr(const void *s, int c, size_t n)
strncpy
char * strncpy(char *__restrict__ s1, const char *__restrict__ s2, size_t n)
memcpy
void * memcpy(void *__restrict__ s1, const void *__restrict__ s2, size_t n)
strncat
char * strncat(char *__restrict__ s1, const char *__restrict__ s2, size_t n)
memmove
void * memmove(void *s1, const void *s2, size_t n)
strcspn
size_t strcspn(const char *s1, const char *s2)
strrchr
char * strrchr(const char *s, int c)
strspn
size_t strspn(const char *s1, const char *s2)
strstr
char * strstr(const char *s1, const char *s2)
_strrev
char * _strrev(char *str)
memset
void * memset(void *ptr, int value, size_t num)
strcat
char * strcat(char *__restrict__ s1, const char *__restrict__ s2)
strpbrk
char * strpbrk(const char *s1, const char *s2)
memcmp
int memcmp(const void *s1, const void *s2, size_t n)
strtok
char * strtok(char *__restrict__ s1, const char *__restrict__ s2)
strncmp
int strncmp(const char *s1, const char *s2, size_t n)
c
byte byte c
Definition: api.h:59
strerror
const char * strerror(int n)