#ffi #bindings #low-level #lab #streaming #lsl #liblsl

sys lsl-sys

Low-level bindings to the system liblsl library (lab streaming layer)

2 releases

0.1.1 Oct 26, 2020
0.1.0 Oct 23, 2020

#16 in #lab

37 downloads per month
Used in lsl

MIT license

2.5MB
31K SLoC

C++ 26K SLoC // 0.1% comments Visual Studio Project 3.5K SLoC Rust 1.5K SLoC // 0.0% comments Visual Studio Solution 271 SLoC C 154 SLoC // 0.2% comments Shell 32 SLoC // 0.3% comments Python 28 SLoC // 0.2% comments Batch 26 SLoC Forge Config 22 SLoC Perl 21 SLoC // 0.4% comments

lsl-sys

This is the low-level auto-generated binding to the liblsl library. You probably don't want to use this library directly; instead, check out the higher-level lsl crate.

Getting the source code

git clone --recurse-submodules https://github.com/labstreaminglayer/liblsl-rust

Compiling

See documentation in the liblsl-rust repository for build instructions.

Regenerating C FFI bindings

You only need to run this if you want to update the autogenerated header bindings (src/generated.rs), e.g., to pull in new declarations from an updated liblsl version.

For this you need the bindgen tool, which you can obtain as described here here.

Then, run the following commands to regenerate the bindings:

cd lsl-sys

# (prefix with liblsl license text)
echo "/* $(cat liblsl/LICENSE) */" > src/generated.rs

# (append bindings to file)
bindgen liblsl/include/lsl_c.h \
    --whitelist-function "^lsl_.*" \
    --whitelist-var "^lsl_.*" \
    --whitelist-type "^lsl_.*" \
    >> src/generated.rs

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the lsl-sys crate by you, shall be licensed as MIT, without any additional terms or conditions.

Dependencies