MCPcopy Create free account
hub / github.com/ClusterLabs/pacemaker / print_xml_output

Function print_xml_output

tools/cibadmin.c:183–212  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

181/* *INDENT-ON* */
182
183static void
184print_xml_output(xmlNode *xml)
185{
186 char *buffer;
187 if (!xml) {
188 return;
189 } else if (xml->type != XML_ELEMENT_NODE) {
190 return;
191 }
192
193 if(command_options & cib_xpath_address) {
194 const char *id = crm_element_value(xml, XML_ATTR_ID);
195
196 if(safe_str_eq((const char *)xml->name, "xpath-query")) {
197 xmlNode *child = NULL;
198
199 for (child = xml->children; child; child = child->next) {
200 print_xml_output(child);
201 }
202
203 } else {
204 printf("%s\n", id);
205 }
206
207 } else {
208 buffer = dump_xml_formatted(xml);
209 fprintf(stdout, "%s\n", crm_str(buffer));
210 free(buffer);
211 }
212}
213
214int
215main(int argc, char **argv)

Callers 2

mainFunction · 0.85
cibadmin_op_callbackFunction · 0.85

Calls 2

crm_element_valueFunction · 0.85
dump_xml_formattedFunction · 0.85

Tested by

no test coverage detected