diff options
Diffstat (limited to 'src/include/string.h')
-rw-r--r-- | src/include/string.h | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/src/include/string.h b/src/include/string.h new file mode 100644 index 0000000..be98568 --- /dev/null +++ b/src/include/string.h | |||
@@ -0,0 +1,47 @@ | |||
1 | #ifndef _STRING_H_ | ||
2 | #define _STRING_H_ | ||
3 | |||
4 | #ifndef NULL | ||
5 | #define NULL ((void *) 0) | ||
6 | #endif | ||
7 | |||
8 | #ifndef _SIZE_T | ||
9 | #define _SIZE_T | ||
10 | typedef unsigned int size_t; | ||
11 | #endif | ||
12 | |||
13 | extern char * strerror(int errno); | ||
14 | |||
15 | /* | ||
16 | * This string-include defines all string functions as inline | ||
17 | * functions. Use gcc. It also assumes ds=es=data space, this should be | ||
18 | * normal. Most of the string-functions are rather heavily hand-optimized, | ||
19 | * see especially strtok,strstr,str[c]spn. They should work, but are not | ||
20 | * very easy to understand. Everything is done entirely within the register | ||
21 | * set, making the functions fast and clean. String instructions have been | ||
22 | * used through-out, making for "slightly" unclear code :-) | ||
23 | * | ||
24 | * (C) 1991 Linus Torvalds | ||
25 | */ | ||
26 | |||
27 | extern inline char * strcpy(char * dest,const char *src); | ||
28 | extern inline char * strcat(char * dest,const char * src); | ||
29 | extern inline int strcmp(const char * cs,const char * ct); | ||
30 | extern inline int strspn(const char * cs, const char * ct); | ||
31 | extern inline int strcspn(const char * cs, const char * ct); | ||
32 | extern inline char * strpbrk(const char * cs,const char * ct); | ||
33 | extern inline char * strstr(const char * cs,const char * ct); | ||
34 | extern inline int strlen(const char * s); | ||
35 | extern char * ___strtok; | ||
36 | |||
37 | extern inline char * strtok(char * s,const char * ct); | ||
38 | |||
39 | /* | ||
40 | * Changes by falcon<zhangjinw@gmail.com>, the original return value is static | ||
41 | * inline ... it can not be called by other functions in another files. | ||
42 | */ | ||
43 | |||
44 | extern inline void * memcpy(void * dest,const void * src, int n); | ||
45 | extern inline void * memmove(void * dest,const void * src, int n); | ||
46 | extern inline void * memchr(const void * cs,char c,int count); | ||
47 | #endif | ||