fix: build.rs add: readmes
This commit is contained in:
parent
3695bba306
commit
dc4d89a6b3
4 changed files with 30 additions and 1 deletions
2
Cargo.lock
generated
2
Cargo.lock
generated
|
@ -191,7 +191,7 @@ checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"
|
|||
|
||||
[[package]]
|
||||
name = "scs-rs-proc-macros"
|
||||
version = "0.1.0"
|
||||
version = "0.1.1"
|
||||
dependencies = [
|
||||
"quote",
|
||||
"syn",
|
||||
|
|
4
README.md
Normal file
4
README.md
Normal file
|
@ -0,0 +1,4 @@
|
|||
# SCS SDK Bindings for Rust
|
||||
|
||||
## How to use
|
||||
Check out [README.md](scs_rs/README.md) of [scs-sdk-rs](https://crates.io/crates/scs-sdk-rs) crate.
|
22
scs_rs/README.md
Normal file
22
scs_rs/README.md
Normal file
|
@ -0,0 +1,22 @@
|
|||
# SCS SDK Bindings
|
||||
|
||||
## Usage Example
|
||||
```rust
|
||||
#[no_mangle]
|
||||
#[scs_sdk_rs::proc_macros::scs_telemetry_init]
|
||||
// pub extern "C" fn scs_telemetry_init(version: scs_sdk_rs::scs_u32_t, params: *const scs_sdk_rs::scs_telemetry_init_params_t) -> scs_sdk_rs::scs_result_t
|
||||
pub fn init() {
|
||||
let version_params_ptr = params as *const scs_sdk_rs::scs_telemetry_init_params_v101_t;
|
||||
|
||||
unsafe {
|
||||
// example for using params
|
||||
let version_params = *version_params_ptr;
|
||||
|
||||
version_params.common.log.unwrap()(scs_sdk_rs::SCS_LOG_TYPE_message, "The Rust telemetry plugin is loaded.".as_ptr() as *const i8);
|
||||
}
|
||||
|
||||
// ...
|
||||
|
||||
scs_sdk_rs::SCS_RESULT_ok
|
||||
}
|
||||
```
|
|
@ -5,6 +5,9 @@ fn main() {
|
|||
|
||||
let bindings = bindgen::Builder::default()
|
||||
.header("wrapper.hpp")
|
||||
.blocklist_item(r#"(\w+)_(MAX|MIN|WIDTH)"#)
|
||||
.blocklist_item(r#"some_requirement_failed_at_(\d+)"#)
|
||||
.blocklist_function(r#"(\w+)_(init|shutdown)(\w*)"#)
|
||||
.parse_callbacks(Box::new(bindgen::CargoCallbacks))
|
||||
.generate()
|
||||
.expect("Unable to generate bindings");
|
||||
|
|
Loading…
Reference in a new issue