Return the first definition whose label AND name both match (either may be * NULL to wildcard). Mirrors the helper in repro_extraction.c. */
| 82 | /* Return the first definition whose label AND name both match (either may be |
| 83 | * NULL to wildcard). Mirrors the helper in repro_extraction.c. */ |
| 84 | static CBMDefinition *find_def(CBMFileResult *r, const char *label, |
| 85 | const char *name) { |
| 86 | for (int i = 0; i < r->defs.count; i++) { |
| 87 | CBMDefinition *d = &r->defs.items[i]; |
| 88 | if (label && (!d->label || strcmp(d->label, label) != 0)) |
| 89 | continue; |
| 90 | if (name && (!d->name || strcmp(d->name, name) != 0)) |
| 91 | continue; |
| 92 | return d; |
| 93 | } |
| 94 | return NULL; |
| 95 | } |
| 96 | |
| 97 | /* Return 1 if any entry in the NULL-terminated decorators array contains |
| 98 | * needle as a substring. */ |