dmi_reader_get_bytes

Synopsis

#include <opendmi/reader.h>

bool dmi_reader_get_bytes(dmi_reader_t *reader, void *ptr, size_t length);

Description

The dmi_reader_get_bytes function copies length bytes from the reader into the buffer pointed to by ptr and advances the reader cursor.

Referring to the bytes of the buffer in place, rather than copying them, is what dmi_reader_ref_bytes does.

Parameters

reader

Reader to read from.

ptr

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

length

Number of bytes to read.

Return value

true on success, false if there are fewer than length bytes remaining in the reader, 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.