dmi_encoder_put_string

Synopsis

#include <opendmi/encoder.h>

bool dmi_encoder_put_string(dmi_encoder_t *encoder, const char *value);

Description

The dmi_encoder_put_string function writes the number the string is referred to by.

The string is looked up among the ones the structure has been decoded with, so that a field keeps the number of the string it refers to, and is added to the strings of the encoder otherwise. A missing string is written as zero.

Parameters

encoder

Encoder to write to.

value

String to refer to, or nullptr.

Return value

true on success, false otherwise.

Errors

DMI_ERROR_OUT_OF_MEMORY

Buffers of the encoder cannot grow.

DMI_ERROR_ARGUMENT_INVALID

Structure refers to more strings than a byte can number.