Skip to content

jgcodes2020/decan

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Decan

[insert picture of half-open can]

A no-nonsense dynamic library loading crate.

Takes inspiration both from libloading and dlopen.

Example usage

use std::{path::{Path, PathBuf}, process::Command};

use decan::{can::Can, SymbolGroup};

#[derive(SymbolGroup)]
pub struct DecanTestlib {
    pub print_message: extern "C" fn(),
    pub square_int: Option<extern "C" fn(i32) -> i32>,
}

#[test]
fn main() {
    let can = unsafe { Can::<_, DecanTestlib>::load("libdecan_testlib.so").unwrap() };

    (can.print_message)();
    assert_eq!((can.square_int.unwrap())(2), 4);
}

About

A no-nonsense dynamic library loading crate.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages