File tree Expand file tree Collapse file tree 4 files changed +46
-0
lines changed Expand file tree Collapse file tree 4 files changed +46
-0
lines changed Original file line number Diff line number Diff line change
1
+ # Generated by Cargo
2
+ /target /
3
+ Cargo.lock
4
+
5
+ # Generated by mdbook
6
+ /book /book /
7
+
8
+ # Generated by rustfmt
9
+ * .bk
10
+
11
+ # IDEs / Editor
12
+ * .iml
13
+ .idea
Original file line number Diff line number Diff line change
1
+ attributes_on_same_line_as_field = false
2
+ attributes_on_same_line_as_variant = false
3
+ reorder_imports = true
4
+ reorder_import_names = true
5
+ reorder_imports_in_group = true
6
+ binop_separator = " Back"
7
+ # imports_indent = "Block"
Original file line number Diff line number Diff line change
1
+ [package ]
2
+ name = " specs-ffi"
3
+ version = " 0.1.0"
4
+ authors = [" torkleyy <torkleyy@gmail.com>" ]
5
+
6
+ [dependencies ]
7
+ shred = " 0.5"
8
+ specs = " 0.10"
Original file line number Diff line number Diff line change
1
+ #![ no_mangle]
2
+
3
+ extern crate shred;
4
+ extern crate specs;
5
+
6
+ #[ repr( C ) ]
7
+ pub struct SpecsWorld ( pub specs:: World ) ;
8
+
9
+ pub fn create_world ( ) -> * mut SpecsWorld {
10
+ let world = SpecsWorld ( specs:: World :: new ( ) ) ;
11
+ let world = Box :: new ( world) ;
12
+
13
+ Box :: into_raw ( world)
14
+ }
15
+
16
+ pub fn free_world ( w : * mut SpecsWorld ) {
17
+ unsafe { Box :: from_raw ( w) ; }
18
+ }
You can’t perform that action at this time.
0 commit comments