MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / cbm_spawn_match

Function cbm_spawn_match

internal/cbm/spawn_patterns.c:483–500  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

481}
482
483const 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. */

Callers 3

cbm_pipeline_spawn_siteFunction · 0.85
sp_apiFunction · 0.85
sp_programFunction · 0.85

Calls 3

spawn_tableFunction · 0.85
spawn_expandFunction · 0.85
spawn_entry_matchesFunction · 0.85

Tested by 2

sp_apiFunction · 0.68
sp_programFunction · 0.68