mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-09 03:18:30 +00:00
core: Config and XML tweaks needed for geolocation
Added:
Replace a variable in a list:
int ast_variable_list_replace_variable(struct ast_variable **head,
struct ast_variable *old, struct ast_variable *new);
Added test as well.
Create a "name=value" string from a variable list:
'name1="val1",name2="val2"', etc.
struct ast_str *ast_variable_list_join(
const struct ast_variable *head, const char *item_separator,
const char *name_value_separator, const char *quote_char,
struct ast_str **str);
Added test as well.
Allow the name of an XML element to be changed.
void ast_xml_set_name(struct ast_xml_node *node, const char *name);
Change-Id: I330a5f63dc0c218e0d8dfc0745948d2812141ccb
This commit is contained in:
committed by
Friendly Automation
parent
466a361626
commit
83372e7ab5
@@ -332,6 +332,15 @@ void ast_xml_set_text(struct ast_xml_node *node, const char *content)
|
||||
xmlNodeSetContent((xmlNode *) node, (const xmlChar *) content);
|
||||
}
|
||||
|
||||
void ast_xml_set_name(struct ast_xml_node *node, const char *name)
|
||||
{
|
||||
if (!node || !name) {
|
||||
return;
|
||||
}
|
||||
|
||||
xmlNodeSetName((xmlNode *) node, (const xmlChar *) name);
|
||||
}
|
||||
|
||||
int ast_xml_doc_dump_file(FILE *output, struct ast_xml_doc *doc)
|
||||
{
|
||||
return xmlDocDump(output, (xmlDocPtr)doc);
|
||||
|
||||
Reference in New Issue
Block a user