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§
- chd_
error - Error types that may occur when reading a CHD file or hunk.
Constants§
- CHD_
OPEN_ READ - Open a CHD for reading.
- CHD_
OPEN_ READWRITE - 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. - PRECACHE_
CHUNK_ SIZE chd_precache - The chunk size to read when pre-caching the underlying file stream into memory.
Functions§
- chd_
close ⚠ - Close a CHD file.
- chd_
codec_ config - Set codec internal parameters.
- chd_
core_ ⚠file chd_core_file - Returns the associated
core_file*. - chd_
error_ ⚠string - Returns an error string for the corresponding CHD error.
- chd_
get_ codec_ name - Get the name of a particular codec.
- chd_
get_ ⚠header - Returns a pointer to the extracted CHD header data.
- chd_
get_ ⚠metadata - Get indexed metadata of the given search tag and index.
- chd_
open ⚠ - Opens a CHD file by file name, with a layout-undefined backing file pointer owned by the library.
- chd_
open_ ⚠core_ file chd_virtio - Open an existing CHD file from an opened
core_fileobject. - chd_
open_ ⚠file chd_core_file - Open an existing CHD file from an opened
core_fileobject. - chd_
precache ⚠chd_precache - Precache the underlying file into memory.
- chd_
precache_ ⚠progress chd_precache - Precache the underlying file into memory with an optional callback to report progress.
- chd_
read ⚠ - Read a single hunk from the CHD file.
- chd_
read_ ⚠header - Read CHD header data from the file into the pointed struct.
Type Aliases§
- chd_
file - An opaque type for an opened CHD file.