Expand description
A (mostly) libchdr compatible C-API for chd-rs.
For Rust consumers, consider using chd-rs instead.
The best way to integrate chd-rs in your C or C++ project is to instead vendor the sources directly into your project, with a compatible implementation of libchdcorefile for your platform as required.
ABI compatibility with libchdr
chd-rs-capi makes the following ABI-compatibility guarantees compared to libchdr when compiled statically.
chd_erroris ABI and API-compatible with chd.hchd_headeris ABI and API-compatible chd.hchd_file *is an opaque pointer. It is not layout compatible with chd.c- The layout of
core_file *is user-defined when thechd_core_filefeature is enabled. - Freeing any pointer returned by chd-rs with
freeis undefined behaviour. The exception arechd_file *pointers which can be safely freed withchd_close.
Enums
Error types that may occur when reading a CHD file or hunk.
Constants
Open a CHD for reading.
Open a CHD for reading and writing. This mode is not supported and will always return an error
when passed into a constructor function such as chd_open.
chd_precacheThe chunk size to read when pre-caching the underlying file stream into memory.
Functions
Set codec internal parameters.
Returns the associated core_file*.
Returns an error string for the corresponding CHD error.
Get the name of a particular codec.
Returns a pointer to the extracted CHD header data.
Get indexed metadata of the given search tag and index.
Opens a CHD file by file name, with a layout-undefined backing file pointer owned by the library.
Open an existing CHD file from an opened core_file object.
Open an existing CHD file from an opened core_file object.
Precache the underlying file into memory.
Precache the underlying file into memory with an optional callback to report progress.
Read CHD header data from the file into the pointed struct.
Type Definitions
An opaque type for an opened CHD file.