astWatch

Identify a new error status variable for the AST library

Description:

This function allows a new error status variable to be accessed by the AST library when checking for and reporting error conditions.

By default, the library uses an internal integer error status which is set to an error value if an error occurs. Use of astWatch allows the internal error status to be replaced by an integer variable of your choosing, so that the AST library can share its error status directly with other code which uses the same error detection convention.

If an alternative error status variable is supplied, it is used by all related AST functions and macros (e.g. astOK, astStatus and astClearStatus).

Synopsis

int astWatch( int status_ptr )

Parameters:

status_ptr
Pointer to an int whose value is to be used subsequently as the AST inherited status value. If a NULL pointer is supplied, the AST library will revert to using its own internal error status.

Returned Value

astWatch()
Address of the previous error status variable. This may later be passed back to astWatch to restore the previous behaviour of the library. (Note that on the first invocation of astWatch the returned value will be the address of the internal error status variable.)

Notes: