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