Ecore initialization, shutdown functions and reset on fork.

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

Functions
Ecore initialization, shutdown functions and reset on fork.
Ecore

## Functions
int | ecore_init (void)
| Sets up connections, signal handlers, sockets etc.
int | ecore_shutdown (void)
| Shuts down connections, signal handlers sockets etc.
unsigned int | ecore_init_ex (int argc, char **argv)
| This function will propagate the events on the main loop.
unsigned int | ecore_shutdown_ex (void)
| Shuts down connections, signal handlers sockets etc.
EWAPI void | efl_build_version_set (int vmaj, int vmin, int vmic, int revision, const char *flavor, const char *build_id)
| Inform EFL of the version this application was built for.

## Detailed Description

## Function Documentation

## ◆ ecore_init()

int ecore_init | ( | void |  | ) |

Sets up connections, signal handlers, sockets etc.

Returns
  `1` or greater on success, `0` otherwise.

This function sets up all singal handlers and the basic event loop. If it succeeds, `1` will be returned, otherwise `0` will be returned.

#include <Ecore.h>
int main(int argc, char **argv)
{
if (!ecore_init())
{
printf("ERROR: Cannot init Ecore!\n");
return -1;
}
ecore_main_loop_begin();
ecore_shutdown();
}
ecore_shutdown
EAPI int ecore_shutdown(void)
Shuts down connections, signal handlers sockets etc.
Definition: ecore.c:371
ecore_init
EAPI int ecore_init(void)
Sets up connections, signal handlers, sockets etc.
Definition: ecore.c:230
ecore_main_loop_begin
void ecore_main_loop_begin(void)
Runs the application main loop.
Definition: ecore_main.c:1311

This function is affected by some environment variables:

- `ECORE_NO_SYSTEM_MODULES=1` may be used to temporarily disable system modules, often useful for debug.

- `ECORE_FPS_DEBUG=1` prints frames per second, usefult to detect lags and blocking calls.

- `ECORE_MEM_STAT=1` will generate `ecore_mem_stat.${PID}` file with memory statistics.

- `ECORE_ERROR_ABORT=1` will abort on errors.

This function will call eina_init(), so other environment variables may apply.

References ecore_init(), ecore_main_loop_glib_integrate(), ecore_poller_add(), ECORE_POLLER_CORE, eina_evlog(), EINA_FALSE, eina_init(), eina_log_domain_register(), EINA_LOG_ERR, EINA_LOG_STATE_INIT, EINA_LOG_STATE_STOP, eina_log_timing(), eina_prefix_new(), eina_shutdown(), evil_init(), evil_shutdown(), and unsetenv().

Referenced by ecore_audio_init(), ecore_con_init(), ecore_con_url_init(), ecore_drm2_init(), ecore_drm_init(), ecore_evas_init(), ecore_event_init(), ecore_file_init(), ecore_imf_init(), ecore_init(), ecore_init_ex(), ecore_wl2_init(), ecore_wl_init(), edje_init(), eeze_init(), efreet_init(), eio_init(), eldbus_init(), elm_quicklaunch_init(), elput_init(), emotion_init(), and evas_init().

## ◆ ecore_shutdown()

int ecore_shutdown | ( | void |  | ) |

Shuts down connections, signal handlers sockets etc.

Returns
  `0` if ecore shuts down, greater than `0` otherwise. This function shuts down all things set up in ecore_init() and cleans up all event queues, handlers, filters, timers, idlers, idle enterers/exiters etc. set up after ecore_init() was called.

Do not call this function from any callback that may be called from the main loop, as the main loop will then fall over and not function properly.

References eina_evlog(), eina_log_domain_unregister(), EINA_LOG_STATE_SHUTDOWN, EINA_LOG_STATE_START, eina_log_timing(), eina_prefix_free(), eina_shutdown(), and evil_shutdown().

Referenced by ecore_audio_init(), ecore_audio_shutdown(), ecore_con_init(), ecore_con_shutdown(), ecore_con_url_init(), ecore_con_url_shutdown(), ecore_drm2_init(), ecore_drm2_shutdown(), ecore_drm_init(), ecore_drm_shutdown(), ecore_evas_init(), ecore_evas_shutdown(), ecore_event_shutdown(), ecore_file_shutdown(), ecore_imf_init(), ecore_imf_shutdown(), ecore_shutdown_ex(), ecore_wl2_init(), ecore_wl2_shutdown(), ecore_wl_init(), ecore_x_init(), ecore_x_init_from_display(), edje_init(), eeze_init(), eeze_shutdown(), efreet_init(), efreet_shutdown(), eio_shutdown(), eldbus_init(), eldbus_shutdown(), elm_quicklaunch_init(), elm_quicklaunch_shutdown(), elput_init(), elput_shutdown(), emotion_shutdown(), and evas_shutdown().

## ◆ ecore_init_ex()

unsigned int ecore_init_ex | ( | int | argc,
|  | char ** | argv
| ) |  |

This function will propagate the events on the main loop.

So you should call ecore_init() first, then register your callback on `EFL_LOOP_EVENT_ARGUMENTS` and finally call ecore_init_ex().

Once you are shuting down your program, you should symmetrically call ecore_shutdown_ex().

References ecore_app_args_set(), and ecore_init().

Referenced by elm_quicklaunch_fork(), and elm_quicklaunch_sub_init().

## ◆ ecore_shutdown_ex()

unsigned int ecore_shutdown_ex | ( | void |  | ) |

Shuts down connections, signal handlers sockets etc.

Returns
  `0` if ecore shuts down, greater than `0` otherwise. This function shuts down all things set up in ecore_init_ex() and cleans up all event queues, handlers, filters, timers, idlers, idle enterers/exiters etc. set up after ecore_init_ex() was called.

Do not call this function from any callback that may be called from the main loop, as the main loop will then fall over and not function properly.

Note: This function should be called in symetric to ecore_init_ex()

References ecore_shutdown().

Referenced by elm_quicklaunch_fork(), elm_quicklaunch_sub_init(), and elm_quicklaunch_sub_shutdown().

## ◆ efl_build_version_set()

EWAPI void efl_build_version_set | ( | int | vmaj,
|  | int | vmin,
|  | int | vmic,
|  | int | revision,
|  | const char * | flavor,
|  | const char * | build_id
| ) |  |

Inform EFL of the version this application was built for.

This is transparently called from $EFL_MAIN().

Since
  1.18 (as beta)