Makes a copy of the specified map object.
am_map_copy() creates a new instance of a am_map_t, copies all the elements from the specified source_map into it, and assigns to the new instance a pointer. It does not alter the contents of the original map object.
#include "am_map.h" AM_EXPORT am_status_t am_map_copy(am_map_t source_map, am_map_t *map_ptr);
This function takes the following parameters:
The specified map object. It may be NULL.
Pointer to the location of the new map object copy.
Be sure not to pass map_ptr as a valid am_map structure as the reference will be lost.
This function returns one of the following values of the am_status_t enumeration (defined in the <am_types.h> header file):
If the map object was successfully copied.
If unable to allocate memory for the new map object.
If the source_map or map_ptr argument is NULL.
The caller must destroy map_ptr after usage by calling am_map_destroy().