Sun OpenSSO Enterprise 8.0 C API Reference for Application and Web Policy Agent Developers

am_map_copy()

Makes a copy of the specified map object.

Details

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.

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 specified map object. It may be NULL.

map_ptr

Pointer to the location of the new map object copy.


Caution – Caution –

Be sure not to pass map_ptr as a valid am_map structure as the reference will be lost.


Returns

This function returns one of the following values of the am_status_t enumeration (defined in the <am_types.h> header file):

AM_SUCCESS

If the 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.

Memory Concerns

The caller must destroy map_ptr after usage by calling am_map_destroy().