diff options
Diffstat (limited to 'src/wren_inter/wren_inter.h')
| -rw-r--r-- | src/wren_inter/wren_inter.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/wren_inter/wren_inter.h b/src/wren_inter/wren_inter.h index 100f946..a84323f 100644 --- a/src/wren_inter/wren_inter.h +++ b/src/wren_inter/wren_inter.h @@ -3,10 +3,22 @@ #include <wren.h> -char *EvaluateScript(char *script); +enum PUZZLE_TEST_RESULT { + RESULT_OK = 0, + RESULT_WRONG_ANSWER, + RESULT_COMPTIME_NO_ENTRY, + RESULT_COMPTIME_ERR, + RESULT_RUNTIME_ERR, + // TODO: add async evaluation to prevent `while (true)` situation + RESULT_TIMEOUT, + RESULT_INIT_ERROR, +}; WrenVM *InterpreterPrepareMachine(); char *GetMachineOutput(WrenVM *vm); void InterpreterFreeMachine(WrenVM *vm); +// Runs the machine and returns +enum PUZZLE_TEST_RESULT wrenInterpretLimited(WrenVM *vm, const char *module, + const char *script, int sMax); #endif // WREN_INTER_H |
