dmi_writer_put_bytes

Synopsis

#include <opendmi/writer.h>

bool dmi_writer_put_bytes(dmi_writer_t *writer, const void *ptr,
                          size_t length);

Description

The dmi_writer_put_bytes function writes length bytes at ptr at the current position and advances the writer cursor.

The buffer grows as far as the range allows, so writing past the data it holds appends to it.

Parameters

writer

Writer to write to.

ptr

Data to write.

length

Number of bytes to write.

Return value

true on success, false if the bytes do not fit into the range, or on error.

Errors

DMI_ERROR_ARGUMENT_NULL

ptr is nullptr, while length is not zero.

DMI_ERROR_OUT_OF_MEMORY

Buffer of the writer cannot grow.