The mi_set_vardata() function

The mi_set_vardata() accessor routine stores data in the data portion of the data in a varying-length structure (such as mi_lvarchar).

Syntax

void mi_set_vardata(varlen_ptr, data_ptr)
   mi_lvarchar *varlen_ptr;
   char *data_ptr;
varlen_ptr
A pointer to the varying-length structure.
data_ptr
A pointer to the data to insert.
Valid in client LIBMI application? Valid in user-defined routine?
Yes Yes

Usage

The mi_set_vardata() function copies the data that data_ptr references to the data field of the varying-length structure that varlen_ptr references. The function determines the number of bytes to copy from the data length information stored in the varlen_ptr varying-length structure. Therefore, use mi_set_varlen() to set the length of the data before you copy in the data.
Important: The varying-length structure that “varlen_ptr” references is an opaque structure. Do not access fields of this structure directly. Instead, use mi_set_vardata() or mi_set_vardata_align() to store the data in this structure.

The data in a varying-length structure is not null terminated. Do not copy the null terminator into the data portion of a varying-length structure.

Although the varlen_ptr argument is declared as a pointer to an mi_lvarchar value, you can also use the mi_set_vardata() function to set data in other varying-length data types, such as mi_sendrecv.

Return values

None.