Aegis  4.25.D505
/home/archives/aegis/branch.4/branch.25/delta28933.505/common/ac/string.h
Go to the documentation of this file.
00001 //
00002 //      aegis - a project change supervisor
00003 //      Copyright (C) 1994, 1996, 1997, 2002, 2004-2009, 2012 Peter Miller
00004 //
00005 //      This program is free software; you can redistribute it and/or
00006 //      modify it under the terms of the GNU General Public License as
00007 //      published by the Free Software Foundation; either version 3 of
00008 //      the License, or (at your option) any later version.
00009 //
00010 //      This program is distributed in the hope that it will be useful,
00011 //      but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 //      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 //      GNU General Public License for more details.
00014 //
00015 //      You should have received a copy of the GNU General Public License
00016 //      along with this program. If not, see
00017 //      <http://www.gnu.org/licenses/>.
00018 //
00019 
00020 #ifndef COMMON_AC_STRING_H
00021 #define COMMON_AC_STRING_H
00022 
00023 #include <common/config.h>
00024 
00025 #if STDC_HEADERS || HAVE_STRING_H
00026 #  include <string.h>
00027    // An ANSI string.h and pre-ANSI memory.h might conflict.
00028 #  if !STDC_HEADERS && HAVE_MEMORY_H
00029 #    include <memory.h>
00030 #  endif
00031 #else
00032    // memory.h and strings.h conflict on some systems.
00033 #  include <strings.h>
00034 #endif
00035 
00036 extern "C" {
00037 
00038 #if !HAVE_STRCASECMP
00039 int strcasecmp(const char *, const char *);
00040 #endif
00041 
00042 #if !HAVE_STRNCASECMP
00043 int strncasecmp(const char *, const char *, size_t);
00044 #endif
00045 
00046 #if !HAVE_DECL_STRSIGNAL
00047 const char *strsignal(int);
00048 #endif
00049 
00050 #if !HAVE_STRVERSCMP
00051 int strverscmp(const char *, const char *);
00052 #endif
00053 
00054 #if !HAVE_STRLCPY
00055 size_t strlcpy(char *dst, const char *src, size_t size);
00056 #endif
00057 #if !HAVE_STRLCAT
00058 size_t strlcat(char *dst, const char *src, size_t size);
00059 #endif
00060 
00061 #if !HAVE_STRENDCPY
00062 
00128 char *strendcpy(char *dst, const char *src, const char *end);
00129 #endif
00130 
00131 #undef strcat
00132 #define strcat strcat_is_unsafe__use_strendcat_instead@
00133 #undef strcpy
00134 #define strcpy strcpy_is_unsafe__use_strendcpy_instead@
00135 
00136 #ifndef HAVE_MEMMEM
00137 void *memmem(const void *, size_t, const void *, size_t);
00138 #endif
00139 const void *memmem_replacement(const void *, size_t, const void *, size_t);
00140 
00141 // It is possible memmem is present, but severely broken.  See the GNU
00142 // libc memmem(3) man page for just how broken it can get.
00143 #define memmem memmem_replacement
00144 
00145 }
00146 
00147 #endif // COMMON_AC_STRING_H
00148 // vim: set ts=8 sw=4 et :