The introduced SHA1_NOFINAL hasher was not sufficient for EAP-AKA,
[strongswan.git] / src / libstrongswan / printf_hook.h
1 /*
2 * Copyright (C) 2006-2008 Martin Willi
3 * Hochschule fuer Technik Rapperswil
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * for more details.
14 *
15 * $Id$
16 */
17
18 /**
19 * @defgroup printf_hook printf_hook
20 * @{ @ingroup libstrongswan
21 */
22
23 #ifndef PRINTF_HOOK_H_
24 #define PRINTF_HOOK_H_
25
26 typedef struct printf_hook_t printf_hook_t;
27 typedef struct printf_hook_functions_t printf_hook_functions_t;
28
29 #include <printf.h>
30
31 /**
32 * Printf hook function set.
33 *
34 * A printf hook has two functions, one to print the string, one to read
35 * in the number of arguments. See <printf.h>.
36 */
37 struct printf_hook_functions_t {
38
39 /**
40 * Printf hook print function
41 */
42 printf_function *print;
43
44 /**
45 * Printf hook arginfo function
46 */
47 printf_arginfo_function *arginfo;
48 };
49
50 /**
51 * Printf handler management.
52 */
53 struct printf_hook_t {
54
55 /**
56 * Register a printf handler.
57 *
58 * @param spec printf hook format character
59 * @param hook hook functions
60 */
61 void (*add_handler)(printf_hook_t *this, char spec,
62 printf_hook_functions_t hook);
63
64 /**
65 * Destroy a printf_hook instance.
66 */
67 void (*destroy)(printf_hook_t *this);
68 };
69
70 /**
71 * Create a printf_hook instance.
72 */
73 printf_hook_t *printf_hook_create();
74
75 #endif /* PRINTF_HOOK_H_ @}*/