mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-03-13 08:11:01 +03:00
feat: add vt
This commit is contained in:
@@ -2,9 +2,11 @@ use std::{ffi::CStr, os::raw::c_char};
|
||||
|
||||
use crate::plugins::PLUGIN_REGISTRAR;
|
||||
|
||||
// API provided by RustDesk.
|
||||
pub type LoadPluginFunc = fn(*const i8) -> i32;
|
||||
pub type UnloadPluginFunc = fn(*const i8) -> i32;
|
||||
|
||||
#[repr(C)]
|
||||
pub struct RustDeskApiTable {
|
||||
pub register_plugin: LoadPluginFunc,
|
||||
pub unload_plugin: UnloadPluginFunc,
|
||||
@@ -20,9 +22,13 @@ fn unload_plugin(path: *const i8) -> i32 {
|
||||
PLUGIN_REGISTRAR.unload_plugin(path)
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
fn get_api_table() -> RustDeskApiTable {
|
||||
RustDeskApiTable::default()
|
||||
}
|
||||
|
||||
impl Default for RustDeskApiTable {
|
||||
fn default() -> Self {
|
||||
let f = load_plugin;
|
||||
Self {
|
||||
register_plugin: load_plugin,
|
||||
unload_plugin: unload_plugin,
|
||||
|
||||
Reference in New Issue
Block a user