C Standard Library Extensions  1.1
snprintf.h
00001 /* $Id: snprintf.h,v 1.8 2012/03/06 16:35:50 rpalsa Exp $
00002  *
00003  * This file is part of the ESO C Extension Library
00004  * Copyright (C) 2001-2011 European Southern Observatory
00005  *
00006  * This program is free software; you can redistribute it and/or modify
00007  * it under the terms of the GNU General Public License as published by
00008  * the Free Software Foundation; either version 2 of the License, or
00009  * (at 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
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software
00018  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00019  */
00020 
00021 #ifndef CX_SNPRINTF_H
00022 #define CX_SNPRINTF_H
00023 
00024 #ifdef HAVE_CONFIG_H
00025 #  include <config.h>
00026 #endif
00027 
00028 #ifdef HAVE_STDDEF_H
00029 #  include <stdarg.h>
00030 #endif
00031 
00032 #ifdef HAVE_STDDEF_H
00033 #  include <stddef.h>
00034 #endif
00035 
00036 /* Just for defining the CX_BEGIN_DECLS and CX_END_DECLS symbols. */
00037 #include <cxtypes.h>
00038 
00039 
00040 /* Define aliases for the replacement functions */
00041 
00042 #if ! defined(HAVE_SNPRINTF)
00043 #  define snprintf   rpl_snprintf
00044 #endif
00045 
00046 #if ! defined(HAVE_VSNPRINTF)
00047 #  define vsnprintf  rpl_vsnprintf
00048 #endif
00049 
00050 #if ! defined(HAVE_ASPRINTF)
00051 #  define asprintf  rpl_asprintf
00052 #endif
00053 
00054 #if ! defined(HAVE_VASPRINTF)
00055 #  define vasprintf  rpl_vasprintf
00056 #endif
00057 
00058 
00059 CX_BEGIN_DECLS
00060 
00061 #if ! defined(HAVE_SNPRINTF)
00062 int rpl_snprintf(char *str, size_t size, const char *fmt, ...);
00063 #endif
00064 
00065 #if ! defined(HAVE_VSNPRINTF)
00066 int rpl_vsnprintf(char *str, size_t size, const char *fmt, va_list args);
00067 #endif
00068 
00069 #if ! defined(HAVE_ASPRINTF)
00070 int rpl_asprintf(char **str, const char *fmt, ...);
00071 #endif
00072 
00073 #if ! defined(HAVE_VASPRINTF)
00074 int rpl_vasprintf(char **str, const char *fmt, va_list args);
00075 #endif
00076 
00077 CX_END_DECLS
00078 
00079 #endif /* CX_SNPRINTF_H */