ran ecrustify on ecore. some manual fixing too.

SVN revision: 64238
This commit is contained in:
Carsten Haitzler 2011-10-21 05:40:39 +00:00
parent 8893a9ff35
commit 58cbf16625
24 changed files with 5756 additions and 4978 deletions

View File

@ -150,7 +150,8 @@ For example:
@code
#include <Ecore.h>
int main(int argc, const char **argv)
int
main(int argc, const char **argv)
{
ecore_init();
ecore_app_args_set(argc, argv);
@ -172,13 +173,15 @@ Ecore_Timer *timer1 = NULL;
Ecore_Event_Handler *handler1 = NULL;
double start_time = 0.0;
int timer_func(void *data)
int
timer_func(void *data)
{
printf("Tick timer. Sec: %3.2f\n", ecore_time_get() - start_time);
return 1;
}
int exit_func(void *data, int ev_type, void *ev)
int
exit_func(void *data, int ev_type, void *ev)
{
Ecore_Event_Signal_Exit *e;
@ -190,7 +193,8 @@ int exit_func(void *data, int ev_type, void *ev)
return 1;
}
int main(int argc, const char **argv)
int
main(int argc, const char **argv)
{
ecore_init();
ecore_app_args_set(argc, argv);
@ -207,14 +211,16 @@ In the previous example, we initialize our application and get the time at
which our program has started so we can calculate an offset. We set
up a timer to tick off in 0.5 seconds, and since it returns 1, will
keep ticking off every 0.5 seconds until it returns 0, or is deleted
by hand. An event handler is set up to call a function - exit_func(),
by hand. An event handler is set up to call a function -
exit_func(),
whenever an event of type ECORE_EVENT_SIGNAL_EXIT is received (CTRL-C
on the command line will cause such an event to happen). If this event
occurs it tells you what kind of exit signal was received, and asks
the main loop to quit when it is finished by calling
ecore_main_loop_quit().
The handles returned by ecore_timer_add() and ecore_event_handler_add() are
The handles returned by ecore_timer_add() and
ecore_event_handler_add() are
only stored here as an example. If you don't need to address the timer or
event handler again you don't need to store the result, so just call the
function, and don't assign the result to any variable.
@ -309,8 +315,10 @@ extern "C" {
* @{
*/
EAPI int ecore_init(void);
EAPI int ecore_shutdown(void);
EAPI int
ecore_init(void);
EAPI int
ecore_shutdown(void);
/**
* @}
@ -387,16 +395,23 @@ extern "C" {
*/
typedef int (*Ecore_Select_Function)(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout);
EAPI void ecore_main_loop_iterate(void);
EAPI void
ecore_main_loop_iterate(void);
EAPI void ecore_main_loop_select_func_set(Ecore_Select_Function func);
EAPI Ecore_Select_Function ecore_main_loop_select_func_get(void);
EAPI void
ecore_main_loop_select_func_set(Ecore_Select_Function func);
EAPI Ecore_Select_Function
ecore_main_loop_select_func_get(void);
EAPI Eina_Bool ecore_main_loop_glib_integrate(void);
EAPI void ecore_main_loop_glib_always_integrate_disable(void);
EAPI Eina_Bool
ecore_main_loop_glib_integrate(void);
EAPI void
ecore_main_loop_glib_always_integrate_disable(void);
EAPI void ecore_main_loop_begin(void);
EAPI void ecore_main_loop_quit(void);
EAPI void
ecore_main_loop_begin(void);
EAPI void
ecore_main_loop_quit(void);
/**
* @typedef Ecore_Cb Ecore_Cb
@ -426,7 +441,9 @@ extern "C" {
* in the thread, it is owned by the main loop and your callback should take
* care of freeing it if necessary.
*/
EAPI void ecore_main_loop_thread_safe_call_async(Ecore_Cb callback, void *data);
EAPI void
ecore_main_loop_thread_safe_call_async(Ecore_Cb callback,
void *data);
/**
* @brief Call callback synchronously in the main loop.
@ -443,7 +460,9 @@ extern "C" {
* Remember this function will block until the callback is executed in the
* main loop. It can take time and you have no guaranty about the timeline.
*/
EAPI void *ecore_main_loop_thread_safe_call_sync(Ecore_Data_Cb callback, void *data);
EAPI void *
ecore_main_loop_thread_safe_call_sync(Ecore_Data_Cb callback,
void *data);
/**
* @brief This function suspend the main loop in a know state
@ -463,7 +482,8 @@ extern "C" {
* We still advise you, when possible, to use ecore_main_loop_thread_safe_call_async()
* as it will not block the thread nor the main loop.
*/
EAPI int ecore_thread_main_loop_begin(void);
EAPI int
ecore_thread_main_loop_begin(void);
/**
* @brief Unlock the main loop.
@ -476,7 +496,8 @@ extern "C" {
* After a call to ecore_thread_main_loop_begin(), you need to absolutly
* call ecore_thread_main_loop_end(), or you application will stay frozen.
*/
EAPI int ecore_thread_main_loop_end(void);
EAPI int
ecore_thread_main_loop_end(void);
/**
* @}
@ -610,17 +631,37 @@ extern "C" {
#endif
};
EAPI Ecore_Event_Handler *ecore_event_handler_add(int type, Ecore_Event_Handler_Cb func, const void *data);
EAPI void *ecore_event_handler_del(Ecore_Event_Handler *event_handler);
EAPI Ecore_Event *ecore_event_add(int type, void *ev, Ecore_End_Cb func_free, void *data);
EAPI void *ecore_event_del(Ecore_Event *event);
EAPI void *ecore_event_handler_data_get(Ecore_Event_Handler *eh);
EAPI void *ecore_event_handler_data_set(Ecore_Event_Handler *eh, const void *data);
EAPI int ecore_event_type_new(void);
EAPI Ecore_Event_Filter *ecore_event_filter_add(Ecore_Data_Cb func_start, Ecore_Filter_Cb func_filter, Ecore_End_Cb func_end, const void *data);
EAPI void *ecore_event_filter_del(Ecore_Event_Filter *ef);
EAPI int ecore_event_current_type_get(void);
EAPI void *ecore_event_current_event_get(void);
EAPI Ecore_Event_Handler *
ecore_event_handler_add(int type,
Ecore_Event_Handler_Cb func,
const void *data);
EAPI void *
ecore_event_handler_del(Ecore_Event_Handler *event_handler);
EAPI Ecore_Event *
ecore_event_add(int type,
void *ev,
Ecore_End_Cb func_free,
void *data);
EAPI void *
ecore_event_del(Ecore_Event *event);
EAPI void *
ecore_event_handler_data_get(Ecore_Event_Handler *eh);
EAPI void *
ecore_event_handler_data_set(Ecore_Event_Handler *eh,
const void *data);
EAPI int
ecore_event_type_new(void);
EAPI Ecore_Event_Filter *
ecore_event_filter_add(Ecore_Data_Cb func_start,
Ecore_Filter_Cb func_filter,
Ecore_End_Cb func_end,
const void *data);
EAPI void *
ecore_event_filter_del(Ecore_Event_Filter *ef);
EAPI int
ecore_event_current_type_get(void);
EAPI void *
ecore_event_current_event_get(void);
/**
* @}
@ -718,32 +759,72 @@ extern "C" {
Ecore_Exe_Event_Data_Line *lines; /**< an array of line data if line buffered, the last one has it's line member set to NULL */
};
EAPI void ecore_exe_run_priority_set(int pri);
EAPI int ecore_exe_run_priority_get(void);
EAPI Ecore_Exe *ecore_exe_run(const char *exe_cmd, const void *data);
EAPI Ecore_Exe *ecore_exe_pipe_run(const char *exe_cmd, Ecore_Exe_Flags flags, const void *data);
EAPI void ecore_exe_callback_pre_free_set(Ecore_Exe *exe, Ecore_Exe_Cb func);
EAPI Eina_Bool ecore_exe_send(Ecore_Exe *exe, const void *data, int size);
EAPI void ecore_exe_close_stdin(Ecore_Exe *exe);
EAPI void ecore_exe_auto_limits_set(Ecore_Exe *exe, int start_bytes, int end_bytes, int start_lines, int end_lines);
EAPI Ecore_Exe_Event_Data *ecore_exe_event_data_get(Ecore_Exe *exe, Ecore_Exe_Flags flags);
EAPI void ecore_exe_event_data_free(Ecore_Exe_Event_Data *data);
EAPI void *ecore_exe_free(Ecore_Exe *exe);
EAPI pid_t ecore_exe_pid_get(const Ecore_Exe *exe);
EAPI void ecore_exe_tag_set(Ecore_Exe *exe, const char *tag);
EAPI const char *ecore_exe_tag_get(const Ecore_Exe *exe);
EAPI const char *ecore_exe_cmd_get(const Ecore_Exe *exe);
EAPI void *ecore_exe_data_get(const Ecore_Exe *exe);
EAPI void *ecore_exe_data_set(Ecore_Exe *exe, void *data);
EAPI Ecore_Exe_Flags ecore_exe_flags_get(const 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);
EAPI void ecore_exe_quit(Ecore_Exe *exe);
EAPI void ecore_exe_terminate(Ecore_Exe *exe);
EAPI void ecore_exe_kill(Ecore_Exe *exe);
EAPI void ecore_exe_signal(Ecore_Exe *exe, int num);
EAPI void ecore_exe_hup(Ecore_Exe *exe);
EAPI void
ecore_exe_run_priority_set(int pri);
EAPI int
ecore_exe_run_priority_get(void);
EAPI Ecore_Exe *
ecore_exe_run(const char *exe_cmd,
const void *data);
EAPI Ecore_Exe *
ecore_exe_pipe_run(const char *exe_cmd,
Ecore_Exe_Flags flags,
const void *data);
EAPI void
ecore_exe_callback_pre_free_set(Ecore_Exe *exe,
Ecore_Exe_Cb func);
EAPI Eina_Bool
ecore_exe_send(Ecore_Exe *exe,
const void *data,
int size);
EAPI void
ecore_exe_close_stdin(Ecore_Exe *exe);
EAPI void
ecore_exe_auto_limits_set(Ecore_Exe *exe,
int start_bytes,
int end_bytes,
int start_lines,
int end_lines);
EAPI Ecore_Exe_Event_Data *
ecore_exe_event_data_get(Ecore_Exe *exe,
Ecore_Exe_Flags flags);
EAPI void
ecore_exe_event_data_free(Ecore_Exe_Event_Data *data);
EAPI void *
ecore_exe_free(Ecore_Exe *exe);
EAPI pid_t
ecore_exe_pid_get(const Ecore_Exe *exe);
EAPI void
ecore_exe_tag_set(Ecore_Exe *exe,
const char *tag);
EAPI const char *
ecore_exe_tag_get(const Ecore_Exe *exe);
EAPI const char *
ecore_exe_cmd_get(const Ecore_Exe *exe);
EAPI void *
ecore_exe_data_get(const Ecore_Exe *exe);
EAPI void *
ecore_exe_data_set(Ecore_Exe *exe,
void *data);
EAPI Ecore_Exe_Flags
ecore_exe_flags_get(const 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);
EAPI void
ecore_exe_quit(Ecore_Exe *exe);
EAPI void
ecore_exe_terminate(Ecore_Exe *exe);
EAPI void
ecore_exe_kill(Ecore_Exe *exe);
EAPI void
ecore_exe_signal(Ecore_Exe *exe,
int num);
EAPI void
ecore_exe_hup(Ecore_Exe *exe);
/**
* @}
@ -807,16 +888,34 @@ extern "C" {
*/
typedef Eina_Bool (*Ecore_Win32_Handle_Cb)(void *data, Ecore_Win32_Handler *wh);
EAPI Ecore_Fd_Handler *ecore_main_fd_handler_add(int fd, Ecore_Fd_Handler_Flags flags, Ecore_Fd_Cb func, const void *data,
Ecore_Fd_Cb buf_func, const void *buf_data);
EAPI void ecore_main_fd_handler_prepare_callback_set(Ecore_Fd_Handler *fd_handler, Ecore_Fd_Prep_Cb func, const void *data);
EAPI void *ecore_main_fd_handler_del(Ecore_Fd_Handler *fd_handler);
EAPI int ecore_main_fd_handler_fd_get(Ecore_Fd_Handler *fd_handler);
EAPI Eina_Bool ecore_main_fd_handler_active_get(Ecore_Fd_Handler *fd_handler, Ecore_Fd_Handler_Flags flags);
EAPI void ecore_main_fd_handler_active_set(Ecore_Fd_Handler *fd_handler, Ecore_Fd_Handler_Flags flags);
EAPI Ecore_Fd_Handler *
ecore_main_fd_handler_add(int fd,
Ecore_Fd_Handler_Flags flags,
Ecore_Fd_Cb func,
const void *data,
Ecore_Fd_Cb buf_func,
const void *buf_data);
EAPI void
ecore_main_fd_handler_prepare_callback_set(Ecore_Fd_Handler *fd_handler,
Ecore_Fd_Prep_Cb func,
const void *data);
EAPI void *
ecore_main_fd_handler_del(Ecore_Fd_Handler *fd_handler);
EAPI int
ecore_main_fd_handler_fd_get(Ecore_Fd_Handler *fd_handler);
EAPI Eina_Bool
ecore_main_fd_handler_active_get(Ecore_Fd_Handler *fd_handler,
Ecore_Fd_Handler_Flags flags);
EAPI void
ecore_main_fd_handler_active_set(Ecore_Fd_Handler *fd_handler,
Ecore_Fd_Handler_Flags flags);
EAPI Ecore_Win32_Handler *ecore_main_win32_handler_add(void *h, Ecore_Win32_Handle_Cb func, const void *data);
EAPI void *ecore_main_win32_handler_del(Ecore_Win32_Handler *win32_handler);
EAPI Ecore_Win32_Handler *
ecore_main_win32_handler_add(void *h,
Ecore_Win32_Handle_Cb func,
const void *data);
EAPI void *
ecore_main_win32_handler_del(Ecore_Win32_Handler *win32_handler);
/**
* @}
@ -847,11 +946,21 @@ extern "C" {
typedef struct _Ecore_Poller Ecore_Poller; /**< A handle for pollers */
EAPI void ecore_poller_poll_interval_set(Ecore_Poller_Type type, double poll_time);
EAPI double ecore_poller_poll_interval_get(Ecore_Poller_Type type);
EAPI Eina_Bool ecore_poller_poller_interval_set(Ecore_Poller *poller, int interval);
EAPI int ecore_poller_poller_interval_get(Ecore_Poller *poller);
EAPI Ecore_Poller *ecore_poller_add(Ecore_Poller_Type type, int interval, Ecore_Task_Cb func, const void *data);
EAPI void
ecore_poller_poll_interval_set(Ecore_Poller_Type type,
double poll_time);
EAPI double
ecore_poller_poll_interval_get(Ecore_Poller_Type type);
EAPI Eina_Bool
ecore_poller_poller_interval_set(Ecore_Poller *poller,
int interval);
EAPI int
ecore_poller_poller_interval_get(Ecore_Poller *poller);
EAPI Ecore_Poller *
ecore_poller_add(Ecore_Poller_Type type,
int interval,
Ecore_Task_Cb func,
const void *data);
EAPI void *ecore_poller_del(Ecore_Poller *poller);
/**
@ -948,7 +1057,8 @@ extern "C" {
* @see ecore_animator_timeline_add()
* @see ecore_animator_frametime_set()
*/
EAPI Ecore_Animator *ecore_animator_add(Ecore_Task_Cb func, const void *data);
EAPI Ecore_Animator *ecore_animator_add(Ecore_Task_Cb func,
const void *data);
/**
* @brief Add a animator that runs for a limited time
*
@ -976,7 +1086,10 @@ extern "C" {
* @see ecore_animator_pos_map()
* @since 1.1.0
*/
EAPI Ecore_Animator *ecore_animator_timeline_add(double runtime, Ecore_Timeline_Cb func, const void *data);
EAPI Ecore_Animator *
ecore_animator_timeline_add(double runtime,
Ecore_Timeline_Cb func,
const void *data);
/**
* @brief Delete the specified animator from the animator list.
*
@ -990,7 +1103,8 @@ extern "C" {
* is invalid and should not be used again. It will not get called again after
* deletion.
*/
EAPI void *ecore_animator_del(Ecore_Animator *animator);
EAPI void *
ecore_animator_del(Ecore_Animator *animator);
/**
* @brief Suspend the specified animator.
*
@ -1005,7 +1119,8 @@ extern "C" {
* will increase as if the animator hadn't been frozen and the animator may
* have it's execution halted if @p runtime elapsed.
*/
EAPI void ecore_animator_freeze(Ecore_Animator *animator);
EAPI void
ecore_animator_freeze(Ecore_Animator *animator);
/**
* @brief Restore execution of the specified animator.
*
@ -1014,7 +1129,8 @@ extern "C" {
* The specified @p animator will be put back in the set of animators that are
* executed during main loop.
*/
EAPI void ecore_animator_thaw(Ecore_Animator *animator);
EAPI void
ecore_animator_thaw(Ecore_Animator *animator);
/**
* @brief Set the animator call interval in seconds.
*
@ -1028,7 +1144,8 @@ extern "C" {
*
* @note The default @p frametime value is 1/30th of a second.
*/
EAPI void ecore_animator_frametime_set(double frametime);
EAPI void
ecore_animator_frametime_set(double frametime);
/**
* @brief Get the animator call interval in seconds.
*
@ -1038,7 +1155,8 @@ extern "C" {
*
* @see ecore_animator_frametime_set()
*/
EAPI double ecore_animator_frametime_get(void);
EAPI double
ecore_animator_frametime_get(void);
/**
* @brief Maps an input position from 0.0 to 1.0 along a timeline to a
* position in a different curve.
@ -1099,7 +1217,11 @@ extern "C" {
*
* @since 1.1.0
*/
EAPI double ecore_animator_pos_map(double pos, Ecore_Pos_Map map, double v1, double v2);
EAPI double
ecore_animator_pos_map(double pos,
Ecore_Pos_Map map,
double v1,
double v2);
/**
* @brief Set the source of animator ticks for the mainloop
*
@ -1122,7 +1244,8 @@ extern "C" {
* gets a "tick" should call ecore_animator_custom_tick() to make the "tick" over 1
* frame.
*/
EAPI void ecore_animator_source_set(Ecore_Animator_Source source);
EAPI void
ecore_animator_source_set(Ecore_Animator_Source source);
/**
* @brief Get the animator source currently set.
*
@ -1132,7 +1255,8 @@ extern "C" {
*
* @see ecore_animator_source_set()
*/
EAPI Ecore_Animator_Source ecore_animator_source_get(void);
EAPI Ecore_Animator_Source
ecore_animator_source_get(void);
/**
* @brief Set the function that begins a custom animator tick source
*
@ -1152,7 +1276,9 @@ extern "C" {
* @see ecore_animator_custom_source_tick_end_callback_set()
* @see ecore_animator_custom_tick()
*/
EAPI void ecore_animator_custom_source_tick_begin_callback_set(Ecore_Cb func, const void *data);
EAPI void
ecore_animator_custom_source_tick_begin_callback_set(Ecore_Cb func,
const void *data);
/**
* @brief Set the function that ends a custom animator tick source
*
@ -1169,7 +1295,9 @@ extern "C" {
* @see ecore_animator_custom_source_tick_begin_callback_set()
* @see ecore_animator_custom_tick()
*/
EAPI void ecore_animator_custom_source_tick_end_callback_set(Ecore_Cb func, const void *data);
EAPI void
ecore_animator_custom_source_tick_end_callback_set(Ecore_Cb func,
const void *data);
/**
* @brief Trigger a custom animator tick
*
@ -1183,7 +1311,8 @@ extern "C" {
* @see ecore_animator_custom_source_tick_begin_callback_set
* @see ecore_animator_custom_source_tick_end_callback_set()()
*/
EAPI void ecore_animator_custom_tick(void);
EAPI void
ecore_animator_custom_tick(void);
/**
* @}
@ -1209,22 +1338,43 @@ extern "C" {
typedef struct _Ecore_Timer Ecore_Timer; /**< A handle for timers */
EAPI double ecore_time_get(void);
EAPI double ecore_time_unix_get(void);
EAPI double ecore_loop_time_get(void);
EAPI double
ecore_time_get(void);
EAPI double
ecore_time_unix_get(void);
EAPI double
ecore_loop_time_get(void);
EAPI Ecore_Timer *ecore_timer_add(double in, Ecore_Task_Cb func, const void *data);
EAPI Ecore_Timer *ecore_timer_loop_add(double in, Ecore_Task_Cb func, const void *data);
EAPI void *ecore_timer_del(Ecore_Timer *timer);
EAPI void ecore_timer_interval_set(Ecore_Timer *timer, double in);
EAPI double ecore_timer_interval_get(Ecore_Timer *timer);
EAPI void ecore_timer_freeze(Ecore_Timer *timer);
EAPI void ecore_timer_thaw(Ecore_Timer *timer);
EAPI void ecore_timer_delay(Ecore_Timer *timer, double add);
EAPI double ecore_timer_pending_get(Ecore_Timer *timer);
EAPI double ecore_timer_precision_get(void);
EAPI void ecore_timer_precision_set(double precision);
EAPI char *ecore_timer_dump(void);
EAPI Ecore_Timer *
ecore_timer_add(double in,
Ecore_Task_Cb func,
const void *data);
EAPI Ecore_Timer *
ecore_timer_loop_add(double in,
Ecore_Task_Cb func,
const void *data);
EAPI void *
ecore_timer_del(Ecore_Timer *timer);
EAPI void
ecore_timer_interval_set(Ecore_Timer *timer,
double in);
EAPI double
ecore_timer_interval_get(Ecore_Timer *timer);
EAPI void
ecore_timer_freeze(Ecore_Timer *timer);
EAPI void
ecore_timer_thaw(Ecore_Timer *timer);
EAPI void
ecore_timer_delay(Ecore_Timer *timer,
double add);
EAPI double
ecore_timer_pending_get(Ecore_Timer *timer);
EAPI double
ecore_timer_precision_get(void);
EAPI void
ecore_timer_precision_set(double precision);
EAPI char *
ecore_timer_dump(void);
/**
* @}
@ -1293,7 +1443,9 @@ extern "C" {
*
* Idlers are useful for progressively prossessing data without blocking.
*/
EAPI Ecore_Idler *ecore_idler_add(Ecore_Task_Cb func, const void *data);
EAPI Ecore_Idler *
ecore_idler_add(Ecore_Task_Cb func,
const void *data);
/**
* Delete an idler callback from the list to be executed.
@ -1301,14 +1453,23 @@ extern "C" {
* @return The data pointer passed to the idler callback on success. NULL
* otherwise.
*/
EAPI void *ecore_idler_del(Ecore_Idler *idler);
EAPI void *
ecore_idler_del(Ecore_Idler *idler);
EAPI Ecore_Idle_Enterer *ecore_idle_enterer_add(Ecore_Task_Cb func, const void *data);
EAPI Ecore_Idle_Enterer *ecore_idle_enterer_before_add(Ecore_Task_Cb func, const void *data);
EAPI void *ecore_idle_enterer_del(Ecore_Idle_Enterer *idle_enterer);
EAPI Ecore_Idle_Enterer *
ecore_idle_enterer_add(Ecore_Task_Cb func,
const void *data);
EAPI Ecore_Idle_Enterer *
ecore_idle_enterer_before_add(Ecore_Task_Cb func,
const void *data);
EAPI void *
ecore_idle_enterer_del(Ecore_Idle_Enterer *idle_enterer);
EAPI Ecore_Idle_Exiter *ecore_idle_exiter_add(Ecore_Task_Cb func, const void *data);
EAPI void *ecore_idle_exiter_del(Ecore_Idle_Exiter *idle_exiter);
EAPI Ecore_Idle_Exiter *
ecore_idle_exiter_add(Ecore_Task_Cb func,
const void *data);
EAPI void *
ecore_idle_exiter_del(Ecore_Idle_Exiter *idle_exiter);
/**
* @}
@ -1475,7 +1636,8 @@ extern "C" {
* @see ecore_thread_reschedule()
* @see ecore_thread_max_set()
*/
EAPI Ecore_Thread *ecore_thread_run(Ecore_Thread_Cb func_blocking,
EAPI Ecore_Thread *
ecore_thread_run(Ecore_Thread_Cb func_blocking,
Ecore_Thread_Cb func_end,
Ecore_Thread_Cb func_cancel,
const void *data);
@ -1519,7 +1681,8 @@ extern "C" {
* @see ecore_thread_reschedule()
* @see ecore_thread_max_set()
*/
EAPI Ecore_Thread *ecore_thread_feedback_run(Ecore_Thread_Cb func_heavy,
EAPI Ecore_Thread *
ecore_thread_feedback_run(Ecore_Thread_Cb func_heavy,
Ecore_Thread_Notify_Cb func_notify,
Ecore_Thread_Cb func_end,
Ecore_Thread_Cb func_cancel,
@ -1560,7 +1723,8 @@ extern "C" {
*
* @see ecore_thread_check()
*/
EAPI Eina_Bool ecore_thread_cancel(Ecore_Thread *thread);
EAPI Eina_Bool
ecore_thread_cancel(Ecore_Thread *thread);
/**
* Checks if a thread is pending cancellation
*
@ -1580,7 +1744,8 @@ extern "C" {
*
* @see ecore_thread_cancel()
*/
EAPI Eina_Bool ecore_thread_check(Ecore_Thread *thread);
EAPI Eina_Bool
ecore_thread_check(Ecore_Thread *thread);
/**
* Sends data from the worker thread to the main loop
*
@ -1602,7 +1767,9 @@ extern "C" {
*
* @see ecore_thread_feedback_run()
*/
EAPI Eina_Bool ecore_thread_feedback(Ecore_Thread *thread, const void *msg_data);
EAPI Eina_Bool
ecore_thread_feedback(Ecore_Thread *thread,
const void *msg_data);
/**
* Asks for the function in the thread to be called again at a later time
*
@ -1626,7 +1793,8 @@ extern "C" {
* Similarly, if the @p thread is cancelled, the reschedule will not take
* effect.
*/
EAPI Eina_Bool ecore_thread_reschedule(Ecore_Thread *thread);
EAPI Eina_Bool
ecore_thread_reschedule(Ecore_Thread *thread);
/**
* Gets the number of active threads running jobs
*
@ -1640,7 +1808,8 @@ extern "C" {
* in the return of this function unless the thread creation fails and it
* falls back to using one from the pool.
*/
EAPI int ecore_thread_active_get(void);
EAPI int
ecore_thread_active_get(void);
/**
* Gets the number of short jobs waiting for a thread to run
*
@ -1649,7 +1818,8 @@ extern "C" {
* This returns the number of tasks started with ecore_thread_run() that are
* pending, waiting for a thread to become available to run them.
*/
EAPI int ecore_thread_pending_get(void);
EAPI int
ecore_thread_pending_get(void);
/**
* Gets the number of feedback jobs waiting for a thread to run
*
@ -1658,7 +1828,8 @@ extern "C" {
* This returns the number of tasks started with ecore_thread_feedback_run()
* that are pending, waiting for a thread to become available to run them.
*/
EAPI int ecore_thread_pending_feedback_get(void);
EAPI int
ecore_thread_pending_feedback_get(void);
/**
* Gets the total number of pending jobs
*
@ -1667,7 +1838,8 @@ extern "C" {
* Same as the sum of ecore_thread_pending_get() and
* ecore_thread_pending_feedback_get().
*/
EAPI int ecore_thread_pending_total_get(void);
EAPI int
ecore_thread_pending_total_get(void);
/**
* Gets the maximum number of threads that can run simultaneously
*
@ -1686,7 +1858,8 @@ extern "C" {
* @see ecore_thread_max_set()
* @see ecore_thread_max_reset()
*/
EAPI int ecore_thread_max_get(void);
EAPI int
ecore_thread_max_get(void);
/**
* Sets the maximum number of threads allowed to run simultaneously
*
@ -1699,7 +1872,8 @@ extern "C" {
* @see ecore_thread_max_get()
* @see ecore_thread_max_reset()
*/
EAPI void ecore_thread_max_set(int num);
EAPI void
ecore_thread_max_set(int num);
/**
* Resets the maximum number of concurrently running threads to the default
*
@ -1709,7 +1883,8 @@ extern "C" {
* @see ecore_thread_max_get()
* @see ecore_thread_max_set()
*/
EAPI void ecore_thread_max_reset(void);
EAPI void
ecore_thread_max_reset(void);
/**
* Gets the number of threads available for running tasks
*
@ -1721,7 +1896,8 @@ extern "C" {
* changed the maximum number of running threads while other tasks are
* running.
*/
EAPI int ecore_thread_available_get(void);
EAPI int
ecore_thread_available_get(void);
/**
* Adds some data to a hash local to the thread
*
@ -1806,7 +1982,12 @@ extern "C" {
* @see ecore_thread_local_data_find()
* @see ecore_thread_local_data_del()
*/
EAPI Eina_Bool ecore_thread_local_data_add(Ecore_Thread *thread, const char *key, void *value, Eina_Free_Cb cb, Eina_Bool direct);
EAPI Eina_Bool
ecore_thread_local_data_add(Ecore_Thread *thread,
const char *key,
void *value,
Eina_Free_Cb cb,
Eina_Bool direct);
/**
* Sets some data in the hash local to the given thread
*
@ -1834,7 +2015,11 @@ extern "C" {
* @see ecore_thread_local_data_del()
* @see ecore_thread_local_data_find()
*/
EAPI void *ecore_thread_local_data_set(Ecore_Thread *thread, const char *key, void *value, Eina_Free_Cb cb);
EAPI void *
ecore_thread_local_data_set(Ecore_Thread *thread,
const char *key,
void *value,
Eina_Free_Cb cb);
/**
* Gets data stored in the hash local to the given thread
*
@ -1852,7 +2037,9 @@ extern "C" {
* @see ecore_thread_local_data_add()
* @see ecore_thread_local_data_wait()
*/
EAPI void *ecore_thread_local_data_find(Ecore_Thread *thread, const char *key);
EAPI void *
ecore_thread_local_data_find(Ecore_Thread *thread,
const char *key);
/**
* Deletes from the thread's hash the data corresponding to the given key
*
@ -1877,7 +2064,9 @@ extern "C" {
*
* @see ecore_thread_local_data_add()
*/
EAPI Eina_Bool ecore_thread_local_data_del(Ecore_Thread *thread, const char *key);
EAPI Eina_Bool
ecore_thread_local_data_del(Ecore_Thread *thread,
const char *key);
/**
* Adds some data to a hash shared by all threads
@ -1917,7 +2106,11 @@ extern "C" {
* @see ecore_thread_global_data_set()
* @see ecore_thread_global_data_find()
*/
EAPI Eina_Bool ecore_thread_global_data_add(const char *key, void *value, Eina_Free_Cb cb, Eina_Bool direct);
EAPI Eina_Bool
ecore_thread_global_data_add(const char *key,
void *value,
Eina_Free_Cb cb,
Eina_Bool direct);
/**
* Sets some data in the hash shared by all threads
*
@ -1939,7 +2132,10 @@ extern "C" {
* @see ecore_thread_global_data_del()
* @see ecore_thread_global_data_find()
*/
EAPI void *ecore_thread_global_data_set(const char *key, void *value, Eina_Free_Cb cb);
EAPI void *
ecore_thread_global_data_set(const char *key,
void *value,
Eina_Free_Cb cb);
/**
* Gets data stored in the hash shared by all threads
*
@ -1956,7 +2152,8 @@ extern "C" {
* @see ecore_thread_global_data_add()
* @see ecore_thread_global_data_wait()
*/
EAPI void *ecore_thread_global_data_find(const char *key);
EAPI void *
ecore_thread_global_data_find(const char *key);
/**
* Deletes from the shared hash the data corresponding to the given key
*
@ -1979,7 +2176,8 @@ extern "C" {
*
* @see ecore_thread_global_data_add()
*/
EAPI Eina_Bool ecore_thread_global_data_del(const char *key);
EAPI Eina_Bool
ecore_thread_global_data_del(const char *key);
/**
* Gets data stored in the shared hash, or wait for it if it doesn't exist
*
@ -2007,7 +2205,9 @@ extern "C" {
* @see ecore_thread_global_data_add()
* @see ecore_thread_global_data_find()
*/
EAPI void *ecore_thread_global_data_wait(const char *key, double seconds);
EAPI void *
ecore_thread_global_data_wait(const char *key,
double seconds);
/**
* @}
@ -2042,14 +2242,27 @@ extern "C" {
*/
typedef void (*Ecore_Pipe_Cb)(void *data, void *buffer, unsigned int nbyte);
EAPI Ecore_Pipe *ecore_pipe_add(Ecore_Pipe_Cb handler, const void *data);
EAPI void *ecore_pipe_del(Ecore_Pipe *p);
EAPI Eina_Bool ecore_pipe_write(Ecore_Pipe *p, const void *buffer, unsigned int nbytes);
EAPI void ecore_pipe_write_close(Ecore_Pipe *p);
EAPI void ecore_pipe_read_close(Ecore_Pipe *p);
EAPI void ecore_pipe_thaw(Ecore_Pipe *p);
EAPI void ecore_pipe_freeze(Ecore_Pipe *p);
EAPI int ecore_pipe_wait(Ecore_Pipe *p, int message_count, double wait);
EAPI Ecore_Pipe *
ecore_pipe_add(Ecore_Pipe_Cb handler,
const void *data);
EAPI void *
ecore_pipe_del(Ecore_Pipe *p);
EAPI Eina_Bool
ecore_pipe_write(Ecore_Pipe *p,
const void *buffer,
unsigned int nbytes);
EAPI void
ecore_pipe_write_close(Ecore_Pipe *p);
EAPI void
ecore_pipe_read_close(Ecore_Pipe *p);
EAPI void
ecore_pipe_thaw(Ecore_Pipe *p);
EAPI void
ecore_pipe_freeze(Ecore_Pipe *p);
EAPI int
ecore_pipe_wait(Ecore_Pipe *p,
int message_count,
double wait);
/**
* @}
@ -2081,8 +2294,11 @@ extern "C" {
typedef struct _Ecore_Job Ecore_Job; /**< A job handle */
EAPI Ecore_Job *ecore_job_add(Ecore_Cb func, const void *data);
EAPI void *ecore_job_del(Ecore_Job *job);
EAPI Ecore_Job *
ecore_job_add(Ecore_Cb func,
const void *data);
EAPI void *
ecore_job_del(Ecore_Job *job);
/**
* @}
@ -2094,9 +2310,14 @@ extern "C" {
* @{
*/
EAPI void ecore_app_args_set(int argc, const char **argv);
EAPI void ecore_app_args_get(int *argc, char ***argv);
EAPI void ecore_app_restart(void);
EAPI void
ecore_app_args_set(int argc,
const char **argv);
EAPI void
ecore_app_args_get(int *argc,
char ***argv);
EAPI void
ecore_app_restart(void);
/**
* @}
@ -2110,8 +2331,10 @@ extern "C" {
* @{
*/
EAPI void ecore_throttle_adjust(double amount );
EAPI double ecore_throttle_get(void);
EAPI void
ecore_throttle_adjust(double amount);
EAPI double
ecore_throttle_get(void);
/**
* @}

View File

@ -48,7 +48,6 @@
* use multiple values with the same parser.
*/
#ifdef __cplusplus
extern "C" {
#endif
@ -128,7 +127,11 @@ extern "C" {
struct _Ecore_Getopt_Desc_Callback
{
Eina_Bool (*func)(const Ecore_Getopt *parser, const Ecore_Getopt_Desc *desc, const char *str, void *data, Ecore_Getopt_Value *storage);
Eina_Bool (*func)(const Ecore_Getopt *parser,
const Ecore_Getopt_Desc *desc,
const char *str,
void *data,
Ecore_Getopt_Value *storage);
const void *data;
Ecore_Getopt_Desc_Arg_Requirement arg_req;
const char *def;
@ -192,7 +195,6 @@ extern "C" {
#define ECORE_GETOPT_STORE_DOUBLE(shortname, longname, help) \
ECORE_GETOPT_STORE(shortname, longname, help, ECORE_GETOPT_TYPE_DOUBLE)
#define ECORE_GETOPT_STORE_METAVAR(shortname, longname, help, metavar, type) \
ECORE_GETOPT_STORE_FULL(shortname, longname, help, metavar, type, \
ECORE_GETOPT_DESC_ARG_REQUIREMENT_YES, {})
@ -216,7 +218,6 @@ extern "C" {
#define ECORE_GETOPT_STORE_METAVAR_DOUBLE(shortname, longname, help, metavar) \
ECORE_GETOPT_STORE_METAVAR(shortname, longname, help, metavar, ECORE_GETOPT_TYPE_DOUBLE)
#define ECORE_GETOPT_STORE_DEF(shortname, longname, help, type, default_value) \
ECORE_GETOPT_STORE_FULL(shortname, longname, help, NULL, type, \
ECORE_GETOPT_DESC_ARG_REQUIREMENT_OPTIONAL, \
@ -322,7 +323,6 @@ extern "C" {
{shortname, longname, help, metavar, ECORE_GETOPT_ACTION_CHOICE, \
{.choices = choices_array}}
#define ECORE_GETOPT_APPEND(shortname, longname, help, sub_type) \
{shortname, longname, help, NULL, ECORE_GETOPT_ACTION_APPEND, \
{.append_type = sub_type}}
@ -385,17 +385,33 @@ extern "C" {
#define ECORE_GETOPT_VALUE_LIST(val) {.listp = &(val)}
#define ECORE_GETOPT_VALUE_NONE {.ptrp = NULL}
EAPI void ecore_getopt_help(FILE *fp, const Ecore_Getopt *info);
EAPI void
ecore_getopt_help(FILE *fp,
const Ecore_Getopt *info);
EAPI Eina_Bool ecore_getopt_parser_has_duplicates(const Ecore_Getopt *parser);
EAPI int ecore_getopt_parse(const Ecore_Getopt *parser, Ecore_Getopt_Value *values, int argc, char **argv);
EAPI Eina_Bool
ecore_getopt_parser_has_duplicates(const Ecore_Getopt *parser);
EAPI int
ecore_getopt_parse(const Ecore_Getopt *parser,
Ecore_Getopt_Value *values,
int argc,
char **argv);
EAPI Eina_List *ecore_getopt_list_free(Eina_List *list);
/* helper functions to be used with ECORE_GETOPT_CALLBACK_*() */
EAPI Eina_Bool ecore_getopt_callback_geometry_parse(const Ecore_Getopt *parser, const Ecore_Getopt_Desc *desc, const char *str, void *data, Ecore_Getopt_Value *storage);
EAPI Eina_Bool ecore_getopt_callback_size_parse(const Ecore_Getopt *parser, const Ecore_Getopt_Desc *desc, const char *str, void *data, Ecore_Getopt_Value *storage);
EAPI Eina_Bool
ecore_getopt_callback_geometry_parse(const Ecore_Getopt *parser,
const Ecore_Getopt_Desc *desc,
const char *str,
void *data,
Ecore_Getopt_Value *storage);
EAPI Eina_Bool
ecore_getopt_callback_size_parse(const Ecore_Getopt *parser,
const Ecore_Getopt_Desc *desc,
const char *str,
void *data,
Ecore_Getopt_Value *storage);
#ifdef __cplusplus
}

View File

@ -73,7 +73,9 @@ struct _Ecore_Safe_Call
static void _ecore_main_loop_thread_safe_call(Ecore_Safe_Call *order);
static void _thread_safe_cleanup(void *data);
static void _thread_callback(void *data, void *buffer, unsigned int nbyte);
static void _thread_callback(void *data,
void *buffer,
unsigned int nbyte);
static Eina_List *_thread_cb = NULL;
static Ecore_Pipe *_thread_call = NULL;
static Eina_Lock _thread_safety;
@ -273,7 +275,8 @@ unlock:
static int wakeup = 42;
EAPI void
ecore_main_loop_thread_safe_call_async(Ecore_Cb callback, void *data)
ecore_main_loop_thread_safe_call_async(Ecore_Cb callback,
void *data)
{
Ecore_Safe_Call *order;
@ -297,7 +300,8 @@ ecore_main_loop_thread_safe_call_async(Ecore_Cb callback, void *data)
}
EAPI void *
ecore_main_loop_thread_safe_call_sync(Ecore_Data_Cb callback, void *data)
ecore_main_loop_thread_safe_call_sync(Ecore_Data_Cb callback,
void *data)
{
Ecore_Safe_Call *order;
void *ret;
@ -414,7 +418,8 @@ ecore_thread_main_loop_end(void)
}
EAPI void
ecore_print_warning(const char *function, const char *sparam)
ecore_print_warning(const char *function,
const char *sparam)
{
WRN("***** Developer Warning ***** :\n"
"\tThis program is calling:\n\n"
@ -426,7 +431,10 @@ ecore_print_warning(const char *function, const char *sparam)
}
EAPI void
_ecore_magic_fail(const void *d, Ecore_Magic m, Ecore_Magic req_m, const char *fname)
_ecore_magic_fail(const void *d,
Ecore_Magic m,
Ecore_Magic req_m,
const char *fname)
{
ERR("\n"
"*** ECORE ERROR: Ecore Magic Check Failed!!!\n"
@ -455,36 +463,46 @@ _ecore_magic_string_get(Ecore_Magic m)
case ECORE_MAGIC_NONE:
return "None (Freed Object)";
break;
case ECORE_MAGIC_EXE:
return "Ecore_Exe (Executable)";
break;
case ECORE_MAGIC_TIMER:
return "Ecore_Timer (Timer)";
break;
case ECORE_MAGIC_IDLER:
return "Ecore_Idler (Idler)";
break;
case ECORE_MAGIC_IDLE_ENTERER:
return "Ecore_Idle_Enterer (Idler Enterer)";
break;
case ECORE_MAGIC_IDLE_EXITER:
return "Ecore_Idle_Exiter (Idler Exiter)";
break;
case ECORE_MAGIC_FD_HANDLER:
return "Ecore_Fd_Handler (Fd Handler)";
break;
case ECORE_MAGIC_WIN32_HANDLER:
return "Ecore_Win32_Handler (Win32 Handler)";
break;
case ECORE_MAGIC_EVENT_HANDLER:
return "Ecore_Event_Handler (Event Handler)";
break;
case ECORE_MAGIC_EVENT:
return "Ecore_Event (Event)";
break;
default:
return "<UNKNOWN>";
};
}
}
/* fps debug calls - for debugging how much time your app actually spends */
@ -710,3 +728,4 @@ _thread_callback(void *data __UNUSED__,
}
}
}

View File

@ -8,7 +8,6 @@
#include "Ecore.h"
#include "ecore_private.h"
struct _Ecore_Animator
{
EINA_INLIST;
@ -25,7 +24,6 @@ struct _Ecore_Animator
Eina_Bool suspended : 1;
};
static Eina_Bool _ecore_animator_run(void *data);
static Eina_Bool _ecore_animator(void *data);
@ -60,9 +58,11 @@ _begin_tick(void)
_ecore_timer_delay(timer, d);
}
break;
case ECORE_ANIMATOR_SOURCE_CUSTOM:
if (begin_tick_cb) begin_tick_cb((void *)begin_tick_data);
break;
default:
break;
}
@ -82,9 +82,11 @@ _end_tick(void)
timer = NULL;
}
break;
case ECORE_ANIMATOR_SOURCE_CUSTOM:
if (end_tick_cb) end_tick_cb((void *)end_tick_data);
break;
default:
break;
}
@ -134,7 +136,8 @@ _do_tick(void)
}
static Ecore_Animator *
_ecore_animator_add(Ecore_Task_Cb func, const void *data)
_ecore_animator_add(Ecore_Task_Cb func,
const void *data)
{
Ecore_Animator *animator = NULL;
@ -150,7 +153,8 @@ _ecore_animator_add(Ecore_Task_Cb func, const void *data)
}
EAPI Ecore_Animator *
ecore_animator_add(Ecore_Task_Cb func, const void *data)
ecore_animator_add(Ecore_Task_Cb func,
const void *data)
{
Ecore_Animator *animator;
@ -162,7 +166,9 @@ ecore_animator_add(Ecore_Task_Cb func, const void *data)
}
EAPI Ecore_Animator *
ecore_animator_timeline_add(double runtime, Ecore_Timeline_Cb func, const void *data)
ecore_animator_timeline_add(double runtime,
Ecore_Timeline_Cb func,
const void *data)
{
Ecore_Animator *animator;
@ -191,7 +197,8 @@ _pos_map_cos(double in)
}
static double
_pos_map_accel_factor(double pos, double v1)
_pos_map_accel_factor(double pos,
double v1)
{
int i, fact = (int)v1;
double p, o1 = pos, o2 = pos, v;
@ -208,7 +215,9 @@ _pos_map_accel_factor(double pos, double v1)
}
static double
_pos_map_pow(double pos, double divis, int p)
_pos_map_pow(double pos,
double divis,
int p)
{
double v = 1.0;
int i;
@ -217,7 +226,9 @@ _pos_map_pow(double pos, double divis, int p)
}
static double
_pos_map_spring(double pos, int bounces, double decfac)
_pos_map_spring(double pos,
int bounces,
double decfac)
{
int segnum, segpos, b1, b2;
double len, decay, decpos, p2;
@ -235,45 +246,59 @@ _pos_map_spring(double pos, int bounces, double decfac)
}
EAPI double
ecore_animator_pos_map(double pos, Ecore_Pos_Map map, double v1, double v2)
ecore_animator_pos_map(double pos,
Ecore_Pos_Map map,
double v1,
double v2)
{
/* purely functional - locking not required */
if (pos > 1.0) pos = 1.0;
else if (pos < 0.0) pos = 0.0;
else if (pos < 0.0)
pos = 0.0;
switch (map)
{
case ECORE_POS_MAP_LINEAR:
return pos;
case ECORE_POS_MAP_ACCELERATE:
pos = 1.0 - _pos_map_sin((M_PI / 2.0) + ((pos * M_PI) / 2.0));
return pos;
case ECORE_POS_MAP_DECELERATE:
pos = _pos_map_sin((pos * M_PI) / 2.0);
return pos;
case ECORE_POS_MAP_SINUSOIDAL:
pos = (1.0 - _pos_map_cos(pos * M_PI)) / 2.0;
return pos;
case ECORE_POS_MAP_ACCELERATE_FACTOR:
pos = _pos_map_accel_factor(pos, v1);
return pos;
case ECORE_POS_MAP_DECELERATE_FACTOR:
pos = 1.0 - _pos_map_accel_factor(1.0 - pos, v1);
return pos;
case ECORE_POS_MAP_SINUSOIDAL_FACTOR:
if (pos < 0.5) pos = _pos_map_accel_factor(pos * 2.0, v1) / 2.0;
else pos = 1.0 - (_pos_map_accel_factor((1.0 - pos) * 2.0, v1) / 2.0);
return pos;
case ECORE_POS_MAP_DIVISOR_INTERP:
pos = _pos_map_pow(pos, v1, (int)v2);
return pos;
case ECORE_POS_MAP_BOUNCE:
pos = _pos_map_spring(pos, (int)v2, v1);
if (pos < 0.0) pos = -pos;
pos = 1.0 - pos;
return pos;
case ECORE_POS_MAP_SPRING:
pos = 1.0 - _pos_map_spring(pos, (int)v2, v1);
return pos;
default:
return pos;
}
@ -376,7 +401,8 @@ ecore_animator_source_get(void)
}
EAPI void
ecore_animator_custom_source_tick_begin_callback_set(Ecore_Cb func, const void *data)
ecore_animator_custom_source_tick_begin_callback_set(Ecore_Cb func,
const void *data)
{
_ecore_lock();
begin_tick_cb = func;
@ -387,7 +413,8 @@ ecore_animator_custom_source_tick_begin_callback_set(Ecore_Cb func, const void *
}
EAPI void
ecore_animator_custom_source_tick_end_callback_set(Ecore_Cb func, const void *data)
ecore_animator_custom_source_tick_end_callback_set(Ecore_Cb func,
const void *data)
{
_ecore_lock();
end_tick_cb = func;
@ -432,7 +459,8 @@ _ecore_animator_run(void *data)
{
pos = (t - animator->start) / animator->run;
if (pos > 1.0) pos = 1.0;
else if (pos < 0.0) pos = 0.0;
else if (pos < 0.0)
pos = 0.0;
}
run_ret = animator->run_func(animator->run_data, pos);
if (t >= (animator->start + animator->run)) run_ret = EINA_FALSE;
@ -448,3 +476,4 @@ _ecore_animator(void *data __UNUSED__)
_ecore_unlock();
return r;
}

View File

@ -35,7 +35,8 @@ static char **app_argv = NULL;
* for later use by ecore_app_restart() or ecore_app_args_get().
*/
EAPI void
ecore_app_args_set(int argc, const char **argv)
ecore_app_args_set(int argc,
const char **argv)
{
EINA_MAIN_LOOP_CHECK_RETURN;
@ -57,7 +58,8 @@ ecore_app_args_set(int argc, const char **argv)
* same set by ecore_app_args_set().
*/
EAPI void
ecore_app_args_get(int *argc, char ***argv)
ecore_app_args_get(int *argc,
char ***argv)
{
EINA_MAIN_LOOP_CHECK_RETURN;

View File

@ -45,7 +45,6 @@ struct _Ecore_Event
Eina_Bool delete_me : 1;
};
static int events_num = 0;
static Ecore_Event *events = NULL;
static Ecore_Event *event_current = NULL;
@ -67,11 +66,9 @@ static int event_id_max = ECORE_EVENT_COUNT;
static int ecore_raw_event_type = ECORE_EVENT_NONE;
static void *ecore_raw_event_event = NULL;
static void _ecore_event_purge_deleted(void);
static void *_ecore_event_del(Ecore_Event *event);
/**
* @addtogroup Ecore_Event_Group
*
@ -102,7 +99,9 @@ static void *_ecore_event_del(Ecore_Event *event);
* been called, will not be.
*/
EAPI Ecore_Event_Handler *
ecore_event_handler_add(int type, Ecore_Event_Handler_Cb func, const void *data)
ecore_event_handler_add(int type,
Ecore_Event_Handler_Cb func,
const void *data)
{
Ecore_Event_Handler *eh = NULL;
@ -213,7 +212,8 @@ unlock:
* which was previously associated with @p eh by ecore_event_handler_add().
*/
EAPI void *
ecore_event_handler_data_set(Ecore_Event_Handler *eh, const void *data)
ecore_event_handler_data_set(Ecore_Event_Handler *eh,
const void *data)
{
void *old = NULL;
@ -232,7 +232,8 @@ unlock:
}
static void
_ecore_event_generic_free (void *data __UNUSED__, void *event)
_ecore_event_generic_free(void *data __UNUSED__,
void *event)
{
free (event);
}
@ -256,7 +257,10 @@ _ecore_event_generic_free (void *data __UNUSED__, void *event)
* func_free is passed @p data as its data parameter.
*/
EAPI Ecore_Event *
ecore_event_add(int type, void *ev, Ecore_End_Cb func_free, void *data)
ecore_event_add(int type,
void *ev,
Ecore_End_Cb func_free,
void *data)
{
Ecore_Event *event = NULL;
@ -345,7 +349,10 @@ ecore_event_type_new(void)
* and @p data pointer to clean up.
*/
EAPI Ecore_Event_Filter *
ecore_event_filter_add(Ecore_Data_Cb func_start, Ecore_Filter_Cb func_filter, Ecore_End_Cb func_end, const void *data)
ecore_event_filter_add(Ecore_Data_Cb func_start,
Ecore_Filter_Cb func_filter,
Ecore_End_Cb func_end,
const void *data)
{
Ecore_Event_Filter *ef = NULL;
@ -492,7 +499,10 @@ _ecore_event_exist(void)
}
Ecore_Event *
_ecore_event_add(int type, void *ev, Ecore_End_Cb func_free, void *data)
_ecore_event_add(int type,
void *ev,
Ecore_End_Cb func_free,
void *data)
{
Ecore_Event *e;
@ -555,7 +565,6 @@ _ecore_event_purge_deleted(void)
static inline void
_ecore_event_filters_apply()
{
if (!event_filter_current)
{
/* regular main loop, start from head */
@ -636,6 +645,7 @@ _ecore_event_filters_apply()
event_filters_delete_me = 0;
}
}
void
_ecore_event_call(void)
{
@ -777,3 +787,4 @@ _ecore_event_signal_realtime_new(void)
{
return calloc(1, sizeof(Ecore_Event_Signal_Realtime));
}

View File

@ -26,7 +26,6 @@
#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
@ -124,7 +123,6 @@ struct _Ecore_Exe
Ecore_Exe_Cb pre_free_cb;
};
/* TODO: Something to let people build a command line and does auto escaping -
*
* ecore_exe_snprintf()
@ -143,18 +141,26 @@ struct _ecore_exe_dead_exe
char *cmd;
};
static inline void _ecore_exe_exec_it(const char *exe_cmd, Ecore_Exe_Flags flags);
static Eina_Bool _ecore_exe_data_generic_handler(void *data, Ecore_Fd_Handler *fd_handler, Ecore_Exe_Flags flags);
static Eina_Bool _ecore_exe_data_error_handler(void *data, Ecore_Fd_Handler *fd_handler);
static Eina_Bool _ecore_exe_data_read_handler(void *data, Ecore_Fd_Handler *fd_handler);
static Eina_Bool _ecore_exe_data_write_handler(void *data, Ecore_Fd_Handler *fd_handler);
static inline void _ecore_exe_exec_it(const char *exe_cmd,
Ecore_Exe_Flags flags);
static Eina_Bool _ecore_exe_data_generic_handler(void *data,
Ecore_Fd_Handler *fd_handler,
Ecore_Exe_Flags flags);
static Eina_Bool _ecore_exe_data_error_handler(void *data,
Ecore_Fd_Handler *fd_handler);
static Eina_Bool _ecore_exe_data_read_handler(void *data,
Ecore_Fd_Handler *fd_handler);
static Eina_Bool _ecore_exe_data_write_handler(void *data,
Ecore_Fd_Handler *fd_handler);
static void _ecore_exe_flush(Ecore_Exe *exe);
static void _ecore_exe_event_exe_data_free(void *data __UNUSED__, void *ev);
static void _ecore_exe_event_exe_data_free(void *data __UNUSED__,
void *ev);
static Ecore_Exe *_ecore_exe_is_it_alive(pid_t pid);
static Eina_Bool _ecore_exe_make_sure_its_dead(void *data);
static Eina_Bool _ecore_exe_make_sure_its_really_dead(void *data);
static Ecore_Exe_Event_Add *_ecore_exe_event_add_new(void);
static void _ecore_exe_event_add_free(void *data, void *ev);
static void _ecore_exe_event_add_free(void *data,
void *ev);
static void _ecore_exe_dead_attach(Ecore_Exe *exe);
EAPI int ECORE_EXE_EVENT_ADD = 0;
@ -168,7 +174,9 @@ static const char *shell = NULL;
/* FIXME: This errno checking stuff should be put elsewhere for everybody to use.
* For now it lives here though, just to make testing easier.
*/
static int _ecore_exe_check_errno(int result, const char *file, int line);
static int _ecore_exe_check_errno(int result,
const char *file,
int line);
#define E_IF_NO_ERRNO(result, foo, ok) \
while (((ok) = _ecore_exe_check_errno((result) = (foo), __FILE__, __LINE__)) == -1) sleep(1); \
@ -181,7 +189,9 @@ static int _ecore_exe_check_errno(int result, const char *file, int line);
if (((ok) = _ecore_exe_check_errno((result) = (foo), __FILE__, __LINE__)))
static int
_ecore_exe_check_errno(int result, const char *file, int line)
_ecore_exe_check_errno(int result,
const char *file,
int line)
{
int saved_errno = errno;
@ -253,6 +263,7 @@ _ecore_exe_check_errno(int result, const char *file, int line)
result = -1;
break;
}
case EMFILE:
case ENFILE:
case ENOLCK:
@ -262,12 +273,14 @@ _ecore_exe_check_errno(int result, const char *file, int line)
result = 0;
break;
}
case EIO:
{ /* I/O error. */
ERR("*** I/O error in %s @%u.", file, line);
result = 0;
break;
}
case EFAULT:
case EBADF:
case EINVAL:
@ -284,6 +297,7 @@ _ecore_exe_check_errno(int result, const char *file, int line)
result = 0;
break;
}
default:
{ /* Unsupported errno code, please add this one. */
ERR("*** NAUGHTY PROGRAMMER!!!\n"
@ -358,7 +372,8 @@ ecore_exe_run_priority_get(void)
* @return A process handle to the spawned process.
*/
EAPI Ecore_Exe *
ecore_exe_run(const char *exe_cmd, const void *data)
ecore_exe_run(const char *exe_cmd,
const void *data)
{
return ecore_exe_pipe_run(exe_cmd, 0, data);
}
@ -389,7 +404,9 @@ ecore_exe_run(const char *exe_cmd, const void *data)
* @return A process handle to the spawned process.
*/
EAPI Ecore_Exe *
ecore_exe_pipe_run(const char *exe_cmd, Ecore_Exe_Flags flags, const void *data)
ecore_exe_pipe_run(const char *exe_cmd,
Ecore_Exe_Flags flags,
const void *data)
{
Ecore_Exe *exe = NULL;
int statusPipe[2] = { -1, -1 };
@ -569,17 +586,20 @@ ecore_exe_pipe_run(const char *exe_cmd, Ecore_Exe_Flags flags, const void *data)
exe->data = (void *)data;
if ((exe->cmd = strdup(exe_cmd)))
{
if (flags & ECORE_EXE_PIPE_ERROR)
{ /* Setup the error stuff. */
if (flags & ECORE_EXE_PIPE_ERROR) /* Setup the error stuff. */
{
E_IF_NO_ERRNO(result,
fcntl(exe->child_fd_error, F_SETFL,
O_NONBLOCK), ok) {}
O_NONBLOCK), ok) {
}
E_IF_NO_ERRNO(result,
fcntl(exe->child_fd_error, F_SETFD,
FD_CLOEXEC), ok) {}
FD_CLOEXEC), ok) {
}
E_IF_NO_ERRNO(result,
fcntl(exe->child_fd_error_x, F_SETFD,
FD_CLOEXEC), ok) {}
FD_CLOEXEC), ok) {
}
{
exe->error_fd_handler =
ecore_main_fd_handler_add(exe->child_fd_error,
@ -590,17 +610,20 @@ ecore_exe_pipe_run(const char *exe_cmd, Ecore_Exe_Flags flags, const void *data)
ok = 0;
}
}
if (ok && (flags & ECORE_EXE_PIPE_READ))
{ /* Setup the read stuff. */
if (ok && (flags & ECORE_EXE_PIPE_READ)) /* Setup the read stuff. */
{
E_IF_NO_ERRNO(result,
fcntl(exe->child_fd_read, F_SETFL,
O_NONBLOCK), ok) {}
O_NONBLOCK), ok) {
}
E_IF_NO_ERRNO(result,
fcntl(exe->child_fd_read, F_SETFD,
FD_CLOEXEC), ok) {}
FD_CLOEXEC), ok) {
}
E_IF_NO_ERRNO(result,
fcntl(exe->child_fd_read_x, F_SETFD,
FD_CLOEXEC), ok) {}
FD_CLOEXEC), ok) {
}
{
exe->read_fd_handler =
ecore_main_fd_handler_add(exe->child_fd_read,
@ -611,17 +634,20 @@ ecore_exe_pipe_run(const char *exe_cmd, Ecore_Exe_Flags flags, const void *data)
ok = 0;
}
}
if (ok && (flags & ECORE_EXE_PIPE_WRITE))
{ /* Setup the write stuff. */
if (ok && (flags & ECORE_EXE_PIPE_WRITE)) /* Setup the write stuff. */
{
E_IF_NO_ERRNO(result,
fcntl(exe->child_fd_write, F_SETFL,
O_NONBLOCK), ok) {}
O_NONBLOCK), ok) {
}
E_IF_NO_ERRNO(result,
fcntl(exe->child_fd_write, F_SETFD,
FD_CLOEXEC), ok) {}
FD_CLOEXEC), ok) {
}
E_IF_NO_ERRNO(result,
fcntl(exe->child_fd_write_x, F_SETFD,
FD_CLOEXEC), ok) {}
FD_CLOEXEC), ok) {
}
{
exe->write_fd_handler =
ecore_main_fd_handler_add(exe->child_fd_write,
@ -645,8 +671,8 @@ ecore_exe_pipe_run(const char *exe_cmd, Ecore_Exe_Flags flags, const void *data)
ok = 0;
}
if (!ok)
{ /* Something went wrong, so pull down everything. */
if (!ok) /* Something went wrong, so pull down everything. */
{
if (exe->pid) ecore_exe_terminate(exe);
IF_FN_DEL(ecore_exe_free, exe);
}
@ -680,7 +706,8 @@ ecore_exe_pipe_run(const char *exe_cmd, Ecore_Exe_Flags flags, const void *data)
* @param func The function to call before @a exe is freed.
*/
EAPI void
ecore_exe_callback_pre_free_set(Ecore_Exe *exe, Ecore_Exe_Cb func)
ecore_exe_callback_pre_free_set(Ecore_Exe *exe,
Ecore_Exe_Cb func)
{
if (!ECORE_MAGIC_CHECK(exe, ECORE_MAGIC_EXE))
{
@ -704,7 +731,9 @@ ecore_exe_callback_pre_free_set(Ecore_Exe *exe, Ecore_Exe_Cb func)
* @return EINA_TRUE if successful, EINA_FALSE on failure.
*/
EAPI Eina_Bool
ecore_exe_send(Ecore_Exe * exe, const void *data, int size)
ecore_exe_send(Ecore_Exe *exe,
const void *data,
int size)
{
void *buf;
@ -768,7 +797,11 @@ ecore_exe_close_stdin(Ecore_Exe *exe)
* @param end_lines limit of lines at end of output to buffer.
*/
EAPI void
ecore_exe_auto_limits_set(Ecore_Exe *exe, int start_bytes, int end_bytes, int start_lines, int end_lines)
ecore_exe_auto_limits_set(Ecore_Exe *exe,
int start_bytes,
int end_bytes,
int start_lines,
int end_lines)
{
if (!ECORE_MAGIC_CHECK(exe, ECORE_MAGIC_EXE))
{
@ -828,7 +861,8 @@ ecore_exe_auto_limits_set(Ecore_Exe *exe, int start_bytes, int end_bytes, int st
* @param flags Is this a ECORE_EXE_PIPE_READ or ECORE_EXE_PIPE_ERROR?
*/
EAPI Ecore_Exe_Event_Data *
ecore_exe_event_data_get(Ecore_Exe *exe, Ecore_Exe_Flags flags)
ecore_exe_event_data_get(Ecore_Exe *exe,
Ecore_Exe_Flags flags)
{
Ecore_Exe_Event_Data *e = NULL;
int is_buffered = 0;
@ -878,8 +912,8 @@ ecore_exe_event_data_get(Ecore_Exe *exe, Ecore_Exe_Flags flags)
e->data = inbuf;
e->size = inbuf_num;
if (is_buffered)
{ /* Deal with line buffering. */
if (is_buffered) /* Deal with line buffering. */
{
int max = 0;
int count = 0;
int i;
@ -958,7 +992,8 @@ ecore_exe_event_data_get(Ecore_Exe *exe, Ecore_Exe_Flags flags)
* @param tag The string tag to set on the process handle.
*/
EAPI void
ecore_exe_tag_set(Ecore_Exe *exe, const char *tag)
ecore_exe_tag_set(Ecore_Exe *exe,
const char *tag)
{
if (!ECORE_MAGIC_CHECK(exe, ECORE_MAGIC_EXE))
{
@ -1137,7 +1172,8 @@ ecore_exe_data_get(const Ecore_Exe *exe)
* @since 1.1
*/
EAPI void *
ecore_exe_data_set(Ecore_Exe *exe, void *data)
ecore_exe_data_set(Ecore_Exe *exe,
void *data)
{
void *ret;
if (!ECORE_MAGIC_CHECK(exe, ECORE_MAGIC_EXE))
@ -1281,7 +1317,8 @@ ecore_exe_kill(Ecore_Exe *exe)
* the signal will be ignored.
*/
EAPI void
ecore_exe_signal(Ecore_Exe *exe, int num)
ecore_exe_signal(Ecore_Exe *exe,
int num)
{
if (!ECORE_MAGIC_CHECK(exe, ECORE_MAGIC_EXE))
{
@ -1443,13 +1480,15 @@ _ecore_exe_doomsday_clock_get(Ecore_Exe *exe)
}
void
_ecore_exe_doomsday_clock_set(Ecore_Exe *exe, Ecore_Timer *dc)
_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)
_ecore_exe_exec_it(const char *exe_cmd,
Ecore_Exe_Flags flags)
{
char use_sh = 1;
char *buf = NULL;
@ -1526,10 +1565,10 @@ _ecore_exe_exec_it(const char *exe_cmd, Ecore_Exe_Flags flags)
errno = 0;
execl("/bin/sh", "/bin/sh", "-c", exe_cmd, (char *)NULL);
}
else if (use_sh)
{ /* We have to use a shell to run this. */
if (!shell)
{ /* Find users preferred shell. */
else if (use_sh) /* We have to use a shell to run this. */
{
if (!shell) /* Find users preferred shell. */
{
shell = getenv("SHELL");
if (!shell)
shell = "/bin/sh";
@ -1558,7 +1597,9 @@ _ecore_exe_exec_it(const char *exe_cmd, Ecore_Exe_Flags flags)
}
static Eina_Bool
_ecore_exe_data_generic_handler(void *data, Ecore_Fd_Handler *fd_handler, Ecore_Exe_Flags flags)
_ecore_exe_data_generic_handler(void *data,
Ecore_Fd_Handler *fd_handler,
Ecore_Exe_Flags flags)
{
Ecore_Exe *exe;
int child_fd;
@ -1610,10 +1651,10 @@ _ecore_exe_data_generic_handler(void *data, Ecore_Fd_Handler *fd_handler, Ecore_
lost_exe = 0;
errno = 0;
if ((num = read(child_fd, buf, READBUFSIZ)) < 1)
{
/* FIXME: SPEED/SIZE TRADE OFF - add a smaller READBUFSIZE
* (currently 64k) to inbuf, use that instead of buf, and
* save ourselves a memcpy(). */
{
lost_exe = ((errno == EIO) ||
(errno == EBADF) ||
(errno == EPIPE) ||
@ -1621,8 +1662,8 @@ _ecore_exe_data_generic_handler(void *data, Ecore_Fd_Handler *fd_handler, Ecore_
if ((errno != EAGAIN) && (errno != EINTR))
perror("_ecore_exe_generic_handler() read problem ");
}
if (num > 0)
{ /* data got read. */
if (num > 0) /* data got read. */
{
inbuf = realloc(inbuf, inbuf_num + num);
memcpy(inbuf + inbuf_num, buf, num);
inbuf_num += num;
@ -1686,21 +1727,24 @@ _ecore_exe_data_generic_handler(void *data, Ecore_Fd_Handler *fd_handler, Ecore_
}
static Eina_Bool
_ecore_exe_data_error_handler(void *data, Ecore_Fd_Handler *fd_handler)
_ecore_exe_data_error_handler(void *data,
Ecore_Fd_Handler *fd_handler)
{
return _ecore_exe_data_generic_handler(data, fd_handler,
ECORE_EXE_PIPE_ERROR);
}
static Eina_Bool
_ecore_exe_data_read_handler(void *data, Ecore_Fd_Handler *fd_handler)
_ecore_exe_data_read_handler(void *data,
Ecore_Fd_Handler *fd_handler)
{
return _ecore_exe_data_generic_handler(data, fd_handler,
ECORE_EXE_PIPE_READ);
}
static Eina_Bool
_ecore_exe_data_write_handler(void *data, Ecore_Fd_Handler *fd_handler __UNUSED__)
_ecore_exe_data_write_handler(void *data,
Ecore_Fd_Handler *fd_handler __UNUSED__)
{
Ecore_Exe *exe;
@ -1755,8 +1799,8 @@ _ecore_exe_flush(Ecore_Exe *exe)
else
{
exe->write_data_offset += count;
if (exe->write_data_offset >= exe->write_data_size)
{ /* Nothing left to write, clean up. */
if (exe->write_data_offset >= exe->write_data_size) /* Nothing left to write, clean up. */
{
exe->write_data_size = 0;
exe->write_data_offset = 0;
IF_FREE(exe->write_data_buf);
@ -1767,7 +1811,8 @@ _ecore_exe_flush(Ecore_Exe *exe)
}
static void
_ecore_exe_event_exe_data_free(void *data __UNUSED__, void *ev)
_ecore_exe_event_exe_data_free(void *data __UNUSED__,
void *ev)
{
Ecore_Exe_Event_Data *e;
@ -1785,7 +1830,8 @@ _ecore_exe_event_add_new(void)
}
static void
_ecore_exe_event_add_free(void *data __UNUSED__, void *ev)
_ecore_exe_event_add_free(void *data __UNUSED__,
void *ev)
{
Ecore_Exe_Event_Add *e;
@ -1803,7 +1849,8 @@ _ecore_exe_event_del_new(void)
}
void
_ecore_exe_event_del_free(void *data __UNUSED__, void *ev)
_ecore_exe_event_del_free(void *data __UNUSED__,
void *ev)
{
Ecore_Exe_Event_Del *e;
@ -1830,3 +1877,4 @@ _ecore_exe_dead_attach(Ecore_Exe *exe)
exe->doomsday_clock_dead = dead;
}
}

View File

@ -86,18 +86,28 @@ static Ecore_Exe *exes = NULL;
static int _ecore_exe_win32_pipes_set(Ecore_Exe *exe);
static void _ecore_exe_win32_pipes_close(Ecore_Exe *exe);
static BOOL CALLBACK _ecore_exe_enum_windows_procedure(HWND window, LPARAM data);
static void _ecore_exe_event_add_free(void *data, void *ev);
static void _ecore_exe_event_del_free(void *data, void *ev);
static BOOL CALLBACK _ecore_exe_enum_windows_procedure(HWND window,
LPARAM data);
static void _ecore_exe_event_add_free(void *data,
void *ev);
static void _ecore_exe_event_del_free(void *data,
void *ev);
static void _ecore_exe_event_exe_data_free(void *data,
void *ev);
static int _ecore_exe_win32_pipe_thread_generic_cb(void *data, Ecore_Exe_Flags flags);
static int _ecore_exe_win32_pipe_thread_generic_cb(void *data,
Ecore_Exe_Flags flags);
static DWORD WINAPI _ecore_exe_win32_pipe_thread_read_cb(void *data);
static DWORD WINAPI _ecore_exe_win32_pipe_thread_error_cb(void *data);
static Eina_Bool _ecore_exe_close_cb(void *data, Ecore_Win32_Handler *wh);
static void _ecore_exe_pipe_read_cb(void *data, void *buf, unsigned int size);
static int _ecore_exe_pipe_write_cb(void *data, Ecore_Win32_Handler *wh);
static void _ecore_exe_pipe_error_cb(void *data, void *buf, unsigned int size);
static Eina_Bool _ecore_exe_close_cb(void *data,
Ecore_Win32_Handler *wh);
static void _ecore_exe_pipe_read_cb(void *data,
void *buf,
unsigned int size);
static int _ecore_exe_pipe_write_cb(void *data,
Ecore_Win32_Handler *wh);
static void _ecore_exe_pipe_error_cb(void *data,
void *buf,
unsigned int size);
EAPI int ECORE_EXE_EVENT_ADD = 0;
EAPI int ECORE_EXE_EVENT_DEL = 0;
@ -130,21 +140,27 @@ ecore_exe_run_priority_set(int pri)
case ECORE_EXE_WIN32_PRIORITY_IDLE:
run_pri = IDLE_PRIORITY_CLASS;
break;
case ECORE_EXE_WIN32_PRIORITY_BELOW_NORMAL:
run_pri = BELOW_NORMAL_PRIORITY_CLASS;
break;
case ECORE_EXE_WIN32_PRIORITY_NORMAL:
run_pri = NORMAL_PRIORITY_CLASS;
break;
case ECORE_EXE_WIN32_PRIORITY_ABOVE_NORMAL:
run_pri = ABOVE_NORMAL_PRIORITY_CLASS;
break;
case ECORE_EXE_WIN32_PRIORITY_HIGH:
run_pri = HIGH_PRIORITY_CLASS;
break;
case ECORE_EXE_WIN32_PRIORITY_REALTIME:
run_pri = REALTIME_PRIORITY_CLASS;
break;
default:
break;
}
@ -157,16 +173,22 @@ ecore_exe_run_priority_get(void)
{
case IDLE_PRIORITY_CLASS:
return ECORE_EXE_WIN32_PRIORITY_IDLE;
case BELOW_NORMAL_PRIORITY_CLASS:
return ECORE_EXE_WIN32_PRIORITY_BELOW_NORMAL;
case NORMAL_PRIORITY_CLASS:
return ECORE_EXE_WIN32_PRIORITY_NORMAL;
case ABOVE_NORMAL_PRIORITY_CLASS:
return ECORE_EXE_WIN32_PRIORITY_ABOVE_NORMAL;
case HIGH_PRIORITY_CLASS:
return ECORE_EXE_WIN32_PRIORITY_HIGH;
case REALTIME_PRIORITY_CLASS:
return ECORE_EXE_WIN32_PRIORITY_REALTIME;
/* default should not be reached */
default:
return ECORE_EXE_WIN32_PRIORITY_NORMAL;
@ -174,13 +196,16 @@ ecore_exe_run_priority_get(void)
}
EAPI Ecore_Exe *
ecore_exe_run(const char *exe_cmd, const void *data)
ecore_exe_run(const char *exe_cmd,
const void *data)
{
return ecore_exe_pipe_run(exe_cmd, 0, data);
}
EAPI Ecore_Exe *
ecore_exe_pipe_run(const char *exe_cmd, Ecore_Exe_Flags flags, const void *data)
ecore_exe_pipe_run(const char *exe_cmd,
Ecore_Exe_Flags flags,
const void *data)
{
STARTUPINFO si;
PROCESS_INFORMATION pi;
@ -288,7 +313,8 @@ ecore_exe_pipe_run(const char *exe_cmd, Ecore_Exe_Flags flags, const void *data)
}
EAPI void
ecore_exe_callback_pre_free_set(Ecore_Exe *exe, Ecore_Exe_Cb func)
ecore_exe_callback_pre_free_set(Ecore_Exe *exe,
Ecore_Exe_Cb func)
{
if (!ECORE_MAGIC_CHECK(exe, ECORE_MAGIC_EXE))
{
@ -300,7 +326,9 @@ ecore_exe_callback_pre_free_set(Ecore_Exe *exe, Ecore_Exe_Cb func)
}
EAPI Eina_Bool
ecore_exe_send(Ecore_Exe *exe, const void *data, int size)
ecore_exe_send(Ecore_Exe *exe,
const void *data,
int size)
{
void *buf;
@ -350,12 +378,17 @@ ecore_exe_close_stdin(Ecore_Exe *exe)
/* Not used on Windows */
EAPI void
ecore_exe_auto_limits_set(Ecore_Exe *exe __UNUSED__, int start_bytes __UNUSED__, int end_bytes __UNUSED__, int start_lines __UNUSED__, int end_lines __UNUSED__)
ecore_exe_auto_limits_set(Ecore_Exe *exe __UNUSED__,
int start_bytes __UNUSED__,
int end_bytes __UNUSED__,
int start_lines __UNUSED__,
int end_lines __UNUSED__)
{
}
EAPI Ecore_Exe_Event_Data *
ecore_exe_event_data_get(Ecore_Exe *exe, Ecore_Exe_Flags flags)
ecore_exe_event_data_get(Ecore_Exe *exe,
Ecore_Exe_Flags flags)
{
Ecore_Exe_Event_Data *e = NULL;
unsigned char *inbuf;
@ -445,7 +478,8 @@ ecore_exe_pid_get(const Ecore_Exe *exe)
}
EAPI void
ecore_exe_tag_set(Ecore_Exe *exe, const char *tag)
ecore_exe_tag_set(Ecore_Exe *exe,
const char *tag)
{
if (!ECORE_MAGIC_CHECK(exe, ECORE_MAGIC_EXE))
{
@ -594,7 +628,8 @@ ecore_exe_kill(Ecore_Exe *exe)
}
EAPI void
ecore_exe_signal(Ecore_Exe *exe, int num __UNUSED__)
ecore_exe_signal(Ecore_Exe *exe,
int num __UNUSED__)
{
if (!ECORE_MAGIC_CHECK(exe, ECORE_MAGIC_EXE))
{
@ -619,7 +654,8 @@ ecore_exe_hup(Ecore_Exe *exe)
/* FIXME: manage error mode */
static int
_ecore_exe_win32_pipe_thread_generic_cb(void *data, Ecore_Exe_Flags flags)
_ecore_exe_win32_pipe_thread_generic_cb(void *data,
Ecore_Exe_Flags flags)
{
#define BUFSIZE 2048
char buf[BUFSIZE];
@ -824,7 +860,8 @@ _ecore_exe_thread_procedure(LPVOID data __UNUSED__)
}
static BOOL CALLBACK
_ecore_exe_enum_windows_procedure(HWND window, LPARAM data)
_ecore_exe_enum_windows_procedure(HWND window,
LPARAM data)
{
Ecore_Exe *exe;
DWORD thread_id;
@ -890,7 +927,8 @@ _ecore_exe_enum_windows_procedure(HWND window, LPARAM data)
}
static void
_ecore_exe_event_add_free(void *data __UNUSED__, void *ev)
_ecore_exe_event_add_free(void *data __UNUSED__,
void *ev)
{
Ecore_Exe_Event_Add *e;
@ -899,7 +937,8 @@ _ecore_exe_event_add_free(void *data __UNUSED__, void *ev)
}
static void
_ecore_exe_event_del_free(void *data __UNUSED__, void *ev)
_ecore_exe_event_del_free(void *data __UNUSED__,
void *ev)
{
Ecore_Exe_Event_Del *e;
@ -910,7 +949,8 @@ _ecore_exe_event_del_free(void *data __UNUSED__, void *ev)
}
static void
_ecore_exe_event_exe_data_free(void *data __UNUSED__, void *ev)
_ecore_exe_event_exe_data_free(void *data __UNUSED__,
void *ev)
{
Ecore_Exe_Event_Data *e;
@ -919,7 +959,8 @@ _ecore_exe_event_exe_data_free(void *data __UNUSED__, void *ev)
}
static Eina_Bool
_ecore_exe_close_cb(void *data, Ecore_Win32_Handler *wh __UNUSED__)
_ecore_exe_close_cb(void *data,
Ecore_Win32_Handler *wh __UNUSED__)
{
Ecore_Exe_Event_Del *e;
Ecore_Exe *exe;
@ -953,7 +994,9 @@ _ecore_exe_close_cb(void *data, Ecore_Win32_Handler *wh __UNUSED__)
}
static void
_ecore_exe_pipe_read_cb(void *data, void *buf, unsigned int size)
_ecore_exe_pipe_read_cb(void *data,
void *buf,
unsigned int size)
{
Ecore_Exe_Event_Data *e;
@ -965,7 +1008,8 @@ _ecore_exe_pipe_read_cb(void *data, void *buf, unsigned int size)
}
static int
_ecore_exe_pipe_write_cb(void *data, Ecore_Win32_Handler *wh __UNUSED__)
_ecore_exe_pipe_write_cb(void *data,
Ecore_Win32_Handler *wh __UNUSED__)
{
char buf[READBUFSIZ];
Ecore_Exe *exe;
@ -996,7 +1040,9 @@ _ecore_exe_pipe_write_cb(void *data, Ecore_Win32_Handler *wh __UNUSED__)
}
static void
_ecore_exe_pipe_error_cb(void *data, void *buf, unsigned int size)
_ecore_exe_pipe_error_cb(void *data,
void *buf,
unsigned int size)
{
Ecore_Exe_Event_Data *e;
@ -1006,3 +1052,4 @@ _ecore_exe_pipe_error_cb(void *data, void *buf, unsigned int size)
_ecore_exe_event_exe_data_free,
NULL);
}

View File

@ -18,3 +18,4 @@ void
_ecore_exe_shutdown(void)
{
}

View File

@ -47,7 +47,9 @@ static int cols = 80;
static int helpcol = 80 / 3;
static void
_ecore_getopt_help_print_replace_program(FILE *fp, const Ecore_Getopt *parser __UNUSED__, const char *text)
_ecore_getopt_help_print_replace_program(FILE *fp,
const Ecore_Getopt *parser __UNUSED__,
const char *text)
{
do
{
@ -82,7 +84,8 @@ _ecore_getopt_help_print_replace_program(FILE *fp, const Ecore_Getopt *parser __
}
static void
_ecore_getopt_version(FILE *fp, const Ecore_Getopt *parser)
_ecore_getopt_version(FILE *fp,
const Ecore_Getopt *parser)
{
fputs(_("Version:"), fp);
fputc(' ', fp);
@ -90,7 +93,8 @@ _ecore_getopt_version(FILE *fp, const Ecore_Getopt *parser)
}
static void
_ecore_getopt_help_usage(FILE *fp, const Ecore_Getopt *parser)
_ecore_getopt_help_usage(FILE *fp,
const Ecore_Getopt *parser)
{
fputs(_("Usage:"), fp);
fputc(' ', fp);
@ -105,7 +109,12 @@ _ecore_getopt_help_usage(FILE *fp, const Ecore_Getopt *parser)
}
static int
_ecore_getopt_help_line(FILE *fp, const int base, const int total, int used, const char *text, int len)
_ecore_getopt_help_line(FILE *fp,
const int base,
const int total,
int used,
const char *text,
int len)
{
int linebreak = 0;
do
@ -186,7 +195,8 @@ _ecore_getopt_help_line(FILE *fp, const int base, const int total, int used, con
}
static void
_ecore_getopt_help_description(FILE *fp, const Ecore_Getopt *parser)
_ecore_getopt_help_description(FILE *fp,
const Ecore_Getopt *parser)
{
const char *p, *prg, *ver;
int used, prglen, verlen;
@ -242,7 +252,8 @@ _ecore_getopt_help_description(FILE *fp, const Ecore_Getopt *parser)
}
static void
_ecore_getopt_copyright(FILE *fp, const Ecore_Getopt *parser)
_ecore_getopt_copyright(FILE *fp,
const Ecore_Getopt *parser)
{
const char *txt = gettext(parser->copyright);
fputs(_("Copyright:"), fp);
@ -253,7 +264,8 @@ _ecore_getopt_copyright(FILE *fp, const Ecore_Getopt *parser)
}
static void
_ecore_getopt_license(FILE *fp, const Ecore_Getopt *parser)
_ecore_getopt_license(FILE *fp,
const Ecore_Getopt *parser)
{
const char *txt = gettext(parser->license);
fputs(_("License:"), fp);
@ -270,31 +282,44 @@ _ecore_getopt_desc_arg_requirement(const Ecore_Getopt_Desc *desc)
{
case ECORE_GETOPT_ACTION_STORE:
return desc->action_param.store.arg_req;
case ECORE_GETOPT_ACTION_STORE_CONST:
return ECORE_GETOPT_DESC_ARG_REQUIREMENT_NO;
case ECORE_GETOPT_ACTION_STORE_TRUE:
return ECORE_GETOPT_DESC_ARG_REQUIREMENT_NO;
case ECORE_GETOPT_ACTION_STORE_FALSE:
return ECORE_GETOPT_DESC_ARG_REQUIREMENT_NO;
case ECORE_GETOPT_ACTION_CHOICE:
return ECORE_GETOPT_DESC_ARG_REQUIREMENT_YES;
case ECORE_GETOPT_ACTION_APPEND:
return ECORE_GETOPT_DESC_ARG_REQUIREMENT_YES;
case ECORE_GETOPT_ACTION_COUNT:
return ECORE_GETOPT_DESC_ARG_REQUIREMENT_NO;
case ECORE_GETOPT_ACTION_CALLBACK:
return desc->action_param.callback.arg_req;
case ECORE_GETOPT_ACTION_HELP:
return ECORE_GETOPT_DESC_ARG_REQUIREMENT_NO;
case ECORE_GETOPT_ACTION_VERSION:
return ECORE_GETOPT_DESC_ARG_REQUIREMENT_NO;
default:
return ECORE_GETOPT_DESC_ARG_REQUIREMENT_NO;
}
}
static void
_ecore_getopt_help_desc_setup_metavar(const Ecore_Getopt_Desc *desc, char *metavar, int *metavarlen, int maxsize)
_ecore_getopt_help_desc_setup_metavar(const Ecore_Getopt_Desc *desc,
char *metavar,
int *metavarlen,
int maxsize)
{
if (desc->metavar)
{
@ -321,7 +346,10 @@ _ecore_getopt_help_desc_setup_metavar(const Ecore_Getopt_Desc *desc, char *metav
}
static int
_ecore_getopt_help_desc_show_arg(FILE *fp, Ecore_Getopt_Desc_Arg_Requirement requirement, const char *metavar, int metavarlen)
_ecore_getopt_help_desc_show_arg(FILE *fp,
Ecore_Getopt_Desc_Arg_Requirement requirement,
const char *metavar,
int metavarlen)
{
int used;
@ -353,7 +381,11 @@ _ecore_getopt_help_desc_show_arg(FILE *fp, Ecore_Getopt_Desc_Arg_Requirement req
}
static int
_ecore_getopt_help_desc_store(FILE *fp, const int base, const int total, int used, const Ecore_Getopt_Desc *desc)
_ecore_getopt_help_desc_store(FILE *fp,
const int base,
const int total,
int used,
const Ecore_Getopt_Desc *desc)
{
const Ecore_Getopt_Desc_Store *store = &desc->action_param.store;
char buf[64];
@ -370,38 +402,47 @@ _ecore_getopt_help_desc_store(FILE *fp, const int base, const int total, int use
str = "STR";
len = sizeof("STR") - 1;
break;
case ECORE_GETOPT_TYPE_BOOL:
str = "BOOL";
len = sizeof("BOOL") - 1;
break;
case ECORE_GETOPT_TYPE_SHORT:
str = "SHORT";
len = sizeof("SHORT") - 1;
break;
case ECORE_GETOPT_TYPE_INT:
str = "INT";
len = sizeof("INT") - 1;
break;
case ECORE_GETOPT_TYPE_LONG:
str = "LONG";
len = sizeof("LONG") - 1;
break;
case ECORE_GETOPT_TYPE_USHORT:
str = "USHORT";
len = sizeof("USHORT") - 1;
break;
case ECORE_GETOPT_TYPE_UINT:
str = "UINT";
len = sizeof("UINT") - 1;
break;
case ECORE_GETOPT_TYPE_ULONG:
str = "ULONG";
len = sizeof("ULONG") - 1;
break;
case ECORE_GETOPT_TYPE_DOUBLE:
str = "DOUBLE";
len = sizeof("DOUBLE") - 1;
break;
default:
str = "???";
len = sizeof("???") - 1;
@ -423,52 +464,61 @@ _ecore_getopt_help_desc_store(FILE *fp, const int base, const int total, int use
str = store->def.strv;
len = str ? strlen(str) : 0;
break;
case ECORE_GETOPT_TYPE_BOOL:
str = store->def.boolv ? "true" : "false";
len = strlen(str);
break;
case ECORE_GETOPT_TYPE_SHORT:
str = buf;
len = snprintf(buf, sizeof(buf), "%hd", store->def.shortv);
if (len > sizeof(buf) - 1)
len = sizeof(buf) - 1;
break;
case ECORE_GETOPT_TYPE_INT:
str = buf;
len = snprintf(buf, sizeof(buf), "%d", store->def.intv);
if (len > sizeof(buf) - 1)
len = sizeof(buf) - 1;
break;
case ECORE_GETOPT_TYPE_LONG:
str = buf;
len = snprintf(buf, sizeof(buf), "%ld", store->def.longv);
if (len > sizeof(buf) - 1)
len = sizeof(buf) - 1;
break;
case ECORE_GETOPT_TYPE_USHORT:
str = buf;
len = snprintf(buf, sizeof(buf), "%hu", store->def.ushortv);
if (len > sizeof(buf) - 1)
len = sizeof(buf) - 1;
break;
case ECORE_GETOPT_TYPE_UINT:
str = buf;
len = snprintf(buf, sizeof(buf), "%u", store->def.uintv);
if (len > sizeof(buf) - 1)
len = sizeof(buf) - 1;
break;
case ECORE_GETOPT_TYPE_ULONG:
str = buf;
len = snprintf(buf, sizeof(buf), "%lu", store->def.ulongv);
if (len > sizeof(buf) - 1)
len = sizeof(buf) - 1;
break;
case ECORE_GETOPT_TYPE_DOUBLE:
str = buf;
len = snprintf(buf, sizeof(buf), "%f", store->def.doublev);
if (len > sizeof(buf) - 1)
len = sizeof(buf) - 1;
break;
default:
str = "???";
len = sizeof("???") - 1;
@ -483,7 +533,11 @@ _ecore_getopt_help_desc_store(FILE *fp, const int base, const int total, int use
}
static int
_ecore_getopt_help_desc_choices(FILE *fp, const int base, const int total, int used, const Ecore_Getopt_Desc *desc)
_ecore_getopt_help_desc_choices(FILE *fp,
const int base,
const int total,
int used,
const Ecore_Getopt_Desc *desc)
{
const char *const *itr;
const char sep[] = ", ";
@ -512,7 +566,8 @@ _ecore_getopt_help_desc_choices(FILE *fp, const int base, const int total, int u
}
static void
_ecore_getopt_help_desc(FILE *fp, const Ecore_Getopt_Desc *desc)
_ecore_getopt_help_desc(FILE *fp,
const Ecore_Getopt_Desc *desc)
{
Ecore_Getopt_Desc_Arg_Requirement arg_req;
char metavar[32] = "ARG";
@ -573,9 +628,11 @@ _ecore_getopt_help_desc(FILE *fp, const Ecore_Getopt_Desc *desc)
case ECORE_GETOPT_ACTION_STORE:
_ecore_getopt_help_desc_store(fp, helpcol, cols, used, desc);
break;
case ECORE_GETOPT_ACTION_CHOICE:
_ecore_getopt_help_desc_choices(fp, helpcol, cols, used, desc);
break;
default:
break;
}
@ -591,7 +648,8 @@ _ecore_getopt_desc_is_sentinel(const Ecore_Getopt_Desc *desc)
}
static void
_ecore_getopt_help_options(FILE *fp, const Ecore_Getopt *parser)
_ecore_getopt_help_options(FILE *fp,
const Ecore_Getopt *parser)
{
const Ecore_Getopt_Desc *desc;
@ -609,7 +667,8 @@ _ecore_getopt_help_options(FILE *fp, const Ecore_Getopt *parser)
* Message will be print to stderr.
*/
void
ecore_getopt_help(FILE *fp, const Ecore_Getopt *parser)
ecore_getopt_help(FILE *fp,
const Ecore_Getopt *parser)
{
const char *var;
@ -640,7 +699,8 @@ ecore_getopt_help(FILE *fp, const Ecore_Getopt *parser)
}
static const Ecore_Getopt_Desc *
_ecore_getopt_parse_find_long(const Ecore_Getopt *parser, const char *name)
_ecore_getopt_parse_find_long(const Ecore_Getopt *parser,
const char *name)
{
const Ecore_Getopt_Desc *desc = parser->descs;
const char *p = strchr(name, '=');
@ -671,7 +731,8 @@ _ecore_getopt_parse_find_long(const Ecore_Getopt *parser, const char *name)
}
static const Ecore_Getopt_Desc *
_ecore_getopt_parse_find_short(const Ecore_Getopt *parser, char name)
_ecore_getopt_parse_find_short(const Ecore_Getopt *parser,
char name)
{
const Ecore_Getopt_Desc *desc = parser->descs;
for (; !_ecore_getopt_desc_is_sentinel(desc); desc++)
@ -681,7 +742,9 @@ _ecore_getopt_parse_find_short(const Ecore_Getopt *parser, char name)
}
static int
_ecore_getopt_parse_find_nonargs_base(const Ecore_Getopt *parser, int argc, char **argv)
_ecore_getopt_parse_find_nonargs_base(const Ecore_Getopt *parser,
int argc,
char **argv)
{
char **nonargs;
int src, dst, used, base;
@ -769,7 +832,9 @@ _ecore_getopt_parse_find_nonargs_base(const Ecore_Getopt *parser, int argc, char
}
static void
_ecore_getopt_desc_print_error(const Ecore_Getopt_Desc *desc, const char *fmt, ...)
_ecore_getopt_desc_print_error(const Ecore_Getopt_Desc *desc,
const char *fmt,
...)
{
va_list ap;
@ -798,7 +863,8 @@ _ecore_getopt_desc_print_error(const Ecore_Getopt_Desc *desc, const char *fmt, .
}
static Eina_Bool
_ecore_getopt_parse_bool(const char *str, Eina_Bool *v)
_ecore_getopt_parse_bool(const char *str,
Eina_Bool *v)
{
if ((strcmp(str, "0") == 0) ||
(strcasecmp(str, "f") == 0) ||
@ -825,7 +891,8 @@ _ecore_getopt_parse_bool(const char *str, Eina_Bool *v)
}
static Eina_Bool
_ecore_getopt_parse_long(const char *str, long int *v)
_ecore_getopt_parse_long(const char *str,
long int *v)
{
char *endptr = NULL;
*v = strtol(str, &endptr, 0);
@ -833,7 +900,8 @@ _ecore_getopt_parse_long(const char *str, long int *v)
}
static Eina_Bool
_ecore_getopt_parse_double(const char *str, double *v)
_ecore_getopt_parse_double(const char *str,
double *v)
{
char *endptr = NULL;
*v = strtod(str, &endptr);
@ -841,7 +909,10 @@ _ecore_getopt_parse_double(const char *str, double *v)
}
static Eina_Bool
_ecore_getopt_parse_store(const Ecore_Getopt *parser __UNUSED__, const Ecore_Getopt_Desc *desc, Ecore_Getopt_Value *value, const char *arg_val)
_ecore_getopt_parse_store(const Ecore_Getopt *parser __UNUSED__,
const Ecore_Getopt_Desc *desc,
Ecore_Getopt_Value *value,
const char *arg_val)
{
const Ecore_Getopt_Desc_Store *store = &desc->action_param.store;
long int v;
@ -858,9 +929,11 @@ _ecore_getopt_parse_store(const Ecore_Getopt *parser __UNUSED__, const Ecore_Get
{
case ECORE_GETOPT_DESC_ARG_REQUIREMENT_NO:
goto use_optional;
case ECORE_GETOPT_DESC_ARG_REQUIREMENT_OPTIONAL:
if (!arg_val)
goto use_optional;
case ECORE_GETOPT_DESC_ARG_REQUIREMENT_YES:
break;
}
@ -870,6 +943,7 @@ _ecore_getopt_parse_store(const Ecore_Getopt *parser __UNUSED__, const Ecore_Get
case ECORE_GETOPT_TYPE_STR:
*value->strp = (char *)arg_val;
return EINA_TRUE;
case ECORE_GETOPT_TYPE_BOOL:
if (_ecore_getopt_parse_bool(arg_val, &b))
{
@ -882,36 +956,43 @@ _ecore_getopt_parse_store(const Ecore_Getopt *parser __UNUSED__, const Ecore_Get
(desc, _("unknown boolean value %s.\n"), arg_val);
return EINA_FALSE;
}
case ECORE_GETOPT_TYPE_SHORT:
if (!_ecore_getopt_parse_long(arg_val, &v))
goto error;
*value->shortp = v;
return EINA_TRUE;
case ECORE_GETOPT_TYPE_INT:
if (!_ecore_getopt_parse_long(arg_val, &v))
goto error;
*value->intp = v;
return EINA_TRUE;
case ECORE_GETOPT_TYPE_LONG:
if (!_ecore_getopt_parse_long(arg_val, &v))
goto error;
*value->longp = v;
return EINA_TRUE;
case ECORE_GETOPT_TYPE_USHORT:
if (!_ecore_getopt_parse_long(arg_val, &v))
goto error;
*value->ushortp = v;
return EINA_TRUE;
case ECORE_GETOPT_TYPE_UINT:
if (!_ecore_getopt_parse_long(arg_val, &v))
goto error;
*value->uintp = v;
return EINA_TRUE;
case ECORE_GETOPT_TYPE_ULONG:
if (!_ecore_getopt_parse_long(arg_val, &v))
goto error;
*value->ulongp = v;
return EINA_TRUE;
case ECORE_GETOPT_TYPE_DOUBLE:
if (!_ecore_getopt_parse_double(arg_val, &d))
goto error;
@ -932,27 +1013,35 @@ _ecore_getopt_parse_store(const Ecore_Getopt *parser __UNUSED__, const Ecore_Get
case ECORE_GETOPT_TYPE_STR:
*value->strp = (char *)store->def.strv;
break;
case ECORE_GETOPT_TYPE_BOOL:
*value->boolp = store->def.boolv;
break;
case ECORE_GETOPT_TYPE_SHORT:
*value->shortp = store->def.shortv;
break;
case ECORE_GETOPT_TYPE_INT:
*value->intp = store->def.intv;
break;
case ECORE_GETOPT_TYPE_LONG:
*value->longp = store->def.longv;
break;
case ECORE_GETOPT_TYPE_USHORT:
*value->ushortp = store->def.ushortv;
break;
case ECORE_GETOPT_TYPE_UINT:
*value->uintp = store->def.uintv;
break;
case ECORE_GETOPT_TYPE_ULONG:
*value->ulongp = store->def.ulongv;
break;
case ECORE_GETOPT_TYPE_DOUBLE:
*value->doublep = store->def.doublev;
break;
@ -962,7 +1051,10 @@ _ecore_getopt_parse_store(const Ecore_Getopt *parser __UNUSED__, const Ecore_Get
}
static Eina_Bool
_ecore_getopt_parse_store_const(const Ecore_Getopt *parser __UNUSED__, const Ecore_Getopt_Desc *desc, Ecore_Getopt_Value *val, const char *arg_val __UNUSED__)
_ecore_getopt_parse_store_const(const Ecore_Getopt *parser __UNUSED__,
const Ecore_Getopt_Desc *desc,
Ecore_Getopt_Value *val,
const char *arg_val __UNUSED__)
{
if (!val->ptrp)
{
@ -975,7 +1067,10 @@ _ecore_getopt_parse_store_const(const Ecore_Getopt *parser __UNUSED__, const Eco
}
static Eina_Bool
_ecore_getopt_parse_store_true(const Ecore_Getopt *parser __UNUSED__, const Ecore_Getopt_Desc *desc, Ecore_Getopt_Value *val, const char *arg_val __UNUSED__)
_ecore_getopt_parse_store_true(const Ecore_Getopt *parser __UNUSED__,
const Ecore_Getopt_Desc *desc,
Ecore_Getopt_Value *val,
const char *arg_val __UNUSED__)
{
if (!val->boolp)
{
@ -987,7 +1082,10 @@ _ecore_getopt_parse_store_true(const Ecore_Getopt *parser __UNUSED__, const Ecor
}
static Eina_Bool
_ecore_getopt_parse_store_false(const Ecore_Getopt *parser __UNUSED__, const Ecore_Getopt_Desc *desc, Ecore_Getopt_Value *val, const char *arg_val __UNUSED__)
_ecore_getopt_parse_store_false(const Ecore_Getopt *parser __UNUSED__,
const Ecore_Getopt_Desc *desc,
Ecore_Getopt_Value *val,
const char *arg_val __UNUSED__)
{
if (!val->boolp)
{
@ -999,7 +1097,10 @@ _ecore_getopt_parse_store_false(const Ecore_Getopt *parser __UNUSED__, const Eco
}
static Eina_Bool
_ecore_getopt_parse_choice(const Ecore_Getopt *parser __UNUSED__, const Ecore_Getopt_Desc *desc, Ecore_Getopt_Value *val, const char *arg_val)
_ecore_getopt_parse_choice(const Ecore_Getopt *parser __UNUSED__,
const Ecore_Getopt_Desc *desc,
Ecore_Getopt_Value *val,
const char *arg_val)
{
const char *const *pchoice;
@ -1033,7 +1134,10 @@ _ecore_getopt_parse_choice(const Ecore_Getopt *parser __UNUSED__, const Ecore_Ge
}
static Eina_Bool
_ecore_getopt_parse_append(const Ecore_Getopt *parser __UNUSED__, const Ecore_Getopt_Desc *desc, Ecore_Getopt_Value *val, const char *arg_val)
_ecore_getopt_parse_append(const Ecore_Getopt *parser __UNUSED__,
const Ecore_Getopt_Desc *desc,
Ecore_Getopt_Value *val,
const char *arg_val)
{
void *data;
long int v;
@ -1058,6 +1162,7 @@ _ecore_getopt_parse_append(const Ecore_Getopt *parser __UNUSED__, const Ecore_Ge
case ECORE_GETOPT_TYPE_STR:
data = strdup(arg_val);
break;
case ECORE_GETOPT_TYPE_BOOL:
{
if (_ecore_getopt_parse_bool(arg_val, &b))
@ -1073,6 +1178,7 @@ _ecore_getopt_parse_append(const Ecore_Getopt *parser __UNUSED__, const Ecore_Ge
}
}
break;
case ECORE_GETOPT_TYPE_SHORT:
{
if (!_ecore_getopt_parse_long(arg_val, &v))
@ -1082,6 +1188,7 @@ _ecore_getopt_parse_append(const Ecore_Getopt *parser __UNUSED__, const Ecore_Ge
*(short *)data = (short)v;
}
break;
case ECORE_GETOPT_TYPE_INT:
{
if (!_ecore_getopt_parse_long(arg_val, &v))
@ -1091,6 +1198,7 @@ _ecore_getopt_parse_append(const Ecore_Getopt *parser __UNUSED__, const Ecore_Ge
*(int *)data = (int)v;
}
break;
case ECORE_GETOPT_TYPE_LONG:
{
if (!_ecore_getopt_parse_long(arg_val, &v))
@ -1100,6 +1208,7 @@ _ecore_getopt_parse_append(const Ecore_Getopt *parser __UNUSED__, const Ecore_Ge
*(long *)data = v;
}
break;
case ECORE_GETOPT_TYPE_USHORT:
{
if (!_ecore_getopt_parse_long(arg_val, &v))
@ -1109,6 +1218,7 @@ _ecore_getopt_parse_append(const Ecore_Getopt *parser __UNUSED__, const Ecore_Ge
*(unsigned short *)data = (unsigned short)v;
}
break;
case ECORE_GETOPT_TYPE_UINT:
{
if (!_ecore_getopt_parse_long(arg_val, &v))
@ -1118,6 +1228,7 @@ _ecore_getopt_parse_append(const Ecore_Getopt *parser __UNUSED__, const Ecore_Ge
*(unsigned int *)data = (unsigned int)v;
}
break;
case ECORE_GETOPT_TYPE_ULONG:
{
if (!_ecore_getopt_parse_long(arg_val, &v))
@ -1127,6 +1238,7 @@ _ecore_getopt_parse_append(const Ecore_Getopt *parser __UNUSED__, const Ecore_Ge
*(unsigned long *)data = v;
}
break;
case ECORE_GETOPT_TYPE_DOUBLE:
{
if (!_ecore_getopt_parse_double(arg_val, &d))
@ -1136,6 +1248,7 @@ _ecore_getopt_parse_append(const Ecore_Getopt *parser __UNUSED__, const Ecore_Ge
*(double *)data = d;
}
break;
default:
{
_ecore_getopt_desc_print_error(desc, _("could not parse value.\n"));
@ -1153,7 +1266,10 @@ _ecore_getopt_parse_append(const Ecore_Getopt *parser __UNUSED__, const Ecore_Ge
}
static Eina_Bool
_ecore_getopt_parse_count(const Ecore_Getopt *parser __UNUSED__, const Ecore_Getopt_Desc *desc, Ecore_Getopt_Value *val, const char *arg_val __UNUSED__)
_ecore_getopt_parse_count(const Ecore_Getopt *parser __UNUSED__,
const Ecore_Getopt_Desc *desc,
Ecore_Getopt_Value *val,
const char *arg_val __UNUSED__)
{
if (!val->intp)
{
@ -1166,7 +1282,10 @@ _ecore_getopt_parse_count(const Ecore_Getopt *parser __UNUSED__, const Ecore_Get
}
static Eina_Bool
_ecore_getopt_parse_callback(const Ecore_Getopt *parser, const Ecore_Getopt_Desc *desc, Ecore_Getopt_Value *val, const char *arg_val)
_ecore_getopt_parse_callback(const Ecore_Getopt *parser,
const Ecore_Getopt_Desc *desc,
Ecore_Getopt_Value *val,
const char *arg_val)
{
const Ecore_Getopt_Desc_Callback *cb = &desc->action_param.callback;
@ -1175,10 +1294,12 @@ _ecore_getopt_parse_callback(const Ecore_Getopt *parser, const Ecore_Getopt_Desc
case ECORE_GETOPT_DESC_ARG_REQUIREMENT_NO:
arg_val = cb->def;
break;
case ECORE_GETOPT_DESC_ARG_REQUIREMENT_OPTIONAL:
if (!arg_val)
arg_val = cb->def;
break;
case ECORE_GETOPT_DESC_ARG_REQUIREMENT_YES:
break;
}
@ -1208,7 +1329,10 @@ _ecore_getopt_parse_callback(const Ecore_Getopt *parser, const Ecore_Getopt_Desc
}
static Eina_Bool
_ecore_getopt_parse_help(const Ecore_Getopt *parser, const Ecore_Getopt_Desc *desc __UNUSED__, Ecore_Getopt_Value *val, const char *arg_val __UNUSED__)
_ecore_getopt_parse_help(const Ecore_Getopt *parser,
const Ecore_Getopt_Desc *desc __UNUSED__,
Ecore_Getopt_Value *val,
const char *arg_val __UNUSED__)
{
if (val->boolp)
(*val->boolp) = EINA_TRUE;
@ -1217,7 +1341,10 @@ _ecore_getopt_parse_help(const Ecore_Getopt *parser, const Ecore_Getopt_Desc *de
}
static Eina_Bool
_ecore_getopt_parse_version(const Ecore_Getopt *parser, const Ecore_Getopt_Desc *desc, Ecore_Getopt_Value *val, const char *arg_val __UNUSED__)
_ecore_getopt_parse_version(const Ecore_Getopt *parser,
const Ecore_Getopt_Desc *desc,
Ecore_Getopt_Value *val,
const char *arg_val __UNUSED__)
{
if (val->boolp)
(*val->boolp) = EINA_TRUE;
@ -1231,7 +1358,10 @@ _ecore_getopt_parse_version(const Ecore_Getopt *parser, const Ecore_Getopt_Desc
}
static Eina_Bool
_ecore_getopt_parse_copyright(const Ecore_Getopt *parser, const Ecore_Getopt_Desc *desc, Ecore_Getopt_Value *val, const char *arg_val __UNUSED__)
_ecore_getopt_parse_copyright(const Ecore_Getopt *parser,
const Ecore_Getopt_Desc *desc,
Ecore_Getopt_Value *val,
const char *arg_val __UNUSED__)
{
if (val->boolp)
(*val->boolp) = EINA_TRUE;
@ -1245,7 +1375,10 @@ _ecore_getopt_parse_copyright(const Ecore_Getopt *parser, const Ecore_Getopt_Des
}
static Eina_Bool
_ecore_getopt_parse_license(const Ecore_Getopt *parser, const Ecore_Getopt_Desc *desc, Ecore_Getopt_Value *val, const char *arg_val __UNUSED__)
_ecore_getopt_parse_license(const Ecore_Getopt *parser,
const Ecore_Getopt_Desc *desc,
Ecore_Getopt_Value *val,
const char *arg_val __UNUSED__)
{
if (val->boolp)
(*val->boolp) = EINA_TRUE;
@ -1259,41 +1392,62 @@ _ecore_getopt_parse_license(const Ecore_Getopt *parser, const Ecore_Getopt_Desc
}
static Eina_Bool
_ecore_getopt_desc_handle(const Ecore_Getopt *parser, const Ecore_Getopt_Desc *desc, Ecore_Getopt_Value *value, const char *arg_val)
_ecore_getopt_desc_handle(const Ecore_Getopt *parser,
const Ecore_Getopt_Desc *desc,
Ecore_Getopt_Value *value,
const char *arg_val)
{
switch (desc->action)
{
case ECORE_GETOPT_ACTION_STORE:
return _ecore_getopt_parse_store(parser, desc, value, arg_val);
case ECORE_GETOPT_ACTION_STORE_CONST:
return _ecore_getopt_parse_store_const(parser, desc, value, arg_val);
case ECORE_GETOPT_ACTION_STORE_TRUE:
return _ecore_getopt_parse_store_true(parser, desc, value, arg_val);
case ECORE_GETOPT_ACTION_STORE_FALSE:
return _ecore_getopt_parse_store_false(parser, desc, value, arg_val);
case ECORE_GETOPT_ACTION_CHOICE:
return _ecore_getopt_parse_choice(parser, desc, value, arg_val);
case ECORE_GETOPT_ACTION_APPEND:
return _ecore_getopt_parse_append(parser, desc, value, arg_val);
case ECORE_GETOPT_ACTION_COUNT:
return _ecore_getopt_parse_count(parser, desc, value, arg_val);
case ECORE_GETOPT_ACTION_CALLBACK:
return _ecore_getopt_parse_callback(parser, desc, value, arg_val);
case ECORE_GETOPT_ACTION_HELP:
return _ecore_getopt_parse_help(parser, desc, value, arg_val);
case ECORE_GETOPT_ACTION_VERSION:
return _ecore_getopt_parse_version(parser, desc, value, arg_val);
case ECORE_GETOPT_ACTION_COPYRIGHT:
return _ecore_getopt_parse_copyright(parser, desc, value, arg_val);
case ECORE_GETOPT_ACTION_LICENSE:
return _ecore_getopt_parse_license(parser, desc, value, arg_val);
default:
return EINA_FALSE;
}
}
static Eina_Bool
_ecore_getopt_parse_arg_long(const Ecore_Getopt *parser, Ecore_Getopt_Value *values, int argc __UNUSED__, char **argv, int *idx, int *nonargs, const char *arg)
_ecore_getopt_parse_arg_long(const Ecore_Getopt *parser,
Ecore_Getopt_Value *values,
int argc __UNUSED__,
char **argv,
int *idx,
int *nonargs,
const char *arg)
{
const Ecore_Getopt_Desc *desc;
Ecore_Getopt_Desc_Arg_Requirement arg_req;
@ -1357,7 +1511,13 @@ _ecore_getopt_parse_arg_long(const Ecore_Getopt *parser, Ecore_Getopt_Value *val
}
static Eina_Bool
_ecore_getopt_parse_arg_short(const Ecore_Getopt *parser, Ecore_Getopt_Value *values, int argc __UNUSED__, char **argv, int *idx, int *nonargs, const char *arg)
_ecore_getopt_parse_arg_short(const Ecore_Getopt *parser,
Ecore_Getopt_Value *values,
int argc __UNUSED__,
char **argv,
int *idx,
int *nonargs,
const char *arg)
{
int run = 1;
while (run && (arg[0] != '\0'))
@ -1436,7 +1596,12 @@ _ecore_getopt_parse_arg_short(const Ecore_Getopt *parser, Ecore_Getopt_Value *va
}
static Eina_Bool
_ecore_getopt_parse_arg(const Ecore_Getopt *parser, Ecore_Getopt_Value *values, int argc, char **argv, int *idx, int *nonargs)
_ecore_getopt_parse_arg(const Ecore_Getopt *parser,
Ecore_Getopt_Value *values,
int argc,
char **argv,
int *idx,
int *nonargs)
{
char *arg = argv[*idx];
@ -1463,7 +1628,8 @@ _ecore_getopt_parse_arg(const Ecore_Getopt *parser, Ecore_Getopt_Value *values,
}
static const Ecore_Getopt_Desc *
_ecore_getopt_parse_find_short_other(const Ecore_Getopt *parser, const Ecore_Getopt_Desc *orig)
_ecore_getopt_parse_find_short_other(const Ecore_Getopt *parser,
const Ecore_Getopt_Desc *orig)
{
const Ecore_Getopt_Desc *desc = parser->descs;
const char c = orig->shortname;
@ -1481,7 +1647,8 @@ _ecore_getopt_parse_find_short_other(const Ecore_Getopt *parser, const Ecore_Get
}
static const Ecore_Getopt_Desc *
_ecore_getopt_parse_find_long_other(const Ecore_Getopt *parser, const Ecore_Getopt_Desc *orig)
_ecore_getopt_parse_find_long_other(const Ecore_Getopt *parser,
const Ecore_Getopt_Desc *orig)
{
const Ecore_Getopt_Desc *desc = parser->descs;
const char *name = orig->longname;
@ -1605,7 +1772,10 @@ _ecore_getopt_find_help(const Ecore_Getopt *parser)
* @return index of first non-option parameter or -1 on error.
*/
int
ecore_getopt_parse(const Ecore_Getopt *parser, Ecore_Getopt_Value *values, int argc, char **argv)
ecore_getopt_parse(const Ecore_Getopt *parser,
Ecore_Getopt_Value *values,
int argc,
char **argv)
{
int i, nonargs;
@ -1690,7 +1860,11 @@ ecore_getopt_list_free(Eina_List *list)
* @c callback_data value is ignored, you can safely use @c NULL.
*/
Eina_Bool
ecore_getopt_callback_geometry_parse(const Ecore_Getopt *parser __UNUSED__, const Ecore_Getopt_Desc *desc __UNUSED__, const char *str, void *data __UNUSED__, Ecore_Getopt_Value *storage)
ecore_getopt_callback_geometry_parse(const Ecore_Getopt *parser __UNUSED__,
const Ecore_Getopt_Desc *desc __UNUSED__,
const char *str,
void *data __UNUSED__,
Ecore_Getopt_Value *storage)
{
Eina_Rectangle *v = (Eina_Rectangle *)storage->ptrp;
@ -1713,7 +1887,11 @@ ecore_getopt_callback_geometry_parse(const Ecore_Getopt *parser __UNUSED__, cons
* @c callback_data value is ignored, you can safely use @c NULL.
*/
Eina_Bool
ecore_getopt_callback_size_parse(const Ecore_Getopt *parser __UNUSED__, const Ecore_Getopt_Desc *desc __UNUSED__, const char *str, void *data __UNUSED__, Ecore_Getopt_Value *storage)
ecore_getopt_callback_size_parse(const Ecore_Getopt *parser __UNUSED__,
const Ecore_Getopt_Desc *desc __UNUSED__,
const char *str,
void *data __UNUSED__,
Ecore_Getopt_Value *storage)
{
Eina_Rectangle *v = (Eina_Rectangle *)storage->ptrp;
@ -1727,3 +1905,4 @@ ecore_getopt_callback_size_parse(const Ecore_Getopt *parser __UNUSED__, const Ec
return EINA_TRUE;
}

View File

@ -37,7 +37,9 @@ _ecore_glib_fds_resize(size_t size)
}
static int
_ecore_glib_context_query(GMainContext *ctx, int priority, int *p_timer)
_ecore_glib_context_query(GMainContext *ctx,
int priority,
int *p_timer)
{
int reqfds;
@ -70,7 +72,11 @@ _ecore_glib_context_query(GMainContext *ctx, int priority, int *p_timer)
}
static int
_ecore_glib_context_poll_from(const GPollFD *pfds, int count, fd_set *rfds, fd_set *wfds, fd_set *efds)
_ecore_glib_context_poll_from(const GPollFD *pfds,
int count,
fd_set *rfds,
fd_set *wfds,
fd_set *efds)
{
const GPollFD *itr = pfds, *itr_end = pfds + count;
int glib_fds = -1;
@ -92,7 +98,12 @@ _ecore_glib_context_poll_from(const GPollFD *pfds, int count, fd_set *rfds, fd_s
}
static int
_ecore_glib_context_poll_to(GPollFD *pfds, int count, const fd_set *rfds, const fd_set *wfds, const fd_set *efds, int ready)
_ecore_glib_context_poll_to(GPollFD *pfds,
int count,
const fd_set *rfds,
const fd_set *wfds,
const fd_set *efds,
int ready)
{
GPollFD *itr = pfds, *itr_end = pfds + count;
@ -119,7 +130,12 @@ _ecore_glib_context_poll_to(GPollFD *pfds, int count, const fd_set *rfds, const
}
static int
_ecore_glib_select__locked(GMainContext *ctx, int ecore_fds, fd_set *rfds, fd_set *wfds, fd_set *efds, struct timeval *ecore_timeout)
_ecore_glib_select__locked(GMainContext *ctx,
int ecore_fds,
fd_set *rfds,
fd_set *wfds,
fd_set *efds,
struct timeval *ecore_timeout)
{
int priority, maxfds, glib_fds, reqfds, reqtimeout, ret;
struct timeval *timeout, glib_timeout;
@ -161,7 +177,11 @@ _ecore_glib_select__locked(GMainContext *ctx, int ecore_fds, fd_set *rfds, fd_se
}
static int
_ecore_glib_select(int ecore_fds, fd_set *rfds, fd_set *wfds, fd_set *efds, struct timeval *ecore_timeout)
_ecore_glib_select(int ecore_fds,
fd_set *rfds,
fd_set *wfds,
fd_set *efds,
struct timeval *ecore_timeout)
{
GStaticMutex lock = G_STATIC_MUTEX_INIT;
GMutex *mutex = g_static_mutex_get_mutex(&lock);
@ -187,6 +207,7 @@ _ecore_glib_select(int ecore_fds, fd_set *rfds, fd_set *wfds, fd_set *efds, stru
return ret;
}
#endif
void

View File

@ -7,7 +7,6 @@
#include "Ecore.h"
#include "ecore_private.h"
struct _Ecore_Idle_Enterer
{
EINA_INLIST;
@ -18,7 +17,6 @@ struct _Ecore_Idle_Enterer
Eina_Bool delete_me : 1;
};
static Ecore_Idle_Enterer *idle_enterers = NULL;
static Ecore_Idle_Enterer *idle_enterer_current = NULL;
static int idle_enterers_delete_me = 0;
@ -43,7 +41,8 @@ _ecore_idle_enterer_del(Ecore_Idle_Enterer *idle_enterer);
* (or ECORE_CALLBACK_CANCEL) deletes the idle enterer.
*/
EAPI Ecore_Idle_Enterer *
ecore_idle_enterer_add(Ecore_Task_Cb func, const void *data)
ecore_idle_enterer_add(Ecore_Task_Cb func,
const void *data)
{
Ecore_Idle_Enterer *ie = NULL;
@ -72,7 +71,8 @@ unlock:
* (or ECORE_CALLBACK_CANCEL) deletes the idle enterer.
*/
EAPI Ecore_Idle_Enterer *
ecore_idle_enterer_before_add(Ecore_Task_Cb func, const void *data)
ecore_idle_enterer_before_add(Ecore_Task_Cb func,
const void *data)
{
Ecore_Idle_Enterer *ie = NULL;
@ -126,7 +126,6 @@ _ecore_idle_enterer_del(Ecore_Idle_Enterer *idle_enterer)
return idle_enterer->data;
}
void
_ecore_idle_enterer_shutdown(void)
{
@ -205,3 +204,4 @@ _ecore_idle_enterer_exist(void)
if (idle_enterers) return 1;
return 0;
}

View File

@ -7,7 +7,6 @@
#include "Ecore.h"
#include "ecore_private.h"
struct _Ecore_Idle_Exiter
{
EINA_INLIST;
@ -18,7 +17,6 @@ struct _Ecore_Idle_Exiter
Eina_Bool delete_me : 1;
};
static Ecore_Idle_Exiter *idle_exiters = NULL;
static Ecore_Idle_Exiter *idle_exiter_current = NULL;
static int idle_exiters_delete_me = 0;
@ -42,7 +40,8 @@ _ecore_idle_exiter_del(Ecore_Idle_Exiter *idle_exiter);
* (or ECORE_CALLBACK_CANCEL) deletes the idle exiter.
*/
EAPI Ecore_Idle_Exiter *
ecore_idle_exiter_add(Ecore_Task_Cb func, const void *data)
ecore_idle_exiter_add(Ecore_Task_Cb func,
const void *data)
{
Ecore_Idle_Exiter *ie = NULL;
@ -174,3 +173,4 @@ _ecore_idle_exiter_exist(void)
if (idle_exiters) return 1;
return 0;
}

View File

@ -7,7 +7,6 @@
#include "Ecore.h"
#include "ecore_private.h"
struct _Ecore_Idler
{
EINA_INLIST;
@ -18,7 +17,6 @@ struct _Ecore_Idler
Eina_Bool delete_me : 1;
};
static Ecore_Idler *idlers = NULL;
static Ecore_Idler *idler_current = NULL;
static int idlers_delete_me = 0;
@ -27,7 +25,8 @@ static void *
_ecore_idler_del(Ecore_Idler *idler);
EAPI Ecore_Idler *
ecore_idler_add(Ecore_Task_Cb func, const void *data)
ecore_idler_add(Ecore_Task_Cb func,
const void *data)
{
Ecore_Idler *ie = NULL;
@ -79,7 +78,6 @@ _ecore_idler_del(Ecore_Idler *idler)
return idler->data;
}
void
_ecore_idler_shutdown(void)
{
@ -157,3 +155,4 @@ _ecore_idler_exist(void)
if (idlers) return 1;
return 0;
}

View File

@ -7,8 +7,11 @@
#include "Ecore.h"
#include "ecore_private.h"
static Eina_Bool _ecore_job_event_handler(void *data, int type, void *ev);
static void _ecore_job_event_free(void *data, void *ev);
static Eina_Bool _ecore_job_event_handler(void *data,
int type,
void *ev);
static void _ecore_job_event_free(void *data,
void *ev);
static int ecore_event_job_type = 0;
static Ecore_Event_Handler *_ecore_job_handler = NULL;
@ -51,7 +54,8 @@ _ecore_job_shutdown(void)
* @note Once the job has been executed, the job handle is invalid.
*/
EAPI Ecore_Job *
ecore_job_add(Ecore_Cb func, const void *data)
ecore_job_add(Ecore_Cb func,
const void *data)
{
Ecore_Job *job;
@ -98,7 +102,9 @@ ecore_job_del(Ecore_Job *job)
*/
static Eina_Bool
_ecore_job_event_handler(void *data __UNUSED__, int type __UNUSED__, void *ev)
_ecore_job_event_handler(void *data __UNUSED__,
int type __UNUSED__,
void *ev)
{
Ecore_Job *job;
@ -108,7 +114,9 @@ _ecore_job_event_handler(void *data __UNUSED__, int type __UNUSED__, void *ev)
}
static void
_ecore_job_event_free(void *data __UNUSED__, void *ev)
_ecore_job_event_free(void *data __UNUSED__,
void *ev)
{
free(ev);
}

View File

@ -79,7 +79,8 @@ typedef union epoll_data {
uint64_t u64;
} epoll_data_t;
struct epoll_event {
struct epoll_event
{
uint32_t events;
epoll_data_t data;
};
@ -91,14 +92,18 @@ epoll_create(int size __UNUSED__)
}
static inline int
epoll_wait(int epfd __UNUSED__, struct epoll_event *events __UNUSED__,
int maxevents __UNUSED__, int timeout __UNUSED__)
epoll_wait(int epfd __UNUSED__,
struct epoll_event *events __UNUSED__,
int maxevents __UNUSED__,
int timeout __UNUSED__)
{
return -1;
}
static inline int
epoll_ctl(int epfd __UNUSED__, int op __UNUSED__, int fd __UNUSED__,
epoll_ctl(int epfd __UNUSED__,
int op __UNUSED__,
int fd __UNUSED__,
struct epoll_event *event __UNUSED__)
{
return -1;
@ -117,17 +122,21 @@ epoll_ctl(int epfd __UNUSED__, int op __UNUSED__, int fd __UNUSED__,
#define TFD_NONBLOCK 0 /* bogus value */
#endif
static inline int
timerfd_create(int clockid __UNUSED__, int flags __UNUSED__)
timerfd_create(int clockid __UNUSED__,
int flags __UNUSED__)
{
return -1;
}
static inline int
timerfd_settime(int fd __UNUSED__, int flags __UNUSED__,
timerfd_settime(int fd __UNUSED__,
int flags __UNUSED__,
const struct itimerspec *new_value __UNUSED__,
struct itimerspec *old_value __UNUSED__)
{
return -1;
}
#endif /* HAVE_SYS_TIMERFD_H */
#ifdef USE_G_MAIN_LOOP
@ -172,7 +181,6 @@ struct _Ecore_Win32_Handler
};
#endif
#ifndef USE_G_MAIN_LOOP
static int _ecore_main_select(double timeout);
#endif
@ -190,8 +198,11 @@ static void _ecore_main_loop_iterate_internal(int once_only);
#endif
#ifdef _WIN32
static int _ecore_main_win32_select(int nfds, fd_set *readfds, fd_set *writefds,
fd_set *exceptfds, struct timeval *timeout);
static int _ecore_main_win32_select(int nfds,
fd_set *readfds,
fd_set *writefds,
fd_set *exceptfds,
struct timeval *timeout);
static void _ecore_main_win32_handlers_cleanup(void);
#endif
@ -291,7 +302,10 @@ _ecore_get_epoll_fd(void)
}
static inline int
_ecore_epoll_add(int efd, int fd, int events, void *ptr)
_ecore_epoll_add(int efd,
int fd,
int events,
void *ptr)
{
struct epoll_event ev;
@ -322,6 +336,7 @@ _gfd_events_from_fdh(Ecore_Fd_Handler *fdh)
if (fdh->flags & ECORE_FD_ERROR) events |= G_IO_ERR;
return events;
}
#endif
static inline int
@ -412,7 +427,8 @@ _ecore_main_fdh_poll_modify(Ecore_Fd_Handler *fdh)
return r;
}
static inline int _ecore_main_fdh_epoll_mark_active(void)
static inline int
_ecore_main_fdh_epoll_mark_active(void)
{
struct epoll_event ev[32];
int i, ret;
@ -459,7 +475,8 @@ static inline int _ecore_main_fdh_epoll_mark_active(void)
#ifdef USE_G_MAIN_LOOP
static inline int _ecore_main_fdh_glib_mark_active(void)
static inline int
_ecore_main_fdh_glib_mark_active(void)
{
Ecore_Fd_Handler *fdh;
int ret = 0;
@ -487,7 +504,8 @@ static inline int _ecore_main_fdh_glib_mark_active(void)
/* like we are about to enter main_loop_select in _ecore_main_select */
static gboolean
_ecore_main_gsource_prepare(GSource *source __UNUSED__, gint *next_time)
_ecore_main_gsource_prepare(GSource *source __UNUSED__,
gint *next_time)
{
gboolean ready = FALSE;
@ -628,7 +646,9 @@ _ecore_main_gsource_check(GSource *source __UNUSED__)
/* like we just came out of main_loop_select in _ecore_main_select */
static gboolean
_ecore_main_gsource_dispatch(GSource *source __UNUSED__, GSourceFunc callback __UNUSED__, gpointer user_data __UNUSED__)
_ecore_main_gsource_dispatch(GSource *source __UNUSED__,
GSourceFunc callback __UNUSED__,
gpointer user_data __UNUSED__)
{
gboolean events_ready, timers_ready, idlers_ready;
double next_time;
@ -951,8 +971,12 @@ ecore_main_loop_select_func_get(void)
* @ingroup Ecore_FD_Handler_Group
*/
EAPI Ecore_Fd_Handler *
ecore_main_fd_handler_add(int fd, Ecore_Fd_Handler_Flags flags, Ecore_Fd_Cb func, const void *data,
Ecore_Fd_Cb buf_func, const void *buf_data)
ecore_main_fd_handler_add(int fd,
Ecore_Fd_Handler_Flags flags,
Ecore_Fd_Cb func,
const void *data,
Ecore_Fd_Cb buf_func,
const void *buf_data)
{
Ecore_Fd_Handler *fdh = NULL;
@ -994,7 +1018,9 @@ unlock:
#ifdef _WIN32
EAPI Ecore_Win32_Handler *
ecore_main_win32_handler_add(void *h, Ecore_Win32_Handle_Cb func, const void *data)
ecore_main_win32_handler_add(void *h,
Ecore_Win32_Handle_Cb func,
const void *data)
{
Ecore_Win32_Handler *wh;
@ -1012,15 +1038,17 @@ ecore_main_win32_handler_add(void *h, Ecore_Win32_Handle_Cb func, const void *da
EINA_INLIST_GET(wh));
return wh;
}
#else
EAPI Ecore_Win32_Handler *
ecore_main_win32_handler_add(void *h __UNUSED__, Ecore_Win32_Handle_Cb func __UNUSED__,
ecore_main_win32_handler_add(void *h __UNUSED__,
Ecore_Win32_Handle_Cb func __UNUSED__,
const void *data __UNUSED__)
{
return NULL;
}
#endif
#endif
/**
* Marks an FD handler for deletion.
@ -1069,12 +1097,14 @@ ecore_main_win32_handler_del(Ecore_Win32_Handler *win32_handler)
win32_handlers_delete_me = EINA_TRUE;
return win32_handler->data;
}
#else
EAPI void *
ecore_main_win32_handler_del(Ecore_Win32_Handler *win32_handler __UNUSED__)
{
return NULL;
}
#endif
/**
@ -1096,7 +1126,9 @@ ecore_main_win32_handler_del(Ecore_Win32_Handler *win32_handler __UNUSED__)
* @ingroup Ecore_FD_Handler_Group
*/
EAPI void
ecore_main_fd_handler_prepare_callback_set(Ecore_Fd_Handler *fd_handler, Ecore_Fd_Prep_Cb func, const void *data)
ecore_main_fd_handler_prepare_callback_set(Ecore_Fd_Handler *fd_handler,
Ecore_Fd_Prep_Cb func,
const void *data)
{
_ecore_lock();
@ -1151,7 +1183,8 @@ unlock:
* @ingroup Ecore_FD_Handler_Group
*/
EAPI Eina_Bool
ecore_main_fd_handler_active_get(Ecore_Fd_Handler *fd_handler, Ecore_Fd_Handler_Flags flags)
ecore_main_fd_handler_active_get(Ecore_Fd_Handler *fd_handler,
Ecore_Fd_Handler_Flags flags)
{
int ret = EINA_FALSE;
@ -1178,7 +1211,8 @@ unlock:
* @ingroup Ecore_FD_Handler_Group
*/
EAPI void
ecore_main_fd_handler_active_set(Ecore_Fd_Handler *fd_handler, Ecore_Fd_Handler_Flags flags)
ecore_main_fd_handler_active_set(Ecore_Fd_Handler *fd_handler,
Ecore_Fd_Handler_Flags flags)
{
int ret;
@ -1362,7 +1396,8 @@ _ecore_main_select(double timeout)
{
#ifndef _WIN32
if (errno == EINTR) return -1;
else if (errno == EBADF) _ecore_main_fd_handlers_bads_rem();
else if (errno == EBADF)
_ecore_main_fd_handlers_bads_rem();
#endif
}
if (ret > 0)
@ -1396,6 +1431,7 @@ _ecore_main_select(double timeout)
}
return 0;
}
#endif
#ifndef _WIN32
@ -1456,6 +1492,7 @@ _ecore_main_fd_handlers_bads_rem(void)
}
_ecore_main_fd_handlers_cleanup();
}
# endif
#endif
@ -1519,6 +1556,7 @@ _ecore_main_win32_handlers_cleanup(void)
}
if (!deleted_in_use) win32_handlers_delete_me = EINA_FALSE;
}
#endif
static void
@ -1549,7 +1587,6 @@ _ecore_main_fd_handlers_call(void)
fdh->delete_me = EINA_TRUE;
fd_handlers_to_delete = eina_list_append(fd_handlers_to_delete, fdh);
}
}
fdh->references--;
_ecore_fd_valid();
@ -1782,7 +1819,6 @@ start_loop: /***************************************************************/
}
_ecore_fps_marker_2();
/* actually wake up and deal with input, events etc. */
process_all: /***********************************************************/
@ -1809,12 +1845,16 @@ process_all: /***********************************************************/
done: /*******************************************************************/
in_main_loop--;
}
#endif
#ifdef _WIN32
static int
_ecore_main_win32_select(int nfds __UNUSED__, fd_set *readfds, fd_set *writefds,
fd_set *exceptfds, struct timeval *tv)
_ecore_main_win32_select(int nfds __UNUSED__,
fd_set *readfds,
fd_set *writefds,
fd_set *exceptfds,
struct timeval *tv)
{
HANDLE objects[MAXIMUM_WAIT_OBJECTS];
int sockets[MAXIMUM_WAIT_OBJECTS];
@ -1972,4 +2012,5 @@ _ecore_main_win32_select(int nfds __UNUSED__, fd_set *readfds, fd_set *writefds,
return res;
}
#endif

View File

@ -86,9 +86,8 @@ struct _Ecore_Pipe
Eina_Bool delete_me : 1;
};
static Eina_Bool _ecore_pipe_read(void *data, Ecore_Fd_Handler *fd_handler);
static Eina_Bool _ecore_pipe_read(void *data,
Ecore_Fd_Handler *fd_handler);
/**
* @addtogroup Ecore_Pipe_Group
@ -108,7 +107,8 @@ static Eina_Bool _ecore_pipe_read(void *data, Ecore_Fd_Handler *fd_handler);
* @c NULL otherwise.
*/
EAPI Ecore_Pipe *
ecore_pipe_add(Ecore_Pipe_Cb handler, const void *data)
ecore_pipe_add(Ecore_Pipe_Cb handler,
const void *data)
{
Ecore_Pipe *p;
int fds[2];
@ -250,7 +250,9 @@ ecore_pipe_thaw(Ecore_Pipe *p)
* Negative value for @p wait means infite wait.
*/
EAPI int
ecore_pipe_wait(Ecore_Pipe *p, int message_count, double wait)
ecore_pipe_wait(Ecore_Pipe *p,
int message_count,
double wait)
{
struct timeval tv, *t;
fd_set rset;
@ -356,7 +358,9 @@ ecore_pipe_write_close(Ecore_Pipe *p)
* @return Returns EINA_TRUE on a successful write, EINA_FALSE on an error
*/
EAPI Eina_Bool
ecore_pipe_write(Ecore_Pipe *p, const void *buffer, unsigned int nbytes)
ecore_pipe_write(Ecore_Pipe *p,
const void *buffer,
unsigned int nbytes)
{
ssize_t ret;
size_t already_written = 0;
@ -459,7 +463,8 @@ _ecore_pipe_unhandle(Ecore_Pipe *p)
}
static Eina_Bool
_ecore_pipe_read(void *data, Ecore_Fd_Handler *fd_handler __UNUSED__)
_ecore_pipe_read(void *data,
Ecore_Fd_Handler *fd_handler __UNUSED__)
{
Ecore_Pipe *p = (Ecore_Pipe *)data;
int i;
@ -664,3 +669,4 @@ _ecore_pipe_read(void *data, Ecore_Fd_Handler *fd_handler __UNUSED__)
_ecore_pipe_unhandle(p);
return ECORE_CALLBACK_RENEW;
}

View File

@ -7,7 +7,6 @@
#include "Ecore.h"
#include "ecore_private.h"
struct _Ecore_Poller
{
EINA_INLIST;
@ -18,7 +17,6 @@ struct _Ecore_Poller
void *data;
};
static Ecore_Timer *timer = NULL;
static int min_interval = -1;
static int interval_incr = 0;
@ -196,7 +194,6 @@ _ecore_poller_cb_timer(void *data __UNUSED__)
* @{
*/
/**
* Sets the time between ticks (in seconds) for the given ticker clock.
* @param type The ticker type to adjust
@ -206,7 +203,8 @@ _ecore_poller_cb_timer(void *data __UNUSED__)
* by @p type to the time period defined by @p poll_time.
*/
EAPI void
ecore_poller_poll_interval_set(Ecore_Poller_Type type __UNUSED__, double poll_time)
ecore_poller_poll_interval_set(Ecore_Poller_Type type __UNUSED__,
double poll_time)
{
poll_interval = poll_time;
_ecore_poller_next_tick_eval();
@ -272,7 +270,10 @@ ecore_poller_poll_interval_get(Ecore_Poller_Type type __UNUSED__)
* invalid.
*/
EAPI Ecore_Poller *
ecore_poller_add(Ecore_Poller_Type type __UNUSED__, int interval, Ecore_Task_Cb func, const void *data)
ecore_poller_add(Ecore_Poller_Type type __UNUSED__,
int interval,
Ecore_Task_Cb func,
const void *data)
{
Ecore_Poller *poller;
int ibit;
@ -316,7 +317,8 @@ ecore_poller_add(Ecore_Poller_Type type __UNUSED__, int interval, Ecore_Task_Cb
* a poll rate without deleting and re-creating a poller.
*/
EAPI Eina_Bool
ecore_poller_poller_interval_set(Ecore_Poller *poller, int interval)
ecore_poller_poller_interval_set(Ecore_Poller *poller,
int interval)
{
int ibit;
@ -435,3 +437,4 @@ _ecore_poller_shutdown(void)
}
}
}

View File

@ -79,7 +79,6 @@ extern int _ecore_log_dom ;
#define ECORE_MAGIC_WIN32_HANDLER 0xf7e8f1a3
#define ECORE_MAGIC_JOB 0x76543210
#define ECORE_MAGIC Ecore_Magic __magic
#define ECORE_MAGIC_SET(d, m) (d)->__magic = (m)
@ -96,7 +95,9 @@ extern int _ecore_log_dom ;
#undef IF_FN_DEL
#define IF_FN_DEL(_fn, ptr) if (ptr) { _fn(ptr); ptr = NULL; }
EAPI void ecore_print_warning(const char *function, const char *sparam);
EAPI void
ecore_print_warning(const char *function,
const char *sparam);
/* convenience macros for checking pointer parameters for non-NULL */
#undef CHECK_PARAM_POINTER_RETURN
@ -117,13 +118,19 @@ EAPI void ecore_print_warning(const char *function, const char *sparam);
typedef unsigned int Ecore_Magic;
EAPI void _ecore_magic_fail(const void *d, Ecore_Magic m, Ecore_Magic req_m, const char *fname);
EAPI void _ecore_magic_fail(const void *d,
Ecore_Magic m,
Ecore_Magic req_m,
const char *fname);
void _ecore_time_init(void);
Ecore_Timer *_ecore_timer_loop_add(double in, Ecore_Task_Cb func, const void *data);
Ecore_Timer *_ecore_timer_loop_add(double in,
Ecore_Task_Cb func,
const void *data);
void *_ecore_timer_del(Ecore_Timer *timer);
void _ecore_timer_delay(Ecore_Timer *timer, double add);
void _ecore_timer_delay(Ecore_Timer *timer,
double add);
void _ecore_timer_shutdown(void);
void _ecore_timer_cleanup(void);
void _ecore_timer_enable_new(void);
@ -147,12 +154,16 @@ int _ecore_idle_exiter_exist(void);
void _ecore_event_shutdown(void);
int _ecore_event_exist(void);
Ecore_Event *_ecore_event_add(int type, void *ev, Ecore_End_Cb func_free, void *data);
Ecore_Event *_ecore_event_add(int type,
void *ev,
Ecore_End_Cb func_free,
void *data);
void _ecore_event_call(void);
void *_ecore_event_handler_del(Ecore_Event_Handler *event_handler);
Ecore_Timer *_ecore_exe_doomsday_clock_get(Ecore_Exe *exe);
void _ecore_exe_doomsday_clock_set(Ecore_Exe *exe, Ecore_Timer *dc);
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);
@ -166,10 +177,15 @@ void _ecore_main_shutdown(void);
#if defined (_WIN32) || defined (__lv2ppu__)
static inline void _ecore_signal_shutdown(void) { }
static inline void _ecore_signal_init(void) { }
static inline void _ecore_signal_received_process(void) { }
static inline int _ecore_signal_count_get(void) { return 0; }
static inline void _ecore_signal_call(void) { }
#else
void _ecore_signal_shutdown(void);
void _ecore_signal_init(void);
@ -183,7 +199,8 @@ void _ecore_exe_shutdown(void);
#ifndef _WIN32
Ecore_Exe *_ecore_exe_find(pid_t pid);
void *_ecore_exe_event_del_new(void);
void _ecore_exe_event_del_free(void *data, void *ev);
void _ecore_exe_event_del_free(void *data,
void *ev);
#endif
void _ecore_animator_shutdown(void);
@ -238,7 +255,8 @@ _ecore_unlock(void)
* Callback wrappers all assume that ecore _ecore_lock has been called
*/
static inline Eina_Bool
_ecore_call_task_cb(Ecore_Task_Cb func, void *data)
_ecore_call_task_cb(Ecore_Task_Cb func,
void *data)
{
Eina_Bool r;
@ -250,7 +268,8 @@ _ecore_call_task_cb(Ecore_Task_Cb func, void *data)
}
static inline void *
_ecore_call_data_cb(Ecore_Data_Cb func, void *data)
_ecore_call_data_cb(Ecore_Data_Cb func,
void *data)
{
void *r;
@ -262,7 +281,9 @@ _ecore_call_data_cb(Ecore_Data_Cb func, void *data)
}
static inline void
_ecore_call_end_cb(Ecore_End_Cb func, void *user_data, void *func_data)
_ecore_call_end_cb(Ecore_End_Cb func,
void *user_data,
void *func_data)
{
_ecore_unlock();
func(user_data, func_data);
@ -270,8 +291,11 @@ _ecore_call_end_cb(Ecore_End_Cb func, void *user_data, void *func_data)
}
static inline Eina_Bool
_ecore_call_filter_cb(Ecore_Filter_Cb func, void *data,
void *loop_data, int type, void *event)
_ecore_call_filter_cb(Ecore_Filter_Cb func,
void *data,
void *loop_data,
int type,
void *event)
{
Eina_Bool r;
@ -283,7 +307,10 @@ _ecore_call_filter_cb(Ecore_Filter_Cb func, void *data,
}
static inline Eina_Bool
_ecore_call_handler_cb(Ecore_Event_Handler_Cb func, void *data, int type, void *event)
_ecore_call_handler_cb(Ecore_Event_Handler_Cb func,
void *data,
int type,
void *event)
{
Eina_Bool r;
@ -295,7 +322,9 @@ _ecore_call_handler_cb(Ecore_Event_Handler_Cb func, void *data, int type, void *
}
static inline void
_ecore_call_prep_cb(Ecore_Fd_Prep_Cb func, void *data, Ecore_Fd_Handler *fd_handler)
_ecore_call_prep_cb(Ecore_Fd_Prep_Cb func,
void *data,
Ecore_Fd_Handler *fd_handler)
{
_ecore_unlock();
func(data, fd_handler);
@ -303,7 +332,9 @@ _ecore_call_prep_cb(Ecore_Fd_Prep_Cb func, void *data, Ecore_Fd_Handler *fd_hand
}
static inline Eina_Bool
_ecore_call_fd_cb(Ecore_Fd_Cb func, void *data, Ecore_Fd_Handler *fd_handler)
_ecore_call_fd_cb(Ecore_Fd_Cb func,
void *data,
Ecore_Fd_Handler *fd_handler)
{
Eina_Bool r;

View File

@ -18,17 +18,36 @@
typedef void (*Signal_Handler)(int sig, siginfo_t *si, void *foo);
static void _ecore_signal_callback_set(int sig, Signal_Handler func);
static void _ecore_signal_callback_ignore(int sig, siginfo_t *si, void *foo);
static void _ecore_signal_callback_sigchld(int sig, siginfo_t *si, void *foo);
static void _ecore_signal_callback_sigusr1(int sig, siginfo_t *si, void *foo);
static void _ecore_signal_callback_sigusr2(int sig, siginfo_t *si, void *foo);
static void _ecore_signal_callback_sighup(int sig, siginfo_t *si, void *foo);
static void _ecore_signal_callback_sigquit(int sig, siginfo_t *si, void *foo);
static void _ecore_signal_callback_sigint(int sig, siginfo_t *si, void *foo);
static void _ecore_signal_callback_sigterm(int sig, siginfo_t *si, void *foo);
static void _ecore_signal_callback_set(int sig,
Signal_Handler func);
static void _ecore_signal_callback_ignore(int sig,
siginfo_t *si,
void *foo);
static void _ecore_signal_callback_sigchld(int sig,
siginfo_t *si,
void *foo);
static void _ecore_signal_callback_sigusr1(int sig,
siginfo_t *si,
void *foo);
static void _ecore_signal_callback_sigusr2(int sig,
siginfo_t *si,
void *foo);
static void _ecore_signal_callback_sighup(int sig,
siginfo_t *si,
void *foo);
static void _ecore_signal_callback_sigquit(int sig,
siginfo_t *si,
void *foo);
static void _ecore_signal_callback_sigint(int sig,
siginfo_t *si,
void *foo);
static void _ecore_signal_callback_sigterm(int sig,
siginfo_t *si,
void *foo);
#ifdef SIGPWR
static void _ecore_signal_callback_sigpwr(int sig, siginfo_t *si, void *foo);
static void _ecore_signal_callback_sigpwr(int sig,
siginfo_t *si,
void *foo);
#endif
static Eina_Bool _ecore_signal_exe_exit_delay(void *data);
@ -83,7 +102,6 @@ _ecore_signal_shutdown(void)
sigint_count = 0;
sigterm_count = 0;
sig_count = 0;
}
void
@ -364,7 +382,8 @@ _ecore_signal_call(void)
}
static void
_ecore_signal_callback_set(int sig, Signal_Handler func)
_ecore_signal_callback_set(int sig,
Signal_Handler func)
{
struct sigaction sa;
@ -375,12 +394,16 @@ _ecore_signal_callback_set(int sig, Signal_Handler func)
}
static void
_ecore_signal_callback_ignore(int sig __UNUSED__, siginfo_t *si __UNUSED__, void *foo __UNUSED__)
_ecore_signal_callback_ignore(int sig __UNUSED__,
siginfo_t *si __UNUSED__,
void *foo __UNUSED__)
{
}
static void
_ecore_signal_callback_sigchld(int sig __UNUSED__, siginfo_t *si, void *foo __UNUSED__)
_ecore_signal_callback_sigchld(int sig __UNUSED__,
siginfo_t *si,
void *foo __UNUSED__)
{
volatile sig_atomic_t n;
n = sigchld_count;
@ -397,7 +420,9 @@ _ecore_signal_callback_sigchld(int sig __UNUSED__, siginfo_t *si, void *foo __UN
}
static void
_ecore_signal_callback_sigusr1(int sig __UNUSED__, siginfo_t *si, void *foo __UNUSED__)
_ecore_signal_callback_sigusr1(int sig __UNUSED__,
siginfo_t *si,
void *foo __UNUSED__)
{
volatile sig_atomic_t n;
n = sigusr1_count;
@ -413,7 +438,9 @@ _ecore_signal_callback_sigusr1(int sig __UNUSED__, siginfo_t *si, void *foo __UN
}
static void
_ecore_signal_callback_sigusr2(int sig __UNUSED__, siginfo_t *si, void *foo __UNUSED__)
_ecore_signal_callback_sigusr2(int sig __UNUSED__,
siginfo_t *si,
void *foo __UNUSED__)
{
volatile sig_atomic_t n;
n = sigusr2_count;
@ -429,7 +456,9 @@ _ecore_signal_callback_sigusr2(int sig __UNUSED__, siginfo_t *si, void *foo __UN
}
static void
_ecore_signal_callback_sighup(int sig __UNUSED__, siginfo_t *si, void *foo __UNUSED__)
_ecore_signal_callback_sighup(int sig __UNUSED__,
siginfo_t *si,
void *foo __UNUSED__)
{
volatile sig_atomic_t n;
n = sighup_count;
@ -445,7 +474,9 @@ _ecore_signal_callback_sighup(int sig __UNUSED__, siginfo_t *si, void *foo __UNU
}
static void
_ecore_signal_callback_sigquit(int sig __UNUSED__, siginfo_t *si, void *foo __UNUSED__)
_ecore_signal_callback_sigquit(int sig __UNUSED__,
siginfo_t *si,
void *foo __UNUSED__)
{
volatile sig_atomic_t n;
n = sigquit_count;
@ -461,7 +492,9 @@ _ecore_signal_callback_sigquit(int sig __UNUSED__, siginfo_t *si, void *foo __UN
}
static void
_ecore_signal_callback_sigint(int sig __UNUSED__, siginfo_t *si, void *foo __UNUSED__)
_ecore_signal_callback_sigint(int sig __UNUSED__,
siginfo_t *si,
void *foo __UNUSED__)
{
volatile sig_atomic_t n;
n = sigint_count;
@ -477,7 +510,9 @@ _ecore_signal_callback_sigint(int sig __UNUSED__, siginfo_t *si, void *foo __UNU
}
static void
_ecore_signal_callback_sigterm(int sig __UNUSED__, siginfo_t *si, void *foo __UNUSED__)
_ecore_signal_callback_sigterm(int sig __UNUSED__,
siginfo_t *si,
void *foo __UNUSED__)
{
volatile sig_atomic_t n;
n = sigterm_count;
@ -494,7 +529,9 @@ _ecore_signal_callback_sigterm(int sig __UNUSED__, siginfo_t *si, void *foo __UN
#ifdef SIGPWR
static void
_ecore_signal_callback_sigpwr(int sig __UNUSED__, siginfo_t *si, void *foo __UNUSED__)
_ecore_signal_callback_sigpwr(int sig __UNUSED__,
siginfo_t *si,
void *foo __UNUSED__)
{
volatile sig_atomic_t n;
n = sigpwr_count;
@ -508,6 +545,7 @@ _ecore_signal_callback_sigpwr(int sig __UNUSED__, siginfo_t *si, void *foo __UNU
sigpwr_count++;
sig_count++;
}
#endif
static Eina_Bool
@ -524,3 +562,4 @@ _ecore_signal_exe_exit_delay(void *data)
}
return ECORE_CALLBACK_CANCEL;
}

View File

@ -66,7 +66,10 @@ typedef struct
# define PHE(x, y) ((x) == (y))
# define PHS() (HANDLE)GetCurrentThreadId()
int _ecore_thread_win32_create(win32_thread **x, LPTHREAD_START_ROUTINE f, void *d)
int
_ecore_thread_win32_create(win32_thread **x,
LPTHREAD_START_ROUTINE f,
void *d)
{
win32_thread *t;
t = (win32_thread *)calloc(1, sizeof(win32_thread));
@ -84,9 +87,12 @@ int _ecore_thread_win32_create(win32_thread **x, LPTHREAD_START_ROUTINE f, void
return 0;
}
# define PHC(x, f, d) _ecore_thread_win32_create(&(x), (LPTHREAD_START_ROUTINE)f, d)
int _ecore_thread_win32_join(win32_thread *x, void **res)
int
_ecore_thread_win32_join(win32_thread *x,
void **res)
{
if (!PHE(x, PHS()))
{
@ -148,7 +154,10 @@ do { \
LeaveCriticalSection (&x->threads_count_lock); \
} while (0)
int _ecore_thread_win32_cond_timedwait(win32_cond *c, HANDLE *external_mutex, struct timeval *t)
int
_ecore_thread_win32_cond_timedwait(win32_cond *c,
HANDLE *external_mutex,
struct timeval *t)
{
DWORD res;
DWORD val = t->tv_sec * 1000 + (t->tv_usec / 1000);
@ -163,6 +172,7 @@ int _ecore_thread_win32_cond_timedwait(win32_cond *c, HANDLE *external_mutex, st
else
return -1;
}
# define CDW(x, y, t) _ecore_thread_win32_cond_timedwait(x, y, t)
typedef struct
@ -315,10 +325,12 @@ struct _Ecore_Thread_Data
struct _Ecore_Pthread_Worker
{
union {
struct {
struct
{
Ecore_Thread_Cb func_blocking;
} short_run;
struct {
struct
{
Ecore_Thread_Cb func_heavy;
Ecore_Thread_Notify_Cb func_notify;
Ecore_Pipe *notify;
@ -361,14 +373,15 @@ struct _Ecore_Pthread_Data
};
#endif
static int _ecore_thread_count_max = 0;
static int ECORE_THREAD_PIPE_DEL = 0;
static Eina_Array *_ecore_thread_pipe = NULL;
#ifdef EFL_HAVE_THREADS
static void _ecore_thread_handler(void *data __UNUSED__, void *buffer, unsigned int nbyte);
static void _ecore_thread_handler(void *data __UNUSED__,
void *buffer,
unsigned int nbyte);
static Ecore_Pipe *
_ecore_thread_pipe_get(void)
@ -438,7 +451,8 @@ _ecore_thread_data_free(void *data)
}
static void
_ecore_thread_pipe_free(void *data __UNUSED__, void *event)
_ecore_thread_pipe_free(void *data __UNUSED__,
void *event)
{
Ecore_Pipe *p = event;
@ -450,14 +464,17 @@ _ecore_thread_pipe_free(void *data __UNUSED__, void *event)
}
static Eina_Bool
_ecore_thread_pipe_del(void *data __UNUSED__, int type __UNUSED__, void *event __UNUSED__)
_ecore_thread_pipe_del(void *data __UNUSED__,
int type __UNUSED__,
void *event __UNUSED__)
{
/* This is a hack to delay pipe destruction until we are out of its internal loop. */
return ECORE_CALLBACK_CANCEL;
}
static void
_ecore_thread_end(Ecore_Pthread_Data *pth, Ecore_Thread *work)
_ecore_thread_end(Ecore_Pthread_Data *pth,
Ecore_Thread *work)
{
Ecore_Pthread_Worker *worker = (Ecore_Pthread_Worker *)work;
Ecore_Pipe *p;
@ -529,7 +546,9 @@ _ecore_thread_kill(Ecore_Pthread_Worker *work)
}
static void
_ecore_thread_handler(void *data __UNUSED__, void *buffer, unsigned int nbyte)
_ecore_thread_handler(void *data __UNUSED__,
void *buffer,
unsigned int nbyte)
{
Ecore_Pthread_Worker *work;
@ -550,7 +569,9 @@ _ecore_thread_handler(void *data __UNUSED__, void *buffer, unsigned int nbyte)
}
static void
_ecore_notify_handler(void *data, void *buffer, unsigned int nbyte)
_ecore_notify_handler(void *data,
void *buffer,
unsigned int nbyte)
{
Ecore_Pthread_Worker *work = data;
void *user_data;
@ -610,7 +631,8 @@ _ecore_short_job(Ecore_Pipe *end_pipe)
}
static void
_ecore_feedback_job(Ecore_Pipe *end_pipe, PH(thread))
_ecore_feedback_job(Ecore_Pipe *end_pipe,
PH(thread))
{
Ecore_Pthread_Worker *work;
@ -973,7 +995,6 @@ ecore_thread_run(Ecore_Thread_Cb func_blocking,
func_blocking((void *)data, (Ecore_Thread *)work);
if (work->cancel == EINA_FALSE) func_end((void *)data, (Ecore_Thread *)work);
else func_cancel((void *)data, (Ecore_Thread *)work);
} while (work->reschedule == EINA_TRUE);
free(work);
@ -1061,14 +1082,14 @@ ecore_thread_check(Ecore_Thread *thread)
return worker->cancel;
}
EAPI Ecore_Thread *ecore_thread_feedback_run(Ecore_Thread_Cb func_heavy,
EAPI Ecore_Thread *
ecore_thread_feedback_run(Ecore_Thread_Cb func_heavy,
Ecore_Thread_Notify_Cb func_notify,
Ecore_Thread_Cb func_end,
Ecore_Thread_Cb func_cancel,
const void *data,
Eina_Bool try_no_queue)
{
#ifdef EFL_HAVE_THREADS
Ecore_Pthread_Worker *worker;
Ecore_Pthread_Data *pth = NULL;
@ -1206,7 +1227,8 @@ EAPI Ecore_Thread *ecore_thread_feedback_run(Ecore_Thread_Cb func_heavy,
}
EAPI Eina_Bool
ecore_thread_feedback(Ecore_Thread *thread, const void *data)
ecore_thread_feedback(Ecore_Thread *thread,
const void *data)
{
Ecore_Pthread_Worker *worker = (Ecore_Pthread_Worker *)thread;
@ -1331,7 +1353,11 @@ ecore_thread_available_get(void)
}
EAPI Eina_Bool
ecore_thread_local_data_add(Ecore_Thread *thread, const char *key, void *value, Eina_Free_Cb cb, Eina_Bool direct)
ecore_thread_local_data_add(Ecore_Thread *thread,
const char *key,
void *value,
Eina_Free_Cb cb,
Eina_Bool direct)
{
Ecore_Pthread_Worker *worker = (Ecore_Pthread_Worker *)thread;
Ecore_Thread_Data *d;
@ -1366,7 +1392,10 @@ ecore_thread_local_data_add(Ecore_Thread *thread, const char *key, void *value,
}
EAPI void *
ecore_thread_local_data_set(Ecore_Thread *thread, const char *key, void *value, Eina_Free_Cb cb)
ecore_thread_local_data_set(Ecore_Thread *thread,
const char *key,
void *value,
Eina_Free_Cb cb)
{
Ecore_Pthread_Worker *worker = (Ecore_Pthread_Worker *)thread;
Ecore_Thread_Data *d, *r;
@ -1398,9 +1427,9 @@ ecore_thread_local_data_set(Ecore_Thread *thread, const char *key, void *value,
#endif
}
EAPI void *
ecore_thread_local_data_find(Ecore_Thread *thread, const char *key)
ecore_thread_local_data_find(Ecore_Thread *thread,
const char *key)
{
Ecore_Pthread_Worker *worker = (Ecore_Pthread_Worker *)thread;
Ecore_Thread_Data *d;
@ -1423,7 +1452,8 @@ ecore_thread_local_data_find(Ecore_Thread *thread, const char *key)
}
EAPI Eina_Bool
ecore_thread_local_data_del(Ecore_Thread *thread, const char *key)
ecore_thread_local_data_del(Ecore_Thread *thread,
const char *key)
{
Ecore_Pthread_Worker *worker = (Ecore_Pthread_Worker *)thread;
if ((!thread) || (!key))
@ -1440,7 +1470,10 @@ ecore_thread_local_data_del(Ecore_Thread *thread, const char *key)
}
EAPI Eina_Bool
ecore_thread_global_data_add(const char *key, void *value, Eina_Free_Cb cb, Eina_Bool direct)
ecore_thread_global_data_add(const char *key,
void *value,
Eina_Free_Cb cb,
Eina_Bool direct)
{
Eina_Bool ret;
Ecore_Thread_Data *d;
@ -1475,7 +1508,9 @@ ecore_thread_global_data_add(const char *key, void *value, Eina_Free_Cb cb, Eina
}
EAPI void *
ecore_thread_global_data_set(const char *key, void *value, Eina_Free_Cb cb)
ecore_thread_global_data_set(const char *key,
void *value,
Eina_Free_Cb cb)
{
Ecore_Thread_Data *d, *r;
void *ret;
@ -1510,7 +1545,6 @@ ecore_thread_global_data_set(const char *key, void *value, Eina_Free_Cb cb)
#endif
}
EAPI void *
ecore_thread_global_data_find(const char *key)
{
@ -1552,7 +1586,8 @@ ecore_thread_global_data_del(const char *key)
}
EAPI void *
ecore_thread_global_data_wait(const char *key, double seconds)
ecore_thread_global_data_wait(const char *key,
double seconds)
{
double tm = 0;
Ecore_Thread_Data *ret = NULL;
@ -1593,3 +1628,4 @@ ecore_thread_global_data_wait(const char *key, double seconds)
return NULL;
#endif
}

View File

@ -96,3 +96,4 @@ _ecore_throttle(void)
if (throttle_val <= 0) return;
usleep(throttle_val);
}

View File

@ -127,7 +127,6 @@ ecore_loop_time_get(void)
* @}
*/
/********************** Internal methods ********************************/
/* TODO: Documentation says "All implementations support the system-wide
@ -182,3 +181,4 @@ _ecore_time_init(void)
_ecore_time_loop_time = ecore_time_get();
}

View File

@ -36,9 +36,13 @@ struct _Ecore_Timer
unsigned char frozen : 1;
};
static void _ecore_timer_set(Ecore_Timer *timer, double at, double in, Ecore_Task_Cb func, void *data);
static int _ecore_timer_cmp(const void *d1, const void *d2);
static void _ecore_timer_set(Ecore_Timer *timer,
double at,
double in,
Ecore_Task_Cb func,
void *data);
static int _ecore_timer_cmp(const void *d1,
const void *d2);
static int timers_added = 0;
static int timers_delete_me = 0;
@ -48,7 +52,6 @@ static Ecore_Timer *suspended = NULL;
static double last_check = 0.0;
static double precision = 10.0 / 1000000.0;
/**
* @addtogroup Ecore_Time_Group
*
@ -125,7 +128,9 @@ unlock:
* invalid.
*/
EAPI Ecore_Timer *
ecore_timer_add(double in, Ecore_Task_Cb func, const void *data)
ecore_timer_add(double in,
Ecore_Task_Cb func,
const void *data)
{
double now;
Ecore_Timer *timer = NULL;
@ -162,7 +167,9 @@ unlock:
* ecore_timer_add() for more details.
*/
EAPI Ecore_Timer *
ecore_timer_loop_add(double in, Ecore_Task_Cb func, const void *data)
ecore_timer_loop_add(double in,
Ecore_Task_Cb func,
const void *data)
{
Ecore_Timer *timer;
@ -211,7 +218,8 @@ unlock:
* @param in The interval in seconds.
*/
EAPI void
ecore_timer_interval_set(Ecore_Timer *timer, double in)
ecore_timer_interval_set(Ecore_Timer *timer,
double in)
{
_ecore_lock();
@ -261,7 +269,8 @@ unlock:
* @param add The dalay to add to the next iteration.
*/
EAPI void
ecore_timer_delay(Ecore_Timer *timer, double add)
ecore_timer_delay(Ecore_Timer *timer,
double add)
{
if (!ECORE_MAGIC_CHECK(timer, ECORE_MAGIC_TIMER))
{
@ -450,7 +459,9 @@ ecore_timer_dump(void)
*/
Ecore_Timer *
_ecore_timer_loop_add(double in, Ecore_Task_Cb func, const void *data)
_ecore_timer_loop_add(double in,
Ecore_Task_Cb func,
const void *data)
{
double now;
Ecore_Timer *timer = NULL;
@ -471,7 +482,8 @@ _ecore_timer_loop_add(double in, Ecore_Task_Cb func, const void *data)
}
EAPI void
_ecore_timer_delay(Ecore_Timer *timer, double add)
_ecore_timer_delay(Ecore_Timer *timer,
double add)
{
if (timer->frozen)
{
@ -484,7 +496,6 @@ _ecore_timer_delay(Ecore_Timer *timer, double add)
}
}
void *
_ecore_timer_del(Ecore_Timer *timer)
{
@ -656,7 +667,8 @@ _ecore_timer_next_get(void)
}
static inline void
_ecore_timer_reschedule(Ecore_Timer *timer, double when)
_ecore_timer_reschedule(Ecore_Timer *timer,
double when)
{
if ((timer->delete_me) || (timer->frozen)) return;
@ -743,7 +755,11 @@ _ecore_timer_expired_call(double when)
}
static void
_ecore_timer_set(Ecore_Timer *timer, double at, double in, Ecore_Task_Cb func, void *data)
_ecore_timer_set(Ecore_Timer *timer,
double at,
double in,
Ecore_Task_Cb func,
void *data)
{
Ecore_Timer *t2;
@ -770,10 +786,12 @@ _ecore_timer_set(Ecore_Timer *timer, double at, double in, Ecore_Task_Cb func, v
}
static int
_ecore_timer_cmp(const void *d1, const void *d2)
_ecore_timer_cmp(const void *d1,
const void *d2)
{
const Ecore_Timer *t1 = d1;
const Ecore_Timer *t2 = d2;
return (int)((t1->in - t2->in) * 100);
}