]> git.lyx.org Git - lyx.git/blob - src/support/snprintf.h
fix a couple of hard crashes, constify local variables, whitespace changes, some...
[lyx.git] / src / support / snprintf.h
1 #ifndef _PORTABLE_SNPRINTF_H_
2 #define _PORTABLE_SNPRINTF_H_
3
4 #define PORTABLE_SNPRINTF_VERSION_MAJOR 2
5 #define PORTABLE_SNPRINTF_VERSION_MINOR 1
6
7 #ifdef __cplusplus
8 extern "C" {
9 #endif
10   
11 #ifdef HAVE_SNPRINTF
12 #include <stdio.h>
13 #else
14 int snprintf(char *, size_t, const char *, /*args*/ ...);
15 int vsnprintf(char *, size_t, const char *, va_list);
16 #endif
17
18 #if defined(HAVE_SNPRINTF) && defined(PREFER_PORTABLE_SNPRINTF)
19 int portable_snprintf(char *str, size_t str_m, const char *fmt, /*args*/ ...);
20 int portable_vsnprintf(char *str, size_t str_m, const char *fmt, va_list ap);
21 #define snprintf  portable_snprintf
22 #define vsnprintf portable_vsnprintf
23 #endif
24
25 int asprintf  (char **ptr, const char *fmt, /*args*/ ...);
26 int vasprintf (char **ptr, const char *fmt, va_list ap);
27 int asnprintf (char **ptr, size_t str_m, const char *fmt, /*args*/ ...);
28 int vasnprintf(char **ptr, size_t str_m, const char *fmt, va_list ap);
29
30 #ifdef __cplusplus
31 } /* end of extern "C" */
32 #endif
33   
34 #endif