update
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12442 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
18d45d6039
commit
e1a55739f0
|
@ -87,7 +87,7 @@ struct switch_xml_config_item {
|
||||||
* \param options instrutions on how to parse the elements
|
* \param options instrutions on how to parse the elements
|
||||||
* \see switch_xml_config_item_t
|
* \see switch_xml_config_item_t
|
||||||
*/
|
*/
|
||||||
switch_status_t switch_xml_config_parse(switch_xml_t xml, int reload, switch_xml_config_item_t *options);
|
SWITCH_DECLARE(switch_status_t) switch_xml_config_parse(switch_xml_t xml, int reload, switch_xml_config_item_t *instructions);
|
||||||
|
|
||||||
#endif /* !defined(SWITCH_XML_CONFIG_H) */
|
#endif /* !defined(SWITCH_XML_CONFIG_H) */
|
||||||
|
|
||||||
|
|
|
@ -77,13 +77,13 @@ SWITCH_DECLARE(switch_status_t) switch_xml_config_parse(switch_xml_t xml, int re
|
||||||
case SWITCH_CONFIG_STRING:
|
case SWITCH_CONFIG_STRING:
|
||||||
{
|
{
|
||||||
switch_xml_config_string_options_t *string_options = (switch_xml_config_string_options_t*)item->data;
|
switch_xml_config_string_options_t *string_options = (switch_xml_config_string_options_t*)item->data;
|
||||||
if (options->length > 0) {
|
if (string_options->length > 0) {
|
||||||
/* We have a preallocated buffer */
|
/* We have a preallocated buffer */
|
||||||
char *dest = (char*)item->ptr;
|
char *dest = (char*)item->ptr;
|
||||||
if (value) {
|
if (value) {
|
||||||
switch_copy_string(dest, value, string_options->length);
|
switch_copy_string(dest, value, string_options->length);
|
||||||
} else if (options->defaultvalue){
|
} else if (item->defaultvalue){
|
||||||
switch_copy_string(dest, value, string_options->length);
|
switch_copy_string(dest, item->defaultvalue, string_options->length);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
char **dest = (char**)item->ptr;
|
char **dest = (char**)item->ptr;
|
||||||
|
@ -145,7 +145,7 @@ SWITCH_DECLARE(switch_status_t) switch_xml_config_parse(switch_xml_t xml, int re
|
||||||
case SWITCH_CONFIG_FLAG:
|
case SWITCH_CONFIG_FLAG:
|
||||||
{
|
{
|
||||||
int32_t *dest = (int32_t*)item->ptr;
|
int32_t *dest = (int32_t*)item->ptr;
|
||||||
int index = (int)item->data;
|
int index = (int)(intptr_t)item->data;
|
||||||
if (value) {
|
if (value) {
|
||||||
if (switch_true(value)) {
|
if (switch_true(value)) {
|
||||||
*dest |= (1 << index);
|
*dest |= (1 << index);
|
||||||
|
@ -164,7 +164,7 @@ SWITCH_DECLARE(switch_status_t) switch_xml_config_parse(switch_xml_t xml, int re
|
||||||
case SWITCH_CONFIG_FLAGARRAY:
|
case SWITCH_CONFIG_FLAGARRAY:
|
||||||
{
|
{
|
||||||
int8_t *dest = (int8_t*)item->ptr;
|
int8_t *dest = (int8_t*)item->ptr;
|
||||||
int index = (int)item->data;
|
int index = (int)(intptr_t)item->data;
|
||||||
if (value) {
|
if (value) {
|
||||||
dest[index] = !!switch_true(value);
|
dest[index] = !!switch_true(value);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue