Function chd_read

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn chd_read(
    chd: *mut chd_file,
    hunknum: u32,
    buffer: *mut c_void,
) -> chd_error
Expand description

Read a single hunk from the CHD file.

ยงSafety

  • chd is either NULL or a valid pointer to a chd_file obtained from chd_open, chd_open_file, or chd_open_core_file.
  • buffer must an aligned pointer to a block of initialized memory of exactly the hunk size for the input chd_file* that is valid for both reads and writes. This size can be found with chd_get_header.
  • If chd is NULL, returns CHDERR_INVALID_PARAMETER.