Sun Java System Access Manager 7 2005Q4 C API Reference

am_properties_get()

This function and all functions beginning with am_properties_get retrieve values from the properties map. The following parameters and exceptions are common to all functions in the am_propteries_get collection. Additional return values may be specified some functions.

Syntax

#include "am_properties.h"
AM_EXPORT am_status_t
am_properties_get(am_properties_t properties, const char *key,
             const char **value_ptr);

Parameters

This function takes the following parameters:

properties

Handle to the properties object to be examined.

key

Name of the property to look up.

value_ptr

A pointer to where to store the value associated with the default value.

default_value

Default value to use if there is no value associated with the specified key.

Returns

This function returns the unparsed string form of the value associated with one of the following keys:

AM_SUCCESS

If no error is detected.

AM_INVALID_ARGUMENT

If the properties, key, or value_ptr argument is NULL.

AM_NOT_FOUND

If the specified key has no associated value and a default value is not provided.

AM_INVALID_VALUE

If the value associated with the specified key is cannot be parsed as required by the particular accessor function.

AM_NO_MEMORY

If insufficient memory is available to look up the key.

Details

This function checks if the key is present is the properties instance and returns its value.

Memory Concerns: Caller must not modify the value_ptr structure or free the memory.