replace reloadable bool by a flags structure and add required flag

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12469 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Mathieu Rene
2009-03-05 20:18:27 +00:00
parent 167fea04c7
commit c0bc34ee7e
3 changed files with 24 additions and 10 deletions

View File

@@ -32,6 +32,8 @@
#include <switch.h>
switch_xml_config_string_options_t switch_config_string_strdup = { NULL, 0, NULL };
SWITCH_DECLARE(switch_size_t) switch_event_import_xml(switch_xml_t xml, const char *keyname, const char *valuename, switch_event_t **event)
{
switch_xml_t node;
@@ -79,10 +81,15 @@ SWITCH_DECLARE(switch_status_t) switch_xml_config_parse_event(switch_event_t *ev
switch_bool_t changed = SWITCH_FALSE;
switch_xml_config_callback_t callback = (switch_xml_config_callback_t)item->function;
if (reload && !item->reloadable) {
if (reload && !switch_test_flag(item, CONFIG_RELOADABLE)) {
continue;
}
if (!value && switch_test_flag(item, CONFIG_REQUIRED)) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Required parameter [%s] is missing\n", item->key);
return SWITCH_STATUS_FALSE;
}
switch(item->type) {
case SWITCH_CONFIG_INT:
{