2004-11-03 14:45:47 +00:00
|
|
|
/*
|
2012-07-19 18:11:40 +00:00
|
|
|
* Copyright 2004-2012 Haiku, Inc. All Rights Reserved.
|
2004-11-03 14:45:47 +00:00
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
2002-09-17 14:51:59 +00:00
|
|
|
#ifndef _STRING_H_
|
|
|
|
#define _STRING_H_
|
2004-11-03 14:45:47 +00:00
|
|
|
|
2002-09-17 14:51:59 +00:00
|
|
|
|
2022-05-30 13:55:46 +07:00
|
|
|
#include <locale_t.h>
|
2002-09-17 14:51:59 +00:00
|
|
|
#include <sys/types.h>
|
|
|
|
|
2004-11-03 14:45:47 +00:00
|
|
|
|
2002-09-17 14:51:59 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
/* memXXX() functions */
|
|
|
|
extern void *memchr(const void *source, int value, size_t length);
|
|
|
|
extern int memcmp(const void *buffer1, const void *buffer2, size_t length);
|
|
|
|
extern void *memcpy(void *dest, const void *source, size_t length);
|
2005-10-31 12:18:55 +00:00
|
|
|
extern void *memccpy(void *dest, const void *source, int stopByte, size_t length);
|
2002-09-17 14:51:59 +00:00
|
|
|
extern void *memmove(void *dest, const void *source, size_t length);
|
|
|
|
extern void *memset(void *dest, int value, size_t length);
|
2024-10-31 20:34:19 +01:00
|
|
|
extern void *memmem(const void *source, size_t sourceLength,
|
|
|
|
const void *search, size_t searchLength);
|
2002-09-17 14:51:59 +00:00
|
|
|
|
2024-09-16 13:33:23 -04:00
|
|
|
#ifdef _DEFAULT_SOURCE
|
2012-01-05 00:03:08 +01:00
|
|
|
extern void *memrchr(const void *source, int value, size_t length);
|
|
|
|
#endif
|
|
|
|
|
2002-09-17 14:51:59 +00:00
|
|
|
/* string functions */
|
|
|
|
extern char *strcpy(char *dest, const char *source);
|
|
|
|
extern char *strncpy(char *dest, const char *source, size_t length);
|
|
|
|
extern char *strcat(char *dest, const char *source);
|
|
|
|
extern char *strncat(char *dest, const char *source, size_t length);
|
|
|
|
|
|
|
|
extern size_t strlen(const char *string);
|
|
|
|
extern int strcmp(const char *string1, const char *string2);
|
|
|
|
extern int strncmp(const char *string1, const char *string2, size_t length);
|
|
|
|
|
|
|
|
extern char *strchr(const char *string, int character);
|
|
|
|
extern char *strrchr(const char *string, int character);
|
|
|
|
extern char *strstr(const char *string, const char *searchString);
|
|
|
|
|
2024-09-16 13:33:23 -04:00
|
|
|
#ifdef _DEFAULT_SOURCE
|
2003-05-03 16:06:48 +00:00
|
|
|
extern char *strchrnul(const char *string, int character);
|
2012-01-05 00:03:08 +01:00
|
|
|
#endif
|
2003-05-03 16:06:48 +00:00
|
|
|
|
2002-09-17 14:51:59 +00:00
|
|
|
extern char *strpbrk(const char *string, const char *set);
|
|
|
|
extern char *strtok(char *string, const char *set);
|
|
|
|
extern char *strtok_r(char *string, const char *set, char **savePointer);
|
|
|
|
extern size_t strspn(const char *string, const char *set);
|
|
|
|
extern size_t strcspn(const char *string, const char *set);
|
|
|
|
|
|
|
|
extern int strcoll(const char *string1, const char *string2);
|
|
|
|
extern size_t strxfrm(char *string1, const char *string2, size_t length);
|
|
|
|
|
2002-11-01 02:58:34 +00:00
|
|
|
extern char *strerror(int errorCode);
|
2003-11-05 23:52:25 +00:00
|
|
|
extern int strerror_r(int errorCode, char *buffer, size_t bufferSize);
|
2002-09-17 14:51:59 +00:00
|
|
|
|
|
|
|
extern char *strcasestr(const char *string, const char *searchString);
|
|
|
|
|
|
|
|
extern char *strdup(const char *string);
|
2009-01-18 20:27:12 +00:00
|
|
|
extern char *strndup(const char* string, size_t size);
|
2002-09-17 14:51:59 +00:00
|
|
|
extern char *stpcpy(char *dest, const char *source);
|
2023-11-28 20:36:26 -05:00
|
|
|
extern char *stpncpy(char *dest, const char *source, size_t size);
|
2002-09-17 14:51:59 +00:00
|
|
|
|
|
|
|
extern size_t strlcat(char *dest, const char *source, size_t length);
|
|
|
|
extern size_t strlcpy(char *dest, const char *source, size_t length);
|
|
|
|
|
|
|
|
extern size_t strnlen(const char *string, size_t count);
|
|
|
|
|
2008-07-02 19:30:46 +00:00
|
|
|
extern char *strlwr(char *string);
|
|
|
|
extern char *strupr(char *string);
|
2002-09-17 14:51:59 +00:00
|
|
|
|
2008-05-10 21:30:34 +00:00
|
|
|
/* extern char *strsep(char **stringPointer, const char *delimiter); */
|
2002-09-17 14:51:59 +00:00
|
|
|
|
2013-10-01 17:13:58 +02:00
|
|
|
extern const char *strsignal(int signum);
|
2002-09-17 14:51:59 +00:00
|
|
|
|
2022-05-30 13:55:46 +07:00
|
|
|
/* locale versions of string functions */
|
|
|
|
extern int strcoll_l(const char *string1, const char *string2, locale_t locale);
|
|
|
|
extern char *strerror_l(int errorCode, locale_t locale);
|
|
|
|
extern size_t strxfrm_l(char *string1, const char *string2, size_t length, locale_t locale);
|
|
|
|
|
2014-10-30 00:17:37 +01:00
|
|
|
/* for compatibility, pull in functions declared in strings.h */
|
|
|
|
#include <strings.h>
|
|
|
|
|
|
|
|
|
2002-09-17 14:51:59 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* _STRING_H_ */
|