HaikuDepot: notify work status from main window
[haiku.git] / src / tools / fs_shell / string.cpp
blobe6094a4ddd446dc3601a7c04d159db305a7c0ac4
1 /*
2 * Copyright 2007, Ingo Weinhold, bonefish@cs.tu-berlin.de.
3 * Distributed under the terms of the MIT License.
4 */
6 #include "compatibility.h"
8 #include "fssh_string.h"
10 #include <string.h>
11 #include <strings.h>
14 void*
15 fssh_memchr(const void *source, int value, fssh_size_t length)
17 return memchr((void*)source, value, length);
21 int
22 fssh_memcmp(const void *buffer1, const void *buffer2, fssh_size_t length)
24 return memcmp(buffer1, buffer2, length);
28 void*
29 fssh_memcpy(void *dest, const void *source, fssh_size_t length)
31 return memcpy(dest, source, length);
35 #if 0
36 void*
37 fssh_memccpy(void *dest, const void *source, int stopByte, fssh_size_t length)
39 return memccpy(dest, source, stopByte, length);
41 #endif // 0
44 void*
45 fssh_memmove(void *dest, const void *source, fssh_size_t length)
47 return memmove(dest, source, length);
51 void*
52 fssh_memset(void *dest, int value, fssh_size_t length)
54 return memset(dest, value, length);
58 char*
59 fssh_strcpy(char *dest, const char *source)
61 return strcpy(dest, source);
65 char*
66 fssh_strncpy(char *dest, const char *source, fssh_size_t length)
68 return strncpy(dest, source, length);
72 char*
73 fssh_strcat(char *dest, const char *source)
75 return strcat(dest, source);
79 char*
80 fssh_strncat(char *dest, const char *source, fssh_size_t length)
82 return strncat(dest, source, length);
86 fssh_size_t
87 fssh_strlen(const char *string)
89 return strlen(string);
93 int
94 fssh_strcmp(const char *string1, const char *string2)
96 return strcmp(string1, string2);
101 fssh_strncmp(const char *string1, const char *string2, fssh_size_t length)
103 return strncmp(string1, string2, length);
107 char*
108 fssh_strchr(const char *string, int character)
110 return strchr((char*)string, character);
114 char*
115 fssh_strrchr(const char *string, int character)
117 return strrchr((char*)string, character);
121 char*
122 fssh_strstr(const char *string, const char *searchString)
124 return strstr((char*)string, searchString);
128 #if 0
129 char*
130 fssh_strchrnul(const char *string, int character)
133 #endif // 0
136 char*
137 fssh_strpbrk(const char *string, const char *set)
139 return strpbrk((char*)string, set);
143 char*
144 fssh_strtok(char *string, const char *set)
146 return strtok(string, set);
150 char*
151 fssh_strtok_r(char *string, const char *set, char **savePointer)
153 return strtok_r(string, set, savePointer);
157 fssh_size_t
158 fssh_strspn(const char *string, const char *set)
160 return strspn(string, set);
164 fssh_size_t
165 fssh_strcspn(const char *string, const char *set)
167 return strcspn(string, set);
172 fssh_strcoll(const char *string1, const char *string2)
174 return strcoll(string1, string2);
178 fssh_size_t
179 fssh_strxfrm(char *string1, const char *string2, fssh_size_t length)
181 return strxfrm(string1, string2, length);
185 char*
186 fssh_strerror(int errorCode)
188 return strerror(errorCode);
192 #if 0
194 fssh_strerror_r(int errorCode, char *buffer, fssh_size_t bufferSize)
196 return strerror_r(errorCode, buffer, bufferSize);
198 #endif // 0
202 fssh_strcasecmp(const char *string1, const char *string2)
204 return strcasecmp(string1, string2);
209 fssh_strncasecmp(const char *string1, const char *string2, fssh_size_t length)
211 return strncasecmp(string1, string2, length);
215 #if 0
216 char*
217 fssh_strcasestr(const char *string, const char *searchString)
219 return strcasestr(string, searchString);
221 #endif // 0
224 char*
225 fssh_strdup(const char *string)
227 if (!string)
228 return NULL;
229 return strdup(string);
233 char*
234 fssh_stpcpy(char *dest, const char *source)
236 return stpcpy(dest, source);
240 #if 0
241 const char *
242 fssh_strtcopy(char *dest, const char *source)
244 return strtcopy(dest, source);
246 #endif // 0
249 fssh_size_t
250 fssh_strlcat(char *dest, const char *source, fssh_size_t length)
252 return strlcat(dest, source, length);
256 fssh_size_t
257 fssh_strlcpy(char *dest, const char *source, fssh_size_t length)
259 return strlcpy(dest, source, length);
263 fssh_size_t
264 fssh_strnlen(const char *string, fssh_size_t count)
266 return strnlen(string, count);
271 fssh_ffs(int i)
273 return ffs(i);
277 #if 0
278 char*
279 fssh_index(const char *s, int c)
281 return index(s, c);
283 #endif // 0
286 #if 0
287 char*
288 fssh_rindex(char const *s, int c)
290 return rindex(s, c);
292 #endif // 0