diff options
author | Rene Mayrhofer <rene@mayrhofer.eu.org> | 2009-03-22 10:06:21 +0000 |
---|---|---|
committer | Rene Mayrhofer <rene@mayrhofer.eu.org> | 2009-03-22 10:06:21 +0000 |
commit | 7b88a5ce44f52abb13390c6c105bdd58a590a626 (patch) | |
tree | abfb7e16a76d3d65af2c809c949b747a874e33fd /src/libstrongswan/enum.c | |
parent | 3c810543672b76a7c9b871420866f822f8b067d8 (diff) | |
download | vyos-strongswan-7b88a5ce44f52abb13390c6c105bdd58a590a626.tar.gz vyos-strongswan-7b88a5ce44f52abb13390c6c105bdd58a590a626.zip |
- New upstream version.
Diffstat (limited to 'src/libstrongswan/enum.c')
-rw-r--r-- | src/libstrongswan/enum.c | 38 |
1 files changed, 6 insertions, 32 deletions
diff --git a/src/libstrongswan/enum.c b/src/libstrongswan/enum.c index 5eb283807..32524d225 100644 --- a/src/libstrongswan/enum.c +++ b/src/libstrongswan/enum.c @@ -12,7 +12,7 @@ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * - * $Id: enum.c 3589 2008-03-13 14:14:44Z martin $ + * $Id: enum.c 4936 2009-03-12 18:07:32Z tobias $ */ #include <stddef.h> @@ -20,8 +20,6 @@ #include "enum.h" -#include <printf_hook.h> - /** * get the name of an enum value in a enum_name_t list */ @@ -39,10 +37,10 @@ static char *enum_name(enum_name_t *e, int val) } /** - * output handler in printf() for enum names + * Described in header. */ -static int print(FILE *stream, const struct printf_info *info, - const void *const *args) +int enum_printf_hook(char *dst, size_t len, printf_hook_spec_t *spec, + const void *const *args) { enum_name_t *ed = *((enum_name_t**)(args[0])); int val = *((int*)(args[1])); @@ -51,34 +49,10 @@ static int print(FILE *stream, const struct printf_info *info, if (name == NULL) { - return fprintf(stream, "(%d)", val); + return print_in_hook(dst, len, "(%d)", val); } else { - return fprintf(stream, "%s", name); - } -} - -/** - * arginfo handler for printf() hook - */ -static int arginfo(const struct printf_info *info, size_t n, int *argtypes) -{ - if (n > 1) - { - argtypes[0] = PA_POINTER; - argtypes[1] = PA_INT; + return print_in_hook(dst, len, "%s", name); } - return 2; } - -/** - * return printf hook functions - */ -printf_hook_functions_t enum_get_printf_hooks() -{ - printf_hook_functions_t hooks = {print, arginfo}; - - return hooks; -} - |