FreeSWITCH API Documentation
1.7.0
|
Data Structures | |
struct | switch_xml |
A representation of an XML tree. More... | |
Macros | |
#define | SWITCH_XML_BUFSIZE 1024 |
#define | switch_xml_parse_str_dup(x) switch_xml_parse_str_dynamic(x, SWITCH_TRUE) |
Parses a string into a switch_xml_t. More... | |
#define | switch_xml_next(xml) ((xml) ? xml->next : NULL) |
returns the next tag of the same name in the same section and depth or NULL \ if not found More... | |
#define | switch_xml_name(xml) ((xml) ? xml->name : NULL) |
returns the name of the given tag More... | |
#define | switch_xml_txt(xml) ((xml) ? xml->txt : "") |
returns the given tag's character content or empty string if none More... | |
#define | switch_xml_new_d(name) switch_xml_set_flag(switch_xml_new(strdup(name)), SWITCH_XML_NAMEM) |
wrapper for switch_xml_new() that strdup()s name More... | |
#define | switch_xml_add_child_d(xml, name, off) switch_xml_set_flag(switch_xml_add_child(xml, strdup(name), off), SWITCH_XML_NAMEM) |
wrapper for switch_xml_add_child() that strdup()s name More... | |
#define | switch_xml_set_txt_d(xml, txt) switch_xml_set_flag(switch_xml_set_txt(xml, strdup(txt)), SWITCH_XML_TXTM) |
wrapper for switch_xml_set_txt() that strdup()s txt \ sets the character content for the given tag and returns the tag More... | |
#define | switch_xml_set_attr_d(xml, name, value) switch_xml_set_attr(switch_xml_set_flag(xml, SWITCH_XML_DUP), strdup(name), strdup(switch_str_nil(value))) |
Wrapper for switch_xml_set_attr() that strdup()s name/value. Value cannot be NULL. More... | |
#define | switch_xml_set_attr_d_buf(xml, name, value) switch_xml_set_attr(switch_xml_set_flag(xml, SWITCH_XML_DUP), strdup(name), strdup(value)) |
#define | switch_xml_move(xml, dest, off) switch_xml_insert(switch_xml_cut(xml), dest, off) |
Moves an existing tag to become a subtag of dest at the given offset from \ the start of dest's character content. Returns the moved tag. More... | |
#define | switch_xml_remove(xml) switch_xml_free(switch_xml_cut(xml)) |
removes a tag along with all its subtags More... | |
#define | switch_xml_bind_search_function(_f, _s, _u) switch_xml_bind_search_function_ret(_f, _s, _u, NULL) |
Enumerations | |
enum | switch_xml_flag_t { SWITCH_XML_ROOT = (1 << 0), SWITCH_XML_NAMEM = (1 << 1), SWITCH_XML_TXTM = (1 << 2), SWITCH_XML_DUP = (1 << 3) } |
Functions | |
switch_xml_t | switch_xml_parse_str_dynamic (_In_z_ char *s, _In_ switch_bool_t dup) |
Parses a string into a switch_xml_t, ensuring the memory will be freed with switch_xml_free. More... | |
switch_xml_t | switch_xml_parse_str (_In_z_ char *s, _In_ switch_size_t len) |
Given a string of xml data and its length, parses it and creates an switch_xml \ structure. For efficiency, modifies the data by adding null terminators \ and decoding ampersand sequences. If you don't want this, copy the data and \ pass in the copy. Returns NULL on failure. More... | |
switch_xml_t | switch_xml_parse_fd (int fd) |
A wrapper for switch_xml_parse_str() that accepts a file descriptor. First \ attempts to mem map the file. Failing that, reads the file into memory. \ Returns NULL on failure. More... | |
switch_xml_t | switch_xml_parse_file (_In_z_ const char *file) |
a wrapper for switch_xml_parse_fd() that accepts a file name More... | |
switch_xml_t | switch_xml_parse_file_simple (_In_z_ const char *file) |
switch_xml_t | switch_xml_parse_fp (_In_ FILE *fp) |
Wrapper for switch_xml_parse_str() that accepts a file stream. Reads the entire \ stream into memory and then parses it. For xml files, use switch_xml_parse_file() \ or switch_xml_parse_fd() More... | |
switch_xml_t | switch_xml_child (_In_ switch_xml_t xml, _In_z_ const char *name) |
returns the first child tag (one level deeper) with the given name or NULL \ if not found More... | |
switch_xml_t | switch_xml_find_child (_In_ switch_xml_t node, _In_z_ const char *childname, _In_opt_z_ const char *attrname, _In_opt_z_ const char *value) |
find a child tag in a node called 'childname' with an attribute 'attrname' which equals 'value' More... | |
switch_xml_t | switch_xml_find_child_multi (_In_ switch_xml_t node, _In_z_ const char *childname,...) |
switch_xml_t | switch_xml_idx (_In_ switch_xml_t xml, _In_ int idx) |
Returns the Nth tag with the same name in the same section at the same depth \ or NULL if not found. An index of 0 returns the tag given. More... | |
const char * | switch_xml_attr (_In_opt_ switch_xml_t xml, _In_opt_z_ const char *attr) |
returns the value of the requested tag attribute, or NULL if not found More... | |
const char * | switch_xml_attr_soft (_In_ switch_xml_t xml, _In_z_ const char *attr) |
returns the value of the requested tag attribute, or "" if not found More... | |
switch_xml_t | switch_xml_get (_In_ switch_xml_t xml,...) |
Traverses the switch_xml structure to retrieve a specific subtag. Takes a \ variable length list of tag names and indexes. The argument list must be \ terminated by either an index of -1 or an empty string tag name. Example: \ title = switch_xml_get(library, "shelf", 0, "book", 2, "title", -1); \ This retrieves the title of the 3rd book on the 1st shelf of library. \ Returns NULL if not found. More... | |
char * | switch_xml_toxml (_In_ switch_xml_t xml, _In_ switch_bool_t prn_header) |
Converts an switch_xml structure back to xml in html format. Returns a string of html data that \ must be freed. More... | |
char * | switch_xml_toxml_nolock (switch_xml_t xml, _In_ switch_bool_t prn_header) |
char * | switch_xml_tohtml (_In_ switch_xml_t xml, _In_ switch_bool_t prn_header) |
char * | switch_xml_toxml_buf (_In_ switch_xml_t xml, _In_z_ char *buf, _In_ switch_size_t buflen, _In_ switch_size_t offset, _In_ switch_bool_t prn_header) |
Converts an switch_xml structure back to xml using the buffer passed in the parameters. More... | |
const char ** | switch_xml_pi (_In_ switch_xml_t xml, _In_z_ const char *target) |
returns a NULL terminated array of processing instructions for the given \ target More... | |
void | switch_xml_free (_In_opt_ switch_xml_t xml) |
frees the memory allocated for an switch_xml structure More... | |
void | switch_xml_free_in_thread (_In_ switch_xml_t xml, _In_ int stacksize) |
const char * | switch_xml_error (_In_ switch_xml_t xml) |
returns parser error message or empty string if none More... | |
switch_xml_t | switch_xml_new (_In_opt_z_ const char *name) |
returns a new empty switch_xml structure with the given root tag name More... | |
switch_xml_t | switch_xml_add_child (_In_ switch_xml_t xml, _In_z_ const char *name, _In_ switch_size_t off) |
Adds a child tag. off is the offset of the child tag relative to the start \ of the parent tag's character content. Returns the child tag. More... | |
switch_xml_t | switch_xml_set_txt (switch_xml_t xml, const char *txt) |
sets the character content for the given tag and returns the tag More... | |
switch_xml_t | switch_xml_set_attr (switch_xml_t xml, const char *name, const char *value) |
Sets the given tag attribute or adds a new attribute if not found. A value \ of NULL will remove the specified attribute. More... | |
switch_xml_t | switch_xml_set_flag (switch_xml_t xml, switch_xml_flag_t flag) |
sets a flag for the given tag and returns the tag More... | |
switch_xml_t | switch_xml_cut (_In_ switch_xml_t xml) |
removes a tag along with its subtags without freeing its memory More... | |
switch_xml_t | switch_xml_insert (_In_ switch_xml_t xml, _In_ switch_xml_t dest, _In_ switch_size_t off) |
inserts an existing tag into an ezxml structure More... | |
switch_status_t | switch_xml_set_root (switch_xml_t new_main) |
set new core xml root More... | |
switch_status_t | switch_xml_set_open_root_function (switch_xml_open_root_function_t func, void *user_data) |
Set and alternate function for opening xml root. More... | |
switch_xml_t | switch_xml_open_root (_In_ uint8_t reload, _Out_ const char **err) |
open the Core xml root More... | |
switch_status_t | switch_xml_init (_In_ switch_memory_pool_t *pool, _Out_ const char **err) |
initilize the core XML backend More... | |
switch_status_t | switch_xml_reload (const char **err) |
switch_status_t | switch_xml_destroy (void) |
switch_xml_t | switch_xml_root (void) |
retrieve the core XML root node More... | |
switch_status_t | switch_xml_locate (_In_z_ const char *section, _In_opt_z_ const char *tag_name, _In_opt_z_ const char *key_name, _In_opt_z_ const char *key_value, _Out_ switch_xml_t *root, _Out_ switch_xml_t *node, _In_opt_ switch_event_t *params, _In_ switch_bool_t clone) |
locate an xml pointer in the core registry More... | |
switch_status_t | switch_xml_locate_domain (_In_z_ const char *domain_name, _In_opt_ switch_event_t *params, _Out_ switch_xml_t *root, _Out_ switch_xml_t *domain) |
switch_status_t | switch_xml_locate_group (_In_z_ const char *group_name, _In_z_ const char *domain_name, _Out_ switch_xml_t *root, _Out_ switch_xml_t *domain, _Out_ switch_xml_t *group, _In_opt_ switch_event_t *params) |
switch_status_t | switch_xml_locate_user (_In_z_ const char *key, _In_z_ const char *user_name, _In_z_ const char *domain_name, _In_opt_z_ const char *ip, _Out_ switch_xml_t *root, _Out_ switch_xml_t *domain, _Out_ switch_xml_t *user, _Out_opt_ switch_xml_t *ingroup, _In_opt_ switch_event_t *params) |
switch_status_t | switch_xml_locate_user_in_domain (_In_z_ const char *user_name, _In_ switch_xml_t domain, _Out_ switch_xml_t *user, _Out_opt_ switch_xml_t *ingroup) |
switch_status_t | switch_xml_locate_user_merged (const char *key, const char *user_name, const char *domain_name, const char *ip, switch_xml_t *user, switch_event_t *params) |
uint32_t | switch_xml_clear_user_cache (const char *key, const char *user_name, const char *domain_name) |
void | switch_xml_merge_user (switch_xml_t user, switch_xml_t domain, switch_xml_t group) |
switch_xml_t | switch_xml_dup (switch_xml_t xml) |
switch_xml_t | switch_xml_open_cfg (_In_z_ const char *file_path, _Out_ switch_xml_t *node, _In_opt_ switch_event_t *params) |
open a config in the core registry More... | |
void | switch_xml_set_binding_sections (_In_ switch_xml_binding_t *binding, _In_ switch_xml_section_t sections) |
bind a search function to an external gateway More... | |
void | switch_xml_set_binding_user_data (_In_ switch_xml_binding_t *binding, _In_opt_ void *user_data) |
switch_xml_section_t | switch_xml_get_binding_sections (_In_ switch_xml_binding_t *binding) |
void * | switch_xml_get_binding_user_data (_In_ switch_xml_binding_t *binding) |
switch_status_t | switch_xml_bind_search_function_ret (_In_ switch_xml_search_function_t function, _In_ switch_xml_section_t sections, _In_opt_ void *user_data, switch_xml_binding_t **ret_binding) |
switch_status_t | switch_xml_unbind_search_function (_In_ switch_xml_binding_t **binding) |
switch_status_t | switch_xml_unbind_search_function_ptr (_In_ switch_xml_search_function_t function) |
switch_xml_section_t | switch_xml_parse_section_string (_In_opt_z_ const char *str) |
parse a string for a list of sections More... | |
int | switch_xml_std_datetime_check (switch_xml_t xcond, int *offset, const char *tzname) |
switch_status_t | switch_xml_locate_language (switch_xml_t *root, switch_xml_t *node, switch_event_t *params, switch_xml_t *language, switch_xml_t *phrases, switch_xml_t *macros, const char *str_language) |
#define switch_xml_add_child_d | ( | xml, | |
name, | |||
off | |||
) | switch_xml_set_flag(switch_xml_add_child(xml, strdup(name), off), SWITCH_XML_NAMEM) |
wrapper for switch_xml_add_child() that strdup()s name
xml | the xml node |
name | the name of the child |
off | the offset |
Definition at line 269 of file switch_xml.h.
Referenced by add_xml_header(), comp_callback(), do_merge(), switch_console_complete(), switch_event_xmlize(), switch_ivr_generate_xml_cdr(), switch_ivr_set_xml_call_stats(), switch_ivr_set_xml_chan_var(), and switch_ivr_set_xml_profile_data().
#define switch_xml_bind_search_function | ( | _f, | |
_s, | |||
_u | |||
) | switch_xml_bind_search_function_ret(_f, _s, _u, NULL) |
Definition at line 415 of file switch_xml.h.
#define SWITCH_XML_BUFSIZE 1024 |
Definition at line 67 of file switch_xml.h.
Referenced by switch_xml_ampencode(), switch_xml_parse_fp(), switch_xml_str2utf8(), switch_xml_tohtml(), switch_xml_toxml(), switch_xml_toxml_buf(), switch_xml_toxml_nolock(), and switch_xml_toxml_r().
#define switch_xml_move | ( | xml, | |
dest, | |||
off | |||
) | switch_xml_insert(switch_xml_cut(xml), dest, off) |
Moves an existing tag to become a subtag of dest at the given offset from \ the start of dest's character content. Returns the moved tag.
Definition at line 320 of file switch_xml.h.
#define switch_xml_name | ( | xml | ) | ((xml) ? xml->name : NULL) |
returns the name of the given tag
xml | the xml node |
Definition at line 182 of file switch_xml.h.
#define switch_xml_new_d | ( | name | ) | switch_xml_set_flag(switch_xml_new(strdup(name)), SWITCH_XML_NAMEM) |
wrapper for switch_xml_new() that strdup()s name
name | the name of the root |
Definition at line 255 of file switch_xml.h.
#define switch_xml_next | ( | xml | ) | ((xml) ? xml->next : NULL) |
returns the next tag of the same name in the same section and depth or NULL \ if not found
xml | an xml node |
Definition at line 170 of file switch_xml.h.
Referenced by switch_nat_republish().
#define switch_xml_parse_str_dup | ( | x | ) | switch_xml_parse_str_dynamic(x, SWITCH_TRUE) |
Parses a string into a switch_xml_t.
s | The string to parse |
Definition at line 117 of file switch_xml.h.
Referenced by switch_nat_republish().
#define switch_xml_remove | ( | xml | ) | switch_xml_free(switch_xml_cut(xml)) |
removes a tag along with all its subtags
Definition at line 323 of file switch_xml.h.
#define switch_xml_set_attr_d | ( | xml, | |
name, | |||
value | |||
) | switch_xml_set_attr(switch_xml_set_flag(xml, SWITCH_XML_DUP), strdup(name), strdup(switch_str_nil(value))) |
Wrapper for switch_xml_set_attr() that strdup()s name/value. Value cannot be NULL.
xml | the xml node |
name | the attribute name |
value | the attribute value |
Definition at line 299 of file switch_xml.h.
Referenced by do_merge(), switch_ivr_generate_xml_cdr(), and switch_xml_merge_user().
#define switch_xml_set_attr_d_buf | ( | xml, | |
name, | |||
value | |||
) | switch_xml_set_attr(switch_xml_set_flag(xml, SWITCH_XML_DUP), strdup(name), strdup(value)) |
Definition at line 302 of file switch_xml.h.
Referenced by switch_console_complete(), and switch_ivr_generate_xml_cdr().
#define switch_xml_set_txt_d | ( | xml, | |
txt | |||
) | switch_xml_set_flag(switch_xml_set_txt(xml, strdup(txt)), SWITCH_XML_TXTM) |
wrapper for switch_xml_set_txt() that strdup()s txt \ sets the character content for the given tag and returns the tag
xml | the xml node |
txt | the text |
Definition at line 283 of file switch_xml.h.
Referenced by add_xml_header(), comp_callback(), switch_console_complete(), switch_event_xmlize(), switch_ivr_generate_xml_cdr(), switch_ivr_set_xml_call_stats(), switch_ivr_set_xml_chan_var(), and switch_ivr_set_xml_profile_data().
#define switch_xml_txt | ( | xml | ) | ((xml) ? xml->txt : "") |
returns the given tag's character content or empty string if none
xml | the xml node |
Definition at line 187 of file switch_xml.h.
enum switch_xml_flag_t |
Enumerator | |
---|---|
SWITCH_XML_ROOT | |
SWITCH_XML_NAMEM | |
SWITCH_XML_TXTM | |
SWITCH_XML_DUP |
Definition at line 68 of file switch_xml.h.
switch_xml_t switch_xml_add_child | ( | _In_ switch_xml_t | xml, |
_In_z_ const char * | name, | ||
_In_ switch_size_t | off | ||
) |
Adds a child tag. off is the offset of the child tag relative to the start \ of the parent tag's character content. Returns the child tag.
xml | the xml node |
name | the name of the tag |
off | the offset |
const char* switch_xml_attr | ( | _In_opt_ switch_xml_t | xml, |
_In_opt_z_ const char * | attr | ||
) |
returns the value of the requested tag attribute, or NULL if not found
xml | the xml node |
attr | the attribute |
Referenced by load_configuration(), switch_ivr_check_presence_mapping(), switch_ivr_menu_stack_xml_build(), switch_ivr_phrase_macro_event(), switch_ivr_say(), switch_ivr_say_string(), switch_ivr_set_user_xml(), switch_load_network_lists(), and switch_load_timezones().
const char* switch_xml_attr_soft | ( | _In_ switch_xml_t | xml, |
_In_z_ const char * | attr | ||
) |
returns the value of the requested tag attribute, or "" if not found
xml | the xml node |
attr | the attribute |
Referenced by console_xml_config(), recover_callback(), switch_event_import_xml(), switch_ivr_menu_stack_xml_build(), switch_ivr_phrase_macro_event(), switch_load_core_config(), and switch_loadable_module_init().
switch_status_t switch_xml_bind_search_function_ret | ( | _In_ switch_xml_search_function_t | function, |
_In_ switch_xml_section_t | sections, | ||
_In_opt_ void * | user_data, | ||
switch_xml_binding_t ** | ret_binding | ||
) |
switch_xml_t switch_xml_child | ( | _In_ switch_xml_t | xml, |
_In_z_ const char * | name | ||
) |
returns the first child tag (one level deeper) with the given name or NULL \ if not found
xml | an xml node |
name | the name of the child tag |
Referenced by console_xml_config(), load_configuration(), recover_callback(), switch_core_session_request_xml(), switch_ivr_check_presence_mapping(), switch_ivr_menu_stack_xml_build(), switch_ivr_phrase_macro_event(), switch_ivr_set_user_xml(), switch_load_core_config(), switch_load_network_lists(), switch_load_timezones(), switch_loadable_module_init(), switch_nat_republish(), switch_xml_config_parse_module_settings(), and xml_find_var().
uint32_t switch_xml_clear_user_cache | ( | const char * | key, |
const char * | user_name, | ||
const char * | domain_name | ||
) |
Definition at line 1920 of file switch_xml.c.
References CACHE_EXPIRES_HASH, CACHE_HASH, switch_core_hash_delete(), switch_core_hash_find(), switch_core_hash_first_iter(), switch_core_hash_this(), switch_mutex_lock(), switch_mutex_unlock(), switch_safe_free, switch_snprintf(), and switch_xml_free().
Referenced by switch_xml_destroy().
switch_xml_t switch_xml_cut | ( | _In_ switch_xml_t | xml | ) |
removes a tag along with its subtags without freeing its memory
xml | the xml node |
switch_status_t switch_xml_destroy | ( | void | ) |
Definition at line 2358 of file switch_xml.c.
References CACHE_HASH, MAIN_XML_ROOT, switch_core_hash_destroy(), switch_mutex_lock(), switch_mutex_unlock(), SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, switch_xml_clear_user_cache(), switch_xml_free(), and destroy_xml::xml.
Referenced by switch_core_destroy().
switch_xml_t switch_xml_dup | ( | switch_xml_t | xml | ) |
Definition at line 1862 of file switch_xml.c.
References SWITCH_FALSE, switch_xml_parse_str_dynamic(), and switch_xml_toxml().
Referenced by switch_xml_locate_user_cache(), switch_xml_locate_user_merged(), and switch_xml_user_cache().
const char* switch_xml_error | ( | _In_ switch_xml_t | xml | ) |
returns parser error message or empty string if none
xml | the xml node |
switch_xml_t switch_xml_find_child | ( | _In_ switch_xml_t | node, |
_In_z_ const char * | childname, | ||
_In_opt_z_ const char * | attrname, | ||
_In_opt_z_ const char * | value | ||
) |
find a child tag in a node called 'childname' with an attribute 'attrname' which equals 'value'
node | the xml node |
childname | the child tag name |
attrname | the attribute name |
value | the value |
Referenced by switch_ivr_menu_stack_xml_build(), switch_ivr_phrase_macro_event(), and switch_nat_republish().
switch_xml_t switch_xml_find_child_multi | ( | _In_ switch_xml_t | node, |
_In_z_ const char * | childname, | ||
... | |||
) |
void switch_xml_free | ( | _In_opt_ switch_xml_t | xml | ) |
frees the memory allocated for an switch_xml structure
xml | the xml node |
Referenced by console_xml_config(), CoreSession::getXMLCDR(), load_configuration(), recover_callback(), Event::serialize(), switch_channel_clear_device_record(), switch_core_recovery_track(), switch_core_session_reporting_state(), switch_ivr_check_presence_mapping(), switch_ivr_generate_xml_cdr(), switch_ivr_multi_threaded_bridge(), switch_ivr_originate(), switch_ivr_phrase_macro_event(), switch_ivr_say(), switch_ivr_say_string(), switch_ivr_set_user(), switch_load_core_config(), switch_load_network_lists(), switch_load_timezones(), switch_loadable_module_init(), switch_nat_republish(), and switch_xml_config_parse_module_settings().
void switch_xml_free_in_thread | ( | _In_ switch_xml_t | xml, |
_In_ int | stacksize | ||
) |
switch_xml_t switch_xml_get | ( | _In_ switch_xml_t | xml, |
... | |||
) |
Traverses the switch_xml structure to retrieve a specific subtag. Takes a \ variable length list of tag names and indexes. The argument list must be \ terminated by either an index of -1 or an empty string tag name. Example: \ title = switch_xml_get(library, "shelf", 0, "book", 2, "title", -1); \ This retrieves the title of the 3rd book on the 1st shelf of library. \ Returns NULL if not found.
xml | the xml node |
switch_xml_section_t switch_xml_get_binding_sections | ( | _In_ switch_xml_binding_t * | binding | ) |
void* switch_xml_get_binding_user_data | ( | _In_ switch_xml_binding_t * | binding | ) |
switch_xml_t switch_xml_idx | ( | _In_ switch_xml_t | xml, |
_In_ int | idx | ||
) |
Returns the Nth tag with the same name in the same section at the same depth \ or NULL if not found. An index of 0 returns the tag given.
xml | the xml node |
idx | the index |
switch_status_t switch_xml_init | ( | _In_ switch_memory_pool_t * | pool, |
_Out_ const char ** | err | ||
) |
initilize the core XML backend
pool | a memory pool to use |
err | a pointer to set error strings |
Referenced by switch_core_init().
switch_xml_t switch_xml_insert | ( | _In_ switch_xml_t | xml, |
_In_ switch_xml_t | dest, | ||
_In_ switch_size_t | off | ||
) |
inserts an existing tag into an ezxml structure
switch_status_t switch_xml_locate | ( | _In_z_ const char * | section, |
_In_opt_z_ const char * | tag_name, | ||
_In_opt_z_ const char * | key_name, | ||
_In_opt_z_ const char * | key_value, | ||
_Out_ switch_xml_t * | root, | ||
_Out_ switch_xml_t * | node, | ||
_In_opt_ switch_event_t * | params, | ||
_In_ switch_bool_t | clone | ||
) |
locate an xml pointer in the core registry
section | the section to look in |
tag_name | the type of tag in that section |
key_name | the name of the key |
key_value | the value of the key |
root | a pointer to point at the root node |
node | a pointer to the requested node |
params | optional URL formatted params to pass to external gateways |
switch_status_t switch_xml_locate_domain | ( | _In_z_ const char * | domain_name, |
_In_opt_ switch_event_t * | params, | ||
_Out_ switch_xml_t * | root, | ||
_Out_ switch_xml_t * | domain | ||
) |
Referenced by switch_load_network_lists().
switch_status_t switch_xml_locate_group | ( | _In_z_ const char * | group_name, |
_In_z_ const char * | domain_name, | ||
_Out_ switch_xml_t * | root, | ||
_Out_ switch_xml_t * | domain, | ||
_Out_ switch_xml_t * | group, | ||
_In_opt_ switch_event_t * | params | ||
) |
switch_status_t switch_xml_locate_language | ( | switch_xml_t * | root, |
switch_xml_t * | node, | ||
switch_event_t * | params, | ||
switch_xml_t * | language, | ||
switch_xml_t * | phrases, | ||
switch_xml_t * | macros, | ||
const char * | str_language | ||
) |
Definition at line 3147 of file switch_xml.c.
References SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, switch_log_printf(), SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, SWITCH_TRUE, switch_xml_child(), switch_xml_find_child(), switch_xml_free(), and switch_xml_locate().
Referenced by switch_ivr_phrase_macro_event(), switch_ivr_say(), and switch_ivr_say_string().
switch_status_t switch_xml_locate_user | ( | _In_z_ const char * | key, |
_In_z_ const char * | user_name, | ||
_In_z_ const char * | domain_name, | ||
_In_opt_z_ const char * | ip, | ||
_Out_ switch_xml_t * | root, | ||
_Out_ switch_xml_t * | domain, | ||
_Out_ switch_xml_t * | user, | ||
_Out_opt_ switch_xml_t * | ingroup, | ||
_In_opt_ switch_event_t * | params | ||
) |
switch_status_t switch_xml_locate_user_in_domain | ( | _In_z_ const char * | user_name, |
_In_ switch_xml_t | domain, | ||
_Out_ switch_xml_t * | user, | ||
_Out_opt_ switch_xml_t * | ingroup | ||
) |
switch_status_t switch_xml_locate_user_merged | ( | const char * | key, |
const char * | user_name, | ||
const char * | domain_name, | ||
const char * | ip, | ||
switch_xml_t * | user, | ||
switch_event_t * | params | ||
) |
Definition at line 2034 of file switch_xml.c.
References SWITCH_CHANNEL_LOG, switch_is_number(), SWITCH_LOG_DEBUG, switch_log_printf(), switch_micro_time_now(), switch_must_strdup(), switch_safe_free, switch_split, SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, switch_xml_attr(), switch_xml_dup(), switch_xml_free(), switch_xml_locate_user(), switch_xml_locate_user_cache(), switch_xml_merge_user(), switch_xml_user_cache(), time_now(), and zstr.
Referenced by switch_ivr_set_user().
void switch_xml_merge_user | ( | switch_xml_t | user, |
switch_xml_t | domain, | ||
switch_xml_t | group | ||
) |
Definition at line 1904 of file switch_xml.c.
References do_merge(), switch_xml_attr(), switch_xml_set_attr_d, and zstr.
Referenced by switch_xml_locate_user_merged().
switch_xml_t switch_xml_new | ( | _In_opt_z_ const char * | name | ) |
returns a new empty switch_xml structure with the given root tag name
name | the name of the new root tag |
Referenced by switch_event_xmlize(), and switch_ivr_generate_xml_cdr().
switch_xml_t switch_xml_open_cfg | ( | _In_z_ const char * | file_path, |
_Out_ switch_xml_t * | node, | ||
_In_opt_ switch_event_t * | params | ||
) |
open a config in the core registry
file_path | the name of the config section e.g. modules.conf |
node | a pointer to point to the node if it is found |
params | optional URL formatted params to pass to external gateways |
Referenced by console_xml_config(), load_configuration(), switch_ivr_check_presence_mapping(), switch_load_core_config(), switch_load_network_lists(), switch_load_timezones(), switch_loadable_module_init(), and switch_xml_config_parse_module_settings().
switch_xml_t switch_xml_open_root | ( | _In_ uint8_t | reload, |
_Out_ const char ** | err | ||
) |
open the Core xml root
reload | if it's is already open close it and open it again as soon as permissable (blocking) |
err | a pointer to set error strings |
switch_xml_t switch_xml_parse_fd | ( | int | fd | ) |
A wrapper for switch_xml_parse_str() that accepts a file descriptor. First \ attempts to mem map the file. Failing that, reads the file into memory. \ Returns NULL on failure.
fd |
Definition at line 1157 of file switch_xml.c.
References switch_xml_root::dynamic, switch_must_malloc(), switch_xml_parse_str(), and switch_xml_root::xml.
Referenced by switch_xml_parse_file().
switch_xml_t switch_xml_parse_file | ( | _In_z_ const char * | file | ) |
a wrapper for switch_xml_parse_fd() that accepts a file name
file | a file to parse |
switch_xml_t switch_xml_parse_file_simple | ( | _In_z_ const char * | file | ) |
switch_xml_t switch_xml_parse_fp | ( | _In_ FILE * | fp | ) |
Wrapper for switch_xml_parse_str() that accepts a file stream. Reads the entire \ stream into memory and then parses it. For xml files, use switch_xml_parse_file() \ or switch_xml_parse_fd()
fp | a FILE pointer to parse |
switch_xml_section_t switch_xml_parse_section_string | ( | _In_opt_z_ const char * | str | ) |
parse a string for a list of sections
str | a | delimited list of section names |
switch_xml_t switch_xml_parse_str | ( | _In_z_ char * | s, |
_In_ switch_size_t | len | ||
) |
Given a string of xml data and its length, parses it and creates an switch_xml \ structure. For efficiency, modifies the data by adding null terminators \ and decoding ampersand sequences. If you don't want this, copy the data and \ pass in the copy. Returns NULL on failure.
s | a string |
len | the length of the string |
switch_xml_t switch_xml_parse_str_dynamic | ( | _In_z_ char * | s, |
_In_ switch_bool_t | dup | ||
) |
Parses a string into a switch_xml_t, ensuring the memory will be freed with switch_xml_free.
s | The string to parse |
dup | true if you want the string to be strdup()'d automatically |
Referenced by recover_callback().
const char** switch_xml_pi | ( | _In_ switch_xml_t | xml, |
_In_z_ const char * | target | ||
) |
returns a NULL terminated array of processing instructions for the given \ target
xml | the xml node |
target | the instructions |
switch_status_t switch_xml_reload | ( | const char ** | err | ) |
Definition at line 2321 of file switch_xml.c.
References SWITCH_STATUS_GENERR, SWITCH_STATUS_SUCCESS, switch_xml_free(), and switch_xml_open_root().
switch_xml_t switch_xml_root | ( | void | ) |
retrieve the core XML root node
Definition at line 2166 of file switch_xml.c.
References MAIN_XML_ROOT, switch_xml::refs, switch_mutex_lock(), and switch_mutex_unlock().
Referenced by __switch_xml_open_root(), and switch_xml_locate().
switch_xml_t switch_xml_set_attr | ( | switch_xml_t | xml, |
const char * | name, | ||
const char * | value | ||
) |
Sets the given tag attribute or adds a new attribute if not found. A value \ of NULL will remove the specified attribute.
xml | the xml node |
name | the attribute name |
value | the attribute value |
Definition at line 2884 of file switch_xml.c.
References switch_xml::attr, switch_must_malloc(), switch_must_realloc(), switch_must_strdup(), SWITCH_XML_DUP, SWITCH_XML_NAMEM, SWITCH_XML_TXTM, and destroy_xml::xml.
void switch_xml_set_binding_sections | ( | _In_ switch_xml_binding_t * | binding, |
_In_ switch_xml_section_t | sections | ||
) |
bind a search function to an external gateway
function | the search function to bind |
sections | a bitmask of sections you wil service |
user_data | a pointer to private data to be used during the callback |
void switch_xml_set_binding_user_data | ( | _In_ switch_xml_binding_t * | binding, |
_In_opt_ void * | user_data | ||
) |
switch_xml_t switch_xml_set_flag | ( | switch_xml_t | xml, |
switch_xml_flag_t | flag | ||
) |
sets a flag for the given tag and returns the tag
xml | the xml node |
flag | the flag to set |
Definition at line 2934 of file switch_xml.c.
References switch_xml::flags, and destroy_xml::xml.
Referenced by switch_xml_char_content().
switch_status_t switch_xml_set_open_root_function | ( | switch_xml_open_root_function_t | func, |
void * | user_data | ||
) |
Set and alternate function for opening xml root.
Definition at line 2241 of file switch_xml.c.
References switch_mutex_lock(), switch_mutex_unlock(), SWITCH_STATUS_SUCCESS, XML_OPEN_ROOT_FUNCTION, and XML_OPEN_ROOT_FUNCTION_USER_DATA.
switch_status_t switch_xml_set_root | ( | switch_xml_t | new_main | ) |
set new core xml root
Definition at line 2215 of file switch_xml.c.
References MAIN_XML_ROOT, switch_xml::refs, switch_mutex_lock(), switch_mutex_unlock(), switch_set_flag, SWITCH_STATUS_SUCCESS, switch_xml_free(), and SWITCH_XML_ROOT.
Referenced by __switch_xml_open_root().
switch_xml_t switch_xml_set_txt | ( | switch_xml_t | xml, |
const char * | txt | ||
) |
sets the character content for the given tag and returns the tag
xml | the xml node |
txt | the text |
Definition at line 2871 of file switch_xml.c.
References SWITCH_XML_TXTM, and destroy_xml::xml.
int switch_xml_std_datetime_check | ( | switch_xml_t | xcond, |
int * | offset, | ||
const char * | tzname | ||
) |
Definition at line 2980 of file switch_xml.c.
References SWITCH_CHANNEL_LOG, switch_dow_cmp(), switch_dow_int2str(), switch_fulldate_cmp(), switch_is_number(), SWITCH_LOG_DEBUG, SWITCH_LOG_DEBUG9, switch_log_printf(), switch_micro_time_now(), switch_number_cmp(), switch_snprintf(), switch_strftime(), switch_time_exp_lt(), switch_time_exp_tz(), switch_time_exp_tz_name(), switch_tod_cmp(), switch_true(), switch_xml_attr(), switch_time_exp_t::tm_gmtoff, switch_time_exp_t::tm_hour, switch_time_exp_t::tm_isdst, switch_time_exp_t::tm_mday, switch_time_exp_t::tm_min, switch_time_exp_t::tm_mon, switch_time_exp_t::tm_sec, switch_time_exp_t::tm_wday, switch_time_exp_t::tm_yday, switch_time_exp_t::tm_year, and zstr.
char* switch_xml_tohtml | ( | _In_ switch_xml_t | xml, |
_In_ switch_bool_t | prn_header | ||
) |
char* switch_xml_toxml | ( | _In_ switch_xml_t | xml, |
_In_ switch_bool_t | prn_header | ||
) |
Converts an switch_xml structure back to xml in html format. Returns a string of html data that \ must be freed.
xml | the xml node |
prn_header | add <?xml version..> header too |
Referenced by CoreSession::getXMLCDR(), Event::serialize(), switch_core_session_reporting_state(), switch_ivr_multi_threaded_bridge(), and switch_ivr_originate().
char* switch_xml_toxml_buf | ( | _In_ switch_xml_t | xml, |
_In_z_ char * | buf, | ||
_In_ switch_size_t | buflen, | ||
_In_ switch_size_t | offset, | ||
_In_ switch_bool_t | prn_header | ||
) |
Converts an switch_xml structure back to xml using the buffer passed in the parameters.
xml | the xml node |
buf | buffer to use |
buflen | size of buffer |
offset | offset to start at |
prn_header | add <?xml version..> header too |
char* switch_xml_toxml_nolock | ( | switch_xml_t | xml, |
_In_ switch_bool_t | prn_header | ||
) |
Referenced by switch_core_recovery_track().
switch_status_t switch_xml_unbind_search_function | ( | _In_ switch_xml_binding_t ** | binding | ) |
switch_status_t switch_xml_unbind_search_function_ptr | ( | _In_ switch_xml_search_function_t | function | ) |