Ne.app NeANT
The Ne.app NeANT User module of the NeANT distribution.
string.h
Go to the documentation of this file.
1
29#include <rw/_defs.h>
30
31#ifndef _RWSTD_NO_DEPRECATED_C_HEADERS
32# ifndef _RWSTD_STRING_H_INCLUDED
33# define _RWSTD_STRING_H_INCLUDED
34# include <cstring>
35
36# ifndef _RWSTD_NO_NAMESPACE
37
38using std::size_t;
39
40using std::memchr;
41
42#if !defined (__GNUG__) || __GNUG__ > 2
43
44// predeclared intrinsic functions cannot be redeclared
45using std::memcmp;
46using std::memcpy;
47using std::strcmp;
48using std::strcpy;
49using std::strlen;
50
51#endif // < gcc 3.0
52
53using std::memmove;
54using std::memset;
55using std::strcat;
56using std::strchr;
57using std::strcoll;
58using std::strcspn;
59using std::strerror;
60using std::strncat;
61using std::strncmp;
62using std::strncpy;
63using std::strpbrk;
64using std::strrchr;
65using std::strspn;
66using std::strstr;
67using std::strtok;
68using std::strxfrm;
69
70# endif // _RWSTD_NO_NAMESPACE
71# endif // _RWSTD_STRING_H_INCLUDED
72
73#else
74
75#ifndef _RWSTD_STRING_H_INCLUDED
76#define _RWSTD_STRING_H_INCLUDED
77
78# include _RWSTD_ANSI_C_STRING_H
79
80# undef index
81# undef rindex
82
83# undef strcpy
84# undef strcmp
85
86# undef strlen
87# undef strchr
88# undef strrchr
89# undef strcat
90# undef memchr
91# undef memcpy
92# undef memmove
93# undef memcmp
94# undef memset
95
96# undef memccpy
97# undef strncat
98# undef strncmp
99# undef strncpy
100
101
102#if defined (_RWSTD_NO_MEMCHR) && !defined (_RWSTD_NO_MEMCHR_IN_LIBC)
103
104extern "C" void* memchr (void*, int, _RWSTD_SIZE_T);
105
106inline const void* memchr (const void *__s, int __c, _RWSTD_SIZE_T __n)
107{
108 return memchr (_RWSTD_CONST_CAST (void*, __s), __c, __n);
109}
110
111# undef _RWSTD_NO_MEMCHR
112
113#endif // _RWSTD_NO_MEMCHR && !_RWSTD_NO_MEMCHR_IN_LIBC
114
115
116#if defined (_RWSTD_NO_STRPBRK) && !defined (_RWSTD_NO_STRPBRK_IN_LIBC)
117
118extern "C" char* strpbrk (char*, const char*);
119
120inline const char* strpbrk (const char *__s, const char *__pat)
121{
122 return strpbrk (_RWSTD_CONST_CAST (char*, __s), __pat);
123}
124
125# undef _RWSTD_NO_STRPBRK
126
127#endif // _RWSTD_NO_STRPBRK && !_RWSTD_NO_STRPBRK_IN_LIBC
128
129
130#if defined (_RWSTD_NO_STRCHR) && !defined (_RWSTD_NO_STRCHR_IN_LIBC)
131
132extern "C" char* strchr (char*, int);
133
134inline const char* strchr (const char *__s, int __c)
135{
136 return strchr (_RWSTD_CONST_CAST (char*, __s), __c);
137}
138
139# undef _RWSTD_NO_STRCHR
140
141#endif // _RWSTD_NO_STRCHR && !_RWSTD_NO_STRCHR_IN_LIBC
142
143
144#if defined (_RWSTD_NO_STRRCHR) && !defined (_RWSTD_NO_STRRCHR_IN_LIBC)
145
146extern "C" char* strrchr (char*, int);
147
148inline const char* strrchr (const char *__s, int __c)
149{
150 return strrchr (_RWSTD_CONST_CAST (char*, __s), __c);
151}
152
153# undef _RWSTD_NO_STRRCHR
154
155#endif // _RWSTD_NO_STRRCHR && !_RWSTD_NO_STRRCHR_IN_LIBC
156
157
158#if defined (_RWSTD_NO_STRSTR) && !defined (_RWSTD_NO_STRSTR_IN_LIBC)
159
160extern "C" char* strstr (char*, const char*);
161
162inline const char* strstr (const char *__s1, const char *__s2)
163{
164 return strstr (_RWSTD_CONST_CAST (char*, __s1), __s2);
165}
166
167# undef _RWSTD_NO_STRSTR
168
169#endif // _RWSTD_NO_STRSTR && !_RWSTD_NO_STRSTR_IN_LIBC
170
171# endif // _RWSTD_STRING_H_INCLUDED
172#endif // _RWSTD_NO_DEPRECATED_C_HEADERS
#define _RWSTD_CONST_CAST(T, x)
Definition _defs.h:536