oamGetKeyword

Retrieves a keyword value for the managed object with the specified handle.

Prototype

DWORD oamGetKeyword ( HMOBJ hObject, const char *szKeyword, const char *szValue, DWORD dwValueSize )

Argument

Description

hObject

[in] Managed object to get keyword name and value from (returned by oamOpenObject).

szKeyword

[in] Pointer to the name of keyword.

szValue

[out] Pointer to buffer containing value assigned to szKeyword.

dwValueSize

[in] Size of szValue (maximum number of bytes to return, including final null character).


Return values

Return value

Description

SUCCESS

 

CTAERR_BAD_ARGUMENT

szValue or szKeyword is NULL or 0.

CTAERR_INVALID_HANDLE

hObject is invalid.

CTAERR_SVR_COMM

Natural Access Server is not running.

OAMERR_ACCESS_DENIED

hObject is not open.

OAMERR_NOT_ENOUGH_MEMORY

Specified buffer size is too small.

OAMERR_NOT_FOUND

szKeyword not found.

OAMERR_SERVER_NOT_RUNNING

Supervisor is shut down.


Details

oamGetKeyword retrieves a keyword value for the managed object with the specified handle (returned by oamOpenObject). The object must be open. For more information about keywords, see Accessing configuration data.

See also

oamGetQualifier, oamSetKeyword

Example

DWORD getKeyword( CTAHD ctahd, HMOBJ objHd, char *pKeyword, char *value )
{
    DWORD ret;

    /* Get the value of the passed in keyword. The managed object
    *  has previously been opened and a handle to it (objHd) has been
    *  provided.
    */
    ret = oamGetKeyword( objHd, pKeyword, value, sizeof(value) );
   
    if ( ret != SUCCESS )
    {
        char errMsg[ 100 ];

        ctaGetText( ctahd, ret, errMsg, sizeof(errMsg) );
        printf("oamGetKeyword failed: %s\n", errMsg );
    }

    return ret;
}