summaryrefslogtreecommitdiff
path: root/src/lib/eolian/eolian_database.h
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@osg.samsung.com>2018-03-20 17:34:38 +0100
committerDaniel Kolesa <d.kolesa@osg.samsung.com>2018-03-20 17:34:51 +0100
commit2db8e8e914b8ce6f437997f9cf9e72c1220f11fe (patch)
treed02bff324cc692ae66379bbd70ca2d28144e2a83 /src/lib/eolian/eolian_database.h
parent7c6d8010a8f2c29abf4d726198803dd3c84064cf (diff)
eolian: make use of panics for certain alloc errors
Diffstat (limited to 'src/lib/eolian/eolian_database.h')
-rw-r--r--src/lib/eolian/eolian_database.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/lib/eolian/eolian_database.h b/src/lib/eolian/eolian_database.h
index f2fccf2..320862c 100644
--- a/src/lib/eolian/eolian_database.h
+++ b/src/lib/eolian/eolian_database.h
@@ -114,6 +114,7 @@ static inline void eolian_state_vlog(const Eolian_State *state, const Eolian_Obj
114static inline void eolian_state_log(const Eolian_State *state, const char *fmt, ...) EINA_ARG_NONNULL(1, 2) EINA_PRINTF(2, 3); 114static inline void eolian_state_log(const Eolian_State *state, const char *fmt, ...) EINA_ARG_NONNULL(1, 2) EINA_PRINTF(2, 3);
115static inline void eolian_state_log_obj(const Eolian_State *state, const Eolian_Object *obj, const char *fmt, ...) EINA_ARG_NONNULL(1, 2, 3) EINA_PRINTF(3, 4); 115static inline void eolian_state_log_obj(const Eolian_State *state, const Eolian_Object *obj, const char *fmt, ...) EINA_ARG_NONNULL(1, 2, 3) EINA_PRINTF(3, 4);
116 116
117static inline void eolian_state_panic(Eolian_State *state, const char *fmt, ...) EINA_ARG_NONNULL(1, 2) EINA_PRINTF(2, 3);
117 118
118static inline void 119static inline void
119eolian_state_vlog(const Eolian_State *state, const Eolian_Object *obj, 120eolian_state_vlog(const Eolian_State *state, const Eolian_Object *obj,
@@ -144,6 +145,15 @@ eolian_state_log_obj(const Eolian_State *state, const Eolian_Object *obj,
144 va_end(args); 145 va_end(args);
145} 146}
146 147
148static inline void
149eolian_state_panic(Eolian_State *state, const char *fmt, ...)
150{
151 va_list args;
152 va_start(args, fmt);
153 state->panic_msg = eina_stringshare_vprintf(fmt, args);
154 va_end(args);
155 longjmp(state->jmp_env, 1);
156}
147 157
148struct _Eolian_Documentation 158struct _Eolian_Documentation
149{ 159{