plugin, tmp commit

Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
fufesou
2023-04-18 23:02:37 +08:00
parent f8a292cc56
commit ecf8c2664c
14 changed files with 547 additions and 118 deletions

19
src/plugin/mod.rs Normal file
View File

@@ -0,0 +1,19 @@
use hbb_common::{dlopen::symbor::Library, log, ResultType};
use std::{
ffi::{c_char, CStr},
path::Path,
};
mod callback_msg;
mod config;
pub mod desc;
mod plugins;
pub use plugins::load_plugins;
#[inline]
fn cstr_to_string(cstr: *const c_char) -> ResultType<String> {
Ok(String::from_utf8(unsafe {
CStr::from_ptr(cstr).to_bytes().to_vec()
})?)
}