/**
 * \file   uclibc/lib/include/cstring
 * \brief  
 *
 * \date   05/19/2004
 * \author Alexander Warg  <alexander.warg@os.inf.tu-dresden.de>
 */
/* (c) 2004 Technische Universitaet Dresden
 * This file is part of DROPS, which is distributed under the terms of the
 * GNU General Public License 2. Please see the COPYING file for details.
 */
/* -*- c++ -*- */

#ifndef CSTRING_INCLUDE
#define CSTRING_INCLUDE

extern "C" {
#include <string.h>
}

namespace std {
#if(__GNUC__>=3) 

  // gcc pre 3.0 treats std:: as ::
  // so the following usings produce
  // already defined errors

  using ::memcpy;
  using ::memccpy;
  using ::memmove;
  // using ::memccmp; -- not in uClibc
  using ::memcmp;
  using ::memset;
  using ::memchr;

  
  using ::strcpy;
  using ::strncpy;
  using ::strcat;
  using ::strncat;
  using ::strcmp;
  using ::strncmp;
  using ::strlen;
  using ::strspn;
  using ::strcspn;
  using ::strcoll;

  
  using ::strpbrk;
  using ::strrchr;
  using ::strchr;
  using ::strstr;


  // gcc pre 3.0 also don't know the __builtin_xxx
  // functions

  inline char*
  strpbrk(char* __s1, const char* __s2)
  { return __builtin_strpbrk(const_cast<const char*>(__s1), __s2); }



  inline char*
  strrchr(char* __s1, int __n)
  { return __builtin_strrchr(const_cast<const char*>(__s1), __n); }



  inline char*
  strchr(char* __s1, int __n)
  { return __builtin_strchr(const_cast<const char*>(__s1), __n); }



  inline char*
  strstr(char* __s1, const char* __s2)
  { return __builtin_strstr(const_cast<const char*>(__s1), __s2); }

#endif
  
};


#endif
