/* Copyright (C) 2008 Andreas Baumann This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #ifndef WOLF_STRING_H #define WOLF_STRING_H /** * @addtogroup wolf_port Porting * @{ */ /** * @file string.h * @brief nivelate things found in string.h, strings.h * @author Andreas Baumann */ #include "port/sys.h" #include /* on some platforms we must also include the old strings.h to get * functions like str(n)casecmp */ #ifdef HAVE_STRINGS_H #include /* for strcasecmp and strncasecmp */ #endif #include /* for size_t */ #if defined _WIN32 #include /* for memcpy */ #endif #if !defined HAVE_STRDUP || defined TEST_STRDUP char *wolf_port_strdup( const char *s ); #endif #if !defined HAVE_STRDUP #define strdup wolf_port_strdup #endif #if !defined HAVE_STRERROR_R || defined TEST_STRERROR_R int wolf_port_strerror_r( int num, char *buf, size_t buflen ); #endif #if !defined HAVE_STRERROR_R #define strerror_r( errnum, buf, buflen ) wolf_port_strerror_r( errnum, buf, buflen ) #endif #if !defined HAVE_STRCASECMP || defined TEST_STRCASECMP int wolf_port_strcasecmp( const char *s1, const char *s2 ); #endif #if !defined HAVE_STRCASECMP #define strcasecmp( s1, s2 ) wolf_port_strcasecmp( s1, s2 ) #endif #if !defined HAVE_STRNCASECMP || defined TEST_STRNCASECMP int wolf_port_strncasecmp( const char *s1, const char *s2, size_t n ); #endif #if !defined HAVE_STRNCASECMP #define strncasecmp( s1, s2, n ) wolf_port_strncasecmp( s1, s2, n ) #endif #if !defined HAVE_STRLCPY || defined TEST_STRLCPY size_t wolf_port_strlcpy( char *d, const char *s, size_t bufsize ); #endif #if !defined HAVE_STRLCPY #define strlcpy( d, s, bufsize ) wolf_port_strlcpy( d, s, bufsize ) #else #if defined MUST_DEFINE_STRLCPY_PROTOTYPE size_t strlcpy( char *d, const char *s, size_t bufsize ); #endif #endif #if !defined HAVE_STRLCAT || defined TEST_STRLCAT size_t wolf_port_strlcat( char *d, const char *s, size_t bufsize ); #endif #if !defined HAVE_STRLCAT #define strlcat( d, s, bufsize ) wolf_port_strlcat( d, s, bufsize ) #else #if defined MUST_DEFINE_STRLCAT_PROTOTYPE size_t strlcat( char *d, const char *s, size_t bufsize ); #endif #endif /** @} */ /* @addtogroup wolf_port */ #endif /* ifndef WOLF_STRING_H */