HTTP_CALLS + ASYNC_CALLS edges out of the function `source_name`. */
| 11590 | |
| 11591 | /* HTTP_CALLS + ASYNC_CALLS edges out of the function `source_name`. */ |
| 11592 | static int service_edges_from(cbm_store_t *s, const char *project, const char *source_name) { |
| 11593 | static const char *const types[] = {"HTTP_CALLS", "ASYNC_CALLS"}; |
| 11594 | int matches = 0; |
| 11595 | for (size_t t = 0; t < sizeof(types) / sizeof(types[0]); t++) { |
| 11596 | cbm_edge_t *edges = NULL; |
| 11597 | int edge_count = 0; |
| 11598 | if (cbm_store_find_edges_by_type(s, project, types[t], &edges, &edge_count) != |
| 11599 | CBM_STORE_OK) { |
| 11600 | return -1; |
| 11601 | } |
| 11602 | for (int i = 0; i < edge_count; i++) { |
| 11603 | cbm_node_t source = {0}; |
| 11604 | if (cbm_store_find_node_by_id(s, edges[i].source_id, &source) == CBM_STORE_OK && |
| 11605 | source.name && strcmp(source.name, source_name) == 0) { |
| 11606 | matches++; |
| 11607 | } |
| 11608 | cbm_node_free_fields(&source); |
| 11609 | } |
| 11610 | cbm_store_free_edges(edges, edge_count); |
| 11611 | } |
| 11612 | return matches; |
| 11613 | } |
| 11614 | |
| 11615 | /* IMPORTS edges out of `file_path` that bind `local_name`; -1 on a failed query. */ |
| 11616 | static int imports_binding_count(cbm_store_t *s, const char *project, const char *file_path, |
no test coverage detected