efl/src/lib/evas/main.c

70 lines
1.5 KiB
C
Raw Normal View History

#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
int _evas_alloc_error = 0;
static int _evas_debug_init = 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
evas_alloc_error(void)
{
return _evas_alloc_error;
}
static void
_evas_debug_init_from_env(void)
{
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)
{
if (!_evas_debug_init)
{
_evas_debug_init_from_env();
}
if (_evas_debug_show == _EVAS_DEBUG_SHOW)
CRI("Evas Magic Check Failed!!!");
2002-11-08 00:02:15 -08:00
}
void
evas_debug_input_null(void)
{
if (!_evas_debug_init)
{
_evas_debug_init_from_env();
}
if (_evas_debug_show == _EVAS_DEBUG_SHOW)
CRI("Input object pointer is NULL!");
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)
{
_evas_debug_init_from_env();
2004-01-27 18:43:13 -08:00
}
if ((_evas_debug_show == _EVAS_DEBUG_SHOW) ||
(_evas_debug_show == _EVAS_DEBUG_DEFAULT))
CRI("%s", str);
2004-01-27 18:43:13 -08:00
if (_evas_debug_abort) abort();
}