1 | #ifndef _STRING_H |
---|
2 | #define _STRING_H |
---|
3 | |
---|
4 | #include <sys/types.h> |
---|
5 | |
---|
6 | |
---|
7 | char *strcpy(char* dest, const char* src); |
---|
8 | |
---|
9 | void *memccpy(void* dest, const void* src, int c, size_t n); |
---|
10 | void *memmove(void* dest, const void *src, size_t n); |
---|
11 | |
---|
12 | int memccmp(const void* s1, const void* s2, int c, size_t n); |
---|
13 | |
---|
14 | void* memset(void* s, int c, size_t n); |
---|
15 | int memcmp(const void* s1, const void* s2, size_t n) ; |
---|
16 | void* memcpy(void* dest, const void* src, size_t n); |
---|
17 | |
---|
18 | char *strncpy(char* dest, const char* src, size_t n); |
---|
19 | int strncmp(const char* s1, const char* s2, size_t n) ; |
---|
20 | |
---|
21 | char *strcat(char* dest, const char* src); |
---|
22 | char *strncat(char* dest, const char* src, size_t n); |
---|
23 | |
---|
24 | int strcmp(const char *s1, const char *s2) ; |
---|
25 | |
---|
26 | size_t strlen(const char *s); |
---|
27 | |
---|
28 | #ifdef _GNU_SOURCE |
---|
29 | size_t strnlen(const char *s,size_t maxlen) ; |
---|
30 | #endif |
---|
31 | |
---|
32 | char *strstr(const char *haystack, const char *needle) ; |
---|
33 | |
---|
34 | char *strdup(const char *s) ; |
---|
35 | |
---|
36 | char *strchr(const char *s, int c) ; |
---|
37 | char *strrchr(const char *s, int c) ; |
---|
38 | |
---|
39 | size_t strspn(const char *s, const char *_accept); |
---|
40 | size_t strcspn(const char *s, const char *reject); |
---|
41 | |
---|
42 | char *strpbrk(const char *s, const char *_accept); |
---|
43 | char *strsep(char ** stringp, const char * delim); |
---|
44 | |
---|
45 | void* memchr(const void *s, int c, size_t n) ; |
---|
46 | |
---|
47 | #ifdef _GNU_SOURCE |
---|
48 | void* memrchr(const void *s, int c, size_t n); |
---|
49 | #endif |
---|
50 | |
---|
51 | |
---|
52 | char *strerror(int errnum); |
---|
53 | |
---|
54 | /* work around b0rken GNU crapware like tar 1.13.19 */ |
---|
55 | #define strerror strerror |
---|
56 | int strerror_r(int errnum,char* buf,size_t n); |
---|
57 | |
---|
58 | #ifdef _GNU_SOURCE |
---|
59 | const char *strsignal(int signum); |
---|
60 | void *memmem(const void *haystack, size_t haystacklen, const void *needle, size_t needlelen); |
---|
61 | |
---|
62 | void* mempcpy(void* dest,const void* src,size_t n); |
---|
63 | |
---|
64 | char *strndup(const char *s,size_t n); |
---|
65 | |
---|
66 | #define strdupa(s) ({ const char* tmp=s; size_t l=strlen(tmp)+1; char* x=alloca(l); memcpy(x,tmp,l); }) |
---|
67 | #define strndupa(s,n) ({ const char* tmp=s; const char* y=memchr(tmp,0,(n)); size_t l=y?y-tmp:n; char* x=alloca(l+1); x[l]=0; memcpy(x,tmp,l); }) |
---|
68 | #endif |
---|
69 | |
---|
70 | char *strtok(char * s, const char * delim); |
---|
71 | char *strtok_r(char * s, const char * delim, char ** ptrptr); |
---|
72 | |
---|
73 | size_t strlcpy(char * dst, const char * src, size_t size); |
---|
74 | size_t strlcat(char * dst, const char * src, size_t size); |
---|
75 | |
---|
76 | int strcoll(const char *s1, const char *s2); |
---|
77 | size_t strxfrm(char *dest, const char * src, size_t n); |
---|
78 | |
---|
79 | #ifdef _BSD_SOURCE |
---|
80 | #include <strings.h> |
---|
81 | #endif |
---|
82 | |
---|
83 | char *stpcpy(char * dest, const char * src); |
---|
84 | char* stpncpy(char* dest, const char* src, size_t n); |
---|
85 | |
---|
86 | #ifdef _GNU_SOURCE |
---|
87 | int ffsl(long i); |
---|
88 | int ffsll(long long i); |
---|
89 | #endif |
---|
90 | |
---|
91 | #endif |
---|