summaryrefslogtreecommitdiff
path: root/src/libstrongswan/enum.c
diff options
context:
space:
mode:
authorRene Mayrhofer <rene@mayrhofer.eu.org>2009-03-22 09:52:39 +0000
committerRene Mayrhofer <rene@mayrhofer.eu.org>2009-03-22 09:52:39 +0000
commit7a229aeb240cc750546f55ad089022f0ca7dc44f (patch)
treed1767cb9d72b52a79a5b74e570fd57d0a0e87c1c /src/libstrongswan/enum.c
parent19364e11c66714324bd3d5d0dc9212db397085cb (diff)
downloadvyos-strongswan-7a229aeb240cc750546f55ad089022f0ca7dc44f.tar.gz
vyos-strongswan-7a229aeb240cc750546f55ad089022f0ca7dc44f.zip
[svn-upgrade] Integrating new upstream version, strongswan (4.2.13)
Diffstat (limited to 'src/libstrongswan/enum.c')
-rw-r--r--src/libstrongswan/enum.c38
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;
-}
-