feat: change dummy c to a rust plugin example

This commit is contained in:
Kingtous
2023-04-13 02:06:42 +08:00
parent e3c828a6f1
commit f2f39e31a1
7 changed files with 81 additions and 31 deletions

View File

@@ -8,8 +8,8 @@ pub type UnloadPluginFunc = fn(*const c_char) -> i32;
#[repr(C)]
pub struct RustDeskApiTable {
pub register_plugin: LoadPluginFunc,
pub unload_plugin: UnloadPluginFunc,
pub(crate) register_plugin: LoadPluginFunc,
pub(crate) unload_plugin: UnloadPluginFunc,
}
#[no_mangle]
@@ -22,11 +22,6 @@ fn unload_plugin(path: *const c_char) -> i32 {
PLUGIN_REGISTRAR.unload_plugin(path)
}
#[no_mangle]
fn get_api_table() -> RustDeskApiTable {
RustDeskApiTable::default()
}
impl Default for RustDeskApiTable {
fn default() -> Self {
Self {