Sun Java System Access Manager 7 2005Q4 C API Reference

am_map_copy()

Makes a copy of a map object.

Syntax

#include "am_map.h"
AM_EXPORT am_status_t
am_map_copy(am_map_t source_map, am_map_t *map_ptr);

Parameters

This function takes the following parameters:

source_map

The handle for the map object to be destroyed. The handle may be NULL.

map_ptr

A pointer to where to store the handle of the new created map object.

Returns

This function returns am_status_t with one of the following values:

AM_SUCCESS

If a map object was successfully copied.

AM_NO_MEMORY

If unable to allocate memory for the new map object.

AM_INVALID_ARGUMENT

If the source_map or map_ptr argument is NULL.

Details

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.