1 |
#ifndef ONI_H |
2 |
#error Do not include this file directly, include Oni/Oni.h instead! |
3 |
#endif |
4 |
|
5 |
#ifndef BFW_SCRIPTLANG_H |
6 |
#define BFW_SCRIPTLANG_H |
7 |
|
8 |
typedef enum { |
9 |
sl_int32, |
10 |
sl_str32, |
11 |
sl_float, |
12 |
sl_bool, /* Actually int32 0 or 1. */ |
13 |
sl_void, |
14 |
} sl_type; |
15 |
|
16 |
typedef struct { |
17 |
sl_type type; |
18 |
union { |
19 |
void* value; |
20 |
int32_t value_int32; |
21 |
char* value_str32; |
22 |
float value_float; |
23 |
char value_bool; |
24 |
} val; |
25 |
} sl_arg; |
26 |
|
27 |
typedef struct { |
28 |
char* name; |
29 |
char* calllocation; //maybe |
30 |
int linenumber; //perhaps |
31 |
} sl_callinfo; |
32 |
|
33 |
// Method signature for script (BSL) functions |
34 |
typedef uint16_t ( ONICALL *sl_func)(sl_callinfo* callinfo, uint32_t numargs, sl_arg args[], int* dontuse1, int* dontuse2, sl_arg* ret); |
35 |
|
36 |
|
37 |
#endif |