From 2b10cb50424d2d273fbf6967405e54ed1100349b Mon Sep 17 00:00:00 2001 From: caro Date: Sun, 3 Jan 2010 21:55:50 +0000 Subject: [PATCH] * move structures from ecore_private.h to the corresponding source files * add 2 internal ecore_exe functions as ecore_signak.c uses Ecore_Exe members no test is done in those 2 functions * remove standard headers from ecore_private.h git-svn-id: http://svn.enlightenment.org/svn/e/trunk/ecore@44862 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/lib/ecore/Ecore.h | 1 + src/lib/ecore/ecore_anim.c | 11 + src/lib/ecore/ecore_events.c | 35 +++ src/lib/ecore/ecore_exe.c | 127 +++++++++++ src/lib/ecore/ecore_idle_enterer.c | 11 + src/lib/ecore/ecore_idle_exiter.c | 11 + src/lib/ecore/ecore_idler.c | 11 + src/lib/ecore/ecore_main.c | 32 +++ src/lib/ecore/ecore_poll.c | 12 + src/lib/ecore/ecore_private.h | 277 +----------------------- src/lib/ecore/ecore_signal.c | 11 +- src/lib/ecore/ecore_timer.c | 18 ++ src/lib/ecore_con/ecore_con_dns.c | 2 + src/lib/ecore_con/ecore_con_info.c | 2 + src/lib/ecore_con/ecore_con_url.c | 1 + src/lib/ecore_config/ecore_config.c | 2 +- src/lib/ecore_evas/ecore_evas.c | 2 + src/lib/ecore_file/ecore_file_monitor_inotify.c | 2 + src/lib/ecore_x/xlib/ecore_x.c | 1 + src/lib/ecore_x/xlib/ecore_x_atoms.c | 2 + src/lib/ecore_x/xlib/ecore_x_events.c | 1 + src/lib/ecore_x/xlib/ecore_x_gc.c | 2 + src/lib/ecore_x/xlib/ecore_x_netwm.c | 1 + src/lib/ecore_x/xlib/ecore_x_window.c | 2 + 24 files changed, 299 insertions(+), 278 deletions(-) diff --git a/src/lib/ecore/Ecore.h b/src/lib/ecore/Ecore.h index c2c3b9b..5ad3fc2 100644 --- a/src/lib/ecore/Ecore.h +++ b/src/lib/ecore/Ecore.h @@ -260,6 +260,7 @@ extern "C" { EAPI char *ecore_exe_tag_get(Ecore_Exe *exe); EAPI char *ecore_exe_cmd_get(Ecore_Exe *exe); EAPI void *ecore_exe_data_get(Ecore_Exe *exe); + EAPI Ecore_Exe_Flags ecore_exe_flags_get(Ecore_Exe *exe); EAPI void ecore_exe_pause(Ecore_Exe *exe); EAPI void ecore_exe_continue(Ecore_Exe *exe); EAPI void ecore_exe_interrupt(Ecore_Exe *exe); diff --git a/src/lib/ecore/ecore_anim.c b/src/lib/ecore/ecore_anim.c index 2830a0e..0d29639 100644 --- a/src/lib/ecore/ecore_anim.c +++ b/src/lib/ecore/ecore_anim.c @@ -11,6 +11,17 @@ #include "Ecore.h" #include "ecore_private.h" + +struct _Ecore_Animator +{ + EINA_INLIST; + ECORE_MAGIC; + unsigned char delete_me : 1; + int (*func) (void *data); + void *data; +}; + + static int _ecore_animator(void *data); static Ecore_Timer *timer = NULL; diff --git a/src/lib/ecore/ecore_events.c b/src/lib/ecore/ecore_events.c index c67df3f..e17b83b 100644 --- a/src/lib/ecore/ecore_events.c +++ b/src/lib/ecore/ecore_events.c @@ -11,6 +11,41 @@ #include "Ecore.h" #include "ecore_private.h" + +struct _Ecore_Event_Handler +{ + EINA_INLIST; + ECORE_MAGIC; + int type; + int delete_me : 1; + int (*func) (void *data, int type, void *event); + void *data; +}; + +struct _Ecore_Event_Filter +{ + EINA_INLIST; + ECORE_MAGIC; + int delete_me : 1; + void * (*func_start) (void *data); + int (*func_filter) (void *data, void *loop_data, int type, void *event); + void (*func_end) (void *data, void *loop_data); + void *loop_data; + void *data; +}; + +struct _Ecore_Event +{ + EINA_INLIST; + ECORE_MAGIC; + int type; + void *event; + int delete_me : 1; + void (*func_free) (void *data, void *ev); + void *data; +}; + + static int events_num = 0; static Ecore_Event *events = NULL; diff --git a/src/lib/ecore/ecore_exe.c b/src/lib/ecore/ecore_exe.c index 0c3697d..cfbc59b 100644 --- a/src/lib/ecore/ecore_exe.c +++ b/src/lib/ecore/ecore_exe.c @@ -26,6 +26,104 @@ #include "Ecore.h" #include "ecore_private.h" + + /* FIXME: Getting respawn to work + * + * There is no way that we can do anything about the internal state info of + * an external exe. The same can be said about the state of user code. User + * code in this context means the code that is using ecore_exe to manage exe's + * for it. + * + * Document that the exe must be respawnable, in other words, there is no + * state that it cannot regenerate by just killing it and starting it again. + * This includes state that the user code knows about, as the respawn is + * transparent to that code. On the other hand, maybe a respawn event might + * be useful, or maybe resend the currently non existant add event. For + * consistancy with ecore_con, an add event is good anyway. + * + * The Ecore_exe structure is reused for respawning, so that the (opaque) + * pointer held by the user remains valid. This means that the Ecore_Exe + * init and del functions may need to be split into two parts each to avoid + * duplicating code - common code part, and the rest. This implies that + * the unchanging members mentioned next should NEVER change. + * + * These structure members don't need to change - + * __list_data - we stay on the list + * ECORE_MAGIC - this is a constant + * data - passed in originally + * cmd - passed in originally + * flags - passed in originally + * + * These structure members need to change - + * tag - state that must be regenerated, zap it + * pid - it will be different + * child_fd_write - it will be different + * child_fd_read - it will be different + * child_fd_error - it will be different + * write_fd_handler - we cannot change the fd used by a handler, this changes coz the fd changes. + * read_fd_handler - we cannot change the fd used by a handler, this changes coz the fd changes. + * error_fd_handler - we cannot change the fd used by a handler, this changes coz the fd changes. + * + * Hmm, the read, write, and error buffers could be tricky. + * They are not atomic, and could be in a semi complete state. + * They fall into the "state must be regenerated" mentioned above. + * A respawn/add event should take care of it. + * + * These structure members need to change - + * write_data_buf - state that must be regenerated, zap it + * write_data_size - state that must be regenerated, zap it + * write_data_offset - state that must be regenerated, zap it + * read_data_buf - state that must be regenerated, zap it + * read_data_size - state that must be regenerated, zap it + * error_data_buf - state that must be regenerated, zap it + * error_data_size - state that must be regenerated, zap it + * close_write - state that must be regenerated, zap it + * + * There is the problem that an exe that fell over and needs respawning + * might keep falling over, keep needing to be respawned, and tie up system + * resources with the constant respawning. An exponentially increasing + * timeout (with maximum timeout) between respawns should take care of that. + * Although this is not a "contention for a resource" problem, the exe falling + * over may be, so a random element added to the timeout may help, and won't + * hurt. The user code may need to be informed that a timeout is in progress. + */ + +struct _Ecore_Exe +{ + EINA_INLIST; + ECORE_MAGIC; + pid_t pid; + void *data; + char *tag; + char *cmd; + Ecore_Exe_Flags flags; + Ecore_Fd_Handler *write_fd_handler; /* the fd_handler to handle write to child - if this was used, or NULL if not */ + Ecore_Fd_Handler *read_fd_handler; /* the fd_handler to handle read from child - if this was used, or NULL if not */ + Ecore_Fd_Handler *error_fd_handler; /* the fd_handler to handle errors from child - if this was used, or NULL if not */ + void *write_data_buf; /* a data buffer for data to write to the child - + * realloced as needed for more data and flushed when the fd handler says writes are possible + */ + int write_data_size; /* the size in bytes of the data buffer */ + int write_data_offset; /* the offset in bytes in the data buffer */ + void *read_data_buf; /* data read from the child awating delivery to an event */ + int read_data_size; /* data read from child in bytes */ + void *error_data_buf; /* errors read from the child awating delivery to an event */ + int error_data_size; /* errors read from child in bytes */ + int child_fd_write; /* fd to write TO to send data to the child */ + int child_fd_read; /* fd to read FROM when child has sent us (the parent) data */ + int child_fd_error; /* fd to read FROM when child has sent us (the parent) errors */ + int child_fd_write_x; /* fd to write TO to send data to the child */ + int child_fd_read_x; /* fd to read FROM when child has sent us (the parent) data */ + int child_fd_error_x; /* fd to read FROM when child has sent us (the parent) errors */ + int close_stdin; + + int start_bytes, end_bytes, start_lines, end_lines; /* Number of bytes/lines to auto pipe at start/end of stdout/stderr. */ + + Ecore_Timer *doomsday_clock; /* The Timer of Death. Muahahahaha. */ + void *doomsday_clock_dead; /* data for the doomsday clock */ +}; + + /* TODO: Something to let people build a command line and does auto escaping - * * ecore_exe_snprintf() @@ -1028,6 +1126,23 @@ ecore_exe_data_get(Ecore_Exe *exe) } /** + * Retrieves the flags attached to the given process handle. + * @param exe The given process handle. + * @return The flags attached to @p exe. + * @ingroup Ecore_Exe_Basic_Group + */ +EAPI Ecore_Exe_Flags +ecore_exe_flags_get(Ecore_Exe *exe) +{ + if (!ECORE_MAGIC_CHECK(exe, ECORE_MAGIC_EXE)) + { + ECORE_MAGIC_FAIL(exe, ECORE_MAGIC_EXE, "ecore_exe_data_get"); + return 0; + } + return exe->flags; +} + +/** * @defgroup Ecore_Exe_Signal_Group Spawned Process Signal Functions * * Functions that send signals to spawned processes. @@ -1307,6 +1422,18 @@ _ecore_exe_find(pid_t pid) return NULL; } +Ecore_Timer * +_ecore_exe_doomsday_clock_get(Ecore_Exe *exe) +{ + return exe->doomsday_clock; +} + +void +_ecore_exe_doomsday_clock_set(Ecore_Exe *exe, Ecore_Timer *dc) +{ + exe->doomsday_clock = dc; +} + static inline void _ecore_exe_exec_it(const char *exe_cmd, Ecore_Exe_Flags flags) { diff --git a/src/lib/ecore/ecore_idle_enterer.c b/src/lib/ecore/ecore_idle_enterer.c index ee53ac9..683a6f0 100644 --- a/src/lib/ecore/ecore_idle_enterer.c +++ b/src/lib/ecore/ecore_idle_enterer.c @@ -11,6 +11,17 @@ #include "Ecore.h" #include "ecore_private.h" + +struct _Ecore_Idle_Enterer +{ + EINA_INLIST; + ECORE_MAGIC; + int delete_me : 1; + int (*func) (void *data); + void *data; +}; + + static Ecore_Idle_Enterer *idle_enterers = NULL; static int idle_enterers_delete_me = 0; diff --git a/src/lib/ecore/ecore_idle_exiter.c b/src/lib/ecore/ecore_idle_exiter.c index 9a83ccc..2c5cafe 100644 --- a/src/lib/ecore/ecore_idle_exiter.c +++ b/src/lib/ecore/ecore_idle_exiter.c @@ -11,6 +11,17 @@ #include "Ecore.h" #include "ecore_private.h" + +struct _Ecore_Idle_Exiter +{ + EINA_INLIST; + ECORE_MAGIC; + int delete_me : 1; + int (*func) (void *data); + void *data; +}; + + static Ecore_Idle_Exiter *idle_exiters = NULL; static int idle_exiters_delete_me = 0; diff --git a/src/lib/ecore/ecore_idler.c b/src/lib/ecore/ecore_idler.c index 0898a3d..76b68ba 100644 --- a/src/lib/ecore/ecore_idler.c +++ b/src/lib/ecore/ecore_idler.c @@ -11,6 +11,17 @@ #include "Ecore.h" #include "ecore_private.h" + +struct _Ecore_Idler +{ + EINA_INLIST; + ECORE_MAGIC; + int delete_me : 1; + int (*func) (void *data); + void *data; +}; + + static Ecore_Idler *idlers = NULL; static int idlers_delete_me = 0; diff --git a/src/lib/ecore/ecore_main.c b/src/lib/ecore/ecore_main.c index d08b818..2851fec 100644 --- a/src/lib/ecore/ecore_main.c +++ b/src/lib/ecore/ecore_main.c @@ -36,6 +36,38 @@ #include "Ecore.h" #include "ecore_private.h" + +struct _Ecore_Fd_Handler +{ + EINA_INLIST; + ECORE_MAGIC; + int fd; + Ecore_Fd_Handler_Flags flags; + int read_active : 1; + int write_active : 1; + int error_active : 1; + int delete_me : 1; + int (*func) (void *data, Ecore_Fd_Handler *fd_handler); + void *data; + int (*buf_func) (void *data, Ecore_Fd_Handler *fd_handler); + void *buf_data; + void (*prep_func) (void *data, Ecore_Fd_Handler *fd_handler); + void *prep_data; +}; + +#ifdef _WIN32 +struct _Ecore_Win32_Handler +{ + EINA_INLIST; + ECORE_MAGIC; + HANDLE h; + int (*func) (void *data, Ecore_Win32_Handler *win32_handler); + void *data; + int delete_me : 1; +}; +#endif + + static int _ecore_main_select(double timeout); static void _ecore_main_fd_handlers_cleanup(void); #ifndef _WIN32 diff --git a/src/lib/ecore/ecore_poll.c b/src/lib/ecore/ecore_poll.c index 162113b..09ae899 100644 --- a/src/lib/ecore/ecore_poll.c +++ b/src/lib/ecore/ecore_poll.c @@ -11,6 +11,18 @@ #include "Ecore.h" #include "ecore_private.h" + +struct _Ecore_Poller +{ + EINA_INLIST; + ECORE_MAGIC; + int ibit; + unsigned char delete_me : 1; + int (*func) (void *data); + void *data; +}; + + static Ecore_Timer *timer = NULL; static int min_interval = -1; static int interval_incr = 0; diff --git a/src/lib/ecore/ecore_private.h b/src/lib/ecore/ecore_private.h index 0d8e879..6347a60 100644 --- a/src/lib/ecore/ecore_private.h +++ b/src/lib/ecore/ecore_private.h @@ -1,28 +1,6 @@ #ifndef _ECORE_PRIVATE_H #define _ECORE_PRIVATE_H -#include -#include -#include -#include -#include - -#ifdef HAVE_SIGNAL_H -# include -#endif - -#ifdef _WIN32 -# define WIN32_LEAN_AND_MEAN -# include -# undef WIN32_LEAN_AND_MEAN -#endif - -#include - -#ifdef EAPI -# undef EAPI -#endif - extern int _ecore_log_dom ; #ifdef _ECORE_DEFAULT_LOG_DOM # undef _ECORE_DEFAULT_LOG_DOM @@ -58,34 +36,6 @@ extern int _ecore_log_dom ; # undef CRIT #endif #define CRIT(...) EINA_LOG_DOM_CRIT(_ECORE_DEFAULT_LOG_DOM, __VA_ARGS__) -#ifdef _WIN32 -# ifdef EFL_ECORE_BUILD -# ifdef DLL_EXPORT -# define EAPI __declspec(dllexport) -# else -# define EAPI -# endif /* ! DLL_EXPORT */ -# else -# define EAPI __declspec(dllimport) -# endif /* ! EFL_ECORE_BUILD */ -#else -# ifdef __GNUC__ -# if __GNUC__ >= 4 -# define EAPI __attribute__ ((visibility("default"))) -# else -# define EAPI -# endif -# else -# define EAPI -# endif -#endif /* ! _WIN32 */ - -#ifdef __GNUC__ -# if __GNUC__ >= 4 -// BROKEN in gcc 4 on amd64 -//# pragma GCC visibility push(hidden) -# endif -#endif #ifndef PATH_MAX # define PATH_MAX 4096 @@ -162,228 +112,6 @@ EAPI void ecore_print_warning(const char *function, const char *sparam); typedef unsigned int Ecore_Magic; - /* FIXME: Getting respawn to work - * - * There is no way that we can do anything about the internal state info of - * an external exe. The same can be said about the state of user code. User - * code in this context means the code that is using ecore_exe to manage exe's - * for it. - * - * Document that the exe must be respawnable, in other words, there is no - * state that it cannot regenerate by just killing it and starting it again. - * This includes state that the user code knows about, as the respawn is - * transparent to that code. On the other hand, maybe a respawn event might - * be useful, or maybe resend the currently non existant add event. For - * consistancy with ecore_con, an add event is good anyway. - * - * The Ecore_exe structure is reused for respawning, so that the (opaque) - * pointer held by the user remains valid. This means that the Ecore_Exe - * init and del functions may need to be split into two parts each to avoid - * duplicating code - common code part, and the rest. This implies that - * the unchanging members mentioned next should NEVER change. - * - * These structure members don't need to change - - * __list_data - we stay on the list - * ECORE_MAGIC - this is a constant - * data - passed in originally - * cmd - passed in originally - * flags - passed in originally - * - * These structure members need to change - - * tag - state that must be regenerated, zap it - * pid - it will be different - * child_fd_write - it will be different - * child_fd_read - it will be different - * child_fd_error - it will be different - * write_fd_handler - we cannot change the fd used by a handler, this changes coz the fd changes. - * read_fd_handler - we cannot change the fd used by a handler, this changes coz the fd changes. - * error_fd_handler - we cannot change the fd used by a handler, this changes coz the fd changes. - * - * Hmm, the read, write, and error buffers could be tricky. - * They are not atomic, and could be in a semi complete state. - * They fall into the "state must be regenerated" mentioned above. - * A respawn/add event should take care of it. - * - * These structure members need to change - - * write_data_buf - state that must be regenerated, zap it - * write_data_size - state that must be regenerated, zap it - * write_data_offset - state that must be regenerated, zap it - * read_data_buf - state that must be regenerated, zap it - * read_data_size - state that must be regenerated, zap it - * error_data_buf - state that must be regenerated, zap it - * error_data_size - state that must be regenerated, zap it - * close_write - state that must be regenerated, zap it - * - * There is the problem that an exe that fell over and needs respawning - * might keep falling over, keep needing to be respawned, and tie up system - * resources with the constant respawning. An exponentially increasing - * timeout (with maximum timeout) between respawns should take care of that. - * Although this is not a "contention for a resource" problem, the exe falling - * over may be, so a random element added to the timeout may help, and won't - * hurt. The user code may need to be informed that a timeout is in progress. - */ -#ifndef _WIN32 -struct _Ecore_Exe -{ - EINA_INLIST; - ECORE_MAGIC; - pid_t pid; - void *data; - char *tag; - char *cmd; - Ecore_Exe_Flags flags; - Ecore_Fd_Handler *write_fd_handler; /* the fd_handler to handle write to child - if this was used, or NULL if not */ - Ecore_Fd_Handler *read_fd_handler; /* the fd_handler to handle read from child - if this was used, or NULL if not */ - Ecore_Fd_Handler *error_fd_handler; /* the fd_handler to handle errors from child - if this was used, or NULL if not */ - void *write_data_buf; /* a data buffer for data to write to the child - - * realloced as needed for more data and flushed when the fd handler says writes are possible - */ - int write_data_size; /* the size in bytes of the data buffer */ - int write_data_offset; /* the offset in bytes in the data buffer */ - void *read_data_buf; /* data read from the child awating delivery to an event */ - int read_data_size; /* data read from child in bytes */ - void *error_data_buf; /* errors read from the child awating delivery to an event */ - int error_data_size; /* errors read from child in bytes */ - int child_fd_write; /* fd to write TO to send data to the child */ - int child_fd_read; /* fd to read FROM when child has sent us (the parent) data */ - int child_fd_error; /* fd to read FROM when child has sent us (the parent) errors */ - int child_fd_write_x; /* fd to write TO to send data to the child */ - int child_fd_read_x; /* fd to read FROM when child has sent us (the parent) data */ - int child_fd_error_x; /* fd to read FROM when child has sent us (the parent) errors */ - int close_stdin; - - int start_bytes, end_bytes, start_lines, end_lines; /* Number of bytes/lines to auto pipe at start/end of stdout/stderr. */ - - Ecore_Timer *doomsday_clock; /* The Timer of Death. Muahahahaha. */ - void *doomsday_clock_dead; /* data for the doomsday clock */ -}; -#endif - -struct _Ecore_Timer -{ - EINA_INLIST; - ECORE_MAGIC; - double in; - double at; - double pending; - int (*func) (void *data); - void *data; - - unsigned char delete_me : 1; - unsigned char just_added : 1; - unsigned char frozen : 1; - unsigned char running : 1; -}; - -struct _Ecore_Idler -{ - EINA_INLIST; - ECORE_MAGIC; - int delete_me : 1; - int (*func) (void *data); - void *data; -}; - -struct _Ecore_Idle_Enterer -{ - EINA_INLIST; - ECORE_MAGIC; - int delete_me : 1; - int (*func) (void *data); - void *data; -}; - -struct _Ecore_Idle_Exiter -{ - EINA_INLIST; - ECORE_MAGIC; - int delete_me : 1; - int (*func) (void *data); - void *data; -}; - -struct _Ecore_Fd_Handler -{ - EINA_INLIST; - ECORE_MAGIC; - int fd; - Ecore_Fd_Handler_Flags flags; - int read_active : 1; - int write_active : 1; - int error_active : 1; - int delete_me : 1; - int (*func) (void *data, Ecore_Fd_Handler *fd_handler); - void *data; - int (*buf_func) (void *data, Ecore_Fd_Handler *fd_handler); - void *buf_data; - void (*prep_func) (void *data, Ecore_Fd_Handler *fd_handler); - void *prep_data; -}; - -#ifdef _WIN32 -struct _Ecore_Win32_Handler -{ - EINA_INLIST; - ECORE_MAGIC; - HANDLE h; - int (*func) (void *data, Ecore_Win32_Handler *win32_handler); - void *data; - int delete_me : 1; -}; -#endif - -struct _Ecore_Event_Handler -{ - EINA_INLIST; - ECORE_MAGIC; - int type; - int delete_me : 1; - int (*func) (void *data, int type, void *event); - void *data; -}; - -struct _Ecore_Event_Filter -{ - EINA_INLIST; - ECORE_MAGIC; - int delete_me : 1; - void * (*func_start) (void *data); - int (*func_filter) (void *data, void *loop_data, int type, void *event); - void (*func_end) (void *data, void *loop_data); - void *loop_data; - void *data; -}; - -struct _Ecore_Event -{ - EINA_INLIST; - ECORE_MAGIC; - int type; - void *event; - int delete_me : 1; - void (*func_free) (void *data, void *ev); - void *data; -}; - -struct _Ecore_Animator -{ - EINA_INLIST; - ECORE_MAGIC; - unsigned char delete_me : 1; - int (*func) (void *data); - void *data; -}; - -struct _Ecore_Poller -{ - EINA_INLIST; - ECORE_MAGIC; - int ibit; - unsigned char delete_me : 1; - int (*func) (void *data); - void *data; -}; - EAPI void _ecore_magic_fail(const void *d, Ecore_Magic m, Ecore_Magic req_m, const char *fname); void _ecore_timer_shutdown(void); @@ -410,7 +138,10 @@ Ecore_Event *_ecore_event_add(int type, void *ev, void (*func_free) (void *data void *_ecore_event_del(Ecore_Event *event); void _ecore_event_call(void); -EAPI void *_ecore_event_signal_user_new(void); +Ecore_Timer *_ecore_exe_doomsday_clock_get(Ecore_Exe *exe); +void _ecore_exe_doomsday_clock_set(Ecore_Exe *exe, Ecore_Timer *dc); + +EAPI void *_ecore_event_signal_user_new(void); void *_ecore_event_signal_hup_new(void); void *_ecore_event_signal_exit_new(void); void *_ecore_event_signal_power_new(void); diff --git a/src/lib/ecore/ecore_signal.c b/src/lib/ecore/ecore_signal.c index bba6db2..5d5a42b 100644 --- a/src/lib/ecore/ecore_signal.c +++ b/src/lib/ecore/ecore_signal.c @@ -232,7 +232,7 @@ _ecore_signal_call(void) if ((n < MAXSIGQ) && (sigchld_info[n].si_signo)) e->data = sigchld_info[n]; /* No need to clone this. */ - if ((e->exe) && (e->exe->flags & (ECORE_EXE_PIPE_READ | ECORE_EXE_PIPE_ERROR))) + if ((e->exe) && (ecore_exe_flags_get(e->exe) & (ECORE_EXE_PIPE_READ | ECORE_EXE_PIPE_ERROR))) { /* We want to report the Last Words of the exe, so delay this event. * This is twice as relevant for stderr. @@ -256,8 +256,11 @@ _ecore_signal_call(void) * check to see for Last Words, and only delay if there are any. * This has it's own set of problems. */ - IF_FN_DEL(ecore_timer_del, e->exe->doomsday_clock); - e->exe->doomsday_clock = ecore_timer_add(0.1, _ecore_signal_exe_exit_delay, e); + Ecore_Timer *doomsday_clock; + + doomsday_clock = _ecore_exe_doomsday_clock_get(e->exe); + IF_FN_DEL(ecore_timer_del, doomsday_clock); + _ecore_exe_doomsday_clock_set(e->exe, ecore_timer_add(0.1, _ecore_signal_exe_exit_delay, e)); } else { @@ -615,7 +618,7 @@ _ecore_signal_exe_exit_delay(void *data) e = data; if (e) { - e->exe->doomsday_clock = NULL; + _ecore_exe_doomsday_clock_set(e->exe, NULL); _ecore_event_add(ECORE_EXE_EVENT_DEL, e, _ecore_exe_event_del_free, NULL); } diff --git a/src/lib/ecore/ecore_timer.c b/src/lib/ecore/ecore_timer.c index 21a81b0..843ea10 100644 --- a/src/lib/ecore/ecore_timer.c +++ b/src/lib/ecore/ecore_timer.c @@ -12,6 +12,24 @@ #include "Ecore.h" #include "ecore_private.h" + +struct _Ecore_Timer +{ + EINA_INLIST; + ECORE_MAGIC; + double in; + double at; + double pending; + int (*func) (void *data); + void *data; + + unsigned char delete_me : 1; + unsigned char just_added : 1; + unsigned char frozen : 1; + unsigned char running : 1; +}; + + static void _ecore_timer_set(Ecore_Timer *timer, double at, double in, int (*func) (void *data), void *data); static int timers_added = 0; diff --git a/src/lib/ecore_con/ecore_con_dns.c b/src/lib/ecore_con/ecore_con_dns.c index bc43188..3655781 100644 --- a/src/lib/ecore_con/ecore_con_dns.c +++ b/src/lib/ecore_con/ecore_con_dns.c @@ -33,6 +33,8 @@ #endif #include +#include +#include #include #ifdef __OpenBSD__ # include diff --git a/src/lib/ecore_con/ecore_con_info.c b/src/lib/ecore_con/ecore_con_info.c index 5386718..7bc9822 100644 --- a/src/lib/ecore_con/ecore_con_info.c +++ b/src/lib/ecore_con/ecore_con_info.c @@ -31,6 +31,8 @@ void *alloca (size_t); #endif #include +#include +#include #include #ifdef __OpenBSD__ # include diff --git a/src/lib/ecore_con/ecore_con_url.c b/src/lib/ecore_con/ecore_con_url.c index 482912e..ff45dc6 100644 --- a/src/lib/ecore_con/ecore_con_url.c +++ b/src/lib/ecore_con/ecore_con_url.c @@ -52,6 +52,7 @@ #include #include #include +#include #include "Ecore.h" #include "ecore_private.h" diff --git a/src/lib/ecore_config/ecore_config.c b/src/lib/ecore_config/ecore_config.c index bdf52d5..491f121 100644 --- a/src/lib/ecore_config/ecore_config.c +++ b/src/lib/ecore_config/ecore_config.c @@ -336,7 +336,7 @@ ecore_config_as_string_get(const char *key) val = NULL; r = NULL; if (!(e = ecore_config_get(key))) - ERR(0, "no such property, \"%s\"...", key); + ERR("no such property, \"%s\"...", key); else { switch (e->type) diff --git a/src/lib/ecore_evas/ecore_evas.c b/src/lib/ecore_evas/ecore_evas.c index 05c09a6..ea96690 100644 --- a/src/lib/ecore_evas/ecore_evas.c +++ b/src/lib/ecore_evas/ecore_evas.c @@ -7,6 +7,8 @@ #endif #include +#include +#include #include "Ecore.h" #include "ecore_private.h" diff --git a/src/lib/ecore_file/ecore_file_monitor_inotify.c b/src/lib/ecore_file/ecore_file_monitor_inotify.c index 9ae4613..bc2c111 100644 --- a/src/lib/ecore_file/ecore_file_monitor_inotify.c +++ b/src/lib/ecore_file/ecore_file_monitor_inotify.c @@ -8,6 +8,8 @@ #include #include +#include +#include #include "ecore_file_private.h" diff --git a/src/lib/ecore_x/xlib/ecore_x.c b/src/lib/ecore_x/xlib/ecore_x.c index 6e26723..9105313 100644 --- a/src/lib/ecore_x/xlib/ecore_x.c +++ b/src/lib/ecore_x/xlib/ecore_x.c @@ -8,6 +8,7 @@ #include #include +#include #include "Ecore.h" #include "ecore_private.h" diff --git a/src/lib/ecore_x/xlib/ecore_x_atoms.c b/src/lib/ecore_x/xlib/ecore_x_atoms.c index 03e8e03..31220a4 100644 --- a/src/lib/ecore_x/xlib/ecore_x_atoms.c +++ b/src/lib/ecore_x/xlib/ecore_x_atoms.c @@ -23,6 +23,8 @@ extern "C" void *alloca (size_t); #endif +#include + #include "Ecore.h" #include "ecore_x_private.h" #include "Ecore_X.h" diff --git a/src/lib/ecore_x/xlib/ecore_x_events.c b/src/lib/ecore_x/xlib/ecore_x_events.c index 694d54e..e89ca34 100644 --- a/src/lib/ecore_x/xlib/ecore_x_events.c +++ b/src/lib/ecore_x/xlib/ecore_x_events.c @@ -7,6 +7,7 @@ #endif #include +#include #include #include diff --git a/src/lib/ecore_x/xlib/ecore_x_gc.c b/src/lib/ecore_x/xlib/ecore_x_gc.c index a76ab5f..9ea0316 100644 --- a/src/lib/ecore_x/xlib/ecore_x_gc.c +++ b/src/lib/ecore_x/xlib/ecore_x_gc.c @@ -6,6 +6,8 @@ # include #endif +#include + #include "Ecore.h" #include "ecore_x_private.h" #include "Ecore_X.h" diff --git a/src/lib/ecore_x/xlib/ecore_x_netwm.c b/src/lib/ecore_x/xlib/ecore_x_netwm.c index 7551101..873d0e6 100644 --- a/src/lib/ecore_x/xlib/ecore_x_netwm.c +++ b/src/lib/ecore_x/xlib/ecore_x_netwm.c @@ -10,6 +10,7 @@ # include #endif +#include #include #include "Ecore.h" diff --git a/src/lib/ecore_x/xlib/ecore_x_window.c b/src/lib/ecore_x/xlib/ecore_x_window.c index 3877b91..416ed5a 100644 --- a/src/lib/ecore_x/xlib/ecore_x_window.c +++ b/src/lib/ecore_x/xlib/ecore_x_window.c @@ -7,6 +7,8 @@ #endif #include +#include +#include #include "Ecore.h" #include "ecore_x_private.h" -- 2.7.4