New crate: libchm, simple wrapper around ChmLib

⚓ Rust    📅 2025-12-13    👤 surdeus    👁️ 1      

surdeus

I've just published a new crate, called libchm. It's a simple wrapper around the CHmLib C library from http://www.jedrea.com, with safe-ish helpers. It works for my personal use case of writing an ebook/ddocument reader, but I welcome feedback!

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(())
}

GitHub: GitHub - trypsynth/libchm: Thin Rust wrapper over CHmLib.
Crates.io: crates.io: Rust Package Registry
Docs.rs: libchm 0.1.0 - Docs.rs

1 post - 1 participant

Read full topic

🏷️ Rust_feed