string.h revision 3aeed660
1/*
2 * Copyright 2004-2012 Haiku, Inc. All Rights Reserved.
3 * Distributed under the terms of the MIT License.
4 */
5#ifndef _STRING_H_
6#define _STRING_H_
7
8
9#include <sys/types.h>
10
11
12#ifdef __cplusplus
13extern "C" {
14#endif
15
16
17/* memXXX() functions */
18extern void		*memchr(const void *source, int value, size_t length);
19extern int		memcmp(const void *buffer1, const void *buffer2, size_t length);
20extern void		*memcpy(void *dest, const void *source, size_t length);
21extern void		*memccpy(void *dest, const void *source, int stopByte, size_t length);
22extern void		*memmove(void *dest, const void *source, size_t length);
23extern void		*memset(void *dest, int value, size_t length);
24
25#ifdef _GNU_SOURCE
26extern void		*memrchr(const void *source, int value, size_t length);
27#endif
28
29/* string functions */
30extern char		*strcpy(char *dest, const char *source);
31extern char		*strncpy(char *dest, const char *source, size_t length);
32extern char		*strcat(char *dest, const char *source);
33extern char		*strncat(char *dest, const char *source, size_t length);
34
35extern size_t	strlen(const char *string);
36extern int		strcmp(const char *string1, const char *string2);
37extern int		strncmp(const char *string1, const char *string2, size_t length);
38
39extern char		*strchr(const char *string, int character);
40extern char		*strrchr(const char *string, int character);
41extern char		*strstr(const char *string, const char *searchString);
42
43#ifdef _GNU_SOURCE
44extern char		*strchrnul(const char *string, int character);
45#endif
46
47extern char		*strpbrk(const char *string, const char *set);
48extern char		*strtok(char *string, const char *set);
49extern char		*strtok_r(char *string, const char *set, char **savePointer);
50extern size_t	strspn(const char *string, const char *set);
51extern size_t	strcspn(const char *string, const char *set);
52
53extern int		strcoll(const char *string1, const char *string2);
54extern size_t	strxfrm(char *string1, const char *string2, size_t length);
55
56extern char		*strerror(int errorCode);
57extern int		strerror_r(int errorCode, char *buffer, size_t bufferSize);
58
59extern char		*strcasestr(const char *string, const char *searchString);
60
61extern char		*strdup(const char *string);
62extern char		*strndup(const char* string, size_t size);
63extern char		*stpcpy(char *dest, const char *source);
64
65extern size_t	strlcat(char *dest, const char *source, size_t length);
66extern size_t	strlcpy(char *dest, const char *source, size_t length);
67
68extern size_t	strnlen(const char *string, size_t count);
69
70extern char		*strlwr(char *string);
71extern char		*strupr(char *string);
72
73/* extern char		*strsep(char **stringPointer, const char *delimiter); */
74
75extern const char	*strsignal(int signum);
76
77#ifdef __cplusplus
78}
79#endif
80
81#endif  /* _STRING_H_ */
82