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

am_properties_get_boolean_with_default()

Retrieves boolean type values from the specified properties object.

Details

am_properties_get_boolean_with_default() will return a defined default value if no other value is present, contrary to the behavior of am_properties_get_boolean().

Syntax

#include "am_properties.h"
am_properties_get_boolean_with_default(am_properties_t properties,
                                       const char *key, 
                                       int default_value,
                                       int *value_ptr);

Parameters

This function takes the following parameters:

properties

The specified properties object.

key

Pointer to the specified key in the specified properties object.

default_value

Value to return if none is defined for the specified key.

value_ptr

Pointer to the location where the boolean associated with the specified key will be stored.

Returns

One of the following values stored in value_ptr:

!0

If the value associated with the specified key is true, on, or yes.

0

If the value associated with the specified key is false, off, or no.

If the associated value does not match any of the recognized boolean values, AM_INVALID_VALUE will be returned.