dlopen/raw/mod.rs
1/*!
2Low-level API for opening and getting raw symbols from dynamic link libraries.
3
4As a low-level API it returns raw pointers, references and functions from loaded libraries.
5This means that this API does not provide any protection against problems with dangling symbols.
6You may consider using other APIs to achieve better safety.
7However this API is the most flexible one and you may find is useful when creating your custom
8approach to loading dynamic link libraries.
9
10# Example
11```no_run
12extern crate dlopen;
13use dlopen::raw::Library;
14fn main(){
15 let lib = Library::open("libexample.so").unwrap();
16 let fun_add_one: unsafe extern "C" fn(i32)->i32 = unsafe{lib.symbol("add_one")}.unwrap();
17 println!("1+1= {}", unsafe{fun_add_one(1)});
18
19 drop(lib);
20 //warning! fun_add_one is now a dangling symbol and use of it may crash your application.
21}
22```
23*/
24
25
26
27//!
28
29mod common;
30#[cfg(unix)]
31mod unix;
32#[cfg(windows)]
33mod windows;
34#[cfg(test)]
35mod tests;
36
37pub use self::common::{Library, AddressInfo, OverlappingSymbol, AddressInfoObtainer};