diff --git a/src/lib/error.c b/src/lib/error.c index a5268a07f..910db3984 100644 --- a/src/lib/error.c +++ b/src/lib/error.c @@ -39,6 +39,12 @@ cinelerra_error_tls_init (void) pthread_key_create (&cinelerra_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 err name of the error with 'CINELERRA_ERROR_' prefix (example: CINELERRA_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* cinelerra_error_set (const char * nerr) { @@ -52,6 +58,11 @@ cinelerra_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* cinelerra_error () { diff --git a/src/lib/error.h b/src/lib/error.h index 071a3c914..21d9dcb73 100644 --- a/src/lib/error.h +++ b/src/lib/error.h @@ -67,20 +67,9 @@ const char* CINELERRA_ERROR_##err = "CINELERRA_ERROR_" #err ":" msg (({ERROR (flag, "%s", strchr(CINELERRA_ERROR_##err, ':')+1);}), \ cinelerra_error_set(CINELERRA_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 err name of the error with 'CINELERRA_ERROR_' prefix (example: CINELERRA_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* cinelerra_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* cinelerra_error ();