Subversion Repositories Kolibri OS

Rev

Rev 4874 | Rev 6099 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
4349 Serge 1
/*
2
 * string.h
3
 *
4
 * Definitions for memory and string functions.
5
 */
6
 
7
#ifndef _STRING_H_
8
#define	_STRING_H_
9
 
10
#include "_ansi.h"
11
#include 
12
#include 
4921 Serge 13
#include 
4349 Serge 14
 
15
#define __need_size_t
4921 Serge 16
#define __need_NULL
4349 Serge 17
#include 
18
 
19
_BEGIN_STD_C
20
 
21
_PTR 	 _EXFUN(memchr,(const _PTR, int, size_t));
22
int 	 _EXFUN(memcmp,(const _PTR, const _PTR, size_t));
4921 Serge 23
_PTR 	 _EXFUN(memcpy,(_PTR __restrict, const _PTR __restrict, size_t));
4349 Serge 24
_PTR	 _EXFUN(memmove,(_PTR, const _PTR, size_t));
25
_PTR	 _EXFUN(memset,(_PTR, int, size_t));
4921 Serge 26
char 	*_EXFUN(strcat,(char *__restrict, const char *__restrict));
4349 Serge 27
char 	*_EXFUN(strchr,(const char *, int));
28
int	 _EXFUN(strcmp,(const char *, const char *));
29
int	 _EXFUN(strcoll,(const char *, const char *));
4921 Serge 30
char 	*_EXFUN(strcpy,(char *__restrict, const char *__restrict));
4349 Serge 31
size_t	 _EXFUN(strcspn,(const char *, const char *));
32
char 	*_EXFUN(strerror,(int));
33
size_t	 _EXFUN(strlen,(const char *));
4921 Serge 34
char 	*_EXFUN(strncat,(char *__restrict, const char *__restrict, size_t));
4349 Serge 35
int	 _EXFUN(strncmp,(const char *, const char *, size_t));
4921 Serge 36
char 	*_EXFUN(strncpy,(char *__restrict, const char *__restrict, size_t));
4349 Serge 37
char 	*_EXFUN(strpbrk,(const char *, const char *));
38
char 	*_EXFUN(strrchr,(const char *, int));
39
size_t	 _EXFUN(strspn,(const char *, const char *));
40
char 	*_EXFUN(strstr,(const char *, const char *));
41
 
42
#ifndef _REENT_ONLY
4921 Serge 43
char 	*_EXFUN(strtok,(char *__restrict, const char *__restrict));
4349 Serge 44
#endif
45
 
4921 Serge 46
size_t	 _EXFUN(strxfrm,(char *__restrict, const char *__restrict, size_t));
4349 Serge 47
 
48
#ifndef __STRICT_ANSI__
4921 Serge 49
char 	*_EXFUN(strtok_r,(char *__restrict, const char *__restrict, char **__restrict));
4349 Serge 50
 
51
int	 _EXFUN(bcmp,(const void *, const void *, size_t));
52
void	 _EXFUN(bcopy,(const void *, void *, size_t));
53
void	 _EXFUN(bzero,(void *, size_t));
54
int	 _EXFUN(ffs,(int));
55
char 	*_EXFUN(index,(const char *, int));
4921 Serge 56
_PTR	 _EXFUN(memccpy,(_PTR __restrict, const _PTR __restrict, int, size_t));
4349 Serge 57
_PTR	 _EXFUN(mempcpy,(_PTR, const _PTR, size_t));
58
_PTR	 _EXFUN(memmem, (const _PTR, size_t, const _PTR, size_t));
4921 Serge 59
_PTR 	 _EXFUN(memrchr,(const _PTR, int, size_t));
60
_PTR 	 _EXFUN(rawmemchr,(const _PTR, int));
4349 Serge 61
char 	*_EXFUN(rindex,(const char *, int));
4921 Serge 62
char 	*_EXFUN(stpcpy,(char *__restrict, const char *__restrict));
63
char 	*_EXFUN(stpncpy,(char *__restrict, const char *__restrict, size_t));
4349 Serge 64
int	 _EXFUN(strcasecmp,(const char *, const char *));
65
char	*_EXFUN(strcasestr,(const char *, const char *));
66
char 	*_EXFUN(strchrnul,(const char *, int));
4921 Serge 67
#endif
68
#if !defined(__STRICT_ANSI__) || (_XOPEN_SOURCE - 0) >= 500
4349 Serge 69
char 	*_EXFUN(strdup,(const char *));
4921 Serge 70
#endif
71
#ifndef __STRICT_ANSI__
4349 Serge 72
char 	*_EXFUN(_strdup_r,(struct _reent *, const char *));
4921 Serge 73
#endif
74
#if !defined(__STRICT_ANSI__) || (_XOPEN_SOURCE - 0) >= 700
4349 Serge 75
char 	*_EXFUN(strndup,(const char *, size_t));
4921 Serge 76
#endif
77
#ifndef __STRICT_ANSI__
4349 Serge 78
char 	*_EXFUN(_strndup_r,(struct _reent *, const char *, size_t));
79
/* There are two common strerror_r variants.  If you request
80
   _GNU_SOURCE, you get the GNU version; otherwise you get the POSIX
81
   version.  POSIX requires that #undef strerror_r will still let you
82
   invoke the underlying function, but that requires gcc support.  */
83
#ifdef _GNU_SOURCE
84
char 	*_EXFUN(strerror_r,(int, char *, size_t));
85
#else
86
# ifdef __GNUC__
87
int      _EXFUN(strerror_r,(int, char *, size_t)) __asm__ (__ASMNAME ("__xpg_strerror_r"));
88
# else
89
int      _EXFUN(__xpg_strerror_r,(int, char *, size_t));
90
#  define strerror_r __xpg_strerror_r
91
# endif
92
#endif
93
size_t	 _EXFUN(strlcat,(char *, const char *, size_t));
94
size_t	 _EXFUN(strlcpy,(char *, const char *, size_t));
95
int	 _EXFUN(strncasecmp,(const char *, const char *, size_t));
96
size_t	 _EXFUN(strnlen,(const char *, size_t));
97
char 	*_EXFUN(strsep,(char **, const char *));
98
char	*_EXFUN(strlwr,(char *));
99
char	*_EXFUN(strupr,(char *));
100
#ifndef DEFS_H	/* Kludge to work around problem compiling in gdb */
101
char  *_EXFUN(strsignal, (int __signo));
102
#endif
103
#ifdef __CYGWIN__
104
int     _EXFUN(strtosigno, (const char *__name));
105
#endif
106
 
107
/* Recursive version of strerror.  */
108
char *	_EXFUN(_strerror_r, (struct _reent *, int, int, int *));
109
 
110
#if defined _GNU_SOURCE && defined __GNUC__
111
#define strdupa(__s) \
112
	(__extension__ ({const char *__in = (__s); \
113
			 size_t __len = strlen (__in) + 1; \
114
			 char * __out = (char *) __builtin_alloca (__len); \
115
			 (char *) memcpy (__out, __in, __len);}))
116
#define strndupa(__s, __n) \
117
	(__extension__ ({const char *__in = (__s); \
118
			 size_t __len = strnlen (__in, (__n)) + 1; \
119
			 char *__out = (char *) __builtin_alloca (__len); \
120
			 __out[__len-1] = '\0'; \
121
			 (char *) memcpy (__out, __in, __len-1);}))
122
#endif /* _GNU_SOURCE && __GNUC__ */
123
 
124
/* These function names are used on Windows and perhaps other systems.  */
125
#ifndef strcmpi
126
#define strcmpi strcasecmp
127
#endif
128
#ifndef stricmp
129
#define stricmp strcasecmp
130
#endif
131
#ifndef strncmpi
132
#define strncmpi strncasecmp
133
#endif
134
#ifndef strnicmp
135
#define strnicmp strncasecmp
136
#endif
137
 
138
#endif /* ! __STRICT_ANSI__ */
139
 
140
#include 
141
 
142
_END_STD_C
143
 
144
#endif /* _STRING_H_ */