2008-08-06 11:15:24 -07:00
|
|
|
/* EINA - EFL data type library
|
|
|
|
* Copyright (C) 2008 Cedric Bail
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library;
|
|
|
|
* if not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2008-08-28 00:46:42 -07:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include "config.h"
|
|
|
|
#endif
|
|
|
|
|
2008-10-10 02:33:40 -07:00
|
|
|
#include "Eina.h"
|
2008-08-06 08:37:29 -07:00
|
|
|
|
2008-08-28 00:46:42 -07:00
|
|
|
/*============================================================================*
|
|
|
|
* Global *
|
|
|
|
*============================================================================*/
|
|
|
|
|
|
|
|
/*============================================================================*
|
|
|
|
* API *
|
|
|
|
*============================================================================*/
|
|
|
|
|
2008-10-27 13:24:12 -07:00
|
|
|
static int _eina_main_count = 0;
|
|
|
|
|
2008-08-06 08:37:29 -07:00
|
|
|
EAPI int
|
|
|
|
eina_init(void)
|
|
|
|
{
|
2008-10-27 13:24:12 -07:00
|
|
|
if (_eina_main_count) goto finish_init;
|
2008-08-06 08:37:29 -07:00
|
|
|
|
2008-10-27 13:24:12 -07:00
|
|
|
eina_error_init();
|
2008-09-03 05:06:50 -07:00
|
|
|
eina_hash_init();
|
|
|
|
eina_stringshare_init();
|
|
|
|
eina_list_init();
|
|
|
|
eina_array_init();
|
2008-09-18 03:04:46 -07:00
|
|
|
eina_counter_init();
|
|
|
|
eina_benchmark_init();
|
2008-09-24 10:21:53 -07:00
|
|
|
eina_magic_string_init();
|
2008-08-06 08:37:29 -07:00
|
|
|
|
2008-10-27 13:24:12 -07:00
|
|
|
finish_init:
|
|
|
|
return ++_eina_main_count;
|
2008-08-06 08:37:29 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI int
|
|
|
|
eina_shutdown(void)
|
|
|
|
{
|
2008-10-27 13:24:12 -07:00
|
|
|
if (_eina_main_count != 1) goto finish_shutdown;
|
2008-08-06 08:37:29 -07:00
|
|
|
|
2008-09-24 10:21:53 -07:00
|
|
|
eina_magic_string_shutdown();
|
2008-09-18 03:04:46 -07:00
|
|
|
eina_benchmark_shutdown();
|
|
|
|
eina_counter_shutdown();
|
2008-08-07 06:12:57 -07:00
|
|
|
eina_array_shutdown();
|
|
|
|
eina_list_shutdown();
|
2008-09-03 05:06:50 -07:00
|
|
|
eina_stringshare_shutdown();
|
|
|
|
eina_hash_shutdown();
|
2008-10-27 13:24:12 -07:00
|
|
|
eina_error_shutdown();
|
2008-08-06 08:37:29 -07:00
|
|
|
|
2008-10-27 13:24:12 -07:00
|
|
|
finish_shutdown:
|
|
|
|
return --_eina_main_count;
|
2008-08-06 08:37:29 -07:00
|
|
|
}
|
|
|
|
|