In order to expose a function with C binary interface for interoperability with other programming languages, Rust developers should use #[no_mangle] attribute and specify ABI for the declared function.
```rust
pub extern "C" fn func_name () /* -> ... */ { // ... } ```
You can read about it more here
This library allows to perform syn-driven parsing for obtaining the information about location of these no-mangle-pub-extern-C functions.
main.rs
```rust use nomanglepubexportcfn::{parsefornomanglepubexterncfns, ParsedFile};
fn main() {
let crateroot = std::env::var("CARGOMANIFESTDIR").unwrap();
let parsedfiles: Vec
unused.rs
```rust
pub extern "C" fn s() { // test } ```
text
[
ParsedFile {
path: "...\\no_mangle_pub_export_c_fn\\src\\lib.rs",
no_mangle_pub_export_c_fns: NoManglePubExportCFns {
no_mangle_pub_export_c_fn_vec: [],
},
},
ParsedFile {
path: "...\\no_mangle_pub_export_c_fn\\src\\main.rs",
no_mangle_pub_export_c_fns: NoManglePubExportCFns {
no_mangle_pub_export_c_fn_vec: [],
},
},
ParsedFile {
path: "...\\no_mangle_pub_export_c_fn\\src\\unused.rs",
no_mangle_pub_export_c_fns: NoManglePubExportCFns {
no_mangle_pub_export_c_fn_vec: [
NoManglePubExportCFnEnds {
start_line: 1,
start_column: 0,
end_line: 4,
end_column: 1,
},
],
},
},
]
All structures in this library implement Serialize and Deserialize traits from [https://docs.rs/serde/latest/serde/#]. Because of that you can convert into many data formats supporting serde.
Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.