-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathssvm.h
More file actions
56 lines (36 loc) · 1.22 KB
/
Copy pathssvm.h
File metadata and controls
56 lines (36 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#ifndef SSVM_H
#define SSVM_H
namespace _vm
{
#define GET_STACK_INDEX(index) \
(index < 0 ? index += vm_script.stack.iFrameIndex : index)
int LoadScript(char* filename);
void ResetScript();
void RunScript();
void CopyValue(Value* dest, Value source);
int ValueToInt(Value value);
float ValueToFloat(Value value);
char* ValueToString(Value value);
Value GetStackValue(int index);
void SetStackValue(int index, Value value);
int GetOpTypeFromStack(int opIndex);
int GetOpTypeFromInstr(int opIndex);
Value GetOpValue(int opIndex);
Value* GetOpValuePointer(int opIndex);
int GetOpValueAsInt(int opIndex);
float GetOpValueAsFloat(int opIndex);
char* GetOpValueAsString(int opIndex);
int GetOpValueAsStackIndex(int opIndex);
int GetOpValueAsInstrIndex(int opIndex);
int GetOpValueAsFuncIndex(int opIndex);
char* GetOpValueASHostAPI(int opIndex);
void Push(Value value);
Value Pop();
void PushFrame(int size);
void PopFrame(int size);
void ReturnValue_String(char* str);
void ReturnValue_Int(int integer);
void ReturnValue_Float(float fnum);
#define ReturnValue_Pointer(p) ReturnValue_Int((intptr_t)p)
}
#endif