dmi_reader_get_bytes_at

Synopsis

#include <opendmi/reader.h>

bool dmi_reader_get_bytes_at(
        const dmi_reader_t *reader,
        void               *ptr,
        size_t              offset,
        size_t              length);

Description

The dmi_reader_get_bytes_at function copies length bytes starting at offset from the beginning of the range into the buffer pointed to by ptr. The reader cursor is not modified.

Parameters

reader

Reader to read from.

ptr

Buffer that receives the data; must be at least length bytes.

offset

Byte offset from the beginning of the range.

length

Number of bytes to read.

Return value

true on success, false if the requested range exceeds the reader bounds, or on error.

Errors

The error is raised against the context of the buffer being read.

DMI_ERROR_ARGUMENT_NULL

ptr is nullptr, while length is not zero.