diff --git a/src/lib/error.c b/src/lib/error.c index b2bc390b6..dc9acfa56 100644 --- a/src/lib/error.c +++ b/src/lib/error.c @@ -45,13 +45,7 @@ lumiera_error_tls_init (void) pthread_key_create (&lumiera_error_tls, NULL); } -/** - * Set error state for the current thread. - * If the error state of the current thread was cleared, then set it, else preserve the old state. - * @param nerr name of the error with 'LUMIERA_ERROR_' prefix (example: LUMIERA_ERROR_NO_MEMORY) - * @return old state, that is NULL for success, when the state was cleared and a pointer to a pending - * error when the error state was already set - */ + const char* lumiera_error_set (const char * nerr) { @@ -65,12 +59,6 @@ lumiera_error_set (const char * nerr) } -/** - * Get and clear current error state. - * This function clears the error state, if it needs to be reused, one has to store it in a temporary - * variable. - * @return pointer to any pending error of this thread, NULL if no error is pending - */ const char* lumiera_error () { diff --git a/src/lib/error.h b/src/lib/error.h index 1eeb42dda..e00e69c6b 100644 --- a/src/lib/error.h +++ b/src/lib/error.h @@ -70,9 +70,22 @@ const char* LUMIERA_ERROR_##err = "LUMIERA_ERROR_" #err ":" msg (({ERROR (flag, "%s", strchr(LUMIERA_ERROR_##err, ':')+1);}), \ lumiera_error_set(LUMIERA_ERROR_##err)) +/** + * Set error state for the current thread. + * If the error state of the current thread was cleared, then set it, else preserve the old state. + * @param nerr name of the error with 'LUMIERA_ERROR_' prefix (example: LUMIERA_ERROR_NO_MEMORY) + * @return old state, that is NULL for success, when the state was cleared and a pointer to a pending + * error when the error state was already set + */ const char* lumiera_error_set (const char * err); +/** + * Get and clear current error state. + * This function clears the error state, if it needs to be reused, one has to store it in a temporary + * variable. + * @return pointer to any pending error of this thread, NULL if no error is pending + */ const char* lumiera_error ();