DYNAMICS C API
C-compatible interface to the DYNAMICS library
Loading...
Searching...
No Matches
Error reporting

Functions

void c_set_error_handler (c_error_handler fcn, void *user_data)
 Register a handler invoked whenever the C interface records an error on the calling thread.
 
int c_get_last_error (void)
 Get the most recent error recorded on the calling thread.
 
int c_get_last_error_message (int n, char *buffer)
 Copy the message for the most recent error on the calling thread.
 
void c_clear_error (void)
 Clear the error recorded on the calling thread.
 

Detailed Description

Function Documentation

◆ c_set_error_handler()

void c_set_error_handler ( c_error_handler  fcn,
void *  user_data 
)

Register a handler invoked whenever the C interface records an error on the calling thread.

Parameters
fcnHandler, or NULL to remove the current handler.
user_dataOpaque pointer forwarded to fcn.

◆ c_get_last_error()

int c_get_last_error ( void  )

Get the most recent error recorded on the calling thread.

The value is retained until c_clear_error is called; successful calls do not reset it.

Returns
The error code, or DYN_NO_ERROR if no error has been recorded.

◆ c_get_last_error_message()

int c_get_last_error_message ( int  n,
char *  buffer 
)

Copy the message for the most recent error on the calling thread.

Parameters
nCapacity of buffer, including the terminating null character.
bufferOutput null-terminated message; truncated to fit.
Returns
The full length of the message, excluding the null character.

◆ c_clear_error()

void c_clear_error ( void  )

Clear the error recorded on the calling thread.