| 1230 | } |
| 1231 | |
| 1232 | static int count_edges_between_nodes(const cbm_gbuf_t *gbuf, const cbm_gbuf_node_t *source, |
| 1233 | const cbm_gbuf_node_t *target, const char *edge_type) { |
| 1234 | if (!gbuf || !source || !target || !edge_type) { |
| 1235 | return -1; |
| 1236 | } |
| 1237 | const cbm_gbuf_edge_t **edges = NULL; |
| 1238 | int count = 0; |
| 1239 | if (cbm_gbuf_find_edges_by_source_type(gbuf, source->id, edge_type, &edges, &count) != 0) { |
| 1240 | return -1; |
| 1241 | } |
| 1242 | int matches = 0; |
| 1243 | for (int i = 0; i < count; i++) { |
| 1244 | if (edges[i] && edges[i]->target_id == target->id) { |
| 1245 | matches++; |
| 1246 | } |
| 1247 | } |
| 1248 | return matches; |
| 1249 | } |
| 1250 | |
| 1251 | static bool has_edge_from_callable_to_node(const cbm_gbuf_t *gbuf, const char *source_tail, |
| 1252 | const cbm_gbuf_node_t *target, const char *edge_type) { |
no test coverage detected