FreeSWITCH API Documentation
1.7.0
|
#include <switch.h>
Go to the source code of this file.
Functions | |
switch_size_t | switch_event_import_xml (switch_xml_t xml, const char *keyname, const char *valuename, switch_event_t **event) |
Parses a list of xml elements into an event. More... | |
switch_status_t | switch_xml_config_parse_module_settings (const char *file, switch_bool_t reload, switch_xml_config_item_t *instructions) |
Parses a module's settings. More... | |
void | switch_xml_config_item_print_doc (int level, switch_xml_config_item_t *item) |
Prints out an item's documentation on the console. More... | |
switch_status_t | switch_xml_config_parse (switch_xml_t xml, switch_bool_t reload, switch_xml_config_item_t *instructions) |
Parses all the xml elements, following a ruleset defined by an array of switch_xml_config_item_t. More... | |
switch_status_t | switch_xml_config_enum_str2int (switch_xml_config_enum_item_t *enum_options, const char *value, int *out) |
Gets the int representation of an enum. More... | |
const char * | switch_xml_config_enum_int2str (switch_xml_config_enum_item_t *enum_options, int value) |
Gets the string representation of an enum. More... | |
switch_status_t | switch_xml_config_parse_event (switch_event_t *event, int count, switch_bool_t reload, switch_xml_config_item_t *instructions) |
Parses all of an event's elements, following a ruleset defined by an array of switch_xml_config_item_t. More... | |
void | switch_xml_config_cleanup (switch_xml_config_item_t *instructions) |
Free any memory allocated by the configuration. More... | |
void | switch_config_perform_set_item (switch_xml_config_item_t *item, const char *key, switch_xml_config_type_t type, int flags, void *ptr, const void *defaultvalue, void *data, switch_xml_config_callback_t function, const char *syntax, const char *helptext) |
Variables | |
switch_xml_config_string_options_t | switch_config_string_strdup = { NULL, 0, NULL } |
static switch_xml_config_enum_item_t | switch_config_types_enum [] |
void switch_config_perform_set_item | ( | switch_xml_config_item_t * | item, |
const char * | key, | ||
switch_xml_config_type_t | type, | ||
int | flags, | ||
void * | ptr, | ||
const void * | defaultvalue, | ||
void * | data, | ||
switch_xml_config_callback_t | function, | ||
const char * | syntax, | ||
const char * | helptext | ||
) |
Definition at line 477 of file switch_xml_config.c.
switch_size_t switch_event_import_xml | ( | switch_xml_t | xml, |
const char * | keyname, | ||
const char * | valuename, | ||
switch_event_t ** | event | ||
) |
Parses a list of xml elements into an event.
xml | First element of the xml list to parse |
keyname | Name of the key attribute |
keyvalue | Name of the value attribute |
event | [out] event (if *event is NOT NULL, the headers will be appended to the existing event) |
Definition at line 49 of file switch_xml_config.c.
References switch_xml::next, switch_assert, switch_event_add_header_string(), SWITCH_EVENT_CLONE, switch_event_create, SWITCH_STACK_BOTTOM, and switch_xml_attr_soft().
Referenced by switch_xml_config_parse().
void switch_xml_config_cleanup | ( | switch_xml_config_item_t * | instructions | ) |
Free any memory allocated by the configuration.
instructions | instrutions on how to parse the elements |
Definition at line 447 of file switch_xml_config.c.
References CONFIG_SHUTDOWN, switch_xml_config_item::data, switch_xml_config_item::function, switch_xml_config_item::key, switch_xml_config_item::ptr, SWITCH_CONFIG_STRING, SWITCH_FALSE, switch_safe_free, and switch_xml_config_item::type.
const char* switch_xml_config_enum_int2str | ( | switch_xml_config_enum_item_t * | enum_options, |
int | value | ||
) |
Gets the string representation of an enum.
enum_options | the switch_xml_config_enum_item_t array for this enum |
value | int value to search |
Definition at line 127 of file switch_xml_config.c.
Referenced by switch_xml_config_item_print_doc().
switch_status_t switch_xml_config_enum_str2int | ( | switch_xml_config_enum_item_t * | enum_options, |
const char * | value, | ||
int * | out | ||
) |
Gets the int representation of an enum.
enum_options | the switch_xml_config_enum_item_t array for this enum |
value | string value to search |
Definition at line 115 of file switch_xml_config.c.
References SWITCH_STATUS_FALSE, and SWITCH_STATUS_SUCCESS.
Referenced by switch_xml_config_parse_event().
void switch_xml_config_item_print_doc | ( | int | level, |
switch_xml_config_item_t * | item | ||
) |
Prints out an item's documentation on the console.
level | loglevel to use |
item | item which the doc should be printed |
Definition at line 91 of file switch_xml_config.c.
References CONFIG_REQUIRED, SWITCH_CHANNEL_LOG_CLEAN, switch_log_printf(), switch_test_flag, and switch_xml_config_enum_int2str().
Referenced by switch_xml_config_parse_event().
switch_status_t switch_xml_config_parse | ( | switch_xml_t | xml, |
switch_bool_t | reload, | ||
switch_xml_config_item_t * | instructions | ||
) |
Parses all the xml elements, following a ruleset defined by an array of switch_xml_config_item_t.
xml | The first element of the list to parse |
reload | true to skip all non-reloadable options |
instructions | instrutions on how to parse the elements |
Definition at line 100 of file switch_xml_config.c.
References switch_event_destroy(), switch_event_import_xml(), and switch_xml_config_parse_event().
Referenced by switch_xml_config_parse_module_settings().
switch_status_t switch_xml_config_parse_event | ( | switch_event_t * | event, |
int | count, | ||
switch_bool_t | reload, | ||
switch_xml_config_item_t * | instructions | ||
) |
Parses all of an event's elements, following a ruleset defined by an array of switch_xml_config_item_t.
event | The event structure containing the key and values to parse |
reload | true to skip all non-reloadable options |
instructions | instrutions on how to parse the elements |
Definition at line 137 of file switch_xml_config.c.
References CONFIG_LOAD, CONFIG_RELOAD, CONFIG_RELOADABLE, CONFIG_REQUIRED, switch_xml_config_item::data, switch_xml_config_item::defaultvalue, switch_xml_config_int_options_t::enforce_max, switch_xml_config_atomic_options_t::enforce_max, switch_xml_config_int_options_t::enforce_min, switch_xml_config_atomic_options_t::enforce_min, switch_xml_config_item::function, if(), switch_xml_config_item::key, switch_xml_config_string_options_t::length, switch_xml_config_int_options_t::max, switch_xml_config_atomic_options_t::max, switch_xml_config_int_options_t::min, switch_xml_config_atomic_options_t::min, switch_event_header::name, switch_event_header::next, switch_xml_config_string_options_t::pool, switch_xml_config_item::ptr, switch_atomic_read(), switch_atomic_set(), SWITCH_CHANNEL_LOG, SWITCH_CONFIG_ATOMIC, SWITCH_CONFIG_BOOL, SWITCH_CONFIG_CUSTOM, SWITCH_CONFIG_ENUM, SWITCH_CONFIG_FLAG, SWITCH_CONFIG_FLAGARRAY, SWITCH_CONFIG_INT, SWITCH_CONFIG_LAST, SWITCH_CONFIG_STRING, switch_copy_string(), switch_core_strdup, switch_event_get_header, SWITCH_FALSE, switch_false(), switch_is_number(), SWITCH_LOG_ERROR, switch_log_printf(), SWITCH_LOG_WARNING, switch_regex_match(), switch_safe_free, SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, switch_test_flag, SWITCH_TRUE, switch_true(), switch_xml_config_enum_str2int(), switch_xml_config_item_print_doc(), switch_xml_config_item::type, switch_xml_config_string_options_t::validation_regex, and zstr.
Referenced by switch_xml_config_parse().
switch_status_t switch_xml_config_parse_module_settings | ( | const char * | file, |
switch_bool_t | reload, | ||
switch_xml_config_item_t * | instructions | ||
) |
Parses a module's settings.
reload | true to skip all non-reloadable options |
file | the configuration file to look for |
instructions | the instructions |
Definition at line 72 of file switch_xml_config.c.
References SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, switch_log_printf(), SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, switch_xml_child(), switch_xml_config_parse(), switch_xml_free(), and switch_xml_open_cfg().
switch_xml_config_string_options_t switch_config_string_strdup = { NULL, 0, NULL } |
Definition at line 35 of file switch_xml_config.c.
|
static |
Definition at line 37 of file switch_xml_config.c.