2 * Copyright 2007, Ingo Weinhold, bonefish@cs.tu-berlin.de.
3 * Distributed under the terms of the MIT License.
6 #include "compatibility.h"
8 #include "fssh_string.h"
15 fssh_memchr(const void *source
, int value
, fssh_size_t length
)
17 return memchr((void*)source
, value
, length
);
22 fssh_memcmp(const void *buffer1
, const void *buffer2
, fssh_size_t length
)
24 return memcmp(buffer1
, buffer2
, length
);
29 fssh_memcpy(void *dest
, const void *source
, fssh_size_t length
)
31 return memcpy(dest
, source
, length
);
37 fssh_memccpy(void *dest
, const void *source
, int stopByte
, fssh_size_t length
)
39 return memccpy(dest
, source
, stopByte
, length
);
45 fssh_memmove(void *dest
, const void *source
, fssh_size_t length
)
47 return memmove(dest
, source
, length
);
52 fssh_memset(void *dest
, int value
, fssh_size_t length
)
54 return memset(dest
, value
, length
);
59 fssh_strcpy(char *dest
, const char *source
)
61 return strcpy(dest
, source
);
66 fssh_strncpy(char *dest
, const char *source
, fssh_size_t length
)
68 return strncpy(dest
, source
, length
);
73 fssh_strcat(char *dest
, const char *source
)
75 return strcat(dest
, source
);
80 fssh_strncat(char *dest
, const char *source
, fssh_size_t length
)
82 return strncat(dest
, source
, length
);
87 fssh_strlen(const char *string
)
89 return strlen(string
);
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
);
108 fssh_strchr(const char *string
, int character
)
110 return strchr((char*)string
, character
);
115 fssh_strrchr(const char *string
, int character
)
117 return strrchr((char*)string
, character
);
122 fssh_strstr(const char *string
, const char *searchString
)
124 return strstr((char*)string
, searchString
);
130 fssh_strchrnul(const char *string
, int character
)
137 fssh_strpbrk(const char *string
, const char *set
)
139 return strpbrk((char*)string
, set
);
144 fssh_strtok(char *string
, const char *set
)
146 return strtok(string
, set
);
151 fssh_strtok_r(char *string
, const char *set
, char **savePointer
)
153 return strtok_r(string
, set
, savePointer
);
158 fssh_strspn(const char *string
, const char *set
)
160 return strspn(string
, set
);
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
);
179 fssh_strxfrm(char *string1
, const char *string2
, fssh_size_t length
)
181 return strxfrm(string1
, string2
, length
);
186 fssh_strerror(int errorCode
)
188 return strerror(errorCode
);
194 fssh_strerror_r(int errorCode
, char *buffer
, fssh_size_t bufferSize
)
196 return strerror_r(errorCode
, buffer
, bufferSize
);
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
);
217 fssh_strcasestr(const char *string
, const char *searchString
)
219 return strcasestr(string
, searchString
);
225 fssh_strdup(const char *string
)
229 return strdup(string
);
234 fssh_stpcpy(char *dest
, const char *source
)
236 return stpcpy(dest
, source
);
242 fssh_strtcopy(char *dest
, const char *source
)
244 return strtcopy(dest
, source
);
250 fssh_strlcat(char *dest
, const char *source
, fssh_size_t length
)
252 return strlcat(dest
, source
, length
);
257 fssh_strlcpy(char *dest
, const char *source
, fssh_size_t length
)
259 return strlcpy(dest
, source
, length
);
264 fssh_strnlen(const char *string
, fssh_size_t count
)
266 return strnlen(string
, count
);
279 fssh_index(const char *s
, int c
)
288 fssh_rindex(char const *s
, int c
)