Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

snprintf.h

Go to the documentation of this file.
00001 #ifndef _PORTABLE_SNPRINTF_H_
00002 #define _PORTABLE_SNPRINTF_H_
00003 
00004 #define PORTABLE_SNPRINTF_VERSION_MAJOR 2
00005 #define PORTABLE_SNPRINTF_VERSION_MINOR 2
00006 
00007 #ifdef HAVE_SNPRINTF
00008 #include <stdio.h>
00009 #else
00010 extern int snprintf(char *, size_t, const char *, /*args*/ ...);
00011 extern int vsnprintf(char *, size_t, const char *, va_list);
00012 #endif
00013 
00014 /* XCONQ HACK: We always want to get these functions and their 
00015    prototypes, so we "fake" having snprintf(3) even if the 
00016    system doesn't provide it, because the following will 
00017    actually handle both the absent and the present cases.
00018 */
00019 #ifndef HAVE_SNPRINTF
00020 #define HAVE_SNPRINTF
00021 #endif
00022 #ifndef PREFER_PORTABLE_SNPRINTF
00023 #define PREFER_PORTABLE_SNPRINTF
00024 #endif
00025 
00026 #if defined(HAVE_SNPRINTF) && defined(PREFER_PORTABLE_SNPRINTF)
00027 extern int portable_snprintf(char *str, size_t str_m, const char *fmt, /*args*/ ...);
00028 extern int portable_vsnprintf(char *str, size_t str_m, const char *fmt, va_list ap);
00029 #define snprintf  portable_snprintf
00030 #define vsnprintf portable_vsnprintf
00031 #endif
00032 
00033 extern int asprintf  (char **ptr, const char *fmt, /*args*/ ...);
00034 extern int vasprintf (char **ptr, const char *fmt, va_list ap);
00035 extern int asnprintf (char **ptr, size_t str_m, const char *fmt, /*args*/ ...);
00036 extern int vasnprintf(char **ptr, size_t str_m, const char *fmt, va_list ap);
00037 
00038 #endif

Generated on Sat Sep 17 10:28:53 2005 for XconqKernel by doxygen 1.3.6