OSDN Git Service

2002-01-16 Benjamin Kosnik <bkoz@redhat.com>
[pf3gnuchains/gcc-fork.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 #ifndef _CPP_CSTRING
35 #define _CPP_CSTRING 1
36
37 #include <cstddef>
38
39 #pragma GCC system_header
40 #include <string.h>
41
42 // Get rid of those macros defined in <string.h> in lieu of real functions.
43 #undef memcpy
44 #undef memmove
45 #undef strcpy
46 #undef strncpy
47 #undef strcat
48 #undef strncat
49 #undef memcmp
50 #undef strcmp
51 #undef strcoll
52 #undef strncmp
53 #undef strxfrm
54 #undef memchr
55 #undef strchr
56 #undef strcspn
57 #undef strpbrk
58 #undef strrchr
59 #undef strspn
60 #undef strstr
61 #undef strtok
62 #undef memset
63 #undef strerror
64 #undef strlen
65
66 namespace std 
67 {
68   using ::memcpy;
69   using ::memmove;
70   using ::strcpy;
71   using ::strncpy;
72   using ::strcat;
73   using ::strncat;
74   using ::memcmp;
75   using ::strcmp;
76   using ::strcoll;
77   using ::strncmp;
78   using ::strxfrm;
79   using ::strcspn;
80   using ::strspn;
81   using ::strtok;
82   using ::memset;
83   using ::strerror;
84   using ::strlen;
85
86   using ::memchr;
87
88   inline void*
89   memchr(void* __p, int __c, size_t __n)
90   { return memchr(const_cast<const void*>(__p), __c, __n); }
91
92   using ::strchr;
93
94   inline char*
95   strchr(char* __s1, int __n)
96   { return __builtin_strchr(const_cast<const char*>(__s1), __n); }
97
98   using ::strpbrk;
99
100   inline char*
101   strpbrk(char* __s1, const char* __s2)
102   { return __builtin_strpbrk(const_cast<const char*>(__s1), __s2); }
103
104   using ::strrchr;
105
106   inline char*
107   strrchr(char* __s1, int __n)
108   { return __builtin_strrchr(const_cast<const char*>(__s1), __n); }
109
110   using ::strstr;
111
112   inline char*
113   strstr(char* __s1, const char* __s2)
114   { return __builtin_strstr(const_cast<const char*>(__s1), __s2); }
115 }
116
117 #endif