Whole document tree std_cstring.hGo to the documentation of this file.00001 // -*- C++ -*- forwarding header. 00002 00003 // Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. 00004 // 00005 // This file is part of the GNU ISO C++ Library. This library is free 00006 // software; you can redistribute it and/or modify it under the 00007 // terms of the GNU General Public License as published by the 00008 // Free Software Foundation; either version 2, or (at your option) 00009 // any later version. 00010 00011 // This library is distributed in the hope that it will be useful, 00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 // GNU General Public License for more details. 00015 00016 // You should have received a copy of the GNU General Public License along 00017 // with this library; see the file COPYING. If not, write to the Free 00018 // Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, 00019 // USA. 00020 00021 // As a special exception, you may use this file as part of a free software 00022 // library without restriction. Specifically, if other files instantiate 00023 // templates or use macros or inline functions from this file, or you compile 00024 // this file and link it with other files to produce an executable, this 00025 // file does not by itself cause the resulting executable to be covered by 00026 // the GNU General Public License. This exception does not however 00027 // invalidate any other reasons why the executable file might be covered by 00028 // the GNU General Public License. 00029 00030 // 00031 // ISO C++ 14882: 20.4.6 C library 00032 // 00033 00034 #ifndef _CPP_CSTRING 00035 #define _CPP_CSTRING 1 00036 00037 #include <bits/std_cstddef.h> 00038 00039 #pragma GCC system_header 00040 #include <string.h> 00041 00042 // Get rid of those macros defined in <string.h> in lieu of real functions. 00043 #undef memcpy 00044 #undef memmove 00045 #undef strcpy 00046 #undef strncpy 00047 #undef strcat 00048 #undef strncat 00049 #undef memcmp 00050 #undef strcmp 00051 #undef strcoll 00052 #undef strncmp 00053 #undef strxfrm 00054 #undef memchr 00055 #undef strchr 00056 #undef strcspn 00057 #undef strpbrk 00058 #undef strrchr 00059 #undef strspn 00060 #undef strstr 00061 #undef strtok 00062 #undef memset 00063 #undef strerror 00064 #undef strlen 00065 00066 namespace std 00067 { 00068 using ::memcpy; 00069 using ::memmove; 00070 using ::strcpy; 00071 using ::strncpy; 00072 using ::strcat; 00073 using ::strncat; 00074 using ::memcmp; 00075 using ::strcmp; 00076 using ::strcoll; 00077 using ::strncmp; 00078 using ::strxfrm; 00079 using ::strcspn; 00080 using ::strspn; 00081 using ::strtok; 00082 using ::memset; 00083 using ::strerror; 00084 using ::strlen; 00085 00086 using ::memchr; 00087 00088 inline void* 00089 memchr(void* __p, int __c, size_t __n) 00090 { return memchr(const_cast<const void*>(__p), __c, __n); } 00091 00092 using ::strchr; 00093 00094 inline char* 00095 strchr(char* __s1, int __n) 00096 { return __builtin_strchr(const_cast<const char*>(__s1), __n); } 00097 00098 using ::strpbrk; 00099 00100 inline char* 00101 strpbrk(char* __s1, const char* __s2) 00102 { return __builtin_strpbrk(const_cast<const char*>(__s1), __s2); } 00103 00104 using ::strrchr; 00105 00106 inline char* 00107 strrchr(char* __s1, int __n) 00108 { return __builtin_strrchr(const_cast<const char*>(__s1), __n); } 00109 00110 using ::strstr; 00111 00112 inline char* 00113 strstr(char* __s1, const char* __s2) 00114 { return __builtin_strstr(const_cast<const char*>(__s1), __s2); } 00115 } 00116 00117 #endif Generated on Mon Apr 8 03:11:33 2002 for libstdc++-v3 Source by ![]() |