00001 /* 00002 * snprintf.h 00003 * header file for snprintf.c 00004 * 00005 * $Id: snprintf.h,v 1.23 2011/02/13 14:19:33 simple Exp $ 00006 */ 00007 /* 00008 * Copyright (C) 2000 - 2011 Eggheads Development Team 00009 * 00010 * This program is free software; you can redistribute it and/or 00011 * modify it under the terms of the GNU General Public License 00012 * as published by the Free Software Foundation; either version 2 00013 * of the License, or (at your option) any later version. 00014 * 00015 * This program is distributed in the hope that it will be useful, 00016 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00018 * GNU General Public License for more details. 00019 * 00020 * You should have received a copy of the GNU General Public License 00021 * along with this program; if not, write to the Free Software 00022 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00023 */ 00024 00025 #ifndef _EGG_COMPAT_SNPRINTF_H_ 00026 #define _EGG_COMPAT_SNPRINTF_H_ 00027 00028 #include "src/main.h" 00029 #include <stdio.h> 00030 00031 /* Check for broken snprintf versions */ 00032 #ifdef BROKEN_SNPRINTF 00033 # ifdef HAVE_VSNPRINTF 00034 # undef HAVE_VSNPRINTF 00035 # endif 00036 # ifdef HAVE_SNPRINTF 00037 # undef HAVE_SNPRINTF 00038 # endif 00039 #endif 00040 00041 /* Use the system libraries version of vsnprintf() if available. Otherwise 00042 * use our own. 00043 */ 00044 #ifndef HAVE_VSNPRINTF 00045 int egg_vsnprintf(char *str, size_t count, const char *fmt, va_list ap); 00046 #else 00047 # define egg_vsnprintf vsnprintf 00048 #endif 00049 00050 /* Use the system libraries version of snprintf() if available. Otherwise 00051 * use our own. 00052 */ 00053 #ifndef HAVE_SNPRINTF 00054 # ifdef __STDC__ 00055 int egg_snprintf(char *str, size_t count, const char *fmt, ...); 00056 # else 00057 int egg_snprintf(); 00058 # endif 00059 #else 00060 # define egg_snprintf snprintf 00061 #endif 00062 00063 #endif /* !_EGG_COMPAT_SNPRINTF_H_ */