1
0
Fork 0

Add common struct

This commit is contained in:
Florian RICHER 2022-01-28 22:06:47 +01:00
parent cdb82d6ccc
commit 4b94fa645c
10 changed files with 65 additions and 25 deletions

View file

@ -2,6 +2,13 @@
# It is not intended for manual editing.
version = 3
[[package]]
name = "hotload_plugin"
version = "0.1.0"
[[package]]
name = "hotload_toto1"
version = "0.1.0"
dependencies = [
"hotload_plugin",
]

View file

@ -6,7 +6,7 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
# hotload_plugin = { path = "../../crates/hotload_plugin" }
hotload_plugin = { path = "../../crates/hotload_plugin" }
[lib]
crate-type = ["dylib"]

View file

@ -1,9 +1,12 @@
#[no_mangle]
pub extern fn version() -> String {
"0.2.0".to_string()
}
use hotload_plugin::HotloadPlugin;
#[no_mangle]
pub extern fn name() -> String {
"test name".to_string()
pub extern "C" fn register() -> *const HotloadPlugin {
let plugin = Box::new(HotloadPlugin {
name: String::from("test_lib"),
version: String::from("0.1.0"),
author: String::from("mrdev023"),
});
Box::into_raw(plugin)
}