#low-level #api-bindings #lzham

sys lzham-sys

Low level FFI-bindings for the lzham codec

1 unstable release

0.1.1 Oct 30, 2020
0.1.0 Oct 29, 2020

#737 in Compression

27 downloads per month
Used in 3 crates (via lzham)

MIT license

1MB
25K SLoC

Rust 12K SLoC C++ 11K SLoC // 0.0% comments Visual Studio Project 2K SLoC C 299 SLoC // 0.1% comments Visual Studio Solution 106 SLoC Bitbake 31 SLoC

lzham-sys

Low level Rust FFI bindings for lzham codec generated using bindgen.

You must have cmake and a C++ compiler to build this crate, as the lzham library is built along with the crate. The crate does not search for a prebuilt library.

Usage

Add the following to your Cargo.toml:

[dependencies]
lzham-sys = "0.1.1"

Linking

lzham-sys supports both static and dynamic linking. To link statically, you can either set LIBLZHAM_STATIC or LZHAM_STATIC environment variables to true, or use the static feature.

To link dynamically, use the dynamic feature.

If you don't set any environment variables or use any features, the build will be the expected default library linking method based on OS or target. For Windows, macOS and Linux with musl, it will be static. For Linux without musl, it will be dynamic.

Note that environment variables take precedence over features. In case of any ambiguity, it uses the default linking method.

Features

The crate has the following three features:

  • generate_bindings: Generates the bindings again (uses bindgen)
  • static: Links to the library statically
  • dynamic: Links to the library dynamically

License

lzham_sys is available under the MIT license. See LICENSE for more details.

No runtime deps

~0–340KB