Definition in file error.c.
#include <pthread.h>
#include "lib/error.h"

Go to the source code of this file.
Functions | |
| lumiera_err | lumiera_error (void) |
| Get and clear current error state. | |
| LUMIERA_ERROR_DEFINE (ERRNO,"errno") | |
| lumiera_err | lumiera_error_peek (void) |
| Check current error state without clearing it Please avoid this function and use lumiera_error() if possible. | |
| lumiera_err | lumiera_error_set (lumiera_err nerr) |
| Set error state for the current thread. | |
| static void | lumiera_error_tls_init (void) |
Variables | |
| static pthread_once_t | lumiera_error_initialized = PTHREAD_ONCE_INIT |
| static pthread_key_t | lumiera_error_tls |
| lumiera_err lumiera_error_set | ( | lumiera_err | 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.
| nerr | name of the error with 'LUMIERA_ERROR_' prefix (example: LUMIERA_ERROR_NO_MEMORY) |
Definition at line 50 of file error.c.
Referenced by lumiera::Error::Error().
00051 { 00052 pthread_once (&lumiera_error_initialized, lumiera_error_tls_init); 00053 00054 lumiera_err err = pthread_getspecific (lumiera_error_tls); 00055 if (!err) 00056 pthread_setspecific (lumiera_error_tls, nerr); 00057 00058 return err; 00059 }

| lumiera_err lumiera_error | ( | void | ) |
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.
Definition at line 63 of file error.c.
Referenced by test::Suite::describe(), and lumiera_plugin_init().
00064 { 00065 pthread_once (&lumiera_error_initialized, lumiera_error_tls_init); 00066 00067 lumiera_err err = pthread_getspecific (lumiera_error_tls); 00068 if (err) 00069 pthread_setspecific (lumiera_error_tls, NULL); 00070 return err; 00071 }

| lumiera_err lumiera_error_peek | ( | void | ) |
Check current error state without clearing it Please avoid this function and use lumiera_error() if possible.
Errors must be cleared else certain parts of the application refuse to cooperate with you. This shall only be used to decide if one wants to barf out of a loop or subroutine to deliver the error to a higher level.
Definition at line 75 of file error.c.
Referenced by lumiera_plugin_discover(), and lumiera_plugin_register().
00076 { 00077 pthread_once (&lumiera_error_initialized, lumiera_error_tls_init); 00078 00079 return pthread_getspecific (lumiera_error_tls); 00080 }

1.5.6