MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / fxFindScript

Function fxFindScript

xs/platforms/qca4020/xsHost.c:526–550  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

524#endif
525
526static txBoolean fxFindScript(txMachine* the, txSlot* realm, txString path, txID* id)
527{
528 txPreparation* preparation = the->preparation;
529 txInteger c = preparation->scriptCount;
530 txScript* script = preparation->scripts;
531#if MODDEF_XS_MODS
532 uint8_t *mod;
533 int modSize;
534
535 mod = findMod(the, path + preparation->baseLength, &modSize);
536 if (mod) {
537 *id = fxNewNameC(the, path);
538 return 1;
539 }
540#endif
541 while (c > 0) {
542 if (!c_strcmp(path + preparation->baseLength, script->path)) {
543 *id = fxNewNameC(the, path);
544 return 1;
545 }
546 c--;
547 script++;
548 }
549 return 0;
550}
551
552txID fxFindModule(txMachine* the, txSlot* realm, txID moduleID, txSlot* slot)
553{

Callers 1

fxFindModuleFunction · 0.70

Calls 2

fxNewNameCFunction · 0.85
findModFunction · 0.70

Tested by

no test coverage detected