26 #include <cxstrutils.h>
28 #include <cpl_error.h>
29 #include <cpl_errorstate.h>
38 typedef struct GiError GiError;
41 static GiError _error ;
43 static cxbool _error_init = FALSE;
44 static cxbool _error_saved = FALSE;
56 giraffe_error_init(
void)
66 giraffe_error_clear(
void)
69 if (_error_init == TRUE) {
79 giraffe_error_push(
void)
82 cx_assert(_error_init == TRUE);
84 _error.state = cpl_errorstate_get();
95 giraffe_error_pop(
void)
98 cx_assert(_error_init == TRUE);
100 if (_error_saved == TRUE) {
102 cpl_errorstate_set(_error.state);
103 _error_saved = FALSE;