dmi_writer_skip_ex

Synopsis

#include <opendmi/writer.h>

bool dmi_writer_skip_ex(
        dmi_writer_t      *writer,
        dmi_writer_mark_t  from,
        size_t             length);

Description

The dmi_writer_skip_ex function pads the data out to length bytes past the mark from.

Records of a declared length are padded out to that length rather than to the number of bytes written into them: mark the beginning of the record with dmi_writer_mark, write whatever fields it holds, then pad it out to the length of the record from the mark. The bytes written already are stepped over, the way dmi_writer_skip steps over them.

Counting from the current position is what dmi_writer_skip does.

Parameters

writer

Writer to write to.

from

Mark to count length from, taken from the same writer with dmi_writer_mark.

length

Number of bytes the record takes.

Return value

true on success, false if the record is written past its own length already, if the padding does not fit into the range, or if from was taken of another writer.

Errors

DMI_ERROR_OUT_OF_MEMORY

Buffer of the writer cannot grow.