1
1
#![ allow( clippy:: missing_safety_doc) ]
2
2
3
- use byondapi:: {
4
- byond_string,
5
- map:: { byond_block, byond_length, ByondXYZ } ,
6
- parse_args,
7
- typecheck_trait:: ByondTypeCheck ,
8
- value:: { pointer:: ByondValuePointer , ByondValue } ,
9
- } ;
3
+ use byondapi:: { byond_string, map:: * , parse_args, prelude:: * } ;
10
4
11
5
#[ allow( dead_code) ]
12
6
fn write_log < T : AsRef < [ u8 ] > > ( x : T ) {
@@ -21,24 +15,21 @@ fn setup_panic_handler() {
21
15
}
22
16
23
17
#[ no_mangle]
24
- pub unsafe extern "C" fn test_connection (
25
- _argc : byondapi_sys:: u4c ,
26
- _argv : * mut ByondValue ,
27
- ) -> ByondValue {
18
+ pub unsafe extern "C" fn test_connection ( _argc : u4c , _argv : * mut ByondValue ) -> ByondValue {
28
19
setup_panic_handler ( ) ;
29
20
ByondValue :: new_num ( 69.0 )
30
21
}
31
22
32
23
#[ no_mangle]
33
- pub unsafe extern "C" fn test_args ( argc : byondapi_sys :: u4c , argv : * mut ByondValue ) -> ByondValue {
24
+ pub unsafe extern "C" fn test_args ( argc : u4c , argv : * mut ByondValue ) -> ByondValue {
34
25
setup_panic_handler ( ) ;
35
26
let args = parse_args ( argc, argv) ;
36
27
assert_eq ! ( args. len( ) , 1 ) ;
37
28
args[ 0 ]
38
29
}
39
30
40
31
#[ no_mangle]
41
- pub unsafe extern "C" fn test_ptr ( argc : byondapi_sys :: u4c , argv : * mut ByondValue ) -> ByondValue {
32
+ pub unsafe extern "C" fn test_ptr ( argc : u4c , argv : * mut ByondValue ) -> ByondValue {
42
33
setup_panic_handler ( ) ;
43
34
let args = parse_args ( argc, argv) ;
44
35
let pointer = match ByondValuePointer :: new ( args[ 0 ] . clone ( ) ) {
@@ -64,10 +55,7 @@ pub unsafe extern "C" fn test_ptr(argc: byondapi_sys::u4c, argv: *mut ByondValue
64
55
}
65
56
66
57
#[ no_mangle]
67
- pub unsafe extern "C" fn test_proc_call (
68
- argc : byondapi_sys:: u4c ,
69
- argv : * mut ByondValue ,
70
- ) -> ByondValue {
58
+ pub unsafe extern "C" fn test_proc_call ( argc : u4c , argv : * mut ByondValue ) -> ByondValue {
71
59
setup_panic_handler ( ) ;
72
60
let args = parse_args ( argc, argv) ;
73
61
@@ -80,10 +68,7 @@ pub unsafe extern "C" fn test_proc_call(
80
68
}
81
69
82
70
#[ no_mangle]
83
- pub unsafe extern "C" fn test_readwrite_var (
84
- argc : byondapi_sys:: u4c ,
85
- argv : * mut ByondValue ,
86
- ) -> ByondValue {
71
+ pub unsafe extern "C" fn test_readwrite_var ( argc : u4c , argv : * mut ByondValue ) -> ByondValue {
87
72
setup_panic_handler ( ) ;
88
73
let args = parse_args ( argc, argv) ;
89
74
let object = & args[ 0 ] ;
@@ -100,10 +85,7 @@ pub unsafe extern "C" fn test_readwrite_var(
100
85
}
101
86
}
102
87
#[ no_mangle]
103
- pub unsafe extern "C" fn test_list_push (
104
- argc : byondapi_sys:: u4c ,
105
- argv : * mut ByondValue ,
106
- ) -> ByondValue {
88
+ pub unsafe extern "C" fn test_list_push ( argc : u4c , argv : * mut ByondValue ) -> ByondValue {
107
89
setup_panic_handler ( ) ;
108
90
let args = parse_args ( argc, argv) ;
109
91
@@ -118,10 +100,7 @@ pub unsafe extern "C" fn test_list_push(
118
100
}
119
101
120
102
#[ no_mangle]
121
- pub unsafe extern "C" fn test_list_double (
122
- argc : byondapi_sys:: u4c ,
123
- argv : * mut ByondValue ,
124
- ) -> ByondValue {
103
+ pub unsafe extern "C" fn test_list_double ( argc : u4c , argv : * mut ByondValue ) -> ByondValue {
125
104
setup_panic_handler ( ) ;
126
105
let args = parse_args ( argc, argv) ;
127
106
@@ -137,10 +116,7 @@ pub unsafe extern "C" fn test_list_double(
137
116
}
138
117
139
118
#[ no_mangle]
140
- pub unsafe extern "C" fn test_list_index (
141
- argc : byondapi_sys:: u4c ,
142
- argv : * mut ByondValue ,
143
- ) -> ByondValue {
119
+ pub unsafe extern "C" fn test_list_index ( argc : u4c , argv : * mut ByondValue ) -> ByondValue {
144
120
setup_panic_handler ( ) ;
145
121
let args = parse_args ( argc, argv) ;
146
122
@@ -150,10 +126,7 @@ pub unsafe extern "C" fn test_list_index(
150
126
}
151
127
152
128
#[ no_mangle]
153
- pub unsafe extern "C" fn test_list_pop (
154
- argc : byondapi_sys:: u4c ,
155
- argv : * mut ByondValue ,
156
- ) -> ByondValue {
129
+ pub unsafe extern "C" fn test_list_pop ( argc : u4c , argv : * mut ByondValue ) -> ByondValue {
157
130
setup_panic_handler ( ) ;
158
131
let args = parse_args ( argc, argv) ;
159
132
@@ -174,10 +147,7 @@ pub unsafe extern "C" fn test_list_pop(
174
147
}
175
148
176
149
#[ no_mangle]
177
- pub unsafe extern "C" fn test_length_with_list (
178
- argc : byondapi_sys:: u4c ,
179
- argv : * mut ByondValue ,
180
- ) -> ByondValue {
150
+ pub unsafe extern "C" fn test_length_with_list ( argc : u4c , argv : * mut ByondValue ) -> ByondValue {
181
151
setup_panic_handler ( ) ;
182
152
let args = parse_args ( argc, argv) ;
183
153
@@ -189,7 +159,7 @@ pub unsafe extern "C" fn test_length_with_list(
189
159
}
190
160
}
191
161
#[ no_mangle]
192
- pub unsafe extern "C" fn test_block ( argc : byondapi_sys :: u4c , argv : * mut ByondValue ) -> ByondValue {
162
+ pub unsafe extern "C" fn test_block ( argc : u4c , argv : * mut ByondValue ) -> ByondValue {
193
163
setup_panic_handler ( ) ;
194
164
let _args = parse_args ( argc, argv) ;
195
165
@@ -211,10 +181,7 @@ pub unsafe extern "C" fn test_block(argc: byondapi_sys::u4c, argv: *mut ByondVal
211
181
}
212
182
213
183
#[ no_mangle]
214
- pub unsafe extern "C" fn test_length_with_str (
215
- argc : byondapi_sys:: u4c ,
216
- argv : * mut ByondValue ,
217
- ) -> ByondValue {
184
+ pub unsafe extern "C" fn test_length_with_str ( argc : u4c , argv : * mut ByondValue ) -> ByondValue {
218
185
setup_panic_handler ( ) ;
219
186
let args = parse_args ( argc, argv) ;
220
187
@@ -224,10 +191,7 @@ pub unsafe extern "C" fn test_length_with_str(
224
191
}
225
192
}
226
193
#[ no_mangle]
227
- pub unsafe extern "C" fn test_list_key_lookup (
228
- argc : byondapi_sys:: u4c ,
229
- argv : * mut ByondValue ,
230
- ) -> ByondValue {
194
+ pub unsafe extern "C" fn test_list_key_lookup ( argc : u4c , argv : * mut ByondValue ) -> ByondValue {
231
195
setup_panic_handler ( ) ;
232
196
let args = parse_args ( argc, argv) ;
233
197
@@ -278,7 +242,7 @@ pub unsafe extern "C" fn test_list_key_lookup(
278
242
}
279
243
280
244
#[ no_mangle]
281
- pub unsafe extern "C" fn test_ref ( argc : byondapi_sys :: u4c , argv : * mut ByondValue ) -> ByondValue {
245
+ pub unsafe extern "C" fn test_ref ( argc : u4c , argv : * mut ByondValue ) -> ByondValue {
282
246
setup_panic_handler ( ) ;
283
247
let args = parse_args ( argc, argv) ;
284
248
@@ -290,10 +254,7 @@ pub unsafe extern "C" fn test_ref(argc: byondapi_sys::u4c, argv: *mut ByondValue
290
254
}
291
255
292
256
#[ no_mangle]
293
- pub unsafe extern "C" fn test_non_assoc_list (
294
- argc : byondapi_sys:: u4c ,
295
- argv : * mut ByondValue ,
296
- ) -> ByondValue {
257
+ pub unsafe extern "C" fn test_non_assoc_list ( argc : u4c , argv : * mut ByondValue ) -> ByondValue {
297
258
setup_panic_handler ( ) ;
298
259
let args = parse_args ( argc, argv) ;
299
260
let list = args. get ( 0 ) . unwrap ( ) ;
@@ -318,10 +279,7 @@ pub unsafe extern "C" fn test_non_assoc_list(
318
279
}
319
280
320
281
#[ no_mangle]
321
- pub unsafe extern "C" fn test_list_read (
322
- argc : byondapi_sys:: u4c ,
323
- argv : * mut ByondValue ,
324
- ) -> ByondValue {
282
+ pub unsafe extern "C" fn test_list_read ( argc : u4c , argv : * mut ByondValue ) -> ByondValue {
325
283
setup_panic_handler ( ) ;
326
284
let args = parse_args ( argc, argv) ;
327
285
let list = args. get ( 0 ) . unwrap ( ) ;
0 commit comments