]> git.lyx.org Git - lyx.git/blob - src/support/snprintf.h
Create a grfx::Loader class and so move large chunks of code out of
[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 #ifndef CXX_GLOBAL_CSTD
12 using std::size_t;
13 using std::va_list;
14 #endif
15
16 #if defined(HAVE_DECL_SNPRINTF) || defined(HAVE_DECL_VSNPRINTF)
17 #include <stdio.h>
18 #endif
19 #ifndef HAVE_DECL_SNPRINTF
20 int snprintf(char *, size_t, const char *, /*args*/ ...);
21 #endif
22 #ifndef HAVE_DECL_VSNPRINTF
23 int vsnprintf(char *, size_t, const char *, va_list);
24 #endif
25
26 #if defined(HAVE_SNPRINTF) && defined(PREFER_PORTABLE_SNPRINTF)
27 int portable_snprintf(char *str, size_t str_m, const char *fmt, /*args*/ ...);
28 int portable_vsnprintf(char *str, size_t str_m, const char *fmt, va_list ap);
29 #define snprintf  portable_snprintf
30 #define vsnprintf portable_vsnprintf
31 #endif
32
33 int asprintf  (char **ptr, const char *fmt, /*args*/ ...);
34 int vasprintf (char **ptr, const char *fmt, va_list ap);
35 int asnprintf (char **ptr, size_t str_m, const char *fmt, /*args*/ ...);
36 int vasnprintf(char **ptr, size_t str_m, const char *fmt, va_list ap);
37
38 #ifdef __cplusplus
39 } /* end of extern "C" */
40 #endif
41
42 #endif