summaryrefslogtreecommitdiffstats
path: root/src/include/string.h
blob: be985687a2b2b2b599702a255d44bf5d9b2bd64a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#ifndef _STRING_H_
#define _STRING_H_

#ifndef NULL
#define NULL ((void *) 0)
#endif

#ifndef _SIZE_T
#define _SIZE_T
typedef unsigned int size_t;
#endif

extern char * strerror(int errno);

/*
 * This string-include defines all string functions as inline
 * functions. Use gcc. It also assumes ds=es=data space, this should be
 * normal. Most of the string-functions are rather heavily hand-optimized,
 * see especially strtok,strstr,str[c]spn. They should work, but are not
 * very easy to understand. Everything is done entirely within the register
 * set, making the functions fast and clean. String instructions have been
 * used through-out, making for "slightly" unclear code :-)
 *
 *		(C) 1991 Linus Torvalds
 */
 
extern inline char * strcpy(char * dest,const char *src);
extern inline char * strcat(char * dest,const char * src);
extern inline int strcmp(const char * cs,const char * ct);
extern inline int strspn(const char * cs, const char * ct);
extern inline int strcspn(const char * cs, const char * ct);
extern inline char * strpbrk(const char * cs,const char * ct);
extern inline char * strstr(const char * cs,const char * ct);
extern inline int strlen(const char * s);
extern char * ___strtok;

extern inline char * strtok(char * s,const char * ct);

/*
 * Changes by falcon<zhangjinw@gmail.com>, the original return value is static
 * inline ... it can not be called by other functions in another files.
 */

extern inline void * memcpy(void * dest,const void * src, int n);
extern inline void * memmove(void * dest,const void * src, int n);
extern inline void * memchr(const void * cs,char c,int count);
#endif