Find a definition by label+name; returns NULL if not found. */
| 58 | |
| 59 | /* Find a definition by label+name; returns NULL if not found. */ |
| 60 | static CBMDefinition *find_def(CBMFileResult *r, const char *label, const char *name) { |
| 61 | for (int i = 0; i < r->defs.count; i++) { |
| 62 | CBMDefinition *d = &r->defs.items[i]; |
| 63 | if (d->label && strcmp(d->label, label) == 0 && d->name && strcmp(d->name, name) == 0) |
| 64 | return d; |
| 65 | } |
| 66 | return NULL; |
| 67 | } |
| 68 | |
| 69 | /* Find a definition by name alone (any label). */ |
| 70 | static CBMDefinition *find_def_any(CBMFileResult *r, const char *name) { |