diff options
Diffstat (limited to 'src/libstrongswan/library.c')
-rw-r--r-- | src/libstrongswan/library.c | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/src/libstrongswan/library.c b/src/libstrongswan/library.c index f561f2451..0394f32d7 100644 --- a/src/libstrongswan/library.c +++ b/src/libstrongswan/library.c @@ -1,8 +1,8 @@ /** * @file library.c - * + * * @brief Library (de-)initialization. - * + * */ /* @@ -21,23 +21,22 @@ * for more details. */ -#include <utils/logger_manager.h> -#include <utils/leak_detective.h> +#include <stdarg.h> +#include <stdio.h> -/** - * Called whenever the library is linked from a process - */ -void __attribute__ ((constructor)) library_init(void) -{ - logger_manager_init(); - leak_detective_init(); -} +#include "library.h" /** - * Called whenever the library is unlinked from a process + * default dbg function which printf all to stderr */ -void __attribute__ ((destructor)) library_cleanup(void) +static void dbg_stderr(int level, char *fmt, ...) { - leak_detective_cleanup(); - logger_manager_cleanup(); + va_list args; + + va_start(args, fmt); + vfprintf(stderr, fmt, args); + fprintf(stderr, "\n"); + va_end(args); } + +void (*dbg) (int level, char *fmt, ...) = dbg_stderr; |