The mi_set_varptr() function

The mi_set_varptr() function sets the data pointer in a varying-length structure (such as mi_lvarchar).

Syntax

void mi_set_varptr(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.
Valid in client LIBMI application? Valid in user-defined routine?
Yes Yes

Usage

The mi_set_varptr() function sets the data pointer in the varying-length structure that varlen_ptr references to the buffer that data_ptr references. Use this function to set the data pointer in a varying-length structure to point to a data portion that you allocate.

Server only: Make sure that you allocate the data_ptr buffer with a memory duration appropriate to the use of the data portion.
Important: The varying-length structure that “varlen_ptr” references is an opaque structure. Do not access fields of this structure directly. Instead, use the mi_set_vardata() function to set the data pointer in this structure.

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

For information about how to set the data pointer of a varying-length structure, see the HCL OneDB™ DataBlade® API Programmer's Guide.

Return values

None.