From f73fba54dc8b30c6482e1e8abf15bbf455592fcd Mon Sep 17 00:00:00 2001 From: Rene Mayrhofer Date: Sun, 28 Nov 2010 11:42:20 +0000 Subject: [svn-upgrade] new version strongswan (4.5.0) --- src/libstrongswan/enum.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/libstrongswan/enum.h') diff --git a/src/libstrongswan/enum.h b/src/libstrongswan/enum.h index 691f9f2bc..d5f169772 100644 --- a/src/libstrongswan/enum.h +++ b/src/libstrongswan/enum.h @@ -106,6 +106,24 @@ struct enum_name_t { */ #define ENUM(name, first, last, ...) ENUM_BEGIN(name, first, last, __VA_ARGS__); ENUM_END(name, last) +/** + * Convert a enum value to its string representation. + * + * @param e enum names for this enum value + * @param val enum value to get string for + * @return string for enum, NULL if not found + */ +char *enum_to_name(enum_name_t *e, int val); + +/** + * Convert a enum string back to its enum value. + * + * @param e enum names for this enum value + * @param name name to get enum value for + * @return enum value, -1 if not found + */ +int enum_from_name(enum_name_t *e, char *name); + /** * printf hook function for enum_names_t. * -- cgit v1.2.3