dmi_decoder_get_bytes_at

Synopsis

#include <opendmi/decoder.h>

bool dmi_decoder_get_bytes_at(
        const dmi_decoder_t *decoder,
        void                *ptr,
        size_t               offset,
        size_t               length);

Description

The dmi_decoder_get_bytes_at function copies length bytes at offset from the beginning of the body of the structure into ptr. The cursor is not moved.

Parameters

decoder

Decoder to read from.

ptr

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

offset

Byte offset from the beginning of the structure.

length

Number of the bytes to read.

Return value

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

Errors

DMI_ERROR_ARGUMENT_NULL

ptr is nullptr, while length is not zero.