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

Function cib_GCompareFunc

cib/callbacks.c:1120–1142  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1118}
1119
1120gint
1121cib_GCompareFunc(gconstpointer a, gconstpointer b)
1122{
1123 const xmlNode *a_msg = a;
1124 const xmlNode *b_msg = b;
1125
1126 int msg_a_id = 0;
1127 int msg_b_id = 0;
1128 const char *value = NULL;
1129
1130 value = crm_element_value_const(a_msg, F_CIB_CALLID);
1131 msg_a_id = crm_parse_int(value, NULL);
1132
1133 value = crm_element_value_const(b_msg, F_CIB_CALLID);
1134 msg_b_id = crm_parse_int(value, NULL);
1135
1136 if (msg_a_id == msg_b_id) {
1137 return 0;
1138 } else if (msg_a_id < msg_b_id) {
1139 return -1;
1140 }
1141 return 1;
1142}
1143
1144#if SUPPORT_HEARTBEAT
1145void

Callers

nothing calls this directly

Calls 2

crm_element_value_constFunction · 0.85
crm_parse_intFunction · 0.85

Tested by

no test coverage detected