Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

High-level Rust bindings for the lzham codec.

License

NotificationsYou must be signed in to change notification settings

nextonesfaster/lzham

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

High-level Rust bindings forlzham codec built upon the lower-levellzham-sys crate.

You must havecmake and a C++ compiler to build this crate, as thelzham-sys crate buildslzham library and does not search for a prebuilt library.

Usage

Add the following to yourCargo.toml:

[dependencies]lzham ="0.1.1"

Examples

use lzham::{compress, decompress};let data =String::from("This is a test.");letmut comp =Vec::new();let status =compress(&mut data.as_bytes(),&mut comp);assert!(status.is_success());letmut decomp =Vec::new();let status =decompress(&mut comp.as_slice(),&mut decomp, data.len());assert!(status.is_success());

Linking

lzham supports both static and dynamic linking. To link statically, you can either setLIBLZHAM_STATIC orLZHAM_STATIC environment variables to true, or use thestatic feature.

To link dynamically, use thedynamic 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 bestatic. For Linux without musl, it will bedynamic.

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 two features:

  • static: Links to the library statically
  • dynamic: Links to the library dynamically

These set the appropriatelzham-sys features, which is responsible for building and linking the library.

License

lzham is available under the MIT license. SeeLICENSE for more details.

About

High-level Rust bindings for the lzham codec.

Topics

Resources

License

Stars

Watchers

Forks

Languages


[8]ページ先頭

©2009-2025 Movatter.jp