astGet <X >

Get an attribute value for an Object

Description:

This is a family of functions which return a specified attribute value for an Object using one of several different data types. The type is selected by replacing <X > in the function name by C, D, F, I or L, to obtain a result in const char (i.e. string), double, float, int, or long format, respectively.

If possible, the attribute value is converted to the type you request. If conversion is not possible, an error will result.

Synopsis

<X >type astGet <X >( AstObject this, const char attrib )

Parameters:

this
Pointer to the Object.
attrib
Pointer to a null-terminated string containing the name of the attribute whose value is required.

Applicability

Object
These functions apply to all Objects.

Returned Value

astGet <X >()
The attribute value, in the data type corresponding to <X > (or, in the case of astGetC, a pointer to a constant null-terminated character string containing this value).

Examples:

printf( " RefCount = %dn" , astGetI( z, " RefCount" ) );
Prints the RefCount attribute value for Object " z" as an int.
title = astGetC( axis, " Title" );
Obtains a pointer to a null-terminated character string containing the Title attribute of Object " axis" .

Notes: