2000-10-13 16:23:09 +00:00
|
|
|
#ifndef _PORTABLE_SNPRINTF_H_
|
|
|
|
#define _PORTABLE_SNPRINTF_H_
|
|
|
|
|
|
|
|
#define PORTABLE_SNPRINTF_VERSION_MAJOR 2
|
|
|
|
#define PORTABLE_SNPRINTF_VERSION_MINOR 1
|
|
|
|
|
2000-10-16 13:27:56 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
2002-03-21 17:09:55 +00:00
|
|
|
|
2002-06-10 07:57:39 +00:00
|
|
|
#ifndef CXX_GLOBAL_CSTD
|
|
|
|
using std::size_t;
|
|
|
|
using std::va_list;
|
|
|
|
#endif
|
|
|
|
|
2001-02-06 15:17:11 +00:00
|
|
|
#if defined(HAVE_DECL_SNPRINTF) || defined(HAVE_DECL_VSNPRINTF)
|
2000-10-13 16:23:09 +00:00
|
|
|
#include <stdio.h>
|
2001-02-06 15:17:11 +00:00
|
|
|
#endif
|
|
|
|
#ifndef HAVE_DECL_SNPRINTF
|
2000-10-16 13:27:56 +00:00
|
|
|
int snprintf(char *, size_t, const char *, /*args*/ ...);
|
2001-02-06 15:17:11 +00:00
|
|
|
#endif
|
|
|
|
#ifndef HAVE_DECL_VSNPRINTF
|
2000-10-16 13:27:56 +00:00
|
|
|
int vsnprintf(char *, size_t, const char *, va_list);
|
2000-10-13 16:23:09 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(HAVE_SNPRINTF) && defined(PREFER_PORTABLE_SNPRINTF)
|
2000-10-16 13:27:56 +00:00
|
|
|
int portable_snprintf(char *str, size_t str_m, const char *fmt, /*args*/ ...);
|
|
|
|
int portable_vsnprintf(char *str, size_t str_m, const char *fmt, va_list ap);
|
2000-10-13 16:23:09 +00:00
|
|
|
#define snprintf portable_snprintf
|
|
|
|
#define vsnprintf portable_vsnprintf
|
|
|
|
#endif
|
|
|
|
|
2000-10-16 13:27:56 +00:00
|
|
|
int asprintf (char **ptr, const char *fmt, /*args*/ ...);
|
|
|
|
int vasprintf (char **ptr, const char *fmt, va_list ap);
|
|
|
|
int asnprintf (char **ptr, size_t str_m, const char *fmt, /*args*/ ...);
|
|
|
|
int vasnprintf(char **ptr, size_t str_m, const char *fmt, va_list ap);
|
2000-10-13 16:23:09 +00:00
|
|
|
|
2000-10-16 13:27:56 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
} /* end of extern "C" */
|
|
|
|
#endif
|
2002-03-21 17:09:55 +00:00
|
|
|
|
2000-10-13 16:23:09 +00:00
|
|
|
#endif
|