25#include <cxmessages.h>
27#include <cxstrutils.h>
30#include <cpl_errorstate.h>
39typedef struct GiError GiError;
42static GiError _error ;
44static cxbool _error_init = FALSE;
45static cxbool _error_saved = FALSE;
57giraffe_error_init(
void)
67giraffe_error_clear(
void)
70 if (_error_init == TRUE) {
80giraffe_error_push(
void)
83 cx_assert(_error_init == TRUE);
85 _error.state = cpl_errorstate_get();
96giraffe_error_pop(
void)
99 cx_assert(_error_init == TRUE);
101 if (_error_saved == TRUE) {
103 cpl_errorstate_set(_error.state);
104 _error_saved = FALSE;