00001
00002
00003
00004 #ifndef _PORTABLE_SNPRINTF_H_
00005 #define _PORTABLE_SNPRINTF_H_
00006
00007 #define PORTABLE_SNPRINTF_VERSION_MAJOR 2
00008 #define PORTABLE_SNPRINTF_VERSION_MINOR 2
00009
00010 #ifdef HAVE_SNPRINTF
00011 #include <stdio.h>
00012 #else
00013 int snprintf(char *, size_t, const char *, ...);
00014 int vsnprintf(char *, size_t, const char *, va_list);
00015 #endif
00016
00017 #if defined(HAVE_SNPRINTF) && defined(PREFER_PORTABLE_SNPRINTF)
00018 int portable_snprintf(char *str, size_t str_m, const char *fmt, ...);
00019 int portable_vsnprintf(char *str, size_t str_m, const char *fmt, va_list ap);
00020 #define snprintf portable_snprintf
00021 #define vsnprintf portable_vsnprintf
00022 #endif
00023
00024 typedef int gint;
00025 typedef char gchar;
00026 gint vasprintf (gchar **string, gchar const *format, va_list args);
00027 int vasnprintf(char **ptr, size_t str_m, const char *fmt, va_list ap);
00028
00029 int asprintf (char **ptr, const char *fmt, ...);
00030
00031 int asnprintf (char **ptr, size_t str_m, const char *fmt, ...);
00032
00033
00034 #endif