Makes a copy of a 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 handle for the map object to be destroyed. The handle may be NULL.
A pointer to where to store the handle of the new created map object.
This function returns am_status_t with one of the following values:
If a 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.
This function creates an instance of am_map_t structure, copies all the elements in source_map into the newly created structure and assigns it to map_ptr. It does not alter the contents of source_map.
Memory Concerns: The caller must make sure not to pass a map_ptr which as a valid am_map_t structure, otherwise the reference will be lost. The caller must destroy map_ptr after usage by calling am_map_destroy.