The mi_var_copy() function

The mi_var_copy() function creates a copy of a varying-length structure.

Syntax

mi_lvarchar *mi_var_copy(varlen_ptr)
   mi_lvarchar *varlen_ptr;
varlen_ptr
A pointer to the varying-length structure to copy.
Valid in client LIBMI application? Valid in user-defined routine?
Yes Yes

Usage

The mi_var_copy() function copies the varying-length structure that varlen_ptr references and returns a pointer to the newly allocated copy. The function is a constructor function for a varying-length structure. It creates a varying-length structure with a new data portion whose size is the same as the original varying-length structure (which varlen_ptr references).

Server only: The mi_var_copy() function allocates a new varying-length structure with the current memory duration.
Use the mi_var_free() function to free this structure when it is no longer needed.
Restriction: Do not use the DataBlade® API memory-management functions such as the mi_alloc() function to allocate a varying-length structure.

Return values

An mi_lvarchar pointer
A pointer to a newly allocated varying-length structure.
NULL
The function was not successful.