Data Structures | Macros | Typedefs | Functions | Variables
Main

These functions provide general initialisation and shut down functions. More...

Data Structures

struct  _Eina_Version
 

Macros

#define EINA_VERSION_MAJOR   EFL_VERSION_MAJOR
 Major version of Eina.
 
#define EINA_VERSION_MINOR   EFL_VERSION_MINOR
 Minor version of Eina.
 

Typedefs

typedef struct _Eina_Version Eina_Version
 The version of Eina.
 

Functions

EAPI int eina_init (void)
 Initialize the Eina library. More...
 
EAPI int eina_shutdown (void)
 Shut down the Eina library. More...
 
EAPI int eina_threads_init (void)
 Initialize the mutexes of the Eina library. More...
 
EAPI int eina_threads_shutdown (void)
 Shut down mutexes in the Eina library. More...
 
EAPI Eina_Bool eina_main_loop_is (void)
 Check if you are calling this function from the same thread Eina was initialized or not. More...
 
EAPI void eina_main_loop_define (void)
 You should never use that function excpet if you really really know what your are doing. More...
 

Variables

EAPI Eina_Versioneina_version
 Eina version (defined at configuration time)
 

Detailed Description

These functions provide general initialisation and shut down functions.

Function Documentation

§ eina_init()

EAPI int eina_init ( void  )

Initialize the Eina library.

Returns
1 or greater on success, 0 on error.

This function sets up all the eina modules. It returns 0 on failure (that is, when one of the module fails to initialize), otherwise it returns the number of times it has already been called.

When Eina is not used anymore, call eina_shutdown() to shut down the Eina library.

References EINA_LIKELY, EINA_LOG_COLOR_DEFAULT, eina_log_domain_register(), EINA_LOG_ERR, eina_log_timing(), and ERR.

Referenced by ecore_drm2_init(), ecore_drm_init(), ecore_init(), ecore_win32_init(), ecore_wl2_init(), ecore_wl_init(), ector_init(), edje_init(), eet_init(), eeze_init(), eeze_sensor_async_read(), efreet_init(), efreet_trash_init(), eio_init(), eldbus_init(), elm_code_init(), elm_quicklaunch_init(), elocation_init(), elput_init(), elua_init(), embryo_init(), emile_init(), eo_init(), ethumb_client_init(), and evas_init().

§ eina_shutdown()

EAPI int eina_shutdown ( void  )

Shut down the Eina library.

Returns
0 when all the modules are completely shut down, 1 or greater otherwise.

This function shuts down the Eina library. It returns 0 when it has been called the same number of times than eina_init(). In that case it shut down all the Eina modules.

Once this function succeeds (that is, 0 is returned), you must not call any of the Eina function anymore. You must call eina_init() again to use the Eina functions again.

References eina_log_timing(), EINA_UNLIKELY, and ERR.

Referenced by ecore_drm_init(), ecore_drm_shutdown(), ecore_win32_init(), ecore_win32_shutdown(), ecore_wl_server_mode_set(), ecore_x_init(), eeze_init(), eeze_sensor_async_read(), eeze_shutdown(), efreet_init(), efreet_shutdown(), efreet_trash_init(), efreet_trash_shutdown(), eldbus_init(), elocation_shutdown(), emotion_shutdown(), and efl::eina::log_domain::~log_domain().

§ eina_threads_init()

EAPI int eina_threads_init ( void  )

Initialize the mutexes of the Eina library.

Returns
1 or greater on success, 0 on error.

This function sets up all the mutexes in all eina modules. It returns 0 on failure (that is, when one of the module fails to initialize), otherwise it returns the number of times it has already been called.

When the mutexes are not used anymore, call eina_threads_shutdown() to shut down the mutexes.

This function should never be called outside of the main loop.

References EINA_TRUE.

Referenced by ecore_thread_feedback_run(), and ecore_thread_run().

§ eina_threads_shutdown()

EAPI int eina_threads_shutdown ( void  )

Shut down mutexes in the Eina library.

Returns
0 when all mutexes are completely shut down, 1 or greater otherwise.

This function shuts down the mutexes in the Eina library. It returns 0 when it has been called the same number of times than eina_threads_init(). In that case it shut down all the mutexes.

Once this function succeeds (that is, 0 is returned), you must not call any of the Eina function in a thread anymore. You must call eina_threads_init() again to use the Eina functions in a thread again.

This function should never be called outside of the main loop.

References EINA_FALSE, EINA_INLIST_FOREACH, and eina_lock_debug().

Referenced by ecore_thread_feedback_run(), and ecore_thread_run().

§ eina_main_loop_is()

EAPI Eina_Bool eina_main_loop_is ( void  )

Check if you are calling this function from the same thread Eina was initialized or not.

Returns
EINA_TRUE is the calling function is the same thread, EINA_FALSE otherwise.
Since
1.1.0

Most EFL function are not thread safe and all the call need to happen in the main loop. With this call you could know if you can call an EFL function or not.

References EINA_FALSE, and EINA_TRUE.

Referenced by ecore_job_add(), ecore_main_loop_thread_safe_call_async(), ecore_main_loop_thread_safe_call_sync(), ecore_thread_main_loop_begin(), ecore_thread_main_loop_end(), eina_error_get(), and eina_error_set().

§ eina_main_loop_define()

EAPI void eina_main_loop_define ( void  )

You should never use that function excpet if you really really know what your are doing.

Since
1.1.0

If you are reading this documentation, that certainly means you don't know what is the purpose of this call and you should just not use it.

You should never use that function excpet if you really really know what your are doing.

Referenced by ecore_fork_reset(), ecore_thread_main_loop_begin(), elm_quicklaunch_fork(), and evas_async_events_put().