| 481 | } |
| 482 | |
| 483 | const cbm_spawn_api_t *cbm_spawn_match(CBMLanguage lang, const char *callee, |
| 484 | const CBMImport *imports, int count) { |
| 485 | const cbm_spawn_api_t *table = spawn_table(lang); |
| 486 | if (!table || !callee || !callee[0]) { |
| 487 | return NULL; |
| 488 | } |
| 489 | if (!imports) { |
| 490 | count = 0; |
| 491 | } |
| 492 | char expanded[CBM_SZ_512]; |
| 493 | spawn_expand(callee, imports, count, expanded, sizeof(expanded)); |
| 494 | for (const cbm_spawn_api_t *e = table; e->api; e++) { |
| 495 | if (spawn_entry_matches(e, callee, expanded, imports, count)) { |
| 496 | return e; |
| 497 | } |
| 498 | } |
| 499 | return NULL; |
| 500 | } |
| 501 | |
| 502 | /* The first quoted literal in `text` ("..", '..' or `..`), copied without |
| 503 | * its quotes. False when there is none. */ |