2013-06-20 03:53:29 -07:00
|
|
|
#include "evas_common_private.h"
|
2002-11-08 00:02:15 -08:00
|
|
|
#include "evas_private.h"
|
|
|
|
|
2010-05-28 22:42:21 -07:00
|
|
|
static Evas_Version _version = { VMAJ, VMIN, VMIC, VREV };
|
2010-05-28 23:27:29 -07:00
|
|
|
EAPI Evas_Version *evas_version = &_version;
|
2010-05-28 22:42:21 -07:00
|
|
|
|
2002-11-23 20:06:08 -08:00
|
|
|
int _evas_alloc_error = 0;
|
2003-05-18 22:36:12 -07:00
|
|
|
static int _evas_debug_init = 0;
|
2012-06-10 01:43:49 -07:00
|
|
|
static enum {
|
|
|
|
_EVAS_DEBUG_DEFAULT,
|
|
|
|
_EVAS_DEBUG_HIDE,
|
|
|
|
_EVAS_DEBUG_SHOW
|
|
|
|
} _evas_debug_show = _EVAS_DEBUG_DEFAULT;
|
2003-05-18 22:36:12 -07:00
|
|
|
static int _evas_debug_abort = 0;
|
2002-11-23 20:06:08 -08:00
|
|
|
|
2010-09-22 03:52:54 -07:00
|
|
|
EAPI Evas_Alloc_Error
|
2002-11-23 20:06:08 -08:00
|
|
|
evas_alloc_error(void)
|
|
|
|
{
|
|
|
|
return _evas_alloc_error;
|
|
|
|
}
|
|
|
|
|
2012-06-10 01:43:49 -07:00
|
|
|
static void
|
2016-12-06 05:33:24 -08:00
|
|
|
_evas_debug_init_from_env(void)
|
2012-06-10 01:43:49 -07:00
|
|
|
{
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2002-11-08 00:02:15 -08:00
|
|
|
void
|
|
|
|
evas_debug_error(void)
|
|
|
|
{
|
2003-05-18 22:36:12 -07:00
|
|
|
if (!_evas_debug_init)
|
|
|
|
{
|
2012-06-10 01:43:49 -07:00
|
|
|
_evas_debug_init_from_env();
|
2003-05-18 22:36:12 -07:00
|
|
|
}
|
2012-06-10 01:43:49 -07:00
|
|
|
if (_evas_debug_show == _EVAS_DEBUG_SHOW)
|
2013-12-25 19:22:05 -08:00
|
|
|
CRI("Evas Magic Check Failed!!!");
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
evas_debug_input_null(void)
|
|
|
|
{
|
2003-05-18 22:36:12 -07:00
|
|
|
if (!_evas_debug_init)
|
|
|
|
{
|
2012-06-10 01:43:49 -07:00
|
|
|
_evas_debug_init_from_env();
|
2003-05-18 22:36:12 -07:00
|
|
|
}
|
2012-06-10 01:43:49 -07:00
|
|
|
if (_evas_debug_show == _EVAS_DEBUG_SHOW)
|
2013-12-25 19:22:05 -08:00
|
|
|
CRI("Input object pointer is NULL!");
|
2004-03-07 18:42:08 -08:00
|
|
|
if (_evas_debug_abort) abort();
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
|
2004-01-27 18:43:13 -08:00
|
|
|
void
|
|
|
|
evas_debug_generic(const char *str)
|
|
|
|
{
|
|
|
|
if (!_evas_debug_init)
|
|
|
|
{
|
2012-06-10 01:43:49 -07:00
|
|
|
_evas_debug_init_from_env();
|
2004-01-27 18:43:13 -08:00
|
|
|
}
|
2012-06-10 01:43:49 -07:00
|
|
|
if ((_evas_debug_show == _EVAS_DEBUG_SHOW) ||
|
|
|
|
(_evas_debug_show == _EVAS_DEBUG_DEFAULT))
|
2013-12-25 19:22:05 -08:00
|
|
|
CRI("%s", str);
|
2004-01-27 18:43:13 -08:00
|
|
|
if (_evas_debug_abort) abort();
|
|
|
|
}
|