-
Notifications
You must be signed in to change notification settings - Fork 14
/
Script_internal.h
40 lines (33 loc) · 923 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
39
40
#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 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]
#define FIXUP_MAX FIXUP_STACK
struct fixup_data {
unsigned count[FIXUP_MAX+1];
unsigned *codeindex;
unsigned *codeindex_per[FIXUP_MAX+1];
unsigned char *types;
};
struct varinfo {size_t numrefs; unsigned varsize;};
#endif