pull over a fix from openbeos.
[newos.git] / include / string.h
blob107bf37078e611810b6c5ff216f459042b018d3b
1 /*
2 ** Copyright 2001, Travis Geiselbrecht. All rights reserved.
3 ** Copyright 2002, Manuel J. Petit. All rights reserved.
4 ** Distributed under the terms of the NewOS License.
5 */
7 #ifndef __newos__libc_string__hh__
8 #define __newos__libc_string__hh__
10 #include <stddef.h>
11 #include <arch/string.h>
13 #ifdef __cplusplus
14 namespace std
15 {extern "C" {
16 #endif
19 void *memchr (void const *, int, size_t);
20 int memcmp (void const *, const void *, size_t);
21 void *memcpy (void *, void const *, size_t);
22 void *memmove(void *, void const *, size_t);
23 void *memset (void *, int, size_t);
25 char *strcat(char *, char const *);
26 char *strchr(char const *, int);
27 int strcmp(char const *, char const *);
28 char *strcpy(char *, char const *);
29 char const *strerror(int);
30 size_t strlen(char const *);
31 char *strncat(char *, char const *, size_t);
32 int strncmp(char const *, char const *, size_t);
33 char *strncpy(char *, char const *, size_t);
34 char *strpbrk(char const *, char const *);
35 char *strrchr(char const *, int);
36 size_t strspn(char const *, char const *);
37 size_t strcspn(const char *s, const char *);
38 char *strstr(char const *, char const *);
39 char *strtok(char *, char const *);
40 int strcoll(const char *s1, const char *s2);
41 size_t strxfrm(char *dest, const char *src, size_t n);
42 char *strdup(const char *str);
44 #ifdef __cplusplus
45 }} /* extern "C" */
46 #endif
48 #ifdef __cplusplus
49 extern "C"
51 #endif
53 /* non standard */
54 void *bcopy(void const *, void *, size_t);
55 void bzero(void *, size_t);
56 size_t strlcat(char *, char const *, size_t);
57 size_t strlcpy(char *, char const *, size_t);
58 int strncasecmp(char const *, char const *, size_t);
59 int strnicmp(char const *, char const *, size_t);
60 size_t strnlen(char const *s, size_t count);
62 #ifdef __cplusplus
64 #endif
66 #if defined(__cplusplus) && !defined(_NEWOS_NO_LIBC_COMPAT)
68 using ::std::memchr;
69 using ::std::memcmp;
70 using ::std::memcpy;
71 using ::std::memmove;
72 using ::std::memset;
74 using ::std::memchr;
75 using ::std::memcmp;
76 using ::std::memcpy;
77 using ::std::memmove;
78 using ::std::memset;
79 using ::std::strcat;
80 using ::std::strchr;
81 using ::std::strcmp;
82 using ::std::strcoll;
83 using ::std::strcpy;
84 using ::std::strspn;
85 using ::std::strcspn;
86 using ::std::strerror;
87 //using ::std::atrerror;
88 using ::std::strlen;
89 using ::std::strncat;
90 using ::std::strncmp;
91 using ::std::strncpy;
92 using ::std::strpbrk;
93 using ::std::strrchr;
94 //using ::std::strapn;
95 using ::std::strstr;
96 using ::std::strtok;
97 using ::std::strxfrm;
98 using ::std::strdup;
100 #endif
102 #endif