add switch_xml_unbind_search_function_ptr
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8907 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
8c199004d8
commit
08381c7a17
|
@ -362,6 +362,7 @@ SWITCH_DECLARE(switch_status_t) switch_xml_bind_search_function_removable(switch
|
||||||
switch_xml_section_t sections, void *user_data, switch_xml_binding_t **binding);
|
switch_xml_section_t sections, void *user_data, switch_xml_binding_t **binding);
|
||||||
|
|
||||||
SWITCH_DECLARE(switch_status_t) switch_xml_unbind_search_function(switch_xml_binding_t **binding);
|
SWITCH_DECLARE(switch_status_t) switch_xml_unbind_search_function(switch_xml_binding_t **binding);
|
||||||
|
SWITCH_DECLARE(switch_status_t) switch_xml_unbind_search_function_ptr(switch_xml_search_function_t function);
|
||||||
|
|
||||||
///\brief parse a string for a list of sections
|
///\brief parse a string for a list of sections
|
||||||
///\param str a | delimited list of section names
|
///\param str a | delimited list of section names
|
||||||
|
|
|
@ -166,6 +166,28 @@ SWITCH_DECLARE(switch_status_t) switch_xml_unbind_search_function(switch_xml_bin
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SWITCH_DECLARE(switch_status_t) switch_xml_unbind_search_function_ptr(switch_xml_search_function_t function)
|
||||||
|
{
|
||||||
|
switch_xml_binding_t *ptr, *last = NULL;
|
||||||
|
switch_status_t status = SWITCH_STATUS_FALSE;
|
||||||
|
|
||||||
|
switch_mutex_lock(XML_LOCK);
|
||||||
|
for (ptr = BINDINGS; ptr; ptr = ptr->next) {
|
||||||
|
if (ptr->function == function) {
|
||||||
|
if (last) {
|
||||||
|
last->next = ptr->next;
|
||||||
|
} else {
|
||||||
|
BINDINGS = ptr->next;
|
||||||
|
}
|
||||||
|
status = SWITCH_STATUS_SUCCESS;
|
||||||
|
}
|
||||||
|
last = ptr;
|
||||||
|
}
|
||||||
|
switch_mutex_unlock(XML_LOCK);
|
||||||
|
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
SWITCH_DECLARE(switch_status_t) switch_xml_bind_search_function(switch_xml_search_function_t function, switch_xml_section_t sections, void *user_data)
|
SWITCH_DECLARE(switch_status_t) switch_xml_bind_search_function(switch_xml_search_function_t function, switch_xml_section_t sections, void *user_data)
|
||||||
{
|
{
|
||||||
switch_xml_binding_t *binding = NULL, *ptr = NULL;
|
switch_xml_binding_t *binding = NULL, *ptr = NULL;
|
||||||
|
|
Loading…
Reference in New Issue