Main

- Main Page
- Related Pages
- Modules
- Namespaces
- Data Structures
- Files
- Examples

Data Structures | Macros | Typedefs | Functions | Variables
Main
Core

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_Version * | eina_version
| Eina version (defined at configuration time)

## Detailed Description

These functions provide general initialisation and shut down functions.

## Function Documentation

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_evlog(), EINA_LIKELY, EINA_LOG_COLOR_DEFAULT, eina_log_domain_register(), EINA_LOG_ERR, EINA_LOG_STATE_INIT, eina_log_timing(), and ERR.

Referenced by ecore_drm_init(), ecore_init(), ecore_win32_init(), ecore_wl2_init(), ecore_wl_init(), ecore_x_init(), ector_init(), edje_init(), eet_init(), eeze_init(), eeze_sensor_async_read(), efreet_init(), efreet_trash_init(), eina_mempool_unregister(), eio_init(), eldbus_init(), elocation_init(), elua_init(), embryo_init(), emile_init(), emotion_init(), eo_init(), ethumb_client_init(), ethumb_init(), and evas_init().

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_STATE_SHUTDOWN, eina_log_timing(), EINA_UNLIKELY, and ERR.

Referenced by ecore_drm_init(), ecore_drm_shutdown(), ecore_init(), ecore_shutdown(), ecore_win32_init(), ecore_win32_shutdown(), ecore_wl2_init(), ecore_wl2_shutdown(), ecore_wl_init(), ecore_wl_server_mode_set(), ecore_x_double_click_time_get(), ecore_x_init(), ecore_x_init_from_display(), ector_init(), ector_shutdown(), edje_init(), eet_init(), eet_shutdown(), eeze_init(), eeze_sensor_async_read(), eeze_shutdown(), efreet_init(), efreet_shutdown(), efreet_trash_init(), efreet_trash_shutdown(), eio_init(), eio_shutdown(), eldbus_init(), eldbus_shutdown(), elocation_shutdown(), elua_shutdown(), embryo_init(), emile_init(), emile_shutdown(), emotion_init(), emotion_shutdown(), eo_shutdown(), ethumb_client_init(), ethumb_client_shutdown(), ethumb_init(), ethumb_shutdown(), evas_init(), and evas_shutdown().

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(), ecore_thread_feedback_run(), and ecore_thread_run().

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(), ecore_thread_feedback_run(), and ecore_thread_run().

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_idler_add(), ecore_job_add(), ecore_main_loop_thread_safe_call_async(), ecore_main_loop_thread_safe_call_sync(), ecore_poller_add(), ecore_thread_main_loop_begin(), ecore_thread_main_loop_end(), ecore_timer_add(), eina_error_get(), eina_error_set(), and evas_async_events_put().

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(), ecore_thread_main_loop_end(), and evas_async_events_put().