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

Function fxLoadScript

xs/tools/xsl.c:1036–1060  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1034}
1035
1036txScript* fxLoadScript(txMachine* the, txString path)
1037{
1038 txLinker* linker = (txLinker*)(the->context);
1039 txLinkerScript* linkerScript = linker->firstScript;
1040 while (linkerScript) {
1041 if (!c_strcmp(path, linkerScript->path)) {
1042 txScript* script = fxNewLinkerChunk(linker, sizeof(txScript));
1043 script->callback = fxLinkerScriptCallback;
1044 script->symbolsBuffer = NULL;
1045 script->symbolsSize = 0;
1046 script->codeBuffer = linkerScript->codeBuffer;
1047 script->codeSize = linkerScript->codeSize;
1048 script->hostsBuffer = NULL;
1049 script->hostsSize = 0;
1050 script->path = linkerScript->path;
1051 script->version[0] = XS_MAJOR_VERSION;
1052 script->version[1] = XS_MINOR_VERSION;
1053 script->version[2] = XS_PATCH_VERSION;
1054 script->version[3] = 0;
1055 return script;
1056 }
1057 linkerScript = linkerScript->nextScript;
1058 }
1059 return C_NULL;
1060}
1061
1062txScript* fxParseScript(txMachine* the, void* stream, txGetter getter, txUnsigned flags)
1063{

Callers 1

fxLoadModuleFunction · 0.70

Calls 1

fxNewLinkerChunkFunction · 0.85

Tested by

no test coverage detected