* count_method_defs_named — count defs with label "Method" matching name. * Mirrors the `has_def` helper in test_extraction.c but counts all matches. */
| 63 | * Mirrors the `has_def` helper in test_extraction.c but counts all matches. |
| 64 | */ |
| 65 | static int count_method_defs_named(CBMFileResult *r, const char *name) { |
| 66 | int n = 0; |
| 67 | for (int i = 0; i < r->defs.count; i++) { |
| 68 | const CBMDefinition *d = &r->defs.items[i]; |
| 69 | if (d->label && strcmp(d->label, "Method") == 0 && |
| 70 | d->name && strcmp(d->name, name) == 0) { |
| 71 | n++; |
| 72 | } |
| 73 | } |
| 74 | return n; |
| 75 | } |
| 76 | |
| 77 | /* |
| 78 | * count_defs_with_label — count all defs carrying the given label. |