1/* 2 * Copyright 2004-2007, Haiku Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5#ifndef _FSSH_STRING_H 6#define _FSSH_STRING_H 7 8 9#include "fssh_defs.h" 10 11 12#ifdef __cplusplus 13extern "C" { 14#endif 15 16 17/* memXXX() functions */ 18extern void *fssh_memchr(const void *source, int value, fssh_size_t length); 19extern int fssh_memcmp(const void *buffer1, const void *buffer2, 20 fssh_size_t length); 21extern void *fssh_memcpy(void *dest, const void *source, 22 fssh_size_t length); 23extern void *fssh_memccpy(void *dest, const void *source, int stopByte, 24 fssh_size_t length); 25extern void *fssh_memmove(void *dest, const void *source, 26 fssh_size_t length); 27extern void *fssh_memset(void *dest, int value, fssh_size_t length); 28 29/* string functions */ 30extern char *fssh_strcpy(char *dest, const char *source); 31extern char *fssh_strncpy(char *dest, const char *source, 32 fssh_size_t length); 33extern char *fssh_strcat(char *dest, const char *source); 34extern char *fssh_strncat(char *dest, const char *source, 35 fssh_size_t length); 36 37extern fssh_size_t fssh_strlen(const char *string); 38extern int fssh_strcmp(const char *string1, const char *string2); 39extern int fssh_strncmp(const char *string1, const char *string2, 40 fssh_size_t length); 41 42extern char *fssh_strchr(const char *string, int character); 43extern char *fssh_strrchr(const char *string, int character); 44extern char *fssh_strstr(const char *string, const char *searchString); 45 46extern char *fssh_strchrnul(const char *string, int character); 47 // this is a GNU extension 48 49extern char *fssh_strpbrk(const char *string, const char *set); 50extern char *fssh_strtok(char *string, const char *set); 51extern char *fssh_strtok_r(char *string, const char *set, 52 char **savePointer); 53extern fssh_size_t fssh_strspn(const char *string, const char *set); 54extern fssh_size_t fssh_strcspn(const char *string, const char *set); 55 56extern int fssh_strcoll(const char *string1, const char *string2); 57extern fssh_size_t fssh_strxfrm(char *string1, const char *string2, 58 fssh_size_t length); 59 60extern char *fssh_strerror(int errorCode); 61extern int fssh_strerror_r(int errorCode, char *buffer, 62 fssh_size_t bufferSize); 63 64/* non-standard string functions */ 65extern int fssh_strcasecmp(const char *string1, const char *string2); 66extern int fssh_strncasecmp(const char *string1, const char *string2, 67 fssh_size_t length); 68 69extern char *fssh_strcasestr(const char *string, const char *searchString); 70 71extern char *fssh_strdup(const char *string); 72extern char *fssh_stpcpy(char *dest, const char *source); 73extern const char *fssh_strtcopy(char *dest, const char *source); 74 75extern fssh_size_t fssh_strlcat(char *dest, const char *source, 76 fssh_size_t length); 77extern fssh_size_t fssh_strlcpy(char *dest, const char *source, 78 fssh_size_t length); 79 80extern fssh_size_t fssh_strnlen(const char *string, fssh_size_t count); 81 82extern int fssh_ffs(int i); 83extern char *fssh_index(const char *s, int c); 84extern char *fssh_rindex(char const *s, int c); 85 86 87#ifdef __cplusplus 88} 89#endif 90 91#endif /* _FSSH_STRING_H */ 92