X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=tests%2Futils%2Fxml-utils%2Fextract_xml.cpp;h=80b895411ab45b864208d33f2b673a19e0fe0c7e;hb=28ab034a2c3582d07d3423d2d746731f87d3969f;hp=9bfd50bda83d8e8ed829e2a7277eef2ae419cc28;hpb=52e345b9ac912d033c2a2c25a170a01cf209839d;p=lttng-tools.git diff --git a/tests/utils/xml-utils/extract_xml.cpp b/tests/utils/xml-utils/extract_xml.cpp index 9bfd50bda..80b895411 100644 --- a/tests/utils/xml-utils/extract_xml.cpp +++ b/tests/utils/xml-utils/extract_xml.cpp @@ -24,18 +24,18 @@ * node;b; * node;c; */ +#include + +#include +#include +#include +#include #include #include #include #include #include -#include -#include -#include -#include -#include - #if defined(LIBXML_XPATH_ENABLED) static int opt_verbose; @@ -65,8 +65,9 @@ static int print_xpath_nodes(xmlDocPtr doc, xmlNodeSetPtr nodes, FILE *output) LTTNG_ASSERT(nodes->nodeTab[i]); if (nodes->nodeTab[i]->type == XML_NAMESPACE_DECL) { - fprintf(stderr, "ERR:%s\n", - "This executable does not support xml namespacing\n"); + fprintf(stderr, + "ERR:%s\n", + "This executable does not support xml namespacing\n"); ret = -1; goto end; } else if (nodes->nodeTab[i]->type == XML_ELEMENT_NODE) { @@ -74,16 +75,17 @@ static int print_xpath_nodes(xmlDocPtr doc, xmlNodeSetPtr nodes, FILE *output) if (xmlChildElementCount(cur) == 0) { if (xmlNodeIsText(cur->children)) { - node_child_value_string = xmlNodeListGetString(doc, - cur->children, 1); + node_child_value_string = + xmlNodeListGetString(doc, cur->children, 1); if (node_exist) { result = true; } else if (opt_verbose) { - fprintf(output, "%s;%s;\n", cur->name, - node_child_value_string); + fprintf(output, + "%s;%s;\n", + cur->name, + node_child_value_string); } else { - fprintf(output, "%s\n", - node_child_value_string); + fprintf(output, "%s\n", node_child_value_string); } xmlFree(node_child_value_string); } else { @@ -91,8 +93,9 @@ static int print_xpath_nodes(xmlDocPtr doc, xmlNodeSetPtr nodes, FILE *output) if (node_exist) { result = true; } else { - fprintf(stderr, "ERR:%s\n", - "Xpath expression return non-final xml element"); + fprintf(stderr, + "ERR:%s\n", + "Xpath expression return non-final xml element"); ret = -1; goto end; } @@ -102,8 +105,9 @@ static int print_xpath_nodes(xmlDocPtr doc, xmlNodeSetPtr nodes, FILE *output) result = true; } else { /* We don't want to print non-final element */ - fprintf(stderr, "ERR:%s\n", - "Xpath expression return non-final xml element"); + fprintf(stderr, + "ERR:%s\n", + "Xpath expression return non-final xml element"); ret = -1; goto end; } @@ -255,7 +259,7 @@ int main(int argc, char **argv) return -1; } /* Do the main job */ - if (extract_xpath(argv[optind], (xmlChar *)argv[optind+1])) { + if (extract_xpath(argv[optind], (xmlChar *) argv[optind + 1])) { return -1; }