-
Notifications
You must be signed in to change notification settings - Fork 164
Expand file tree
/
Copy pathfunction_types.fbs
More file actions
124 lines (95 loc) · 1.77 KB
/
function_types.fbs
File metadata and controls
124 lines (95 loc) · 1.77 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
namespace Hyperlight.Generated;
// the following tables are used to hold the values of the parameters and return values of functions
// they are named with hl prefix to avoid reserved word clashes in generated code
// hlint is a 32 bit signed integer
table hlint {
value:int;
}
// hluint is a 32 bit unsigned integer
table hluint {
value:uint;
}
// hllong is a 64 bit signed integer
table hllong {
value:long;
}
// hlulong is a 64 bit unsigned integer
table hlulong {
value:ulong;
}
// hlfloat is 32-bit float
table hlfloat {
value:float;
}
// hldouble is 64-bit float
table hldouble {
value:double;
}
// hlstring is a UTF8 encoded string
table hlstring{
value:string;
}
// hlbool is a C99 boolean
table hlbool {
value:bool;
}
// hlvecbytes is a vector of bytes
table hlvecbytes {
value:[ubyte];
}
// hlsizeprefixedbuffer is a vector of bytes prefixed with a 32 bit integer
table hlsizeprefixedbuffer {
size:int;
value:[ubyte];
}
// hlvoid is a void (used for functions that return nothing)
table hlvoid {
}
// This represents a parameter value in a function call
union ParameterValue {
hlint,
hluint,
hllong,
hlulong,
hlfloat,
hldouble,
hlstring,
hlbool,
hlvecbytes,
}
// This represents a parameter type in a function definition
enum ParameterType : ubyte {
hlint,
hluint,
hllong,
hlulong,
hlfloat,
hldouble,
hlstring,
hlbool,
hlvecbytes,
}
enum ReturnType : ubyte {
hlint,
hluint,
hllong,
hlulong,
hlfloat,
hldouble,
hlstring,
hlbool,
hlvoid,
hlsizeprefixedbuffer,
}
union ReturnValue {
hlint,
hluint,
hllong,
hlulong,
hlfloat,
hldouble,
hlstring,
hlbool,
hlvoid,
hlsizeprefixedbuffer,
}