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

mi_var_copy()

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

Syntax

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).

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

You must use with the mi_var_free() function to free this structure when it is no longer needed.

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 a newly allocated varying-length structure.
NULL indicates that the function was not successful.

Related Topics

See the description of the following functions: mi_lvarchar_to_string(), mi_new_var(), mi_string_to_lvarchar(), mi_var_free(), and mi_var_to_buffer().

For more information, see Managing Memory for a Varying-Length Structure.


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