int _evas_alloc_error = 0;
static int _evas_debug_init = 0;
-static int _evas_debug_show = 0;
+static enum {
+ _EVAS_DEBUG_DEFAULT,
+ _EVAS_DEBUG_HIDE,
+ _EVAS_DEBUG_SHOW
+} _evas_debug_show = _EVAS_DEBUG_DEFAULT;
static int _evas_debug_abort = 0;
EAPI Evas_Alloc_Error
return NULL;
}
+static void
+_evas_debug_init_from_env()
+{
+ const char *tmp = getenv("EVAS_DEBUG_SHOW");
+ if (tmp)
+ {
+ int dbgshow = atoi(tmp);
+ _evas_debug_show = (dbgshow) ? _EVAS_DEBUG_SHOW : _EVAS_DEBUG_HIDE;
+ }
+ if (getenv("EVAS_DEBUG_ABORT")) _evas_debug_abort = 1;
+ _evas_debug_init = 1;
+}
+
void
evas_debug_error(void)
{
if (!_evas_debug_init)
{
- if (getenv("EVAS_DEBUG_SHOW")) _evas_debug_show = 1;
- if (getenv("EVAS_DEBUG_ABORT")) _evas_debug_abort = 1;
- _evas_debug_init = 1;
+ _evas_debug_init_from_env();
}
- if (_evas_debug_show)
+ if (_evas_debug_show == _EVAS_DEBUG_SHOW)
CRIT("Evas Magic Check Failed!!!");
}
{
if (!_evas_debug_init)
{
- if (getenv("EVAS_DEBUG_SHOW")) _evas_debug_show = 1;
- if (getenv("EVAS_DEBUG_ABORT")) _evas_debug_abort = 1;
- _evas_debug_init = 1;
+ _evas_debug_init_from_env();
}
- if (_evas_debug_show)
+ if (_evas_debug_show == _EVAS_DEBUG_SHOW)
CRIT("Input object pointer is NULL!");
if (_evas_debug_abort) abort();
}
{
if (!_evas_debug_init)
{
- if (getenv("EVAS_DEBUG_SHOW")) _evas_debug_show = 1;
- if (getenv("EVAS_DEBUG_ABORT")) _evas_debug_abort = 1;
- _evas_debug_init = 1;
+ _evas_debug_init_from_env();
}
- if (_evas_debug_show)
+ if ((_evas_debug_show == _EVAS_DEBUG_SHOW) ||
+ (_evas_debug_show == _EVAS_DEBUG_DEFAULT))
CRIT("Input object is zero'ed out (maybe a freed object or zero-filled RAM)!");
if (_evas_debug_abort) abort();
}
{
if (!_evas_debug_init)
{
- if (getenv("EVAS_DEBUG_SHOW")) _evas_debug_show = 1;
- if (getenv("EVAS_DEBUG_ABORT")) _evas_debug_abort = 1;
- _evas_debug_init = 1;
+ _evas_debug_init_from_env();
}
- if (_evas_debug_show)
+ if ((_evas_debug_show == _EVAS_DEBUG_SHOW) ||
+ (_evas_debug_show == _EVAS_DEBUG_DEFAULT))
CRIT("Input object is wrong type\n"
" Expected: %08x - %s\n"
" Supplied: %08x - %s",
{
if (!_evas_debug_init)
{
- if (getenv("EVAS_DEBUG_SHOW")) _evas_debug_show = 1;
- if (getenv("EVAS_DEBUG_ABORT")) _evas_debug_abort = 1;
- _evas_debug_init = 1;
+ _evas_debug_init_from_env();
}
- if (_evas_debug_show)
+ if ((_evas_debug_show == _EVAS_DEBUG_SHOW) ||
+ (_evas_debug_show == _EVAS_DEBUG_DEFAULT))
CRIT("%s", str);
if (_evas_debug_abort) abort();
}