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

Method mcRun

tools/ffi.js:496–518  ·  view source on GitHub ↗
(tool, description)

Source from the content-addressed store, hash-verified

494 this.addMCConfigDTSFile(tool, signatures);
495 }
496 mcRun(tool, description) {
497 let path = tool.fragmentPath.slice(0, -3) + "-ffi.mk";
498 path = tool.resolveFilePath(path);
499 if (!path)
500 throw new Error("No FFI support!");
501 tool.fragmentPath = path;
502 const signatures = this.parseSignatures(description.functions);
503 if (tool.platform == "pebble") {
504 path = tool.mainPath + tool.slash + ".." + tool.slash + "c";
505 path = tool.resolveDirectoryPath(path);
506 if (!path)
507 throw new Error("No c directory!");
508 const file = new TabFile(path + tool.slash + "mc.ffi.c", tool);
509 this.generateCFile(file, signatures, true, false);
510 file.close();
511 }
512 else {
513 this.addSources(tool, description.sources);
514 this.addMCRunCFile(tool, signatures);
515 this.addMCRunCFolder(tool);
516 }
517 this.addMCRunDTSFile(tool, signatures);
518 }
519}
520
521export default FFIGlue;

Callers 1

runMethod · 0.95

Calls 9

parseSignaturesMethod · 0.95
generateCFileMethod · 0.95
addSourcesMethod · 0.95
addMCRunCFileMethod · 0.95
addMCRunCFolderMethod · 0.95
addMCRunDTSFileMethod · 0.95
resolveFilePathMethod · 0.80
sliceMethod · 0.65
closeMethod · 0.65

Tested by

no test coverage detected