From b610bf2f9f7ba628095d4cae73e8066a7527ca12 Mon Sep 17 00:00:00 2001 From: Mathieu Rene Date: Sat, 20 Jun 2009 03:37:15 +0000 Subject: [PATCH] Implement new config parser in mod_voicemail git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13879 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/include/switch_xml_config.h | 17 +++-------------- src/switch_xml_config.c | 16 ++++++++++++++++ 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/src/include/switch_xml_config.h b/src/include/switch_xml_config.h index eac9da0763..4cd0df62ff 100644 --- a/src/include/switch_xml_config.h +++ b/src/include/switch_xml_config.h @@ -106,20 +106,9 @@ struct switch_xml_config_item { #define SWITCH_CONFIG_SET_ITEM(_item, _key, _type, _flags, _ptr, _defaultvalue, _data, _syntax, _helptext) switch_config_perform_set_item(&(_item), _key, _type, _flags, _ptr, (void*)(_defaultvalue), _data, NULL, _syntax, _helptext) #define SWITCH_CONFIG_SET_ITEM_CALLBACK(_item, _key, _type, _flags, _ptr, _defaultvalue, _data, _function, _syntax, _helptext) switch_config_perform_set_item(&(_item), _key, _type, _flags, _ptr, (void*)(_defaultvalue), _data, _function, _syntax, _helptext) -inline void switch_config_perform_set_item(switch_xml_config_item_t *item, const char *key, switch_xml_config_type_t type, int flags, void *ptr, - const void* defaultvalue, void *data, switch_xml_config_callback_t function, const char *syntax, const char *helptext) -{ - item->key = key; - item->type = type; - item->flags = flags; - item->ptr = ptr; - item->defaultvalue = defaultvalue; - item->data = data; - item->function = function; - item->syntax = syntax; - item->helptext = helptext; -} - +SWITCH_DECLARE(void) switch_config_perform_set_item(switch_xml_config_item_t *item, const char *key, switch_xml_config_type_t type, int flags, void *ptr, + const void* defaultvalue, void *data, switch_xml_config_callback_t function, const char *syntax, const char *helptext); + /*! * \brief Gets the int representation of an enum * \param enum_options the switch_xml_config_enum_item_t array for this enum diff --git a/src/switch_xml_config.c b/src/switch_xml_config.c index d2ce9e6d24..48147a059a 100644 --- a/src/switch_xml_config.c +++ b/src/switch_xml_config.c @@ -425,6 +425,22 @@ SWITCH_DECLARE(void) switch_xml_config_cleanup(switch_xml_config_item_t *instruc } } + +SWITCH_DECLARE(void) switch_config_perform_set_item(switch_xml_config_item_t *item, const char *key, switch_xml_config_type_t type, int flags, void *ptr, + const void* defaultvalue, void *data, switch_xml_config_callback_t function, const char *syntax, const char *helptext) +{ + item->key = key; + item->type = type; + item->flags = flags; + item->ptr = ptr; + item->defaultvalue = defaultvalue; + item->data = data; + item->function = function; + item->syntax = syntax; + item->helptext = helptext; +} + + /* For Emacs: * Local Variables: * mode:c