Find a definition by name in an extraction result. */
| 33 | |
| 34 | /* Find a definition by name in an extraction result. */ |
| 35 | static const CBMDefinition *find_def(const CBMFileResult *r, const char *name) { |
| 36 | for (int i = 0; i < r->defs.count; i++) { |
| 37 | if (strcmp(r->defs.items[i].name, name) == 0) { |
| 38 | return &r->defs.items[i]; |
| 39 | } |
| 40 | } |
| 41 | return NULL; |
| 42 | } |
| 43 | |
| 44 | /* Count SIMILAR_TO edges in graph buffer. */ |
| 45 | static int count_similar_to_edges(const cbm_gbuf_t *gb) { |