#### 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 = %d∖n`"` , 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:

- Attribute names are not case sensitive and may be surrounded by white space.

- An appropriate `"` null`"` value will be returned if this function is invoked with the AST error status set, or if it should fail for any reason. This null value is zero for numeric values and NULL for pointer values.

- The pointer returned by astGetC is guaranteed to remain valid and the string to which it points will not be over-written for a total of 50 successive invocations of this function. After this, the memory containing the string may be re-used, so a copy of the string should be made if it is needed for longer than this.

Copyright (C) 2021 East Asian Observatory