RTS API Documentation
1.10.11
|
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_toxml(xml, prn_header) switch_xml_toxml_ex(xml, prn_header, USE_UTF_8_ENCODING) |
Converts an switch_xml structure back to xml in html format. Returns a string of html data that \ must be freed. More... | |
#define | switch_xml_toxml_nolock(xml, prn_header) switch_xml_toxml_nolock_ex(xml, prn_header, USE_UTF_8_ENCODING) |
#define | switch_xml_tohtml(xml, prn_header) switch_xml_tohtml_ex(xml, prn_header, USE_UTF_8_ENCODING) |
#define | switch_xml_toxml_buf(xml, buf, buflen, offset, prn_header) switch_xml_toxml_buf_ex(xml, buf, buflen, offset, prn_header, USE_UTF_8_ENCODING); |
Converts an switch_xml structure back to xml using the buffer passed in the parameters. 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_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), SWITCH_XML_CDATA = (1 << 4) } |
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_ex (_In_ switch_xml_t xml, _In_ switch_bool_t prn_header, switch_bool_t use_utf8_encoding) |
char * | switch_xml_toxml_nolock_ex (switch_xml_t xml, _In_ switch_bool_t prn_header, switch_bool_t use_utf8_encoding) |
char * | switch_xml_tohtml_ex (_In_ switch_xml_t xml, _In_ switch_bool_t prn_header, switch_bool_t use_utf8_encoding) |
char * | switch_xml_toxml_buf_ex (_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, switch_bool_t use_utf8_encoding) |
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_add_child_d (_In_ switch_xml_t xml, _In_z_ const char *name, _In_ switch_size_t off) |
wrapper for switch_xml_add_child() that strdup()s name 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_txt_d (switch_xml_t xml, const char *txt) |
wrapper for switch_xml_set_txt() that strdup()s 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_attr_d (switch_xml_t xml, const char *name, const char *value) |
Wrapper for switch_xml_set_attr() that strdup()s name/value. Value cannot be NULL. More... | |
switch_xml_t | switch_xml_set_attr_d_buf (switch_xml_t xml, const char *name, const char *value) |
Wrapper for switch_xml_set_attr() that strdup()s name/value. Value cannot be NULL. 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_bind_search_function | ( | _f, | |
_s, | |||
_u | |||
) | switch_xml_bind_search_function_ret(_f, _s, _u, NULL) |
Definition at line 431 of file switch_xml.h.
#define SWITCH_XML_BUFSIZE 1024 |
Definition at line 69 of file switch_xml.h.
Referenced by switch_xml_ampencode(), switch_xml_parse_fp(), switch_xml_str2utf8(), switch_xml_tohtml_ex(), switch_xml_toxml_buf_ex(), switch_xml_toxml_ex(), switch_xml_toxml_nolock_ex(), 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 336 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 189 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 270 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 177 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 124 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 339 of file switch_xml.h.
#define switch_xml_tohtml | ( | xml, | |
prn_header | |||
) | switch_xml_tohtml_ex(xml, prn_header, USE_UTF_8_ENCODING) |
Definition at line 226 of file switch_xml.h.
#define switch_xml_toxml | ( | xml, | |
prn_header | |||
) | switch_xml_toxml_ex(xml, prn_header, USE_UTF_8_ENCODING) |
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 |
use_utf8_encoding | encoding into ampersand entities for UTF-8 chars |
Definition at line 224 of file switch_xml.h.
Referenced by CoreSession::getXMLCDR(), Event::serialize(), switch_core_session_reporting_state(), switch_ivr_multi_threaded_bridge(), switch_ivr_originate(), switch_xml_dup(), and switch_xml_locate().
#define switch_xml_toxml_buf | ( | xml, | |
buf, | |||
buflen, | |||
offset, | |||
prn_header | |||
) | switch_xml_toxml_buf_ex(xml, buf, buflen, offset, prn_header, USE_UTF_8_ENCODING); |
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 |
use_utf8_encoding | encoding into ampersand entities for UTF-8 chars |
Definition at line 240 of file switch_xml.h.
#define switch_xml_toxml_nolock | ( | xml, | |
prn_header | |||
) | switch_xml_toxml_nolock_ex(xml, prn_header, USE_UTF_8_ENCODING) |
Definition at line 225 of file switch_xml.h.
Referenced by switch_core_recovery_track().
#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 194 of file switch_xml.h.
enum switch_xml_flag_t |
Enumerator | |
---|---|
SWITCH_XML_ROOT | |
SWITCH_XML_NAMEM | |
SWITCH_XML_TXTM | |
SWITCH_XML_DUP | |
SWITCH_XML_CDATA |
Definition at line 70 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 |
switch_xml_t switch_xml_add_child_d | ( | _In_ switch_xml_t | xml, |
_In_z_ const char * | name, | ||
_In_ switch_size_t | off | ||
) |
wrapper for switch_xml_add_child() that strdup()s name
xml | the xml node |
name | the name of the child |
off | the offset |
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().
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(), load_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_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 2028 of file switch_xml.c.
References switch_core_get_variable(), 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 2473 of file switch_xml.c.
References 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 1970 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_config(), load_configuration(), recover_callback(), Event::serialize(), switch_channel_clear_device_record(), switch_core_recovery_track(), switch_core_session_reporting_state(), switch_event_xmlize(), 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_extended(), 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 3356 of file switch_xml.c.
References memset(), name, path, pool, switch_assert, SWITCH_CHANNEL_LOG, switch_event_add_header_string(), switch_log_printf(), SWITCH_LOG_WARNING, switch_must_malloc(), switch_must_realloc(), switch_safe_free, SWITCH_STACK_BOTTOM, SWITCH_STATUS_SUCCESS, switch_xml_locate_language_ex(), and while().
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 2145 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_extended().
void switch_xml_merge_user | ( | switch_xml_t | user, |
switch_xml_t | domain, | ||
switch_xml_t | group | ||
) |
Definition at line 2012 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_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 1241 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 2436 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 2281 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 3013 of file switch_xml.c.
References switch_xml::attr, switch_xml::flags, switch_must_malloc(), switch_must_realloc(), switch_must_strdup(), SWITCH_XML_DUP, SWITCH_XML_NAMEM, SWITCH_XML_NIL, SWITCH_XML_TXTM, and destroy_xml::xml.
Referenced by switch_xml_set_attr_d(), and switch_xml_set_attr_d_buf().
switch_xml_t switch_xml_set_attr_d | ( | switch_xml_t | xml, |
const char * | name, | ||
const char * | 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 3077 of file switch_xml.c.
References switch_must_strdup(), switch_str_nil, SWITCH_XML_DUP, switch_xml_set_attr(), and switch_xml_set_flag().
Referenced by do_merge(), switch_ivr_generate_xml_cdr(), and switch_xml_merge_user().
switch_xml_t switch_xml_set_attr_d_buf | ( | switch_xml_t | xml, |
const char * | name, | ||
const char * | 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 3085 of file switch_xml.c.
References switch_must_strdup(), SWITCH_XML_DUP, switch_xml_set_attr(), and switch_xml_set_flag().
Referenced by switch_console_complete(), and switch_ivr_generate_xml_cdr().
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 3092 of file switch_xml.c.
References switch_xml::flags, and destroy_xml::xml.
Referenced by switch_xml_add_child_d(), switch_xml_char_content(), switch_xml_set_attr_d(), switch_xml_set_attr_d_buf(), and switch_xml_set_txt_d().
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 2356 of file switch_xml.c.
References switch_mutex_lock(), switch_mutex_unlock(), and SWITCH_STATUS_SUCCESS.
switch_status_t switch_xml_set_root | ( | switch_xml_t | new_main | ) |
set new core xml root
Definition at line 2330 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 2993 of file switch_xml.c.
References switch_xml::flags, SWITCH_XML_TXTM, switch_xml::txt, and destroy_xml::xml.
Referenced by switch_xml_set_txt_d().
switch_xml_t switch_xml_set_txt_d | ( | switch_xml_t | xml, |
const char * | txt | ||
) |
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 3005 of file switch_xml.c.
References switch_xml_set_flag(), switch_xml_set_txt(), and SWITCH_XML_TXTM.
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().
int switch_xml_std_datetime_check | ( | switch_xml_t | xcond, |
int * | offset, | ||
const char * | tzname | ||
) |
Definition at line 3138 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_ex | ( | _In_ switch_xml_t | xml, |
_In_ switch_bool_t | prn_header, | ||
switch_bool_t | use_utf8_encoding | ||
) |
char* switch_xml_toxml_buf_ex | ( | _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, | ||
switch_bool_t | use_utf8_encoding | ||
) |
char* switch_xml_toxml_ex | ( | _In_ switch_xml_t | xml, |
_In_ switch_bool_t | prn_header, | ||
switch_bool_t | use_utf8_encoding | ||
) |
char* switch_xml_toxml_nolock_ex | ( | switch_xml_t | xml, |
_In_ switch_bool_t | prn_header, | ||
switch_bool_t | use_utf8_encoding | ||
) |
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 | ) |