]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
xml_config tweaks
authorMathieu Rene <mrene@avgs.ca>
Sat, 6 Jun 2009 19:10:37 +0000 (19:10 +0000)
committerMathieu Rene <mrene@avgs.ca>
Sat, 6 Jun 2009 19:10:37 +0000 (19:10 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13665 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/include/switch_xml_config.h

index 35bb0d7e75102a19c84f3f8ee5d5ba4136854133..f66b447b0a6bb7ea55e8140670824c60f9576192 100644 (file)
@@ -98,11 +98,32 @@ struct switch_xml_config_item {
        char *helptext;                                                 /*< Optional documentation text for this setting */
 };
 
-#define SWITCH_CONFIG_ITEM(_key, _type, _flags, _ptr, _defaultvalue, _data, _syntax, _helptext)        { _key, _type, _flags, _ptr, _defaultvalue, _data, NULL, _syntax, _helptext }
-#define SWITCH_CONFIG_ITEM_STRING_STRDUP(_key, _flags, _ptr, _defaultvalue, _syntax, _helptext)        { _key, SWITCH_CONFIG_STRING, _flags, _ptr, _defaultvalue, &switch_config_string_strdup, NULL, _helptext}
-#define SWITCH_CONFIG_ITEM_CALLBACK(_key, _type, _flags, _ptr, _defaultvalue, _data, _functiondata, _syntax, _helptext)        { _key, _type, _flags, _ptr, _defaultvalue, _functiondata, _data, _syntax, _helptext }
+#define SWITCH_CONFIG_ITEM(_key, _type, _flags, _ptr, _defaultvalue, _data, _syntax, _helptext)        { _key, _type, _flags, _ptr, (void*)_defaultvalue, (void*)_data, NULL, _syntax, _helptext }
+#define SWITCH_CONFIG_ITEM_STRING_STRDUP(_key, _flags, _ptr, _defaultvalue, _syntax, _helptext)        { _key, SWITCH_CONFIG_STRING, _flags, _ptr, (void*)_defaultvalue, &switch_config_string_strdup, NULL, _syntax, _helptext }
+#define SWITCH_CONFIG_ITEM_CALLBACK(_key, _type, _flags, _ptr, _defaultvalue, _function, _functiondata, _syntax, _helptext)    { _key, _type, _flags, _ptr, (void*)_defaultvalue, _functiondata, _function, _syntax, _helptext }
 #define SWITCH_CONFIG_ITEM_END() { NULL, SWITCH_CONFIG_LAST, 0, NULL, NULL, NULL, NULL, NULL, NULL }
 
+#define SWITCH_CONFIG_SET_ITEM(_item, _key, _type, _flags, _ptr, _defaultvalue, _data, _syntax, _helptext)  \
+       _item.key = _key; \
+       _item.type = _type; \
+       _item.flags = _flags; \
+       _item.ptr = _ptr; \
+       _item.defaultvalue = (void*)_defaultvalue; \
+       _item.data = (void*)_data; \
+       _item.syntax = _syntax; \
+       _item.helptext = _helptext
+
+#define SWITCH_CONFIG_SET_ITEM_CALLBACK(_item, _key, _type, _flags, _ptr, _defaultvalue, _function, _syntax, _helptext)  \
+       _item.key = _key; \
+       _item.type = _type; \
+       _item.flags = _flags; \
+       _item.ptr = ptr; \
+       _item.defaultvalue = (void*)_defaultvalue; \
+       _item.data = (void*)_data; \
+       _item.function = _function \
+       _item.syntax = _syntax; \
+       _item.helptext = _helptext
+
 /*! 
  * \brief Gets the int representation of an enum
  * \param enum_options the switch_xml_config_enum_item_t array for this enum