libchm 0.1.0

Tiny wrapper around ChmLib with safe-ish helpers.
docs.rs failed to build libchm-0.1.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.

libchm

Tiny Rust wrapper around libchm for reading CHM archives with safe-ish helpers.

Status

  • Minimal API: open a file, enumerate entries, read a file, and inspect ChmUnitInfo.
  • Bundles and builds upstream chmlib during build.rs (downloads chmlib-0.40 from jedrea.com).
  • Tested only on Windows and Linux x64, treat as experimental.

Installation

cargo ad libchm

Usage

use libchm::{ChmHandle, CHM_ENUMERATE_ALL, Result, unit_info_path};

fn main() -> Result<()> {
	let mut chm = ChmHandle::open("docs.chm")?;
	chm.enumerate(CHM_ENUMERATE_ALL, |ui| {
		println!("{}", unit_info_path(ui));
		true // keep going
	})?;
	let bytes = chm.read_file("/index.html")?;
	println!("index size: {}", bytes.len());
	Ok(())
}

Building

  • Requires a C toolchain.
  • Build script downloads and compiles chmlib-0.40 automatically (no system install needed).
  • No network? Pre-download the tarball and point Cargo to a cached source via CARGO_NET_OFFLINE or a mirror.

License

MIT for this crate. Upstream chmlib is LGPL-2.0-or-later; ensure compatibility for your use case.