apoCHARMM 1.0.0
High-performance molecular dynamics simulations on GPUs
 
Loading...
Searching...
No Matches
Error.h File Reference

Declares access to the calling thread's last C ABI diagnostic. More...

Functions

const char * apo_last_error (void)
 Returns the current thread's most recent C ABI diagnostic.
 

Detailed Description

Declares access to the calling thread's last C ABI diagnostic.

Function Documentation

◆ apo_last_error()

const char * apo_last_error ( void  )

Returns the current thread's most recent C ABI diagnostic.

Call this function immediately after a status-returning apoCHARMM C function returns a value other than APO_STATUS_OK. The function does not clear or otherwise modify the diagnostic. A non-NULL pointer to an empty string means that no diagnostic is currently recorded.

The returned pointer is borrowed from apoCHARMM and refers to a null-terminated byte string. A later status-returning apoCHARMM C API call on the same thread clears or replaces the storage, even when that later call succeeds. Successful destruction preserves an existing diagnostic, while a destruction failure may replace it.

Returns
A non-NULL borrowed pointer to storage owned by apoCHARMM. The pointer remains valid until the diagnostic is cleared or replaced on the same thread, or until that thread exits.
Note
Diagnostics are thread-local; calls on another thread neither expose nor invalidate this thread's diagnostic.
Warning
Do not free or modify the returned bytes. Copy them before another C ABI call can invalidate the pointer, and do not use the pointer after the originating thread exits.
See also
apo_status