|
The mi_collection_copy() function copies a collection to a new collection variable.
The mi_collection_copy() function copies the collection that src_coll references to a newly allocated collection structure. This function is a constructor function for the collection structure. It allocates a new collection structure in the current memory duration.
For example, the mi_collection_copy() function creates a copy of the colval collection:
In this example, the mi_value() function returns a pointer to colval, which is a collection column. However, the memory that is allocated to colval is freed when you close the connection with mi_close(). The copy of colval that the call to the mi_collection_copy() function creates is in the current memory duration. This new collection, which new_retval references, can now be returned from this function.
MI_COLLECTION * | is the address of the newly allocated collection. |
NULL | indicates that the function was not successful. |
See the descriptions of the following functions: mi_collection_close(), mi_collection_create(), mi_collection_delete(), mi_collection_fetch(), mi_collection_free(), mi_collection_insert(), mi_collection_open(), and mi_collection_update().
For a description of collections, see Collections.