| 13 | #include <string.h> |
| 14 | |
| 15 | static const CBMDefinition *oa_route(const CBMFileResult *r, const char *qn) { |
| 16 | for (int i = 0; i < r->defs.count; i++) { |
| 17 | const CBMDefinition *d = &r->defs.items[i]; |
| 18 | if (d->qualified_name && strcmp(d->qualified_name, qn) == 0) { |
| 19 | return d; |
| 20 | } |
| 21 | } |
| 22 | printf(" no definition %s\n", qn); |
| 23 | return NULL; |
| 24 | } |
| 25 | |
| 26 | static const char *oa_prop(const CBMDefinition *d, const char *key) { |
| 27 | for (int i = 0; d && d->extra_props && d->extra_props[i]; i += 2) { |