informix
Informix DataBlade API Programmer's Manual
DataBlade API Function Descriptions

mi_new_var()

The mi_new_var() function creates a new varying-length structure for text data.

Syntax

Usage

The mi_new_var() function is a constructor function for a varying-length structure. It allocates a varying-length structure with data_len bytes of data in its data portion. The function allocates memory for the varying-length structure that it returns. Therefore, you must use the mi_var_free() function to free this structure when it is no longer needed.

The mi_new_var() function allocates a new varying-length structure with the current memory duration.

Important: Do not use the DataBlade API memory-management functions such as mi_alloc() to allocate a varying-length structure.

Return Values

mi_lvarchar * is a pointer to the new variable-length structure.
NULL indicates that the function was not successful.

Related Topics

See the descriptions of the following functions: mi_get_vardata(), mi_get_vardata_align(), mi_get_varlen(), mi_lvarchar_to_string(), mi_set_vardata(), mi_set_vardata_align(), mi_set_varlen(), mi_string_to_lvarchar(), mi_var_copy(), and mi_var_free().

For more information, see Varying-Length Data Structures.


Informix DataBlade API Programmer's Manual, Version 9.2
Copyright © 1999, Informix Software, Inc. All rights reserved