1 // The -*- C++ -*- null-terminated string header.
2 // This file is part of the GNU ANSI C++ Library.
9 #if 0 // Let's not bother with this just yet.
13 #pragma interface "cstring"
16 // The ANSI C prototypes for these functions have a const argument type and
17 // non-const return type, so we can't use them.
20 extern inline const char *
21 _G_strchr (const char *s, int c)
27 _G_strchr (char *s, int c)
29 return const_cast<char *> (strchr (s, c));
32 extern inline const char *
33 _G_strpbrk (const char *s1, const char *s2)
35 return strpbrk (s1, s2);
39 _G_strpbrk (char *s1, const char *s2)
41 return const_cast<char *> (strpbrk (s1, s2));
44 extern inline const char *
45 _G_strrchr (const char *s, int c)
47 return strrchr (s, c);
51 _G_strrchr (char *s, int c)
53 return const_cast<char *> (strrchr (s, c));
56 extern inline const char *
57 _G_strstr (const char *s1, const char *s2)
59 return strstr (s1, s2);
63 _G_strstr (char *s1, const char *s2)
65 return const_cast<char *> (strstr (s1, s2));
68 extern inline const void *
69 _G_memchr (const void *s, int c, size_t n)
71 return memchr (s, c, n);
75 _G_memchr (void *s, int c, size_t n)
77 return const_cast<void *> (memchr (s, c, n));
81 // Lose any vendor macros for these functions.
88 // Ewww, namespace pollution. Anyone have a better idea?
89 #define strchr _G_strchr
90 #define strpbrk _G_strpbrk
91 #define strrchr _G_strrchr
92 #define strstr _G_strstr
93 #define memchr _G_memchr
96 #endif // !defined (__CSTRING__)