]> git.ipfire.org Git - thirdparty/strongswan.git/blob - src/libstrongswan/utils/printf_hook/printf_hook_vstr.h
Update copyright headers after acquisition by secunet
[thirdparty/strongswan.git] / src / libstrongswan / utils / printf_hook / printf_hook_vstr.h
1 /*
2 * Copyright (C) 2009 Tobias Brunner
3 * Copyright (C) 2006-2008 Martin Willi
4 *
5 * Copyright (C) secunet Security Networks AG
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 * for more details.
16 */
17
18 /**
19 * @defgroup printf_hook_vstr printf_hook_vstr
20 * @{ @ingroup printf_hook
21 */
22
23 #ifndef PRINTF_HOOK_VSTR_H_
24 #define PRINTF_HOOK_VSTR_H_
25
26 #include <stdarg.h>
27 #include <stdio.h>
28
29 int vstr_wrapper_printf(const char *format, ...);
30 int vstr_wrapper_fprintf(FILE *stream, const char *format, ...);
31 int vstr_wrapper_sprintf(char *str, const char *format, ...);
32 int vstr_wrapper_snprintf(char *str, size_t size, const char *format, ...);
33 int vstr_wrapper_asprintf(char **str, const char *format, ...);
34
35 int vstr_wrapper_vprintf(const char *format, va_list ap);
36 int vstr_wrapper_vfprintf(FILE *stream, const char *format, va_list ap);
37 int vstr_wrapper_vsprintf(char *str, const char *format, va_list ap);
38 int vstr_wrapper_vsnprintf(char *str, size_t size, const char *format, va_list ap);
39 int vstr_wrapper_vasprintf(char **str, const char *format, va_list ap);
40
41 #ifdef printf
42 #undef printf
43 #endif
44 #ifdef fprintf
45 #undef fprintf
46 #endif
47 #ifdef sprintf
48 #undef sprintf
49 #endif
50 #ifdef snprintf
51 #undef snprintf
52 #endif
53 #ifdef asprintf
54 #undef asprintf
55 #endif
56 #ifdef vprintf
57 #undef vprintf
58 #endif
59 #ifdef vfprintf
60 #undef vfprintf
61 #endif
62 #ifdef vsprintf
63 #undef vsprintf
64 #endif
65 #ifdef vsnprintf
66 #undef vsnprintf
67 #endif
68 #ifdef vasprintf
69 #undef vasprintf
70 #endif
71
72 #define printf vstr_wrapper_printf
73 #define fprintf vstr_wrapper_fprintf
74 #define sprintf vstr_wrapper_sprintf
75 #define snprintf vstr_wrapper_snprintf
76 #define asprintf vstr_wrapper_asprintf
77
78 #define vprintf vstr_wrapper_vprintf
79 #define vfprintf vstr_wrapper_vfprintf
80 #define vsprintf vstr_wrapper_vsprintf
81 #define vsnprintf vstr_wrapper_vsnprintf
82 #define vasprintf vstr_wrapper_vasprintf
83
84 #endif /** PRINTF_HOOK_VSTR_H_ @}*/