- Main Page
- Related Pages
- Modules
- 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_LIKELY, eina_log_domain_register(), EINA_LOG_ERR, and eina_log_timing().

Referenced by ecore_init(), ecore_win32_init(), ecore_wince_init(), ecore_wl_init(), ecore_x_init(), edje_init(), eet_init(), eeze_init(), efreet_init(), efreet_trash_init(), eio_init(), eldbus_init(), ethumb_client_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_timing(), and EINA_UNLIKELY.

Referenced by ecore_init(), ecore_shutdown(), ecore_win32_init(), ecore_win32_shutdown(), ecore_wince_init(), ecore_wince_shutdown(), ecore_wl_init(), ecore_x_init(), edje_init(), eet_init(), eet_shutdown(), eeze_init(), eeze_shutdown(), efreet_init(), efreet_shutdown(), efreet_trash_init(), efreet_trash_shutdown(), eio_init(), eio_shutdown(), eldbus_init(), eldbus_shutdown(), ethumb_client_init(), ethumb_client_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_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, and EINA_INLIST_FOREACH.

Referenced by 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_main_loop_thread_safe_call_async(), ecore_main_loop_thread_safe_call_sync(), ecore_thread_main_loop_begin(), and ecore_thread_main_loop_end().

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_thread_main_loop_begin().