| 3530 | } |
| 3531 | |
| 3532 | static bool compare_edge_callback(void *context, bool added, |
| 3533 | const cbm_graph_edge_identity_t *edge) { |
| 3534 | compare_response_t *response = (compare_response_t *)context; |
| 3535 | compare_result_set_t *set = added ? &response->edges_added : &response->edges_removed; |
| 3536 | if (set->returned >= response->limit || set->budget_exhausted) { |
| 3537 | return true; |
| 3538 | } |
| 3539 | yyjson_mut_doc *doc = yyjson_mut_doc_new(NULL); |
| 3540 | yyjson_mut_val *item = doc ? yyjson_mut_obj(doc) : NULL; |
| 3541 | yyjson_mut_val *source = doc ? compare_node_json(doc, &edge->source) : NULL; |
| 3542 | yyjson_mut_val *target = doc ? compare_node_json(doc, &edge->target) : NULL; |
| 3543 | bool ok = item && source && target && yyjson_mut_obj_add_val(doc, item, "source", source) && |
| 3544 | yyjson_mut_obj_add_val(doc, item, "target", target) && |
| 3545 | compare_add_identity_string(doc, item, "type", edge->type) && |
| 3546 | compare_add_identity_string(doc, item, "local_name_gen", edge->local_name_gen); |
| 3547 | if (ok) { |
| 3548 | yyjson_mut_doc_set_root(doc, item); |
| 3549 | } |
| 3550 | return compare_append_item(response, set, doc, ok ? item : NULL); |
| 3551 | } |
| 3552 | |
| 3553 | static bool compare_cancel_callback(void *context) { |
| 3554 | compare_response_t *response = (compare_response_t *)context; |
nothing calls this directly
no test coverage detected