forked from enlightenment/efl
parent
e12623ee46
commit
b1f46fb7e8
|
@ -1,4 +1,3 @@
|
|||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
|
|
@ -14,22 +14,22 @@ static double animators_frametime = 1.0 / 30.0;
|
|||
* @param data The data to pass to the function
|
||||
* @return A handle to the new animator
|
||||
* @ingroup Ecore_Animator_Group
|
||||
*
|
||||
*
|
||||
* This function adds a animator and returns its handle on success and NULL on
|
||||
* failure. The function @p func will be called every N seconds where N is the
|
||||
* frametime interval set by ecore_animator_frametime_set(). The function will
|
||||
* be passed the @p data pointer as its parameter.
|
||||
*
|
||||
* When the animator @p func is called, it must return a value of either 1 or 0.
|
||||
* If it returns 1 (or ECORE_CALLBACK_RENEW), it will be called again at the
|
||||
* next tick, or if it returns 0 (or ECORE_CALLBACK_CANCEL) it will be deleted
|
||||
*
|
||||
* When the animator @p func is called, it must return a value of either 1 or 0.
|
||||
* If it returns 1 (or ECORE_CALLBACK_RENEW), it will be called again at the
|
||||
* next tick, or if it returns 0 (or ECORE_CALLBACK_CANCEL) it will be deleted
|
||||
* automatically making any references/handles for it invalid.
|
||||
*/
|
||||
EAPI Ecore_Animator *
|
||||
ecore_animator_add(int (*func) (void *data), const void *data)
|
||||
{
|
||||
Ecore_Animator *animator;
|
||||
|
||||
|
||||
if (!func) return NULL;
|
||||
animator = calloc(1, sizeof(Ecore_Animator));
|
||||
if (!animator) return NULL;
|
||||
|
@ -47,7 +47,7 @@ ecore_animator_add(int (*func) (void *data), const void *data)
|
|||
* @param animator The animator to delete
|
||||
* @return The data pointer set for the animator
|
||||
* @ingroup Ecore_Animator_Group
|
||||
*
|
||||
*
|
||||
* Delete the specified @p aqnimator from the set of animators that are executed
|
||||
* during main loop execution. This function returns the data parameter that
|
||||
* was being passed to the callback on success, or NULL on failure. After this
|
||||
|
@ -72,7 +72,7 @@ ecore_animator_del(Ecore_Animator *animator)
|
|||
/**
|
||||
* Set the animator call interval in seconds.
|
||||
* @param frametime The time in seconds in between animator ticks.
|
||||
*
|
||||
*
|
||||
* This function sets the time interval (in seconds) inbetween animator ticks.
|
||||
*/
|
||||
EAPI void
|
||||
|
@ -93,7 +93,7 @@ ecore_animator_frametime_set(double frametime)
|
|||
/**
|
||||
* Get the animator call interval in seconds.
|
||||
* @return The time in second in between animator ticks.
|
||||
*
|
||||
*
|
||||
* this function retrieves the time inbetween animator ticks, in seconds.
|
||||
*/
|
||||
EAPI double
|
||||
|
@ -109,11 +109,11 @@ _ecore_animator_shutdown(void)
|
|||
{
|
||||
ecore_timer_del(timer);
|
||||
timer = NULL;
|
||||
}
|
||||
}
|
||||
while (animators)
|
||||
{
|
||||
Ecore_Animator *animator;
|
||||
|
||||
|
||||
animator = animators;
|
||||
animators = _ecore_list2_remove(animators, animator);
|
||||
ECORE_MAGIC_SET(animator, ECORE_MAGIC_NONE);
|
||||
|
@ -129,7 +129,7 @@ _ecore_animator(void *data __UNUSED__)
|
|||
for (l = (Ecore_List2 *)animators; l;)
|
||||
{
|
||||
Ecore_Animator *animator;
|
||||
|
||||
|
||||
animator = (Ecore_Animator *)l;
|
||||
l = l->next;
|
||||
if (!animator->delete_me)
|
||||
|
@ -146,7 +146,7 @@ _ecore_animator(void *data __UNUSED__)
|
|||
for (l = (Ecore_List2 *)animators; l;)
|
||||
{
|
||||
Ecore_Animator *animator;
|
||||
|
||||
|
||||
animator = (Ecore_Animator *)l;
|
||||
l = l->next;
|
||||
if (animator->delete_me)
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
@ -17,7 +16,7 @@ static char **app_argv = NULL;
|
|||
* Set up the programs command-line arguments.
|
||||
* @param argc The same as passed as argc to the programs main() function
|
||||
* @param argv The same as passed as argv to the programs main() function
|
||||
*
|
||||
*
|
||||
* A call to this function will store the programs command-line arguments
|
||||
* for later use by ecore_app_restart() or ecore_app_args_get().
|
||||
*/
|
||||
|
@ -34,7 +33,7 @@ ecore_app_args_set(int argc, const char **argv)
|
|||
* Return the programs stored command-line arguments.
|
||||
* @param argc A pointer to the return value to hold argc
|
||||
* @param argv A pointer to the return value to hold argv
|
||||
*
|
||||
*
|
||||
* When called, this funciton returns the arguments for the program stored by
|
||||
* ecore_app_args_set(). The integer pointed to by @p argc will be filled, if
|
||||
* the pointer is not NULL, and the string array pointer @p argv will be filled
|
||||
|
@ -50,7 +49,7 @@ ecore_app_args_get(int *argc, char ***argv)
|
|||
|
||||
/**
|
||||
* Restart the program executable with the command-line arguments stored.
|
||||
*
|
||||
*
|
||||
* This function will restart & re-execute this program in place of itself
|
||||
* using the command-line arguments stored by ecore_app_args_set(). This is
|
||||
* an easy way for a program to restart itself for cleanup purposes,
|
||||
|
@ -61,7 +60,7 @@ ecore_app_restart(void)
|
|||
{
|
||||
char *args[4096];
|
||||
int i;
|
||||
|
||||
|
||||
if ((app_argc < 1) || (!app_argv)) return;
|
||||
if (app_argc >= 4096) return;
|
||||
for (i = 0; i < app_argc; i++) args[i] = app_argv[i];
|
||||
|
|
|
@ -24,21 +24,21 @@ static void *ecore_raw_event_event = NULL;
|
|||
* @param func The function to call when the event is found in the queue
|
||||
* @param data A data pointer to pass to the called function @p func
|
||||
* @return A new Event handler, or NULL on failure
|
||||
*
|
||||
*
|
||||
* Add an event handler to the list of handlers. This will, on success, return
|
||||
* a handle to the event handler object that was created, that can be used
|
||||
* later to remove the handler using ecore_event_handler_del(). The @p type
|
||||
* later to remove the handler using ecore_event_handler_del(). The @p type
|
||||
* parameter is the iteger of the event type that will trigger this callback
|
||||
* to be called. The callback @p func is called when this event is processed
|
||||
* and will be passed the event type, a pointer to the private event
|
||||
* structure that is specific to that event type, and a data pointer that is
|
||||
* structure that is specific to that event type, and a data pointer that is
|
||||
* provided in this call as the @p data parameter.
|
||||
*
|
||||
* When the callback @p func is called, it must return 1 or 0. If it returns
|
||||
* 1 (or ECORE_CALLBACK_RENEW), It will keep being called as per normal, for
|
||||
* each handler set up for that event type. If it returns 0 (or
|
||||
*
|
||||
* When the callback @p func is called, it must return 1 or 0. If it returns
|
||||
* 1 (or ECORE_CALLBACK_RENEW), It will keep being called as per normal, for
|
||||
* each handler set up for that event type. If it returns 0 (or
|
||||
* ECORE_CALLBACK_CANCEL), it will cease processing handlers for that particular
|
||||
* event, so all handler set to handle that event type that have not already
|
||||
* event, so all handler set to handle that event type that have not already
|
||||
* been called, will not be.
|
||||
*/
|
||||
EAPI Ecore_Event_Handler *
|
||||
|
@ -57,14 +57,14 @@ ecore_event_handler_add(int type, int (*func) (void *data, int type, void *event
|
|||
if (type >= (event_handlers_num - 1))
|
||||
{
|
||||
int p_alloc_num;
|
||||
|
||||
|
||||
p_alloc_num = event_handlers_alloc_num;
|
||||
event_handlers_num = type + 1;
|
||||
if (event_handlers_num > event_handlers_alloc_num)
|
||||
{
|
||||
Ecore_Event_Handler **new_handlers;
|
||||
int i;
|
||||
|
||||
|
||||
event_handlers_alloc_num = ((event_handlers_num + 16) / 16) * 16;
|
||||
new_handlers = realloc(event_handlers, event_handlers_alloc_num * sizeof(Ecore_Event_Handler *));
|
||||
if (!new_handlers)
|
||||
|
@ -85,7 +85,7 @@ ecore_event_handler_add(int type, int (*func) (void *data, int type, void *event
|
|||
* Delete an event handler.
|
||||
* @param event_handler Event handler handle to delete
|
||||
* @return Data passed to handler
|
||||
*
|
||||
*
|
||||
* Delete a specified event handler from the handler list. On success this will
|
||||
* delete the event handler and return the pointer passed as @p data when the
|
||||
* handler was added by ecore_event_handler_add(). On failure NULL will be
|
||||
|
@ -95,8 +95,8 @@ EAPI void *
|
|||
ecore_event_handler_del(Ecore_Event_Handler *event_handler)
|
||||
{
|
||||
Ecore_List2_Data *node;
|
||||
|
||||
if (!ECORE_MAGIC_CHECK(event_handler, ECORE_MAGIC_EVENT_HANDLER))
|
||||
|
||||
if (!ECORE_MAGIC_CHECK(event_handler, ECORE_MAGIC_EVENT_HANDLER))
|
||||
{
|
||||
ECORE_MAGIC_FAIL(event_handler, ECORE_MAGIC_EVENT_HANDLER,
|
||||
"ecore_event_handler_del");
|
||||
|
@ -109,7 +109,7 @@ ecore_event_handler_del(Ecore_Event_Handler *event_handler)
|
|||
return event_handler->data;
|
||||
}
|
||||
|
||||
static void
|
||||
static void
|
||||
_ecore_event_generic_free (void *data __UNUSED__, void *event)
|
||||
{
|
||||
free (event);
|
||||
|
@ -122,10 +122,10 @@ _ecore_event_generic_free (void *data __UNUSED__, void *event)
|
|||
* @param func_free The function to be called to free this private structure
|
||||
* @param data The data pointer to be passed to the free function
|
||||
* @return A Handle for that event
|
||||
*
|
||||
*
|
||||
* On success this function returns a handle to an event on the event queue, or
|
||||
* NULL if it fails. If it succeeds, an event of type @p type will be added
|
||||
* to the queue for processing by event handlers added by
|
||||
* to the queue for processing by event handlers added by
|
||||
* ecore_event_handler_add(). The @p ev parameter will be a pointer to the event
|
||||
* private data that is specific to that event type. When the event is no
|
||||
* longer needed, @p func_free will be called and passed the private structure
|
||||
|
@ -147,7 +147,7 @@ ecore_event_add(int type, void *ev, void (*func_free) (void *data, void *ev), vo
|
|||
* Delete an event from the queue.
|
||||
* @param event The event handle to delete
|
||||
* @return The data pointer originally set for the event free function
|
||||
*
|
||||
*
|
||||
* This deletes the event @p event from the event queue, and returns the
|
||||
* @p data parameer originally set when adding it with ecore_event_add(). This
|
||||
* does not immediately call the free function, and it may be called later on
|
||||
|
@ -157,9 +157,9 @@ ecore_event_add(int type, void *ev, void (*func_free) (void *data, void *ev), vo
|
|||
EAPI void *
|
||||
ecore_event_del(Ecore_Event *event)
|
||||
{
|
||||
if (!ECORE_MAGIC_CHECK(event, ECORE_MAGIC_EVENT))
|
||||
if (!ECORE_MAGIC_CHECK(event, ECORE_MAGIC_EVENT))
|
||||
{
|
||||
ECORE_MAGIC_FAIL(event, ECORE_MAGIC_EVENT, "ecore_event_del");
|
||||
ECORE_MAGIC_FAIL(event, ECORE_MAGIC_EVENT, "ecore_event_del");
|
||||
return NULL;
|
||||
}
|
||||
event->delete_me = 1;
|
||||
|
@ -169,8 +169,8 @@ ecore_event_del(Ecore_Event *event)
|
|||
/**
|
||||
* Allocate a new event type id sensibly and return the new id.
|
||||
* @return A new event type id.
|
||||
*
|
||||
* This function allocates a new event type id and returns it. Once an event
|
||||
*
|
||||
* This function allocates a new event type id and returns it. Once an event
|
||||
* type has been allocated it can never be de-allocated during the life of
|
||||
* the program. There is no guarantee of the contents of this event ID, or how
|
||||
* it is calculated, except that the ID will be unique to the current instance
|
||||
|
@ -190,8 +190,8 @@ ecore_event_type_new(void)
|
|||
* @param func_end Function to call after the queu has been filtered
|
||||
* @param data Data to pass to the filter functions
|
||||
* @return A filter handle
|
||||
*
|
||||
* This adds a filter to call callbacks to loop through the event queue and
|
||||
*
|
||||
* This adds a filter to call callbacks to loop through the event queue and
|
||||
* filter events out of the queue. On failure NULL is returned. On success a
|
||||
* Filter handle is returned. Filters are called on the queue just before
|
||||
* Event handler processing to try and remove redundant events. Just as
|
||||
|
@ -207,7 +207,7 @@ EAPI Ecore_Event_Filter *
|
|||
ecore_event_filter_add(void * (*func_start) (void *data), int (*func_filter) (void *data, void *loop_data, int type, void *event), void (*func_end) (void *data, void *loop_data), const void *data)
|
||||
{
|
||||
Ecore_Event_Filter *ef;
|
||||
|
||||
|
||||
if (!func_filter) return NULL;
|
||||
ef = calloc(1, sizeof(Ecore_Event_Filter));
|
||||
if (!ef) return NULL;
|
||||
|
@ -224,14 +224,14 @@ ecore_event_filter_add(void * (*func_start) (void *data), int (*func_filter) (vo
|
|||
* Delete an event filter.
|
||||
* @param ef The event filter handle
|
||||
* @return The data set for the filter
|
||||
*
|
||||
*
|
||||
* Delete a filter that has been added by its @p ef handle. On success this
|
||||
* will return the data pointer set when this filter was added. On failure
|
||||
* NULL is returned.
|
||||
*/
|
||||
EAPI void *
|
||||
ecore_event_filter_del(Ecore_Event_Filter *ef)
|
||||
{
|
||||
{
|
||||
if (!ECORE_MAGIC_CHECK(ef, ECORE_MAGIC_EVENT_FILTER))
|
||||
{
|
||||
ECORE_MAGIC_FAIL(ef, ECORE_MAGIC_EVENT_FILTER, "ecore_event_filter_del");
|
||||
|
@ -245,11 +245,11 @@ ecore_event_filter_del(Ecore_Event_Filter *ef)
|
|||
/**
|
||||
* Return the current event type being handled.
|
||||
* @return The current event type being handled if inside a handler callback
|
||||
*
|
||||
*
|
||||
* If the program is currently inside an Ecore event handler callback this
|
||||
* will return the type of the current event being processed. If Ecore is
|
||||
* not inside an event handler, ECORE_EVENT_NONE is returned.
|
||||
*
|
||||
*
|
||||
* This is useful when certain Ecore modules such as Ecore_Evas "swallow"
|
||||
* events and not all the original information is passed on. In special cases
|
||||
* this extra information may be useful or needed and using this call can let
|
||||
|
@ -265,11 +265,11 @@ ecore_event_current_type_get(void)
|
|||
/**
|
||||
* Return the current event type pointer handled.
|
||||
* @return The current event pointer being handled if inside a handler callback
|
||||
*
|
||||
*
|
||||
* If the program is currently inside an Ecore event handler callback this
|
||||
* will return the pointer of the current event being processed. If Ecore is
|
||||
* not inside an event handler, NULL will be returned.
|
||||
*
|
||||
*
|
||||
* This is useful when certain Ecore modules such as Ecore_Evas "swallow"
|
||||
* events and not all the original information is passed on. In special cases
|
||||
* this extra information may be useful or needed and using this call can let
|
||||
|
@ -286,14 +286,14 @@ void
|
|||
_ecore_event_shutdown(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
||||
while (events) _ecore_event_del(events);
|
||||
for (i = 0; i < event_handlers_num; i++)
|
||||
{
|
||||
while (event_handlers[i])
|
||||
{
|
||||
Ecore_Event_Handler *eh;
|
||||
|
||||
|
||||
eh = event_handlers[i];
|
||||
event_handlers[i] = _ecore_list2_remove(event_handlers[i], eh);
|
||||
ECORE_MAGIC_SET(eh, ECORE_MAGIC_NONE);
|
||||
|
@ -303,7 +303,7 @@ _ecore_event_shutdown(void)
|
|||
while (event_handlers_delete_list)
|
||||
{
|
||||
Ecore_List2_Data *ehd;
|
||||
|
||||
|
||||
ehd = event_handlers_delete_list;
|
||||
event_handlers_delete_list = _ecore_list2_remove(event_handlers_delete_list, ehd);
|
||||
free(ehd);
|
||||
|
@ -315,9 +315,9 @@ _ecore_event_shutdown(void)
|
|||
while (event_filters)
|
||||
{
|
||||
Ecore_Event_Filter *ef;
|
||||
|
||||
|
||||
ef = event_filters;
|
||||
event_filters = _ecore_list2_remove(event_filters, ef);
|
||||
event_filters = _ecore_list2_remove(event_filters, ef);
|
||||
ECORE_MAGIC_SET(ef, ECORE_MAGIC_NONE);
|
||||
free(ef);
|
||||
}
|
||||
|
@ -335,7 +335,7 @@ Ecore_Event *
|
|||
_ecore_event_add(int type, void *ev, void (*func_free) (void *data, void *ev), void *data)
|
||||
{
|
||||
Ecore_Event *e;
|
||||
|
||||
|
||||
e = calloc(1, sizeof(Ecore_Event));
|
||||
if (!e) return NULL;
|
||||
ECORE_MAGIC_SET(e, ECORE_MAGIC_EVENT);
|
||||
|
@ -352,7 +352,7 @@ void *
|
|||
_ecore_event_del(Ecore_Event *event)
|
||||
{
|
||||
void *data;
|
||||
|
||||
|
||||
data = event->data;
|
||||
if (event->func_free) event->func_free(event->data, event->event);
|
||||
events = _ecore_list2_remove(events, event);
|
||||
|
@ -440,7 +440,7 @@ _ecore_event_call(void)
|
|||
// printf("EVENT BATCH DONE\n");
|
||||
ecore_raw_event_type = ECORE_EVENT_NONE;
|
||||
ecore_raw_event_event = NULL;
|
||||
|
||||
|
||||
while (events) _ecore_event_del(events);
|
||||
while (event_handlers_delete_list)
|
||||
{
|
||||
|
@ -458,7 +458,7 @@ EAPI void *
|
|||
_ecore_event_signal_user_new(void)
|
||||
{
|
||||
Ecore_Event_Signal_User *e;
|
||||
|
||||
|
||||
e = calloc(1, sizeof(Ecore_Event_Signal_User));
|
||||
return e;
|
||||
}
|
||||
|
@ -467,7 +467,7 @@ void *
|
|||
_ecore_event_signal_hup_new(void)
|
||||
{
|
||||
Ecore_Event_Signal_Hup *e;
|
||||
|
||||
|
||||
e = calloc(1, sizeof(Ecore_Event_Signal_Hup));
|
||||
return e;
|
||||
}
|
||||
|
@ -476,7 +476,7 @@ void *
|
|||
_ecore_event_signal_exit_new(void)
|
||||
{
|
||||
Ecore_Event_Signal_Exit *e;
|
||||
|
||||
|
||||
e = calloc(1, sizeof(Ecore_Event_Signal_Exit));
|
||||
return e;
|
||||
}
|
||||
|
@ -485,7 +485,7 @@ void *
|
|||
_ecore_event_signal_power_new(void)
|
||||
{
|
||||
Ecore_Event_Signal_Power *e;
|
||||
|
||||
|
||||
e = calloc(1, sizeof(Ecore_Event_Signal_Power));
|
||||
return e;
|
||||
}
|
||||
|
|
|
@ -212,10 +212,10 @@ static int run_pri = ECORE_EXE_PRIORITY_INHERIT;
|
|||
/**
|
||||
* Sets the priority at which to launch processes
|
||||
*
|
||||
* This sets the priority of processes run by ecore_exe_run() and
|
||||
* This sets the priority of processes run by ecore_exe_run() and
|
||||
* ecore_exe_pipe_run(). If set to ECORE_EXE_PRIORITY_INHERIT child processes
|
||||
* inherit the priority of their parent. This is the default.
|
||||
*
|
||||
*
|
||||
* @param pri value -20 to 19 or ECORE_EXE_PRIORITY_INHERIT
|
||||
* @ingroup Ecore_Exe_Basic_Group
|
||||
*/
|
||||
|
@ -228,10 +228,10 @@ ecore_exe_run_priority_set(int pri)
|
|||
/**
|
||||
* Gets the priority at which to launch processes
|
||||
*
|
||||
* This gets ths priority of launched processes. See
|
||||
* This gets ths priority of launched processes. See
|
||||
* ecore_exe_run_priority_set() for details. This just returns the value set
|
||||
* by this call.
|
||||
*
|
||||
*
|
||||
* @return the value set by ecore_exe_run_priority_set()
|
||||
* @ingroup Ecore_Exe_Basic_Group
|
||||
*/
|
||||
|
@ -330,7 +330,7 @@ ecore_exe_pipe_run(const char *exe_cmd, Ecore_Exe_Flags flags, const void *data)
|
|||
if ((flags & ECORE_EXE_PIPE_AUTO) && (!(flags & ECORE_EXE_PIPE_ERROR))
|
||||
&& (!(flags & ECORE_EXE_PIPE_READ)))
|
||||
/* We need something to auto pipe. */
|
||||
flags |= ECORE_EXE_PIPE_READ | ECORE_EXE_PIPE_ERROR;
|
||||
flags |= ECORE_EXE_PIPE_READ | ECORE_EXE_PIPE_ERROR;
|
||||
|
||||
exe->child_fd_error = -1;
|
||||
exe->child_fd_read = -1;
|
||||
|
@ -374,11 +374,11 @@ ecore_exe_pipe_run(const char *exe_cmd, Ecore_Exe_Flags flags, const void *data)
|
|||
{
|
||||
pid_t pid = 0;
|
||||
volatile int vfork_exec_errno = 0;
|
||||
|
||||
|
||||
/* FIXME: I should double check this. After a quick look around, this is already done, but via a more modern method. */
|
||||
/* signal(SIGPIPE, SIG_IGN); We only want EPIPE on errors */
|
||||
pid = fork();
|
||||
|
||||
|
||||
if (pid == -1)
|
||||
{
|
||||
fprintf(stderr, "Failed to fork process\n");
|
||||
|
@ -434,7 +434,7 @@ ecore_exe_pipe_run(const char *exe_cmd, Ecore_Exe_Flags flags, const void *data)
|
|||
if (flags & ECORE_EXE_PIPE_WRITE)
|
||||
E_NO_ERRNO(result, close(writePipe[0]), ok);
|
||||
E_NO_ERRNO(result, close(statusPipe[1]), ok);
|
||||
|
||||
|
||||
_exit(-1);
|
||||
}
|
||||
else /* parent */
|
||||
|
@ -442,13 +442,13 @@ ecore_exe_pipe_run(const char *exe_cmd, Ecore_Exe_Flags flags, const void *data)
|
|||
/* Close the unused pipes. */
|
||||
E_NO_ERRNO(result, close(statusPipe[1]), ok);
|
||||
|
||||
/* FIXME: after having a good look at the current e fd
|
||||
/* FIXME: after having a good look at the current e fd
|
||||
* handling, investigate fcntl(dataPipe[x], F_SETSIG, ...) */
|
||||
/* FIXME: above F_SETSIG etc. - this is async SIGIO based IO
|
||||
* which is also linux specific so we probably don't want to
|
||||
* do this as long as select() is working fine. the only time
|
||||
* we really want to think of SIGIO async IO is when it all
|
||||
* actually works basically everywhere and we can turn all
|
||||
* actually works basically everywhere and we can turn all
|
||||
* IO into DMA async activities (i.e. you do a read() then
|
||||
* the read is complete not on return but when you get a
|
||||
* SIGIO - the read() just starts the transfer and it is
|
||||
|
@ -463,7 +463,7 @@ ecore_exe_pipe_run(const char *exe_cmd, Ecore_Exe_Flags flags, const void *data)
|
|||
for (;;)
|
||||
{
|
||||
char buf;
|
||||
|
||||
|
||||
E_NO_ERRNO(result, read(statusPipe[0], &buf, 1), ok);
|
||||
if (result == 0)
|
||||
{
|
||||
|
@ -560,7 +560,7 @@ ecore_exe_pipe_run(const char *exe_cmd, Ecore_Exe_Flags flags, const void *data)
|
|||
ok = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
exes = _ecore_list2_append(exes, exe);
|
||||
n = 0;
|
||||
}
|
||||
|
@ -579,7 +579,7 @@ ecore_exe_pipe_run(const char *exe_cmd, Ecore_Exe_Flags flags, const void *data)
|
|||
else
|
||||
{
|
||||
Ecore_Exe_Event_Add *e;
|
||||
|
||||
|
||||
e = _ecore_exe_event_add_new();
|
||||
e->exe = exe;
|
||||
if (e) /* Send the event. */
|
||||
|
@ -587,7 +587,7 @@ ecore_exe_pipe_run(const char *exe_cmd, Ecore_Exe_Flags flags, const void *data)
|
|||
_ecore_exe_event_add_free, NULL);
|
||||
/* printf("Running as %d for %s.\n", exe->pid, exe->cmd); */
|
||||
}
|
||||
|
||||
|
||||
errno = n;
|
||||
return exe;
|
||||
}
|
||||
|
@ -1448,7 +1448,7 @@ _ecore_exe_data_generic_handler(void *data, Ecore_Fd_Handler * fd_handler,
|
|||
lost_exe = 0;
|
||||
errno = 0;
|
||||
if ((num = read(child_fd, buf, READBUFSIZ)) < 1)
|
||||
/* FIXME: SPEED/SIZE TRADE OFF - add a smaller READBUFSIZE
|
||||
/* FIXME: SPEED/SIZE TRADE OFF - add a smaller READBUFSIZE
|
||||
* (currently 64k) to inbuf, use that instead of buf, and
|
||||
* save ourselves a memcpy(). */
|
||||
{
|
||||
|
|
|
@ -218,7 +218,7 @@ ecore_hash_hash_set(Ecore_Hash *hash, Ecore_Hash *set)
|
|||
* @return @c TRUE on success, @c FALSE on error.
|
||||
* @ingroup Ecore_Data_Hash_ADT_Destruction_Group
|
||||
*/
|
||||
EAPI void
|
||||
EAPI void
|
||||
ecore_hash_destroy(Ecore_Hash *hash)
|
||||
{
|
||||
unsigned int i = 0;
|
||||
|
@ -281,7 +281,7 @@ ecore_hash_count(Ecore_Hash *hash)
|
|||
* @return TRUE on success, FALSE otherwise.
|
||||
* @ingroup Ecore_Data_Hash_ADT_Traverse_Group
|
||||
*/
|
||||
EAPI int
|
||||
EAPI int
|
||||
ecore_hash_for_each_node(Ecore_Hash *hash, Ecore_For_Each for_each_func, void *user_data)
|
||||
{
|
||||
unsigned int i = 0;
|
||||
|
|
|
@ -77,7 +77,7 @@ _ecore_idle_enterer_shutdown(void)
|
|||
while (idle_enterers)
|
||||
{
|
||||
Ecore_Idle_Enterer *ie;
|
||||
|
||||
|
||||
ie = idle_enterers;
|
||||
idle_enterers = _ecore_list2_remove(idle_enterers, ie);
|
||||
ECORE_MAGIC_SET(ie, ECORE_MAGIC_NONE);
|
||||
|
@ -90,11 +90,11 @@ void
|
|||
_ecore_idle_enterer_call(void)
|
||||
{
|
||||
Ecore_List2 *l;
|
||||
|
||||
|
||||
for (l = (Ecore_List2 *)idle_enterers; l; l = l->next)
|
||||
{
|
||||
Ecore_Idle_Enterer *ie;
|
||||
|
||||
|
||||
ie = (Ecore_Idle_Enterer *)l;
|
||||
if (!ie->delete_me)
|
||||
{
|
||||
|
@ -106,7 +106,7 @@ _ecore_idle_enterer_call(void)
|
|||
for (l = (Ecore_List2 *)idle_enterers; l;)
|
||||
{
|
||||
Ecore_Idle_Enterer *ie;
|
||||
|
||||
|
||||
ie = (Ecore_Idle_Enterer *)l;
|
||||
l = l->next;
|
||||
if (ie->delete_me)
|
||||
|
|
|
@ -53,7 +53,7 @@ _ecore_idle_exiter_shutdown(void)
|
|||
while (idle_exiters)
|
||||
{
|
||||
Ecore_Idle_Exiter *ie;
|
||||
|
||||
|
||||
ie = idle_exiters;
|
||||
idle_exiters = _ecore_list2_remove(idle_exiters, ie);
|
||||
ECORE_MAGIC_SET(ie, ECORE_MAGIC_NONE);
|
||||
|
@ -66,11 +66,11 @@ void
|
|||
_ecore_idle_exiter_call(void)
|
||||
{
|
||||
Ecore_List2 *l;
|
||||
|
||||
|
||||
for (l = (Ecore_List2 *)idle_exiters; l; l = l->next)
|
||||
{
|
||||
Ecore_Idle_Exiter *ie;
|
||||
|
||||
|
||||
ie = (Ecore_Idle_Exiter *)l;
|
||||
if (!ie->delete_me)
|
||||
{
|
||||
|
@ -82,7 +82,7 @@ _ecore_idle_exiter_call(void)
|
|||
for (l = (Ecore_List2 *)idle_exiters; l;)
|
||||
{
|
||||
Ecore_Idle_Exiter *ie;
|
||||
|
||||
|
||||
ie = (Ecore_Idle_Exiter *)l;
|
||||
l = l->next;
|
||||
if (ie->delete_me)
|
||||
|
|
|
@ -13,8 +13,8 @@ static int idlers_delete_me = 0;
|
|||
*
|
||||
* Add an idler handle to the event loop, returning a handle on success and
|
||||
* NULL otherwise. The function @p func will be called repeatedly while
|
||||
* no other events are ready to be processed, as long as it returns 1
|
||||
* (or ECORE_CALLBACK_RENEW). A return of 0 (or ECORE_CALLBACK_CANCEL) deletes
|
||||
* no other events are ready to be processed, as long as it returns 1
|
||||
* (or ECORE_CALLBACK_RENEW). A return of 0 (or ECORE_CALLBACK_CANCEL) deletes
|
||||
* the idler.
|
||||
*
|
||||
* Idlers are useful for progressively prossessing data without blocking.
|
||||
|
@ -61,7 +61,7 @@ _ecore_idler_shutdown(void)
|
|||
while (idlers)
|
||||
{
|
||||
Ecore_Idler *ie;
|
||||
|
||||
|
||||
ie = idlers;
|
||||
idlers = _ecore_list2_remove(idlers, ie);
|
||||
ECORE_MAGIC_SET(ie, ECORE_MAGIC_NONE);
|
||||
|
@ -78,7 +78,7 @@ _ecore_idler_call(void)
|
|||
for (l = (Ecore_List2 *)idlers; l; l = l->next)
|
||||
{
|
||||
Ecore_Idler *ie;
|
||||
|
||||
|
||||
ie = (Ecore_Idler *)l;
|
||||
if (!ie->delete_me)
|
||||
{
|
||||
|
@ -90,7 +90,7 @@ _ecore_idler_call(void)
|
|||
for (l = (Ecore_List2 *)idlers; l;)
|
||||
{
|
||||
Ecore_Idler *ie;
|
||||
|
||||
|
||||
ie = (Ecore_Idler *)l;
|
||||
l = l->next;
|
||||
if (ie->delete_me)
|
||||
|
|
|
@ -36,13 +36,13 @@ static void *_ecore_list_find(Ecore_List *list, Ecore_Compare_Cb function,
|
|||
/* Sorting functions */
|
||||
static Ecore_List_Node *_ecore_list_node_mergesort(Ecore_List_Node *first,
|
||||
int n, Ecore_Compare_Cb compare, int order);
|
||||
static Ecore_List_Node *_ecore_list_node_merge(Ecore_List_Node *first,
|
||||
static Ecore_List_Node *_ecore_list_node_merge(Ecore_List_Node *first,
|
||||
Ecore_List_Node *second,
|
||||
Ecore_Compare_Cb compare,
|
||||
int order);
|
||||
static Ecore_List_Node *_ecore_dlist_node_mergesort(Ecore_List_Node *first,
|
||||
int n, Ecore_Compare_Cb compare, int order);
|
||||
static Ecore_List_Node *_ecore_dlist_node_merge(Ecore_List_Node *first,
|
||||
static Ecore_List_Node *_ecore_dlist_node_merge(Ecore_List_Node *first,
|
||||
Ecore_List_Node *second,
|
||||
Ecore_Compare_Cb compare,
|
||||
int order);
|
||||
|
@ -259,7 +259,7 @@ ecore_list_new(void)
|
|||
* @return @c TRUE if successful, @c FALSE if an error occurs.
|
||||
* @ingroup Ecore_Data_List_Creation_Group
|
||||
*/
|
||||
EAPI int
|
||||
EAPI int
|
||||
ecore_list_init(Ecore_List *list)
|
||||
{
|
||||
CHECK_PARAM_POINTER_RETURN("list", list, FALSE);
|
||||
|
@ -274,7 +274,7 @@ ecore_list_init(Ecore_List *list)
|
|||
* @param list The list to be freed.
|
||||
* @ingroup Ecore_Data_List_Creation_Group
|
||||
*/
|
||||
EAPI void
|
||||
EAPI void
|
||||
ecore_list_destroy(Ecore_List *list)
|
||||
{
|
||||
void *data;
|
||||
|
@ -298,7 +298,7 @@ ecore_list_destroy(Ecore_List *list)
|
|||
* @param free_func The function that will free the key data.
|
||||
* @return @c TRUE on successful set, @c FALSE otherwise.
|
||||
*/
|
||||
EAPI int
|
||||
EAPI int
|
||||
ecore_list_free_cb_set(Ecore_List *list, Ecore_Free_Cb free_func)
|
||||
{
|
||||
CHECK_PARAM_POINTER_RETURN("list", list, FALSE);
|
||||
|
@ -313,7 +313,7 @@ ecore_list_free_cb_set(Ecore_List *list, Ecore_Free_Cb free_func)
|
|||
* @param list The list to check for nodes
|
||||
* @return @c TRUE if no nodes in list, @c FALSE if the list contains nodes
|
||||
*/
|
||||
EAPI int
|
||||
EAPI int
|
||||
ecore_list_empty_is(Ecore_List *list)
|
||||
{
|
||||
int ret = TRUE;
|
||||
|
@ -331,7 +331,7 @@ ecore_list_empty_is(Ecore_List *list)
|
|||
* @param list The list to return the number of the current node.
|
||||
* @return The number of the current node in the list.
|
||||
*/
|
||||
EAPI int
|
||||
EAPI int
|
||||
ecore_list_index(Ecore_List *list)
|
||||
{
|
||||
int ret;
|
||||
|
@ -348,7 +348,7 @@ ecore_list_index(Ecore_List *list)
|
|||
* @param list The list to find the number of nodes
|
||||
* @return The number of nodes in the list.
|
||||
*/
|
||||
EAPI int
|
||||
EAPI int
|
||||
ecore_list_count(Ecore_List *list)
|
||||
{
|
||||
int ret = 0;
|
||||
|
@ -373,7 +373,7 @@ Functions that are used to add nodes to an Ecore_List.
|
|||
* @return @c FALSE if an error occurs, @c TRUE if appended successfully
|
||||
* @ingroup Ecore_Data_List_Add_Item_Group
|
||||
*/
|
||||
EAPI inline int
|
||||
EAPI inline int
|
||||
ecore_list_append(Ecore_List *list, void *data)
|
||||
{
|
||||
int ret;
|
||||
|
@ -390,7 +390,7 @@ ecore_list_append(Ecore_List *list, void *data)
|
|||
}
|
||||
|
||||
/* For adding items to the end of the list */
|
||||
static int
|
||||
static int
|
||||
_ecore_list_append_0(Ecore_List *list, Ecore_List_Node *end)
|
||||
{
|
||||
if (list->last)
|
||||
|
@ -420,7 +420,7 @@ _ecore_list_append_0(Ecore_List *list, Ecore_List_Node *end)
|
|||
* @return @c FALSE if an error occurs, @c TRUE if prepended successfully.
|
||||
* @ingroup Ecore_Data_List_Add_Item_Group
|
||||
*/
|
||||
EAPI inline int
|
||||
EAPI inline int
|
||||
ecore_list_prepend(Ecore_List *list, void *data)
|
||||
{
|
||||
int ret;
|
||||
|
@ -437,7 +437,7 @@ ecore_list_prepend(Ecore_List *list, void *data)
|
|||
}
|
||||
|
||||
/* For adding items to the beginning of the list */
|
||||
static int
|
||||
static int
|
||||
_ecore_list_prepend_0(Ecore_List *list, Ecore_List_Node *start)
|
||||
{
|
||||
/* Put it at the beginning of the list */
|
||||
|
@ -462,7 +462,7 @@ _ecore_list_prepend_0(Ecore_List *list, Ecore_List_Node *start)
|
|||
* @return @c FALSE if there is an error, @c TRUE on success
|
||||
* @ingroup Ecore_Data_List_Add_Item_Group
|
||||
*/
|
||||
EAPI inline int
|
||||
EAPI inline int
|
||||
ecore_list_insert(Ecore_List *list, void *data)
|
||||
{
|
||||
int ret;
|
||||
|
@ -479,7 +479,7 @@ ecore_list_insert(Ecore_List *list, void *data)
|
|||
}
|
||||
|
||||
/* For adding items in front of the current position in the list */
|
||||
static int
|
||||
static int
|
||||
_ecore_list_insert(Ecore_List *list, Ecore_List_Node *new_node)
|
||||
{
|
||||
/*
|
||||
|
@ -521,7 +521,7 @@ _ecore_list_insert(Ecore_List *list, Ecore_List_Node *new_node)
|
|||
* @ingroup Ecore_Data_List_Add_Item_Group
|
||||
*/
|
||||
|
||||
EAPI int
|
||||
EAPI int
|
||||
ecore_list_append_list(Ecore_List *list, Ecore_List *append)
|
||||
{
|
||||
CHECK_PARAM_POINTER_RETURN("list", list, FALSE);
|
||||
|
@ -553,7 +553,7 @@ ecore_list_append_list(Ecore_List *list, Ecore_List *append)
|
|||
* @return @c FALSE if an error occurs, @c TRUE if prepended successfully.
|
||||
* @ingroup Ecore_Data_List_Add_Item_Group
|
||||
*/
|
||||
EAPI int
|
||||
EAPI int
|
||||
ecore_list_prepend_list(Ecore_List *list, Ecore_List *prepend)
|
||||
{
|
||||
CHECK_PARAM_POINTER_RETURN("list", list, FALSE);
|
||||
|
@ -648,7 +648,7 @@ _ecore_list_remove_0(Ecore_List *list)
|
|||
* @return @c TRUE on success, @c FALSE on error
|
||||
* @ingroup Ecore_Data_List_Remove_Item_Group
|
||||
*/
|
||||
EAPI int
|
||||
EAPI int
|
||||
ecore_list_remove_destroy(Ecore_List *list)
|
||||
{
|
||||
void *data;
|
||||
|
@ -808,7 +808,7 @@ _ecore_list_index_goto(Ecore_List *list, int index)
|
|||
if (index > ecore_list_count(list) || index < 0)
|
||||
return NULL;
|
||||
|
||||
if (index < list->index)
|
||||
if (index < list->index)
|
||||
{
|
||||
_ecore_list_first_goto(list);
|
||||
i = 0;
|
||||
|
@ -1053,7 +1053,7 @@ _ecore_list_next(Ecore_List *list)
|
|||
* @note The data for each item on the list is not freed by
|
||||
* @c ecore_list_clear().
|
||||
*/
|
||||
EAPI int
|
||||
EAPI int
|
||||
ecore_list_clear(Ecore_List *list)
|
||||
{
|
||||
CHECK_PARAM_POINTER_RETURN("list", list, FALSE);
|
||||
|
@ -1071,7 +1071,7 @@ ecore_list_clear(Ecore_List *list)
|
|||
* @return Returns @c TRUE on success, @c FALSE on failure.
|
||||
* @ingroup Ecore_Data_List_Traverse_Group
|
||||
*/
|
||||
EAPI int
|
||||
EAPI int
|
||||
ecore_list_for_each(Ecore_List *list, Ecore_For_Each function, void *user_data)
|
||||
{
|
||||
int ret;
|
||||
|
@ -1084,7 +1084,7 @@ ecore_list_for_each(Ecore_List *list, Ecore_For_Each function, void *user_data)
|
|||
}
|
||||
|
||||
/* The real meat of executing the function for each data node */
|
||||
static int
|
||||
static int
|
||||
_ecore_list_for_each(Ecore_List *list, Ecore_For_Each function, void *user_data)
|
||||
{
|
||||
void *value;
|
||||
|
@ -1147,14 +1147,14 @@ EAPI int
|
|||
ecore_list_sort(Ecore_List *list, Ecore_Compare_Cb compare, char order)
|
||||
{
|
||||
CHECK_PARAM_POINTER_RETURN("list", list, 0);
|
||||
|
||||
|
||||
if (list->nodes < 2)
|
||||
return 1;
|
||||
if (list->nodes < ECORE_MERGESORT_LIMIT)
|
||||
return ecore_list_mergesort(list, compare, order);
|
||||
if (!ecore_list_heapsort(list, compare, order))
|
||||
return ecore_list_mergesort(list, compare, order);
|
||||
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -1166,7 +1166,7 @@ ecore_list_sort(Ecore_List *list, Ecore_Compare_Cb compare, char order)
|
|||
* ECORE_SORT_MAX
|
||||
* @return true on success
|
||||
*
|
||||
* Mergesort is a stable, in-place sorting algorithm
|
||||
* Mergesort is a stable, in-place sorting algorithm
|
||||
*/
|
||||
EAPI int
|
||||
ecore_list_mergesort(Ecore_List *list, Ecore_Compare_Cb compare, char order)
|
||||
|
@ -1217,14 +1217,14 @@ ecore_list_merge(Ecore_List *list, Ecore_List *l2, Ecore_Compare_Cb compare, cha
|
|||
ecore_list_append_list(list, l2);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (order == ECORE_SORT_MIN)
|
||||
order = 1;
|
||||
else
|
||||
order = -1;
|
||||
|
||||
list->first = _ecore_list_node_merge(list->first, l2->first, compare, order);
|
||||
|
||||
|
||||
if ((order * compare(list->last->data, l2->last->data)) < 0)
|
||||
list->last = l2->last;
|
||||
|
||||
|
@ -1371,7 +1371,7 @@ ecore_list_heapsort(Ecore_List *list, Ecore_Compare_Cb compare, char order)
|
|||
}
|
||||
|
||||
/* Initialize a node to starting values */
|
||||
EAPI int
|
||||
EAPI int
|
||||
ecore_list_node_init(Ecore_List_Node *node)
|
||||
{
|
||||
CHECK_PARAM_POINTER_RETURN("node", node, FALSE);
|
||||
|
@ -1417,7 +1417,7 @@ ecore_list_node_new()
|
|||
* @return @c TRUE.
|
||||
* @ingroup Ecore_Data_List_Node_Group
|
||||
*/
|
||||
EAPI int
|
||||
EAPI int
|
||||
ecore_list_node_destroy(Ecore_List_Node *node, Ecore_Free_Cb free_func)
|
||||
{
|
||||
CHECK_PARAM_POINTER_RETURN("node", node, FALSE);
|
||||
|
@ -1466,7 +1466,7 @@ ecore_dlist_new()
|
|||
* @return @c TRUE if successful, @c FALSE if an error occurs.
|
||||
* @ingroup Ecore_Data_DList_Creation_Group
|
||||
*/
|
||||
EAPI int
|
||||
EAPI int
|
||||
ecore_dlist_init(Ecore_DList *list)
|
||||
{
|
||||
CHECK_PARAM_POINTER_RETURN("list", list, FALSE);
|
||||
|
@ -1481,7 +1481,7 @@ ecore_dlist_init(Ecore_DList *list)
|
|||
* @param list The doubly linked list to be freed.
|
||||
* @ingroup Ecore_Data_DList_Creation_Group
|
||||
*/
|
||||
EAPI void
|
||||
EAPI void
|
||||
ecore_dlist_destroy(Ecore_DList *list)
|
||||
{
|
||||
void *data;
|
||||
|
@ -1505,7 +1505,7 @@ ecore_dlist_destroy(Ecore_DList *list)
|
|||
* @return @c TRUE on success, @c FALSE on failure.
|
||||
* @ingroup Ecore_Data_DList_Creation_Group
|
||||
*/
|
||||
EAPI int
|
||||
EAPI int
|
||||
ecore_dlist_free_cb_set(Ecore_DList *list, Ecore_Free_Cb free_func)
|
||||
{
|
||||
CHECK_PARAM_POINTER_RETURN("list", list, FALSE);
|
||||
|
@ -1518,7 +1518,7 @@ ecore_dlist_free_cb_set(Ecore_DList *list, Ecore_Free_Cb free_func)
|
|||
* @param list The given doubly linked list.
|
||||
* @return @c TRUE if there are nodes, @c FALSE otherwise.
|
||||
*/
|
||||
EAPI int
|
||||
EAPI int
|
||||
ecore_dlist_empty_is(Ecore_DList *list)
|
||||
{
|
||||
CHECK_PARAM_POINTER_RETURN("list", list, FALSE);
|
||||
|
@ -1531,7 +1531,7 @@ ecore_dlist_empty_is(Ecore_DList *list)
|
|||
* @param list The given doubly linked list.
|
||||
* @return The index of the current node.
|
||||
*/
|
||||
EAPI inline int
|
||||
EAPI inline int
|
||||
ecore_dlist_index(Ecore_DList *list)
|
||||
{
|
||||
CHECK_PARAM_POINTER_RETURN("list", list, FALSE);
|
||||
|
@ -1552,7 +1552,7 @@ ecore_dlist_index(Ecore_DList *list)
|
|||
* @return @c TRUE if the data is successfully appended, @c FALSE otherwise.
|
||||
* @ingroup Ecore_Data_DList_Add_Item_Group
|
||||
*/
|
||||
EAPI int
|
||||
EAPI int
|
||||
ecore_dlist_append(Ecore_DList *list, void *data)
|
||||
{
|
||||
int ret;
|
||||
|
@ -1579,7 +1579,7 @@ ecore_dlist_append(Ecore_DList *list, void *data)
|
|||
* @return @c TRUE if the data is successfully prepended, @c FALSE otherwise.
|
||||
* @ingroup Ecore_Data_DList_Add_Item_Group
|
||||
*/
|
||||
EAPI int
|
||||
EAPI int
|
||||
ecore_dlist_prepend(Ecore_DList *list, void *data)
|
||||
{
|
||||
int ret;
|
||||
|
@ -1606,7 +1606,7 @@ ecore_dlist_prepend(Ecore_DList *list, void *data)
|
|||
* @return @c TRUE on success, @c FALSE otherwise.
|
||||
* @ingroup Ecore_Data_DList_Add_Item_Group
|
||||
*/
|
||||
EAPI int
|
||||
EAPI int
|
||||
ecore_dlist_insert(Ecore_DList *list, void *data)
|
||||
{
|
||||
int ret = TRUE;
|
||||
|
@ -1649,7 +1649,7 @@ ecore_dlist_insert(Ecore_DList *list, void *data)
|
|||
* @return @c TRUE if the data is successfully appended, @c FALSE otherwise.
|
||||
* @ingroup Ecore_Data_DList_Add_Item_Group
|
||||
*/
|
||||
EAPI int
|
||||
EAPI int
|
||||
ecore_dlist_append_list(Ecore_DList *list, Ecore_DList *append)
|
||||
{
|
||||
CHECK_PARAM_POINTER_RETURN("list", list, FALSE);
|
||||
|
@ -1682,7 +1682,7 @@ ecore_dlist_append_list(Ecore_DList *list, Ecore_DList *append)
|
|||
* @return @c TRUE if the data is successfully prepended, @c FALSE otherwise.
|
||||
* @ingroup Ecore_Data_DList_Add_Item_Group
|
||||
*/
|
||||
EAPI int
|
||||
EAPI int
|
||||
ecore_dlist_prepend_list(Ecore_DList *list, Ecore_DList *prepend)
|
||||
{
|
||||
CHECK_PARAM_POINTER_RETURN("list", list, FALSE);
|
||||
|
@ -1766,7 +1766,7 @@ ecore_dlist_first_remove(Ecore_DList *list)
|
|||
* @return @c TRUE on success, @c FALSE otherwise.
|
||||
* @ingroup Ecore_Data_DList_Remove_Item_Group
|
||||
*/
|
||||
EAPI int
|
||||
EAPI int
|
||||
ecore_dlist_remove_destroy(Ecore_DList *list)
|
||||
{
|
||||
void *data;
|
||||
|
@ -2013,7 +2013,7 @@ _ecore_dlist_previous(Ecore_DList *list)
|
|||
*
|
||||
* @return Returns TRUE on success, FALSE on errors
|
||||
*/
|
||||
EAPI int
|
||||
EAPI int
|
||||
ecore_dlist_clear(Ecore_DList *list)
|
||||
{
|
||||
CHECK_PARAM_POINTER_RETURN("list", list, FALSE);
|
||||
|
@ -2039,14 +2039,14 @@ EAPI int
|
|||
ecore_dlist_sort(Ecore_List *list, Ecore_Compare_Cb compare, char order)
|
||||
{
|
||||
CHECK_PARAM_POINTER_RETURN("list", list, 0);
|
||||
|
||||
|
||||
if (list->nodes < 2)
|
||||
return 1;
|
||||
if (list->nodes < ECORE_MERGESORT_LIMIT)
|
||||
return ecore_dlist_mergesort(list, compare, order);
|
||||
if (!ecore_dlist_heapsort(list, compare, order))
|
||||
return ecore_dlist_mergesort(list, compare, order);
|
||||
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -2058,7 +2058,7 @@ ecore_dlist_sort(Ecore_List *list, Ecore_Compare_Cb compare, char order)
|
|||
* ECORE_SORT_MAX
|
||||
* @return true on success
|
||||
*
|
||||
* Mergesort is a stable, in-place sorting algorithm
|
||||
* Mergesort is a stable, in-place sorting algorithm
|
||||
*/
|
||||
EAPI int
|
||||
ecore_dlist_mergesort(Ecore_DList *list, Ecore_Compare_Cb compare, char order)
|
||||
|
@ -2109,14 +2109,14 @@ ecore_dlist_merge(Ecore_DList *list, Ecore_DList *l2, Ecore_Compare_Cb compare,
|
|||
ecore_dlist_append_list(list, l2);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (order == ECORE_SORT_MIN)
|
||||
order = 1;
|
||||
else
|
||||
order = -1;
|
||||
|
||||
list->first = _ecore_dlist_node_merge(list->first, l2->first, compare, order);
|
||||
|
||||
|
||||
if ((order * compare(list->last->data, l2->last->data)) < 0)
|
||||
list->last = l2->last;
|
||||
|
||||
|
@ -2206,14 +2206,14 @@ _ecore_dlist_node_merge(Ecore_List_Node *first, Ecore_List_Node *second,
|
|||
}
|
||||
|
||||
/* append the rest or set it to NULL */
|
||||
if (first)
|
||||
if (first)
|
||||
{
|
||||
ECORE_DLIST_NODE(first)->previous = ECORE_DLIST_NODE(l);
|
||||
l->next = first;
|
||||
}
|
||||
else if (second)
|
||||
{
|
||||
ECORE_DLIST_NODE(second)->previous = ECORE_DLIST_NODE(l);
|
||||
ECORE_DLIST_NODE(second)->previous = ECORE_DLIST_NODE(l);
|
||||
l->next = second;
|
||||
}
|
||||
else
|
||||
|
@ -2227,7 +2227,7 @@ _ecore_dlist_node_merge(Ecore_List_Node *first, Ecore_List_Node *second,
|
|||
* @param node: the node to initialize
|
||||
* @return Returns TRUE on success, FALSE on errors
|
||||
*/
|
||||
EAPI int
|
||||
EAPI int
|
||||
ecore_dlist_node_init(Ecore_DList_Node *node)
|
||||
{
|
||||
int ret;
|
||||
|
@ -2270,7 +2270,7 @@ ecore_dlist_node_new()
|
|||
* @param free_func: the callback function to execute on the data
|
||||
* @return Returns TRUE on success, FALSE on error
|
||||
*/
|
||||
EAPI int
|
||||
EAPI int
|
||||
ecore_dlist_node_destroy(Ecore_DList_Node * node, Ecore_Free_Cb free_func)
|
||||
{
|
||||
CHECK_PARAM_POINTER_RETURN("node", node, FALSE);
|
||||
|
|
|
@ -115,7 +115,7 @@ ecore_main_loop_quit(void)
|
|||
*
|
||||
* Normally the return value from the @p func is "zero means this handler is
|
||||
* finished and can be deleted" as is usual for handler callbacks. However,
|
||||
* if the @p buf_func is supplied, then the return value from the @p func is
|
||||
* if the @p buf_func is supplied, then the return value from the @p func is
|
||||
* "non zero means the handler should be called again in a tight loop".
|
||||
*
|
||||
* @p buf_func is called during event loop handling to check if data that has
|
||||
|
@ -123,8 +123,8 @@ ecore_main_loop_quit(void)
|
|||
* read. Some systems (notably xlib) handle their own buffering, and would
|
||||
* otherwise not work with select(). These systems should use a @p buf_func.
|
||||
* This is a most annoying hack, only ecore_x uses it, so refer to that for
|
||||
* an example. NOTE - @p func should probably return "one" always if
|
||||
* @p buf_func is used, to avoid confusion with the other return value
|
||||
* an example. NOTE - @p func should probably return "one" always if
|
||||
* @p buf_func is used, to avoid confusion with the other return value
|
||||
* semantics.
|
||||
*
|
||||
* @param fd The file descriptor to watch.
|
||||
|
|
|
@ -59,8 +59,8 @@ ecore_path_group_add(Ecore_Path_Group *group, const char *path)
|
|||
CHECK_PARAM_POINTER("path", path);
|
||||
|
||||
if (!group->paths)
|
||||
{
|
||||
group->paths = ecore_list_new();
|
||||
{
|
||||
group->paths = ecore_list_new();
|
||||
ecore_list_free_cb_set(group->paths, free);
|
||||
}
|
||||
|
||||
|
@ -206,4 +206,3 @@ ecore_path_group_available_get(Ecore_Path_Group *group)
|
|||
|
||||
return avail;
|
||||
}
|
||||
|
||||
|
|
|
@ -232,4 +232,3 @@ ecore_plugin_available_get(Ecore_Path_Group *group)
|
|||
|
||||
return avail;
|
||||
}
|
||||
|
||||
|
|
|
@ -11,12 +11,12 @@ static int poller_walking = 0;
|
|||
static double poll_interval = 0.125;
|
||||
static double poll_cur_interval = 0.0;
|
||||
static double last_tick = 0.0;
|
||||
static Ecore_Poller *pollers[16] =
|
||||
static Ecore_Poller *pollers[16] =
|
||||
{
|
||||
NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
|
||||
NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL
|
||||
};
|
||||
static unsigned short poller_counters[16] =
|
||||
static unsigned short poller_counters[16] =
|
||||
{
|
||||
0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0
|
||||
|
@ -30,7 +30,7 @@ _ecore_poller_next_tick_eval(void)
|
|||
{
|
||||
int i;
|
||||
double interval;
|
||||
|
||||
|
||||
min_interval = -1;
|
||||
for (i = 0; i < 15; i++)
|
||||
{
|
||||
|
@ -64,7 +64,7 @@ _ecore_poller_next_tick_eval(void)
|
|||
else
|
||||
{
|
||||
double t;
|
||||
|
||||
|
||||
if (!timer)
|
||||
timer = ecore_timer_add(interval, _ecore_poller_cb_timer, NULL);
|
||||
else
|
||||
|
@ -76,7 +76,7 @@ _ecore_poller_next_tick_eval(void)
|
|||
/* delete the timer and reset it to tick off in the new
|
||||
* time interval. at the tick this will be adjusted */
|
||||
ecore_timer_del(timer);
|
||||
timer = ecore_timer_add(interval - t,
|
||||
timer = ecore_timer_add(interval - t,
|
||||
_ecore_poller_cb_timer, NULL);
|
||||
}
|
||||
}
|
||||
|
@ -103,7 +103,7 @@ _ecore_poller_cb_timer(void *data __UNUSED__)
|
|||
/* wrap back to 0 if we exceed out loop count for the counter */
|
||||
if (poller_counters[i] >= (1 << i)) poller_counters[i] = 0;
|
||||
}
|
||||
|
||||
|
||||
just_added_poller = 0;
|
||||
/* walk the pollers now */
|
||||
poller_walking++;
|
||||
|
@ -131,7 +131,7 @@ _ecore_poller_cb_timer(void *data __UNUSED__)
|
|||
}
|
||||
}
|
||||
poller_walking--;
|
||||
|
||||
|
||||
/* handle deletes afterwards */
|
||||
if (poller_delete_count > 0)
|
||||
{
|
||||
|
@ -161,11 +161,11 @@ _ecore_poller_cb_timer(void *data __UNUSED__)
|
|||
|
||||
just_added_poller = 0;
|
||||
poller_delete_count = 0;
|
||||
|
||||
|
||||
at_tick--;
|
||||
|
||||
|
||||
/* if the timer was deleted then there is no point returning 1 - ambiguous
|
||||
* if we do as it im plies "keep running me" but we have been deleted
|
||||
* if we do as it im plies "keep running me" but we have been deleted
|
||||
* anyway */
|
||||
if (!timer) return 0;
|
||||
|
||||
|
@ -189,7 +189,7 @@ _ecore_poller_cb_timer(void *data __UNUSED__)
|
|||
* @param type The ticker type to adjust
|
||||
* @param poll_time The time (in seconds) between ticks of the clock
|
||||
* @ingroup Ecore_Poller_Group
|
||||
*
|
||||
*
|
||||
* This will adjust the time between ticks of the given ticker type defined
|
||||
* by @p type to the time period defined by @p poll_time.
|
||||
*/
|
||||
|
@ -205,7 +205,7 @@ ecore_poller_poll_interval_set(Ecore_Poller_Type type __UNUSED__, double poll_ti
|
|||
* @param type The ticker type to query
|
||||
* @return The time in seconds between ticks of the ticker clock
|
||||
* @ingroup Ecore_Poller_Group
|
||||
*
|
||||
*
|
||||
* This will get the time between ticks of the specifider ticker clock.
|
||||
*/
|
||||
EAPI double
|
||||
|
@ -233,7 +233,7 @@ ecore_poller_poll_interval_get(Ecore_Poller_Type type __UNUSED__)
|
|||
* save power as the CPU has more of a chance to go into a low power state
|
||||
* the longer it is asleep for, so this should be used if you are at all
|
||||
* power conscious.
|
||||
*
|
||||
*
|
||||
* The @p type parameter defines the poller tick type (there is a virtual
|
||||
* clock ticking all the time - though ecore avoids making it tick when
|
||||
* there will not be any work to do at that tick point). There is only one
|
||||
|
@ -241,7 +241,7 @@ ecore_poller_poll_interval_get(Ecore_Poller_Type type __UNUSED__)
|
|||
* expansion if multiple clocks with different frequencies are really required.
|
||||
* The default time between ticks for the ECORE_POLLER_CORE ticker is 0.125
|
||||
* seconds.
|
||||
*
|
||||
*
|
||||
* The @p interval is the number of ticker ticks that will pass by in between
|
||||
* invocations of the @p func callback. This must be between 1 and 32768
|
||||
* inclusive, and must be a power of 2 (i.e. 1, 2, 4, 8, 16, ... 16384, 32768).
|
||||
|
@ -250,13 +250,13 @@ ecore_poller_poll_interval_get(Ecore_Poller_Type type __UNUSED__)
|
|||
* which tick is undefined, as only the interval between calls can be defined.
|
||||
* Ecore will endeavour to keep pollers synchronised and to call as many in
|
||||
* 1 wakeup event as possible.
|
||||
*
|
||||
*
|
||||
* This function adds a poller and returns its handle on success and NULL on
|
||||
* failure. The function @p func will be called at tick intervals described
|
||||
* above. The function will be passed the @p data pointer as its parameter.
|
||||
*
|
||||
* When the poller @p func is called, it must return a value of either
|
||||
* 1 (or ECORE_CALLBACK_RENEW) or 0 (or ECORE_CALLBACK_CANCEL). If it
|
||||
*
|
||||
* When the poller @p func is called, it must return a value of either
|
||||
* 1 (or ECORE_CALLBACK_RENEW) or 0 (or ECORE_CALLBACK_CANCEL). If it
|
||||
* returns 1, it will be called again at the next tick, or if it returns
|
||||
* 0 it will be deleted automatically making any references/handles for it
|
||||
* invalid.
|
||||
|
@ -266,10 +266,10 @@ ecore_poller_add(Ecore_Poller_Type type __UNUSED__, int interval, int (*func) (v
|
|||
{
|
||||
Ecore_Poller *poller;
|
||||
int ibit;
|
||||
|
||||
|
||||
if (!func) return NULL;
|
||||
if (interval < 1) interval = 1;
|
||||
|
||||
|
||||
poller = calloc(1, sizeof(Ecore_Poller));
|
||||
if (!poller) return NULL;
|
||||
ECORE_MAGIC_SET(poller, ECORE_MAGIC_POLLER);
|
||||
|
@ -283,7 +283,7 @@ ecore_poller_add(Ecore_Poller_Type type __UNUSED__, int interval, int (*func) (v
|
|||
}
|
||||
/* only allow up to 32768 - i.e. ibit == 15, so limit it */
|
||||
if (ibit > 15) ibit = 15;
|
||||
|
||||
|
||||
poller->ibit = ibit;
|
||||
poller->func = func;
|
||||
poller->data = (void *)data;
|
||||
|
@ -309,7 +309,7 @@ EAPI void *
|
|||
ecore_poller_del(Ecore_Poller *poller)
|
||||
{
|
||||
void *data;
|
||||
|
||||
|
||||
if (!ECORE_MAGIC_CHECK(poller, ECORE_MAGIC_POLLER))
|
||||
{
|
||||
ECORE_MAGIC_FAIL(poller, ECORE_MAGIC_POLLER,
|
||||
|
@ -339,7 +339,7 @@ _ecore_poller_shutdown(void)
|
|||
int i;
|
||||
Ecore_List2 *l;
|
||||
Ecore_Poller *poller;
|
||||
|
||||
|
||||
for (i = 0; i < 15; i++)
|
||||
{
|
||||
for (l = (Ecore_List2 *)pollers[i]; l;)
|
||||
|
|
|
@ -44,7 +44,7 @@ ecore_sheap_new(Ecore_Compare_Cb compare, int size)
|
|||
* @param size The number of elements to allow in the heap
|
||||
* @return TRUE on success, FALSE on failure
|
||||
*/
|
||||
EAPI int
|
||||
EAPI int
|
||||
ecore_sheap_init(Ecore_Sheap *heap, Ecore_Compare_Cb compare, int size)
|
||||
{
|
||||
CHECK_PARAM_POINTER_RETURN("heap", heap, FALSE);
|
||||
|
@ -72,7 +72,7 @@ ecore_sheap_init(Ecore_Sheap *heap, Ecore_Compare_Cb compare, int size)
|
|||
*
|
||||
* @param heap The heap to be freed
|
||||
*/
|
||||
EAPI void
|
||||
EAPI void
|
||||
ecore_sheap_destroy(Ecore_Sheap *heap)
|
||||
{
|
||||
int i;
|
||||
|
@ -98,7 +98,7 @@ ecore_sheap_destroy(Ecore_Sheap *heap)
|
|||
* @param free_func The function that will free the key data.
|
||||
* @return @c TRUE on successful set, @c FALSE otherwise.
|
||||
*/
|
||||
EAPI int
|
||||
EAPI int
|
||||
ecore_sheap_free_cb_set(Ecore_Sheap *heap, Ecore_Free_Cb free_func)
|
||||
{
|
||||
CHECK_PARAM_POINTER_RETURN("heap", heap, FALSE);
|
||||
|
@ -115,7 +115,7 @@ ecore_sheap_free_cb_set(Ecore_Sheap *heap, Ecore_Free_Cb free_func)
|
|||
* @return TRUE on success, NULL on failure. Increases the size of the heap if
|
||||
* it becomes larger than available space.
|
||||
*/
|
||||
EAPI int
|
||||
EAPI int
|
||||
ecore_sheap_insert(Ecore_Sheap *heap, void *data)
|
||||
{
|
||||
int i;
|
||||
|
@ -251,7 +251,7 @@ ecore_sheap_extreme(Ecore_Sheap *heap)
|
|||
* @note The heap does not free the old data since it must be passed
|
||||
* in, so the caller can perform the free if desired.
|
||||
*/
|
||||
EAPI int
|
||||
EAPI int
|
||||
ecore_sheap_change(Ecore_Sheap *heap, void *item, void *newval)
|
||||
{
|
||||
int i;
|
||||
|
@ -282,7 +282,7 @@ ecore_sheap_change(Ecore_Sheap *heap, void *item, void *newval)
|
|||
* The comparison function is changed to @compare and the heap is heapified
|
||||
* by the new comparison.
|
||||
*/
|
||||
EAPI int
|
||||
EAPI int
|
||||
ecore_sheap_compare_set(Ecore_Sheap *heap, Ecore_Compare_Cb compare)
|
||||
{
|
||||
CHECK_PARAM_POINTER_RETURN("heap", heap, FALSE);
|
||||
|
@ -305,7 +305,7 @@ ecore_sheap_compare_set(Ecore_Sheap *heap, Ecore_Compare_Cb compare)
|
|||
* Changes the heap order of @heap and re-heapifies the data to this new
|
||||
* order. The default order is a min heap.
|
||||
*/
|
||||
EAPI void
|
||||
EAPI void
|
||||
ecore_sheap_order_set(Ecore_Sheap *heap, char order)
|
||||
{
|
||||
CHECK_PARAM_POINTER("heap", heap);
|
||||
|
@ -322,7 +322,7 @@ ecore_sheap_order_set(Ecore_Sheap *heap, char order)
|
|||
* Sorts the data in the heap into the order that is used for the heap's
|
||||
* data.
|
||||
*/
|
||||
EAPI void
|
||||
EAPI void
|
||||
ecore_sheap_sort(Ecore_Sheap *heap)
|
||||
{
|
||||
int i = 0;
|
||||
|
@ -376,7 +376,7 @@ ecore_sheap_item(Ecore_Sheap *heap, int i)
|
|||
* @param heap The heap to regain heap properties
|
||||
* @param i The position to start heapifying
|
||||
*/
|
||||
static void
|
||||
static void
|
||||
_ecore_sheap_heapify(Ecore_Sheap *heap, int i)
|
||||
{
|
||||
int extreme;
|
||||
|
@ -424,7 +424,7 @@ _ecore_sheap_heapify(Ecore_Sheap *heap, int i)
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
static void
|
||||
_ecore_sheap_update_data(Ecore_Sheap *heap)
|
||||
{
|
||||
int i, old_size;
|
||||
|
|
|
@ -167,7 +167,7 @@ _ecore_signal_call(void)
|
|||
#endif
|
||||
volatile sig_atomic_t n;
|
||||
sigset_t oldset, newset;
|
||||
|
||||
|
||||
if (sig_count == 0) return;
|
||||
sigemptyset(&newset);
|
||||
sigaddset(&newset, SIGPIPE);
|
||||
|
@ -185,7 +185,7 @@ _ecore_signal_call(void)
|
|||
#ifdef SIGRTMIN
|
||||
for (i = 0; i < num; i++)
|
||||
sigaddset(&newset, SIGRTMIN + i);
|
||||
#endif
|
||||
#endif
|
||||
sigprocmask(SIG_BLOCK, &newset, &oldset);
|
||||
if (sigchld_count > MAXSIGQ)
|
||||
printf("ECORE WARNING. %i SIGCHLD in queue. max queue size %i. losing "
|
||||
|
@ -258,7 +258,7 @@ _ecore_signal_call(void)
|
|||
sig_count--;
|
||||
}
|
||||
sigchld_count = 0;
|
||||
|
||||
|
||||
if (sigusr1_count > MAXSIGQ)
|
||||
printf("ECORE WARNING. %i SIGUSR1 in queue. max queue size %i. losing "
|
||||
"siginfo for extra signals.\n", sigusr1_count, MAXSIGQ);
|
||||
|
@ -279,7 +279,7 @@ _ecore_signal_call(void)
|
|||
sig_count--;
|
||||
}
|
||||
sigusr1_count = 0;
|
||||
|
||||
|
||||
if (sigusr2_count > MAXSIGQ)
|
||||
printf("ECORE WARNING. %i SIGUSR2 in queue. max queue size %i. losing "
|
||||
"siginfo for extra signals.\n", sigusr2_count, MAXSIGQ);
|
||||
|
@ -300,7 +300,7 @@ _ecore_signal_call(void)
|
|||
sig_count--;
|
||||
}
|
||||
sigusr2_count = 0;
|
||||
|
||||
|
||||
if (sighup_count > MAXSIGQ)
|
||||
printf("ECORE WARNING. %i SIGHUP in queue. max queue size %i. losing "
|
||||
"siginfo for extra signals.\n", sighup_count, MAXSIGQ);
|
||||
|
@ -319,7 +319,7 @@ _ecore_signal_call(void)
|
|||
sig_count--;
|
||||
}
|
||||
sighup_count = 0;
|
||||
|
||||
|
||||
if (sigquit_count > MAXSIGQ)
|
||||
printf("ECORE WARNING. %i SIGQUIT in queue. max queue size %i. losing "
|
||||
"siginfo for extra signals.\n", sigquit_count, MAXSIGQ);
|
||||
|
@ -361,7 +361,7 @@ _ecore_signal_call(void)
|
|||
sig_count--;
|
||||
}
|
||||
sigint_count = 0;
|
||||
|
||||
|
||||
if (sigterm_count > MAXSIGQ)
|
||||
printf("ECORE WARNING. %i SIGTERM in queue. max queue size %i. losing "
|
||||
"siginfo for extra signals.\n", sigterm_count, MAXSIGQ);
|
||||
|
@ -382,7 +382,7 @@ _ecore_signal_call(void)
|
|||
sig_count--;
|
||||
}
|
||||
sigterm_count = 0;
|
||||
|
||||
|
||||
#ifdef SIGPWR
|
||||
if (sigpwr_count > MAXSIGQ)
|
||||
printf("ECORE WARNING. %i SIGPWR in queue. max queue size %i. losing "
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
#include "ecore_private.h"
|
||||
#include "Ecore_Str.h"
|
||||
|
||||
static int ecore_str_has_suffix_helper(const char *str, const char *suffix,
|
||||
static int ecore_str_has_suffix_helper(const char *str, const char *suffix,
|
||||
int (*cmp)(const char *, const char *));
|
||||
/**
|
||||
* @param dst the destination
|
||||
|
@ -73,7 +73,7 @@ ecore_strlcpy(char *dst, const char *src, size_t siz)
|
|||
* @param dst the destination
|
||||
* @param src the source
|
||||
* @param siz the size of the destination
|
||||
* @return the length of the source string plus MIN(siz, strlen(initial dst))
|
||||
* @return the length of the source string plus MIN(siz, strlen(initial dst))
|
||||
* @brief append a c-string
|
||||
*
|
||||
* Appends src to string dst of size siz (unlike strncat, siz is the
|
||||
|
@ -144,7 +144,7 @@ ecore_str_has_suffix(const char *str, const char *suffix)
|
|||
{
|
||||
CHECK_PARAM_POINTER_RETURN("str", str, 0);
|
||||
CHECK_PARAM_POINTER_RETURN("suffix", suffix, 0);
|
||||
|
||||
|
||||
return ecore_str_has_suffix_helper(str, suffix, strcmp);
|
||||
}
|
||||
|
||||
|
@ -162,16 +162,16 @@ ecore_str_has_extension(const char *str, const char *ext)
|
|||
{
|
||||
CHECK_PARAM_POINTER_RETURN("str", str, 0);
|
||||
CHECK_PARAM_POINTER_RETURN("ext", ext, 0);
|
||||
|
||||
|
||||
return ecore_str_has_suffix_helper(str, ext, strcasecmp);
|
||||
}
|
||||
|
||||
/*
|
||||
* Internal helper function used by ecore_str_has_suffix() and
|
||||
* Internal helper function used by ecore_str_has_suffix() and
|
||||
* ecore_str_has_extension()
|
||||
*/
|
||||
static int
|
||||
ecore_str_has_suffix_helper(const char *str, const char *suffix,
|
||||
ecore_str_has_suffix_helper(const char *str, const char *suffix,
|
||||
int (*cmp)(const char *, const char *))
|
||||
{
|
||||
size_t str_len;
|
||||
|
@ -191,10 +191,10 @@ ecore_str_has_suffix_helper(const char *str, const char *suffix,
|
|||
* string array contains the remainder of string.
|
||||
*
|
||||
* @param str A string to split.
|
||||
* @param delim A string which specifies the places at which to split the
|
||||
* string. The delimiter is not included in any of the
|
||||
* @param delim A string which specifies the places at which to split the
|
||||
* string. The delimiter is not included in any of the
|
||||
* resulting strings, unless max_tokens is reached.
|
||||
* @param max_tokens The maximum number of strings to split string into.
|
||||
* @param max_tokens The maximum number of strings to split string into.
|
||||
* If this is less than 1, the string is split completely.
|
||||
* @return A newly-allocated NULL-terminated array of strings.
|
||||
* To free it: free the first element of the array
|
||||
|
@ -218,7 +218,7 @@ ecore_str_split(const char *str, const char *delim, int max_tokens)
|
|||
dlen = strlen(delim);
|
||||
s = strdup(str);
|
||||
str_array = malloc(sizeof(char *) * (len + 1));
|
||||
for (i = 0; (i < max_tokens) && (sep = strstr(s, delim)); i++)
|
||||
for (i = 0; (i < max_tokens) && (sep = strstr(s, delim)); i++)
|
||||
{
|
||||
str_array[i] = s;
|
||||
s = sep + dlen;
|
||||
|
@ -228,7 +228,6 @@ ecore_str_split(const char *str, const char *delim, int max_tokens)
|
|||
str_array[i++] = s;
|
||||
str_array = realloc(str_array, sizeof(char *) * (i + 1));
|
||||
str_array[i] = NULL;
|
||||
|
||||
|
||||
return str_array;
|
||||
}
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ ecore_strbuf_new(void)
|
|||
EAPI void
|
||||
ecore_strbuf_free(Ecore_Strbuf *buf)
|
||||
{
|
||||
CHECK_PARAM_POINTER("buf", buf);
|
||||
CHECK_PARAM_POINTER("buf", buf);
|
||||
free(buf->buf);
|
||||
free(buf);
|
||||
}
|
||||
|
@ -61,12 +61,12 @@ ecore_strbuf_append(Ecore_Strbuf *buf, const char *str)
|
|||
size_t l;
|
||||
size_t off = 0;
|
||||
|
||||
CHECK_PARAM_POINTER("buf", buf);
|
||||
CHECK_PARAM_POINTER("str", str);
|
||||
CHECK_PARAM_POINTER("buf", buf);
|
||||
CHECK_PARAM_POINTER("str", str);
|
||||
|
||||
l = ecore_strlcpy(buf->buf + buf->len, str, buf->size - buf->len);
|
||||
|
||||
while (l > buf->size - buf->len)
|
||||
while (l > buf->size - buf->len)
|
||||
{
|
||||
/* we successfully appended this much */
|
||||
off += buf->size - buf->len - 1;
|
||||
|
@ -93,7 +93,7 @@ ecore_strbuf_insert(Ecore_Strbuf *buf, const char *str, size_t pos)
|
|||
{
|
||||
size_t len;
|
||||
|
||||
CHECK_PARAM_POINTER("buf", buf);
|
||||
CHECK_PARAM_POINTER("buf", buf);
|
||||
CHECK_PARAM_POINTER("str", str);
|
||||
|
||||
if (pos >= buf->len)
|
||||
|
@ -124,7 +124,7 @@ ecore_strbuf_insert(Ecore_Strbuf *buf, const char *str, size_t pos)
|
|||
EAPI void
|
||||
ecore_strbuf_append_char(Ecore_Strbuf *buf, char c)
|
||||
{
|
||||
CHECK_PARAM_POINTER("buf", buf);
|
||||
CHECK_PARAM_POINTER("buf", buf);
|
||||
if (buf->len >= buf->size - 1)
|
||||
{
|
||||
buf->size += buf->step;
|
||||
|
@ -147,7 +147,7 @@ ecore_strbuf_append_char(Ecore_Strbuf *buf, char c)
|
|||
EAPI const char *
|
||||
ecore_strbuf_string_get(Ecore_Strbuf *buf)
|
||||
{
|
||||
CHECK_PARAM_POINTER_RETURN("buf", buf, NULL);
|
||||
CHECK_PARAM_POINTER_RETURN("buf", buf, NULL);
|
||||
return buf->buf;
|
||||
}
|
||||
|
||||
|
@ -158,7 +158,7 @@ ecore_strbuf_string_get(Ecore_Strbuf *buf)
|
|||
EAPI size_t
|
||||
ecore_strbuf_length_get(Ecore_Strbuf *buf)
|
||||
{
|
||||
CHECK_PARAM_POINTER_RETURN("buf", buf, 0);
|
||||
CHECK_PARAM_POINTER_RETURN("buf", buf, 0);
|
||||
return buf->len;
|
||||
}
|
||||
|
||||
|
@ -167,7 +167,7 @@ ecore_strbuf_length_get(Ecore_Strbuf *buf)
|
|||
* @param buf the Ecore_Strbuf to work with
|
||||
* @param str the string to replace
|
||||
* @param with the replaceing string
|
||||
* @param n the number of the fitting string
|
||||
* @param n the number of the fitting string
|
||||
*
|
||||
* @return true on success
|
||||
*/
|
||||
|
@ -179,7 +179,7 @@ ecore_strbuf_replace(Ecore_Strbuf *buf, const char *str, const char *with,
|
|||
char *spos;
|
||||
size_t pos;
|
||||
|
||||
CHECK_PARAM_POINTER_RETURN("buf", buf, 0);
|
||||
CHECK_PARAM_POINTER_RETURN("buf", buf, 0);
|
||||
CHECK_PARAM_POINTER_RETURN("str", str, 0);
|
||||
CHECK_PARAM_POINTER_RETURN("with", with, 0);
|
||||
|
||||
|
@ -190,21 +190,21 @@ ecore_strbuf_replace(Ecore_Strbuf *buf, const char *str, const char *with,
|
|||
while (n--)
|
||||
{
|
||||
spos = strstr(spos, str);
|
||||
if (!spos || *spos == '\0')
|
||||
if (!spos || *spos == '\0')
|
||||
return 0;
|
||||
if (n) spos++;
|
||||
}
|
||||
|
||||
pos = spos - buf->buf;
|
||||
len1 = strlen(str);
|
||||
len1 = strlen(str);
|
||||
len2 = strlen(with);
|
||||
if (len1 != len2)
|
||||
{
|
||||
/* resize the buffer if necessary */
|
||||
if (!_ecore_strbuf_resize(buf, buf->len - len1 + len2))
|
||||
return 0;
|
||||
/* move the existing text */
|
||||
memmove(buf->buf + pos + len2, buf->buf + pos + len1,
|
||||
/* move the existing text */
|
||||
memmove(buf->buf + pos + len2, buf->buf + pos + len1,
|
||||
buf->len - pos - len1);
|
||||
}
|
||||
/* and now insert the given string */
|
||||
|
@ -233,7 +233,7 @@ ecore_strbuf_replace_all(Ecore_Strbuf *buf, const char *str, const char *with)
|
|||
size_t pos_tmp, start_tmp;
|
||||
int n = 0;
|
||||
|
||||
CHECK_PARAM_POINTER_RETURN("buf", buf, 0);
|
||||
CHECK_PARAM_POINTER_RETURN("buf", buf, 0);
|
||||
CHECK_PARAM_POINTER_RETURN("str", str, 0);
|
||||
CHECK_PARAM_POINTER_RETURN("with", with, 0);
|
||||
|
||||
|
@ -241,7 +241,7 @@ ecore_strbuf_replace_all(Ecore_Strbuf *buf, const char *str, const char *with)
|
|||
if (!spos || *spos == '\0')
|
||||
return 0;
|
||||
|
||||
len1 = strlen(str);
|
||||
len1 = strlen(str);
|
||||
len2 = strlen(with);
|
||||
|
||||
/* if the size of the two string is equal, it is fairly easy to replace them
|
||||
|
@ -256,7 +256,7 @@ ecore_strbuf_replace_all(Ecore_Strbuf *buf, const char *str, const char *with)
|
|||
}
|
||||
return n;
|
||||
}
|
||||
|
||||
|
||||
pos = pos_tmp = spos - buf->buf;
|
||||
tmp_buf = buf->buf;
|
||||
buf->buf = malloc(buf->size);
|
||||
|
@ -280,9 +280,9 @@ ecore_strbuf_replace_all(Ecore_Strbuf *buf, const char *str, const char *with)
|
|||
len = (len + len1) - len2;
|
||||
break;
|
||||
}
|
||||
|
||||
/* copy the untouched text */
|
||||
memcpy(buf->buf + start, tmp_buf + start_tmp, pos - start);
|
||||
|
||||
/* copy the untouched text */
|
||||
memcpy(buf->buf + start, tmp_buf + start_tmp, pos - start);
|
||||
/* copy the new string */
|
||||
memcpy(buf->buf + pos, with, len2);
|
||||
|
||||
|
@ -312,7 +312,7 @@ ecore_strbuf_replace_all(Ecore_Strbuf *buf, const char *str, const char *with)
|
|||
* @param buf the buffer to resize
|
||||
* @param size the minimum size of the buffer
|
||||
*/
|
||||
static int
|
||||
static int
|
||||
_ecore_strbuf_resize(Ecore_Strbuf *buf, size_t size)
|
||||
{
|
||||
char *buffer;
|
||||
|
@ -338,7 +338,7 @@ _ecore_strbuf_resize(Ecore_Strbuf *buf, size_t size)
|
|||
new_step *= 2;
|
||||
}
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
/* shrink the buffer */
|
||||
/*
|
||||
|
@ -351,10 +351,9 @@ _ecore_strbuf_resize(Ecore_Strbuf *buf, size_t size)
|
|||
buffer = realloc(buf->buf, new_size);
|
||||
if (!buffer)
|
||||
return 0;
|
||||
|
||||
|
||||
buf->buf = buffer;
|
||||
buf->size = new_size;
|
||||
buf->step = new_step;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ static int ecore_string_init_count = 0;
|
|||
* Initialize the ecore string internal structure.
|
||||
* @return Zero on failure, non-zero on successful initialization.
|
||||
*/
|
||||
EAPI int
|
||||
EAPI int
|
||||
ecore_string_init()
|
||||
{
|
||||
/*
|
||||
|
@ -100,7 +100,7 @@ ecore_string_instance(const char *string)
|
|||
* @param string The given string.
|
||||
* @ingroup Ecore_String_Group
|
||||
*/
|
||||
EAPI void
|
||||
EAPI void
|
||||
ecore_string_release(const char *string)
|
||||
{
|
||||
Ecore_String *str;
|
||||
|
@ -134,7 +134,7 @@ ecore_string_hash_dump_stats(void)
|
|||
/**
|
||||
* Shutdown the ecore string internal structures
|
||||
*/
|
||||
EAPI void
|
||||
EAPI void
|
||||
ecore_string_shutdown()
|
||||
{
|
||||
--ecore_string_init_count;
|
||||
|
@ -145,7 +145,7 @@ ecore_string_shutdown()
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
static void
|
||||
ecore_string_free_cb(void *data)
|
||||
{
|
||||
Ecore_String *str;
|
||||
|
|
|
@ -19,9 +19,9 @@
|
|||
|
||||
/**
|
||||
* Retrieves the current system time as a floating point value in seconds.
|
||||
*
|
||||
*
|
||||
* Also see ecore_loop_time_get().
|
||||
*
|
||||
*
|
||||
* @return The number of seconds since 12.00AM 1st January 1970.
|
||||
* @ingroup Ecore_Time_Group
|
||||
*/
|
||||
|
@ -42,7 +42,7 @@ double _ecore_loop_time = -1.0;
|
|||
|
||||
/**
|
||||
* Retrieves the time at which the last loop stopped waiting for timeouts or events
|
||||
*
|
||||
*
|
||||
* This gets the time (since Jan 1st, 1970, 12:00AM) that the main loop ceased
|
||||
* waiting for timouts and/or events to come in or for signals or any other
|
||||
* interrupt source. This should be considered a reference point fo all
|
||||
|
@ -51,7 +51,7 @@ double _ecore_loop_time = -1.0;
|
|||
* current actual timepoint - then use ecore_time_get(). If this is called
|
||||
* before any loop has ever been run, then it will call ecore_time_get() for
|
||||
* you the first time and thus have an initial time reference.
|
||||
*
|
||||
*
|
||||
* @return The number of seconds since 12.00AM 1st January 1970.
|
||||
* @ingroup Ecore_Time_Group
|
||||
*/
|
||||
|
|
|
@ -75,9 +75,9 @@ ecore_timer_precision_set(double value)
|
|||
* This function adds a timer and returns its handle on success and NULL on
|
||||
* failure. The function @p func will be called every @in@ seconds. The
|
||||
* function will be passed the @p data pointer as its parameter.
|
||||
*
|
||||
* When the timer @p func is called, it must return a value of either 1
|
||||
* (or ECORE_CALLBACK_RENEW) or 0 (or ECORE_CALLBACK_CANCEL).
|
||||
*
|
||||
* When the timer @p func is called, it must return a value of either 1
|
||||
* (or ECORE_CALLBACK_RENEW) or 0 (or ECORE_CALLBACK_CANCEL).
|
||||
* If it returns 1, it will be called again at the next tick, or if it returns
|
||||
* 0 it will be deleted automatically making any references/handles for it
|
||||
* invalid.
|
||||
|
@ -255,7 +255,7 @@ _ecore_timer_shutdown(void)
|
|||
while (timers)
|
||||
{
|
||||
Ecore_Timer *timer;
|
||||
|
||||
|
||||
timer = timers;
|
||||
timers = _ecore_list2_remove(timers, timer);
|
||||
ECORE_MAGIC_SET(timer, ECORE_MAGIC_NONE);
|
||||
|
@ -282,7 +282,7 @@ _ecore_timer_cleanup(void)
|
|||
for (l = (Ecore_List2 *)timers; l;)
|
||||
{
|
||||
Ecore_Timer *timer;
|
||||
|
||||
|
||||
timer = (Ecore_Timer *)l;
|
||||
l = l->next;
|
||||
if (timer->delete_me)
|
||||
|
@ -297,7 +297,7 @@ _ecore_timer_cleanup(void)
|
|||
for (l = (Ecore_List2 *)suspended; l;)
|
||||
{
|
||||
Ecore_Timer *timer;
|
||||
|
||||
|
||||
timer = (Ecore_Timer *)l;
|
||||
l = l->next;
|
||||
if (timer->delete_me)
|
||||
|
@ -315,14 +315,14 @@ _ecore_timer_cleanup(void)
|
|||
void
|
||||
_ecore_timer_enable_new(void)
|
||||
{
|
||||
Ecore_List2 *l;
|
||||
Ecore_List2 *l;
|
||||
|
||||
if (!timers_added) return;
|
||||
timers_added = 0;
|
||||
for (l = (Ecore_List2 *)timers; l; l = l->next)
|
||||
{
|
||||
Ecore_Timer *timer;
|
||||
|
||||
|
||||
timer = (Ecore_Timer *)l;
|
||||
timer->just_added = 0;
|
||||
}
|
||||
|
@ -377,7 +377,7 @@ _ecore_timer_next_get(void)
|
|||
int
|
||||
_ecore_timer_call(double when)
|
||||
{
|
||||
Ecore_List2 *l;
|
||||
Ecore_List2 *l;
|
||||
Ecore_Timer *timer;
|
||||
|
||||
if (!timers) return 0;
|
||||
|
@ -427,13 +427,13 @@ _ecore_timer_call(double when)
|
|||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_ecore_timer_set(Ecore_Timer *timer, double at, double in, int (*func) (void *data), void *data)
|
||||
{
|
||||
Ecore_List2 *l;
|
||||
|
||||
|
||||
timers_added = 1;
|
||||
timer->at = at;
|
||||
timer->in = in;
|
||||
|
@ -447,7 +447,7 @@ _ecore_timer_set(Ecore_Timer *timer, double at, double in, int (*func) (void *da
|
|||
for (l = ((Ecore_List2 *)(timers))->last; l; l = l->prev)
|
||||
{
|
||||
Ecore_Timer *t2;
|
||||
|
||||
|
||||
t2 = (Ecore_Timer *)l;
|
||||
if (timer->at > t2->at)
|
||||
{
|
||||
|
|
|
@ -51,7 +51,7 @@ ecore_tree_new(Ecore_Compare_Cb compare_func)
|
|||
* @param compare_func: the function used to compare node keys
|
||||
* @return Returns TRUE on successful initialization, FALSE on an error
|
||||
*/
|
||||
EAPI int
|
||||
EAPI int
|
||||
ecore_tree_init(Ecore_Tree *new_tree, Ecore_Compare_Cb compare_func)
|
||||
{
|
||||
CHECK_PARAM_POINTER_RETURN("new_tree", new_tree, FALSE);
|
||||
|
@ -72,7 +72,7 @@ ecore_tree_init(Ecore_Tree *new_tree, Ecore_Compare_Cb compare_func)
|
|||
* @param free_func: the function that will be passed the node being freed
|
||||
* @return Returns TRUE on successful set, FALSE otherwise.
|
||||
*/
|
||||
EAPI int
|
||||
EAPI int
|
||||
ecore_tree_free_value_cb_set(Ecore_Tree *tree, Ecore_Free_Cb free_value)
|
||||
{
|
||||
CHECK_PARAM_POINTER_RETURN("tree", tree, FALSE);
|
||||
|
@ -88,7 +88,7 @@ ecore_tree_free_value_cb_set(Ecore_Tree *tree, Ecore_Free_Cb free_value)
|
|||
* @param free_key: the function that will be passed the node being freed
|
||||
* @return Returns TRUE on successful set, FALSE otherwise.
|
||||
*/
|
||||
EAPI int
|
||||
EAPI int
|
||||
ecore_tree_free_key_cb_set(Ecore_Tree *tree, Ecore_Free_Cb free_key)
|
||||
{
|
||||
CHECK_PARAM_POINTER_RETURN("tree", tree, FALSE);
|
||||
|
@ -102,7 +102,7 @@ ecore_tree_free_key_cb_set(Ecore_Tree *tree, Ecore_Free_Cb free_key)
|
|||
* @brief Initialize a new tree node
|
||||
* @return Returns FALSE if the operation fails, otherwise TRUE
|
||||
*/
|
||||
EAPI int
|
||||
EAPI int
|
||||
ecore_tree_node_init(Ecore_Tree_Node *new_node)
|
||||
{
|
||||
CHECK_PARAM_POINTER_RETURN("new_node", new_node, FALSE);
|
||||
|
@ -149,7 +149,7 @@ ecore_tree_node_new()
|
|||
*
|
||||
* If you don't want the children free'd then you need to remove the node first.
|
||||
*/
|
||||
EAPI int
|
||||
EAPI int
|
||||
ecore_tree_node_destroy(Ecore_Tree_Node *node, Ecore_Free_Cb value_free, Ecore_Free_Cb key_free)
|
||||
{
|
||||
CHECK_PARAM_POINTER_RETURN("node", node, FALSE);
|
||||
|
@ -170,7 +170,7 @@ ecore_tree_node_destroy(Ecore_Tree_Node *node, Ecore_Free_Cb value_free, Ecore_F
|
|||
* @param value: the value to set the node to.
|
||||
* @return Returns TRUE if the node is set successfully, FALSE if not.
|
||||
*/
|
||||
EAPI int
|
||||
EAPI int
|
||||
ecore_tree_node_value_set(Ecore_Tree_Node *node, void *value)
|
||||
{
|
||||
CHECK_PARAM_POINTER_RETURN("node", node, FALSE);
|
||||
|
@ -202,7 +202,7 @@ ecore_tree_node_value_get(Ecore_Tree_Node *node)
|
|||
* @param key: the value to set it's key to.
|
||||
* @return Returns TRUE if the node is set successfully, FALSE if not.
|
||||
*/
|
||||
EAPI int
|
||||
EAPI int
|
||||
ecore_tree_node_key_set(Ecore_Tree_Node *node, void *key)
|
||||
{
|
||||
CHECK_PARAM_POINTER_RETURN("node", node, FALSE);
|
||||
|
@ -235,7 +235,7 @@ ecore_tree_node_key_get(Ecore_Tree_Node *node)
|
|||
*
|
||||
* @return Returns TRUE if tree destroyed successfully, FALSE if not.
|
||||
*/
|
||||
EAPI int
|
||||
EAPI int
|
||||
ecore_tree_destroy(Ecore_Tree *tree)
|
||||
{
|
||||
Ecore_Tree_Node *node;
|
||||
|
@ -351,7 +351,7 @@ ecore_tree_closest_smaller_get(Ecore_Tree *tree, const void *key)
|
|||
* @param value Value to set the found node.
|
||||
* @return TRUE if successful, FALSE if not.
|
||||
*/
|
||||
EAPI int
|
||||
EAPI int
|
||||
ecore_tree_set(Ecore_Tree *tree, void *key, void *value)
|
||||
{
|
||||
Ecore_Tree_Node *node = NULL;
|
||||
|
@ -366,9 +366,9 @@ ecore_tree_set(Ecore_Tree *tree, void *key, void *value)
|
|||
if (!ecore_tree_node_add(tree, node))
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
if (tree->free_key)
|
||||
if (tree->free_key)
|
||||
tree->free_key(key);
|
||||
if (node->value && tree->free_value)
|
||||
tree->free_value(node->value);
|
||||
|
@ -388,7 +388,7 @@ ecore_tree_set(Ecore_Tree *tree, void *key, void *value)
|
|||
* @param node The node to add to @a tree.
|
||||
* @return TRUE on a successful add, FALSE otherwise.
|
||||
*/
|
||||
EAPI int
|
||||
EAPI int
|
||||
ecore_tree_node_add(Ecore_Tree *tree, Ecore_Tree_Node *node)
|
||||
{
|
||||
Ecore_Tree_Node *travel = NULL;
|
||||
|
@ -427,7 +427,7 @@ ecore_tree_node_add(Ecore_Tree *tree, Ecore_Tree_Node *node)
|
|||
* @param node The node to remove from @a tree.
|
||||
* @return TRUE on a successful remove, FALSE otherwise.
|
||||
*/
|
||||
EAPI int
|
||||
EAPI int
|
||||
ecore_tree_node_remove(Ecore_Tree *tree, Ecore_Tree_Node *node)
|
||||
{
|
||||
Ecore_Tree_Node *traverse;
|
||||
|
@ -546,7 +546,7 @@ ecore_tree_node_remove(Ecore_Tree *tree, Ecore_Tree_Node *node)
|
|||
* @param key The key to remove from @a tree.
|
||||
* @return TRUE on a successful remove, FALSE otherwise.
|
||||
*/
|
||||
EAPI int
|
||||
EAPI int
|
||||
ecore_tree_remove(Ecore_Tree *tree, const void *key)
|
||||
{
|
||||
Ecore_Tree_Node *node;
|
||||
|
@ -573,7 +573,7 @@ ecore_tree_remove(Ecore_Tree *tree, const void *key)
|
|||
* @param tree: the tree to check for nodes
|
||||
* @return Returns TRUE if no nodes exist, FALSE otherwise
|
||||
*/
|
||||
EAPI int
|
||||
EAPI int
|
||||
ecore_tree_empty_is(Ecore_Tree *tree)
|
||||
{
|
||||
CHECK_PARAM_POINTER_RETURN("tree", tree, FALSE);
|
||||
|
@ -591,7 +591,7 @@ ecore_tree_empty_is(Ecore_Tree *tree)
|
|||
* @param user_data: data passed to each for_each_func call
|
||||
* @return Returns TRUE on success, FALSE on failure.
|
||||
*/
|
||||
EAPI int
|
||||
EAPI int
|
||||
ecore_tree_for_each_node_value(Ecore_Tree *tree, Ecore_For_Each for_each_func, void *user_data)
|
||||
{
|
||||
CHECK_PARAM_POINTER_RETURN("tree", tree, FALSE);
|
||||
|
@ -610,7 +610,7 @@ ecore_tree_for_each_node_value(Ecore_Tree *tree, Ecore_For_Each for_each_func, v
|
|||
* @param user_data: data passed to each for_each_func call
|
||||
* @return Returns TRUE on success, FALSE on failure.
|
||||
*/
|
||||
EAPI int
|
||||
EAPI int
|
||||
ecore_tree_for_each_node(Ecore_Tree *tree, Ecore_For_Each for_each_func, void *user_data)
|
||||
{
|
||||
CHECK_PARAM_POINTER_RETURN("tree", tree, FALSE);
|
||||
|
@ -692,7 +692,7 @@ tree_node_find(Ecore_Tree *tree, const void *key)
|
|||
}
|
||||
|
||||
/* Balance the tree with respect to node */
|
||||
static int
|
||||
static int
|
||||
tree_node_balance(Ecore_Tree *tree, Ecore_Tree_Node *top_node)
|
||||
{
|
||||
int balance;
|
||||
|
@ -725,7 +725,7 @@ tree_node_balance(Ecore_Tree *tree, Ecore_Tree_Node *top_node)
|
|||
}
|
||||
|
||||
/* Tree is overbalanced to the left, so rotate nodes to the right. */
|
||||
static int
|
||||
static int
|
||||
tree_node_rotate_right(Ecore_Tree *tree, Ecore_Tree_Node *top_node)
|
||||
{
|
||||
Ecore_Tree_Node *temp;
|
||||
|
@ -761,7 +761,7 @@ tree_node_rotate_right(Ecore_Tree *tree, Ecore_Tree_Node *top_node)
|
|||
}
|
||||
|
||||
/* The tree is overbalanced to the right, so we rotate nodes to the left */
|
||||
static int
|
||||
static int
|
||||
tree_node_rotate_left(Ecore_Tree *tree, Ecore_Tree_Node *top_node)
|
||||
{
|
||||
Ecore_Tree_Node *temp;
|
||||
|
@ -804,7 +804,7 @@ tree_node_rotate_left(Ecore_Tree *tree, Ecore_Tree_Node *top_node)
|
|||
* @param user_data: data passed to each for_each_func call
|
||||
* @return Returns FALSE if an error condition occurs, otherwise TRUE
|
||||
*/
|
||||
static int
|
||||
static int
|
||||
tree_for_each_node(Ecore_Tree_Node * node, Ecore_For_Each for_each_func, void *user_data)
|
||||
{
|
||||
CHECK_PARAM_POINTER_RETURN("node", node, FALSE);
|
||||
|
@ -826,7 +826,7 @@ tree_for_each_node(Ecore_Tree_Node * node, Ecore_For_Each for_each_func, void *u
|
|||
* @param for_each_func: the function to pass the nodes values as data
|
||||
* @return Returns FALSE if an error condition occurs, otherwise TRUE
|
||||
*/
|
||||
static int
|
||||
static int
|
||||
tree_for_each_node_value(Ecore_Tree_Node *node, Ecore_For_Each for_each_func, void *user_data)
|
||||
{
|
||||
CHECK_PARAM_POINTER_RETURN("node", node, FALSE);
|
||||
|
|
|
@ -35,7 +35,7 @@ EAPI const unsigned int ecore_prime_table[] =
|
|||
2097143, 4194301, 8388617, 16777213
|
||||
};
|
||||
|
||||
EAPI void
|
||||
EAPI void
|
||||
ecore_print_warning(const char *function, const char *sparam)
|
||||
{
|
||||
fprintf(stderr, "***** Developer Warning ***** :\n"
|
||||
|
@ -53,7 +53,7 @@ ecore_print_warning(const char *function, const char *sparam)
|
|||
* @param key The key to return compute a hash value
|
||||
* @return The key cast to an unsigned int.
|
||||
*/
|
||||
EAPI unsigned int
|
||||
EAPI unsigned int
|
||||
ecore_direct_hash(const void *key)
|
||||
{
|
||||
#ifdef __LP64__
|
||||
|
@ -70,7 +70,7 @@ ecore_direct_hash(const void *key)
|
|||
* @param key A pointer to the string to compute a hash value
|
||||
* @return A computed hash value for @a key.
|
||||
*/
|
||||
EAPI unsigned int
|
||||
EAPI unsigned int
|
||||
ecore_str_hash(const void *key)
|
||||
{
|
||||
int i;
|
||||
|
@ -97,7 +97,7 @@ ecore_str_hash(const void *key)
|
|||
* @param key2 The second key to compare
|
||||
* @return A strcmp style value to indicate the larger key
|
||||
*/
|
||||
EAPI int
|
||||
EAPI int
|
||||
ecore_direct_compare(const void *key1, const void *key2)
|
||||
{
|
||||
unsigned int k1, k2;
|
||||
|
@ -120,7 +120,7 @@ ecore_direct_compare(const void *key1, const void *key2)
|
|||
* @param key2 The second key to compare
|
||||
* @return A strcmp style value to indicate the larger key
|
||||
*/
|
||||
EAPI int
|
||||
EAPI int
|
||||
ecore_str_compare(const void *key1, const void *key2)
|
||||
{
|
||||
const char *k1, *k2;
|
||||
|
|
Loading…
Reference in New Issue