summaryrefslogtreecommitdiff
path: root/src/wren_inter/wren_inter.h
blob: a84323f429c94928091cb42b610941ccaed9a2cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#ifndef WREN_INTER_H
#define WREN_INTER_H

#include <wren.h>

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