/* * AOPPA -- A program for extracting the AnarchyOnline resource database * Prototypes for misc.cc. * * Copyright (C) 2002, 2003 Oskari Saarenmaa * * $Id: misc.h,v 1.7 2003/12/16 06:59:01 pickett Exp $ * * 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 2 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, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * */ #ifndef _AOPPA_MISC_H #define _AOPPA_MISC_H #if defined(_GNU_SOURCE) && !defined(__linux__) #undef _GNU_SOURCE #endif /* _GNU_SOURCE && !__linux__ */ #if defined(_GNU_SOURCE) || defined(__NetBSD__) #define HAVE_ASPRINTF #endif /* _GNU_SOURCE || __NetBSD__ */ #if defined(_GNU_SOURCE) #define HAVE_STRNDUP #define HAVE_MEMMEM #endif /* _GNU_SOURCE */ unsigned int crc32(const unsigned char *, size_t); #define DEBUG_SERIOUS 0 #define DEBUG_INFO 4 #define DEBUG_VERBOSE 6 extern int g_debug; void debugf(int, const char *, ...); #ifndef HAVE_MEMMEM void * memmem(const void *, size_t, const void *, size_t); #endif /* !HAVE_MEMMEM */ #ifndef HAVE_STRNDUP char * strndup(const char *, unsigned int); #endif /* !HAVE_STRNDUP */ #ifndef HAVE_ASPRINTF int asprintf(char **, const char *, ...); #endif /* !HAVE_ASPRINTF */ #endif /* !_AOPPA_MISC_H */