forked from rofl0r/agsutils
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Script_internal.h
38 lines (31 loc) · 866 Bytes
/
Script_internal.h
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
#ifndef SCRIPT_INTERNAL_H
#define SCRIPT_INTERNAL_H
#include <stddef.h>
struct strings {
size_t count;
char ** strings;
char* data;
};
struct importlist {
char** names;
};
#define EXPORT_FUNCTION 1
#define EXPORT_DATA 2
struct function_export {
char* fn;
unsigned instr;
unsigned type;
};
#define FIXUP_GLOBALDATA 1 // code[fixup] += &globaldata[0]
#define FIXUP_FUNCTION 2 // code[fixup] += &code[0]
#define FIXUP_STRING 3 // code[fixup] += &strings[0]
#define FIXUP_IMPORT 4 // code[fixup] = &imported_thing[code[fixup]]
#define FIXUP_DATADATA 5 // globaldata[fixup] += &globaldata[0]
#define FIXUP_STACK 6 // code[fixup] += &stack[0]
struct fixup_data {
char *types;
unsigned *codeindex;
};
enum varsize {vs0 = 0, vs1, vs2, vs4, vsmax};
struct varinfo {size_t numrefs; enum varsize varsize;};
#endif