| 604 | } |
| 605 | |
| 606 | void modRunMachineSetup(txMachine *the) |
| 607 | { |
| 608 | txPreparation *preparation = xsPreparationAndCreation(NULL); |
| 609 | txInteger scriptCount = preparation->scriptCount; |
| 610 | txScript* script = preparation->scripts; |
| 611 | |
| 612 | #ifdef mxInstrument |
| 613 | modInstrumentationSetup(the); |
| 614 | #endif |
| 615 | |
| 616 | gSetupPending = 1; |
| 617 | |
| 618 | xsBeginHost(the); |
| 619 | xsVars(1); |
| 620 | xsVar(0) = xsNewHostFunction(setStepDone, 0); |
| 621 | |
| 622 | while (scriptCount--) { |
| 623 | if (0 == c_strncmp(script->path, "setup/", 6)) { |
| 624 | char path[C_PATH_MAX]; |
| 625 | char *dot; |
| 626 | |
| 627 | c_strcpy(path, script->path); |
| 628 | dot = c_strchr(path, '.'); |
| 629 | if (dot) |
| 630 | *dot = 0; |
| 631 | |
| 632 | xsResult = xsAwaitImport(path, XS_IMPORT_DEFAULT); |
| 633 | if (xsTest(xsResult) && xsIsInstanceOf(xsResult, xsFunctionPrototype)) { |
| 634 | gSetupPending += 1; |
| 635 | xsCallFunction1(xsResult, xsGlobal, xsVar(0)); |
| 636 | } |
| 637 | } |
| 638 | script++; |
| 639 | } |
| 640 | xsEndHost(the); |
| 641 | |
| 642 | setStepDone(the); |
| 643 | } |
| 644 | |
| 645 | #ifdef mxInstrument |
| 646 | #ifdef mxDebug |
nothing calls this directly
no test coverage detected