https://github.com/maulingmonkey/minidl
Extremely lean cross platform library for loading symbols
https://github.com/maulingmonkey/minidl
dll dlopen dlsym loadlibrary rust so
Last synced: 3 months ago
JSON representation
Extremely lean cross platform library for loading symbols
- Host: GitHub
- URL: https://github.com/maulingmonkey/minidl
- Owner: MaulingMonkey
- License: apache-2.0
- Created: 2020-01-14T21:06:41.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-12-08T23:31:51.000Z (over 1 year ago)
- Last Synced: 2024-04-24T20:14:53.383Z (about 1 year ago)
- Topics: dll, dlopen, dlsym, loadlibrary, rust, so
- Language: Rust
- Size: 36.1 KB
- Stars: 2
- Watchers: 3
- Forks: 1
- Open Issues: 4
-
Metadata Files:
- Readme: Readme.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
# minidl
[](https://crates.io/crates/minidl)
[](https://docs.rs/minidl/)
[](https://github.com/MaulingMonkey/minidl/search?q=unsafe+path%3Ars)
[](https://gist.github.com/MaulingMonkey/c81a9f18811079f19326dac4daa5a359#minimum-supported-rust-versions-msrv)
[](https://github.com/MaulingMonkey/minidl)
[](https://github.com/MaulingMonkey/minidl)
[](https://github.com/MaulingMonkey/minidl/actions?query=workflow%3Arust)
[](https://github.com/MaulingMonkey/minidl/issues)
[](https://deps.rs/repo/github/MaulingMonkey/minidl)Extremely lean cross platform library for loading symbols.
* No dependencies (minimal build times)
* No macros (minimal build times)
* No safety (ABI mismatches would be unsound anyways)## Quick Start
```rust
use minidl::*;
use std::os::raw::*;struct Example {
OutputDebugStringA: unsafe extern "system" fn (_: *const c_char),
Invalid_Optional: Option,
}impl Example {
pub fn new() -> Result {
let lib = Library::load("kernel32.dll")?;
unsafe{Ok(Self{
OutputDebugStringA: lib.sym("OutputDebugStringA\0")?,
Invalid_Optional: lib.sym_opt("Invalid_Optional\0"),
})}
}
}
```## License
Licensed under either of
* Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or )
* MIT license ([LICENSE-MIT](LICENSE-MIT) or )at your option.
## Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in the work by you, as defined in the Apache-2.0 license, shall be
dual licensed as above, without any additional terms or conditions.