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

Function diff_xml_object

lib/common/xml.c:1331–1357  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1329
1330
1331xmlNode *
1332diff_xml_object(xmlNode *old, xmlNode *new, gboolean suppress)
1333{
1334 xmlNode *tmp1 = NULL;
1335 xmlNode *diff = create_xml_node(NULL, "diff");
1336 xmlNode *removed = create_xml_node(diff, "diff-removed");
1337 xmlNode *added = create_xml_node(diff, "diff-added");
1338
1339 crm_xml_add(diff, XML_ATTR_CRM_VERSION, CRM_FEATURE_SET);
1340
1341 tmp1 = subtract_xml_object(removed, old, new, FALSE, NULL, "removed:top");
1342 if(suppress && tmp1 != NULL && can_prune_leaf(tmp1)) {
1343 free_xml(tmp1);
1344 }
1345
1346 tmp1 = subtract_xml_object(added, new, old, TRUE, NULL, "added:top");
1347 if(suppress && tmp1 != NULL && can_prune_leaf(tmp1)) {
1348 free_xml(tmp1);
1349 }
1350
1351 if(added->children == NULL && removed->children == NULL) {
1352 free_xml(diff);
1353 diff = NULL;
1354 }
1355
1356 return diff;
1357}
1358
1359gboolean
1360can_prune_leaf(xmlNode *xml_node)

Callers 3

mainFunction · 0.85
mainFunction · 0.85
cib_config_changedFunction · 0.85

Calls 5

create_xml_nodeFunction · 0.85
crm_xml_addFunction · 0.85
subtract_xml_objectFunction · 0.85
can_prune_leafFunction · 0.85
free_xmlFunction · 0.85

Tested by

no test coverage detected