]> git.lyx.org Git - lyx.git/blob - src/support/snprintf.h
ws cleanup
[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 #if defined(HAVE_DECL_SNPRINTF) || defined(HAVE_DECL_VSNPRINTF)
12 #include <stdio.h>
13 #endif
14 #ifndef HAVE_DECL_SNPRINTF
15 int snprintf(char *, size_t, const char *, /*args*/ ...);
16 #endif
17 #ifndef HAVE_DECL_VSNPRINTF
18 int vsnprintf(char *, size_t, const char *, va_list);
19 #endif
20
21 #if defined(HAVE_SNPRINTF) && defined(PREFER_PORTABLE_SNPRINTF)
22 int portable_snprintf(char *str, size_t str_m, const char *fmt, /*args*/ ...);
23 int portable_vsnprintf(char *str, size_t str_m, const char *fmt, va_list ap);
24 #define snprintf  portable_snprintf
25 #define vsnprintf portable_vsnprintf
26 #endif
27
28 int asprintf  (char **ptr, const char *fmt, /*args*/ ...);
29 int vasprintf (char **ptr, const char *fmt, va_list ap);
30 int asnprintf (char **ptr, size_t str_m, const char *fmt, /*args*/ ...);
31 int vasnprintf(char **ptr, size_t str_m, const char *fmt, va_list ap);
32
33 #ifdef __cplusplus
34 } /* end of extern "C" */
35 #endif
36
37 #endif