cstring

Go to the documentation of this file.
00001 // -*- C++ -*- forwarding header.
00002 
00003 // Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
00004 // 2006, 2007, 2008, 2009
00005 // Free Software Foundation, Inc.
00006 //
00007 // This file is part of the GNU ISO C++ Library.  This library is free
00008 // software; you can redistribute it and/or modify it under the
00009 // terms of the GNU General Public License as published by the
00010 // Free Software Foundation; either version 3, or (at your option)
00011 // any later version.
00012 
00013 // This library is distributed in the hope that it will be useful,
00014 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00015 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016 // GNU General Public License for more details.
00017 
00018 // Under Section 7 of GPL version 3, you are granted additional
00019 // permissions described in the GCC Runtime Library Exception, version
00020 // 3.1, as published by the Free Software Foundation.
00021 
00022 // You should have received a copy of the GNU General Public License and
00023 // a copy of the GCC Runtime Library Exception along with this program;
00024 // see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
00025 // <http://www.gnu.org/licenses/>.
00026 
00027 /** @file cstring
00028  *  This is a Standard C++ Library file.  You should @c #include this file
00029  *  in your programs, rather than any of the "*.h" implementation files.
00030  *
00031  *  This is the C++ version of the Standard C Library header @c string.h,
00032  *  and its contents are (mostly) the same as that header, but are all
00033  *  contained in the namespace @c std (except for names which are defined
00034  *  as macros in C).
00035  */
00036 
00037 //
00038 // ISO C++ 14882: 20.4.6  C library
00039 //
00040 
00041 #pragma GCC system_header
00042 
00043 #include <bits/c++config.h>
00044 #include <cstddef>
00045 #include <string.h>
00046 
00047 #ifndef _GLIBCXX_CSTRING
00048 #define _GLIBCXX_CSTRING 1
00049 
00050 // Get rid of those macros defined in <string.h> in lieu of real functions.
00051 #undef memchr
00052 #undef memcmp
00053 #undef memcpy
00054 #undef memmove
00055 #undef memset
00056 #undef strcat
00057 #undef strchr
00058 #undef strcmp
00059 #undef strcoll
00060 #undef strcpy
00061 #undef strcspn
00062 #undef strerror
00063 #undef strlen
00064 #undef strncat
00065 #undef strncmp
00066 #undef strncpy
00067 #undef strpbrk
00068 #undef strrchr
00069 #undef strspn
00070 #undef strstr
00071 #undef strtok
00072 #undef strxfrm
00073 
00074 _GLIBCXX_BEGIN_NAMESPACE(std)
00075 
00076   using ::memchr;
00077   using ::memcmp;
00078   using ::memcpy;
00079   using ::memmove;
00080   using ::memset;
00081   using ::strcat;
00082   using ::strcmp;
00083   using ::strcoll;
00084   using ::strcpy;
00085   using ::strcspn;
00086   using ::strerror;
00087   using ::strlen;
00088   using ::strncat;
00089   using ::strncmp;
00090   using ::strncpy;
00091   using ::strspn;
00092   using ::strtok;
00093   using ::strxfrm;
00094   using ::strchr;
00095   using ::strpbrk;
00096   using ::strrchr;
00097   using ::strstr;
00098 
00099 #ifndef __CORRECT_ISO_CPP_STRING_H_PROTO
00100   inline void*
00101   memchr(void* __p, int __c, size_t __n)
00102   { return memchr(const_cast<const void*>(__p), __c, __n); }
00103 
00104   inline char*
00105   strchr(char* __s1, int __n)
00106   { return __builtin_strchr(const_cast<const char*>(__s1), __n); }
00107 
00108   inline char*
00109   strpbrk(char* __s1, const char* __s2)
00110   { return __builtin_strpbrk(const_cast<const char*>(__s1), __s2); }
00111 
00112   inline char*
00113   strrchr(char* __s1, int __n)
00114   { return __builtin_strrchr(const_cast<const char*>(__s1), __n); }
00115 
00116   inline char*
00117   strstr(char* __s1, const char* __s2)
00118   { return __builtin_strstr(const_cast<const char*>(__s1), __s2); }
00119 #endif
00120 
00121 _GLIBCXX_END_NAMESPACE
00122 
00123 #endif

Generated on Thu Jul 23 21:16:02 2009 for libstdc++ by  doxygen 1.5.8