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

Function print_xml_diff

tools/cib_shadow.c:562–605  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

560}
561
562void
563print_xml_diff(FILE * where, xmlNode * diff)
564{
565 char *buffer = NULL;
566 xmlNode *child = NULL;
567 int max = 1024, len = 0;
568 gboolean is_first = TRUE;
569 xmlNode *added = find_xml_node(diff, "diff-added", FALSE);
570 xmlNode *removed = find_xml_node(diff, "diff-removed", FALSE);
571
572 is_first = TRUE;
573 for (child = __xml_first_child(removed); child != NULL; child = __xml_next(child)) {
574 len = 0;
575 max = 1024;
576 free(buffer);
577 buffer = calloc(1, max);
578
579 if (is_first) {
580 is_first = FALSE;
581 } else {
582 fprintf(where, " --- \n");
583 }
584
585 CRM_CHECK(dump_data_element(0, &buffer, &max, &len, "-", child, TRUE) >= 0, continue);
586 fprintf(where, "%s", buffer);
587 }
588
589 is_first = TRUE;
590 for (child = __xml_first_child(added); child != NULL; child = __xml_next(child)) {
591 len = 0;
592 max = 1024;
593 free(buffer);
594 buffer = calloc(1, max);
595
596 if (is_first) {
597 is_first = FALSE;
598 } else {
599 fprintf(where, " +++ \n");
600 }
601
602 CRM_CHECK(dump_data_element(0, &buffer, &max, &len, "+", child, TRUE) >= 0, continue);
603 fprintf(where, "%s", buffer);
604 }
605}

Callers 1

mainFunction · 0.85

Calls 4

find_xml_nodeFunction · 0.85
__xml_first_childFunction · 0.85
__xml_nextFunction · 0.85
dump_data_elementFunction · 0.85

Tested by

no test coverage detected