]> git.ipfire.org Git - thirdparty/gcc.git/blob - libstdc++-v3/include/c_std/std_cstring.h
Makefile.am (doxygen, [...]): Tweak targets.
[thirdparty/gcc.git] / libstdc++-v3 / include / c_std / std_cstring.h
1 // -*- C++ -*- forwarding header.
2
3 // Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
4 //
5 // This file is part of the GNU ISO C++ Library. This library is free
6 // software; you can redistribute it and/or modify it under the
7 // terms of the GNU General Public License as published by the
8 // Free Software Foundation; either version 2, or (at your option)
9 // any later version.
10
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
15
16 // You should have received a copy of the GNU General Public License along
17 // with this library; see the file COPYING. If not, write to the Free
18 // Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
19 // USA.
20
21 // As a special exception, you may use this file as part of a free software
22 // library without restriction. Specifically, if other files instantiate
23 // templates or use macros or inline functions from this file, or you compile
24 // this file and link it with other files to produce an executable, this
25 // file does not by itself cause the resulting executable to be covered by
26 // the GNU General Public License. This exception does not however
27 // invalidate any other reasons why the executable file might be covered by
28 // the GNU General Public License.
29
30 //
31 // ISO C++ 14882: 20.4.6 C library
32 //
33
34 /** @file cstring
35 * This is a Standard C++ Library file. You should @c #include this file
36 * in your programs, rather than any of the "*.h" implementation files.
37 *
38 * This is the C++ version of the Standard C Library header @c string.h,
39 * and its contents are (mostly) the same as that header, but are all
40 * contained in the namespace @c std.
41 */
42
43 #ifndef _CPP_CSTRING
44 #define _CPP_CSTRING 1
45
46 #include <cstddef>
47
48 #pragma GCC system_header
49 #include <string.h>
50
51 // Get rid of those macros defined in <string.h> in lieu of real functions.
52 #undef memcpy
53 #undef memmove
54 #undef strcpy
55 #undef strncpy
56 #undef strcat
57 #undef strncat
58 #undef memcmp
59 #undef strcmp
60 #undef strcoll
61 #undef strncmp
62 #undef strxfrm
63 #undef memchr
64 #undef strchr
65 #undef strcspn
66 #undef strpbrk
67 #undef strrchr
68 #undef strspn
69 #undef strstr
70 #undef strtok
71 #undef memset
72 #undef strerror
73 #undef strlen
74
75 namespace std
76 {
77 using ::memcpy;
78 using ::memmove;
79 using ::strcpy;
80 using ::strncpy;
81 using ::strcat;
82 using ::strncat;
83 using ::memcmp;
84 using ::strcmp;
85 using ::strcoll;
86 using ::strncmp;
87 using ::strxfrm;
88 using ::strcspn;
89 using ::strspn;
90 using ::strtok;
91 using ::memset;
92 using ::strerror;
93 using ::strlen;
94
95 using ::memchr;
96
97 inline void*
98 memchr(void* __p, int __c, size_t __n)
99 { return memchr(const_cast<const void*>(__p), __c, __n); }
100
101 using ::strchr;
102
103 inline char*
104 strchr(char* __s1, int __n)
105 { return __builtin_strchr(const_cast<const char*>(__s1), __n); }
106
107 using ::strpbrk;
108
109 inline char*
110 strpbrk(char* __s1, const char* __s2)
111 { return __builtin_strpbrk(const_cast<const char*>(__s1), __s2); }
112
113 using ::strrchr;
114
115 inline char*
116 strrchr(char* __s1, int __n)
117 { return __builtin_strrchr(const_cast<const char*>(__s1), __n); }
118
119 using ::strstr;
120
121 inline char*
122 strstr(char* __s1, const char* __s2)
123 { return __builtin_strstr(const_cast<const char*>(__s1), __s2); }
124 }
125
126 #endif