The mi_lvarchar_to_string() function

The mi_lvarchar_to_string() function returns the data in a varying-length structure as a null-terminated string.

Syntax

mi_string *mi_lvarchar_to_string(lv_ptr)
   mi_lvarchar *lv_ptr;
lv_ptr
A pointer to the varying-length structure whose data is to be converted to a null-terminated string.
Valid in client LIBMI application? Valid in user-defined routine?
Yes Yes

Usage

The mi_lvarchar_to_string() function returns a null-terminated string for the data in the varying-length structure that lv_ptr references. This function allocates memory for the string it returns. Because mi_lvarchar_to_string() uses the mi_alloc() function, this string memory has the current memory duration. You must use the mi_free() function to free this string memory when it is no longer needed.

Server only: The mi_lvarchar_to_string() function allocates the string that it creates with the current memory duration.

Return values

An mi_string pointer
A pointer to the newly allocated buffer that contains the string equivalent of the varying-length data.
NULL
The function was not successful.