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

Typedefs | Functions | Variables
Ecore initialization, shutdown functions and reset on fork.
Ecore

## Typedefs
typedef struct _Ecore_Fork_Cb | Ecore_Fork_Cb

## Functions
EAPI int | ecore_init (void)
| Set up connections, signal handlers, sockets etc. More...
EAPI int | ecore_shutdown (void)
| Shut down connections, signal handlers sockets etc. More...
EAPI Eina_Bool | ecore_fork_reset_callback_add (Ecore_Cb func, const void *data)
| Add a function to be called by ecore_fork_reset() More...
EAPI Eina_Bool | ecore_fork_reset_callback_del (Ecore_Cb func, const void *data)
| This removes the callback specified. More...
EAPI void | ecore_fork_reset (void)
| Reset the ecore internal state after a fork. More...

## Variables
static int | fork_cbs_walking = 0
static Eina_List * | fork_cbs = NULL

## Detailed Description

## Function Documentation

int ecore_init | ( | void |  | ) |

Set 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();
}

Examples:
  banshee.c, client.c, complex-types-client-eina-value.c, complex-types-server.c, complex-types.c, connman-list-services.c, ecore_con_client_example.c, ecore_con_client_simple_example.c, ecore_con_lookup_example.c, ecore_con_server_example.c, ecore_con_server_simple_example.c, ecore_con_url_cookies_example.c, ecore_con_url_download_example.c, ecore_con_url_headers_example.c, ecore_event_example_01.c, ecore_event_example_02.c, ecore_exe_example.c, ecore_exe_example_child.c, ecore_fd_handler_example.c, ecore_fd_handler_gnutls_example.c, ecore_idler_example.c, ecore_job_example.c, ecore_pipe_gstreamer_example.c, ecore_pipe_simple_example.c, ecore_poller_example.c, ecore_thread_example.c, ecore_time_functions_example.c, ecore_timer_example.c, eina_tiler_01.c, eio_file_ls.c, ofono-dial.c, and server.c.

References ecore_animator_add(), ecore_main_loop_glib_integrate(), ecore_timer_add(), eina_init(), eina_log_domain_register(), EINA_LOG_ERR, eina_log_timing(), eina_prefix_new(), eina_shutdown(), evil_init(), evil_shutdown(), and unsetenv().

Referenced by ecore_audio_init(), ecore_con_init(), ecore_evas_init(), ecore_file_init(), ecore_imf_init(), ecore_wl_init(), ecore_x_init(), edje_init(), eeze_init(), efreet_init(), efreet_mime_init(), eio_init(), and eldbus_init().

int ecore_shutdown | ( | void |  | ) |

Shut 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.

Examples:
  banshee.c, client.c, complex-types-client-eina-value.c, complex-types-server.c, complex-types.c, connman-list-services.c, ecore_con_client_simple_example.c, ecore_con_lookup_example.c, ecore_con_server_simple_example.c, ecore_con_url_cookies_example.c, ecore_con_url_download_example.c, ecore_con_url_headers_example.c, ecore_event_example_02.c, ecore_exe_example.c, ecore_exe_example_child.c, ecore_fd_handler_example.c, ecore_idler_example.c, ecore_job_example.c, ecore_pipe_gstreamer_example.c, ecore_pipe_simple_example.c, ecore_poller_example.c, ecore_thread_example.c, ecore_time_functions_example.c, ecore_timer_example.c, eina_tiler_01.c, eio_file_ls.c, ofono-dial.c, and server.c.

References ecore_timer_del(), eina_log_domain_unregister(), 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_evas_init(), ecore_evas_shutdown(), ecore_file_shutdown(), ecore_imf_init(), ecore_imf_shutdown(), ecore_wl_init(), ecore_x_init(), edje_init(), eeze_init(), eeze_shutdown(), efreet_init(), efreet_mime_init(), efreet_mime_shutdown(), efreet_shutdown(), eio_shutdown(), eldbus_init(), and eldbus_shutdown().

EAPI Eina_Bool ecore_fork_reset_callback_add | ( | Ecore_Cb | func,
|  | const void * | data
| ) |  |

Add a function to be called by ecore_fork_reset()

This queues `func` to be called (and passed `data` as its argument) when ecore_fork_reset() is called. This allows other libraries and subsystems to also reset their internal state after a fork.

Since
  1.7

References EINA_FALSE, eina_list_append(), and EINA_TRUE.

Referenced by ecore_evas_init().

EAPI Eina_Bool ecore_fork_reset_callback_del | ( | Ecore_Cb | func,
|  | const void * | data
| ) |  |

This removes the callback specified.

This deletes the callback added by ecore_fork_reset_callback_add() using the function and data pointer to specify which to remove.

Since
  1.7

References EINA_FALSE, EINA_LIST_FOREACH, eina_list_remove_list(), and EINA_TRUE.

Referenced by ecore_evas_shutdown().

EAPI void ecore_fork_reset | ( | void |  | ) |

Reset the ecore internal state after a fork.

Ecore maintains internal data that can be affected by the fork() system call which creates a duplicate of the current process. This also duplicates file descriptors which is problematic in that these file descriptors still point to their original sources. This function makes ecore reset internal state (e.g. pipes used for signalling between threads) so they function correctly afterwards.

It is highly suggested that you call this function after any fork() system call inside the child process if you intend to use ecore features after this point and not call any exec() family functions. Not doing so will cause possible misbehaviour.

Since
  1.7

References ecore_pipe_add(), ecore_pipe_del(), ecore_pipe_write(), EINA_LIST_FOREACH, EINA_LIST_FOREACH_SAFE, eina_list_remove_list(), and unsetenv().