123456789101112131415161718192021222324252627282930313233343536373839 |
- #ifndef SCRIPT_H
- #define SCRIPT_H
- #include <stdbool.h>
- #include "vm/Arrays.h"
- #include "vm/ByteCode.h"
- #define SCRIPT_STACK_SIZE 1000
- #define SCRIPT_ERROR_SIZE 256
- typedef struct {
- char error[SCRIPT_ERROR_SIZE];
- ByteCode* code;
- int readIndex;
- char stack[SCRIPT_STACK_SIZE];
- int stackIndex;
- int stackVarIndex;
- int line;
- Arrays arrays;
- } Script;
- Script* sInit(ByteCode* code);
- void sDelete(Script* sc);
- void sRun(Script* sc);
- typedef void (*IntPrinter)(int);
- void sSetIntPrinter(IntPrinter p);
- typedef void (*LongPrinter)(long);
- void sSetLongPrinter(LongPrinter p);
- typedef void (*FloatPrinter)(float);
- void sSetFloatPrinter(FloatPrinter p);
- typedef void (*BoolPrinter)(bool);
- void sSetBoolPrinter(BoolPrinter p);
- typedef void (*PointerPrinter)(Pointer*);
- void sSetPointerPrinter(PointerPrinter p);
- #endif
|