libexplain  1.4.D001
libexplain/ac/string.h
Go to the documentation of this file.
00001 /*
00002  * libexplain - Explain errno values returned by libc functions
00003  * Copyright (C) 2008-2010, 2013 Peter Miller
00004  * Written by Peter Miller <pmiller@opensource.org.au>
00005  *
00006  * This program is free software; you can redistribute it and/or modify
00007  * it under the terms of the GNU Lesser General Public License as published by
00008  * the Free Software Foundation; either version 3 of the License, or (at
00009  * your option) any later version.
00010  *
00011  * This program 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 GNU
00014  * Lesser General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU Lesser General Public License
00017  * along with this program. If not, see <http://www.gnu.org/licenses/>.
00018  */
00019 
00020 #ifndef LIBEXPLAIN_AC_STRING_H
00021 #define LIBEXPLAIN_AC_STRING_H
00022 
00028 #include <libexplain/config.h>
00029 
00030 #if STDC_HEADERS || HAVE_STRING_H
00031 #  include <string.h>
00032    /* An ANSI string.h and pre-ANSI memory.h might conflict. */
00033 #  if !STDC_HEADERS && HAVE_MEMORY_H
00034 #    include <memory.h>
00035 #  endif
00036 #else
00037    /* memory.h and strings.h conflict on some systems. */
00038 #  include <strings.h>
00039 #endif
00040 
00041 #ifdef __cplusplus
00042 extern "C" {
00043 #endif
00044 
00045 #if !HAVE_STRCASECMP
00046 int strcasecmp(const char *, const char *);
00047 #endif
00048 
00049 #if !HAVE_STRNCASECMP
00050 int strncasecmp(const char *, const char *, size_t);
00051 #endif
00052 
00053 #if !HAVE_DECL_STRSIGNAL
00054 const char *strsignal(int);
00055 #endif
00056 
00057 const char *explain_strsignal(int);
00058 
00059 #if !HAVE_DECL_STRVERSCMP
00060 int strverscmp(const char *, const char *);
00061 #endif
00062 
00129 char *explain_strendcpy(char *dst, const char *src, const char *end);
00130 
00131 #define strendcpy you_mean_explain_strendcpy!^%
00132 
00133 #undef strcat
00134 #define strcat strcat_is_unsafe__use_strendcpy_instead@
00135 #undef strcpy
00136 #define strcpy strcpy_is_unsafe__use_strendcpy_instead@
00137 
00138 #ifndef HAVE_STRNSTR
00139 char *strnstr(const char *haystack, const char *needle, size_t haystack_size);
00140 #endif
00141 
00142 #ifdef __cplusplus
00143 }
00144 #endif
00145 
00146 #endif /* LIBEXPLAIN_AC_STRING_H */
00147 /* vim: set ts=8 sw=4 et : */