aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/eolian/eolian_database.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/eolian/eolian_database.c')
-rw-r--r--src/lib/eolian/eolian_database.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/lib/eolian/eolian_database.c b/src/lib/eolian/eolian_database.c
index 7300d46ccd..70fe7a8d4d 100644
--- a/src/lib/eolian/eolian_database.c
+++ b/src/lib/eolian/eolian_database.c
@@ -564,6 +564,12 @@ _hashlist_free(void *data)
eina_list_free((Eina_List*)data);
}
+static void
+_default_panic_cb(const Eolian_State *state EINA_UNUSED, const char *msg)
+{
+ _eolian_log(msg);
+}
+
EAPI Eolian_State *
eolian_state_new(void)
{
@@ -571,6 +577,15 @@ eolian_state_new(void)
if (!state)
return NULL;
+ state->panic = _default_panic_cb;
+
+ if (setjmp(state->jmp_env))
+ {
+ state->panic(state, state->panic_msg);
+ eina_stringshare_del(state->panic_msg);
+ exit(EXIT_FAILURE);
+ }
+
database_unit_init(state, &state->unit, NULL);
state->filenames_eo = eina_hash_string_small_new(free);