Enlightenment CVS committal Author : raster Project : e17 Module : libs/efreet
Dir : e17/libs/efreet/src/lib Modified Files: efreet_desktop.c efreet_desktop.h Log Message: return the void pointer return val from the run cb - not just 1 or 0 :) a superset here... =================================================================== RCS file: /cvs/e/e17/libs/efreet/src/lib/efreet_desktop.c,v retrieving revision 1.33 retrieving revision 1.34 diff -u -3 -r1.33 -r1.34 --- efreet_desktop.c 11 Jan 2008 07:33:57 -0000 1.33 +++ efreet_desktop.c 20 Feb 2008 04:10:02 -0000 1.34 @@ -102,7 +102,7 @@ static void efreet_desktop_type_info_free(Efreet_Desktop_Type_Info *info); static int efreet_desktop_command_flags_get(Efreet_Desktop *desktop); -static void efreet_desktop_command_execs_process(Efreet_Desktop_Command *command, Ecore_List *execs); +static void *efreet_desktop_command_execs_process(Efreet_Desktop_Command *command, Ecore_List *execs); /** * @internal @@ -1097,7 +1097,7 @@ * @return Returns 1 on success or 0 on failure * @brief Get a command to use to execute a desktop entry. */ -EAPI int +EAPI void * efreet_desktop_command_get(Efreet_Desktop *desktop, Ecore_List *files, Efreet_Desktop_Command_Cb func, void *data) { @@ -1168,7 +1168,7 @@ * @brief Get a command to use to execute a desktop entry, and receive progress * updates for downloading of remote URI's passed in. */ -EAPI int +EAPI void * efreet_desktop_command_progress_get(Efreet_Desktop *desktop, Ecore_List *files, Efreet_Desktop_Command_Cb cb_command, Efreet_Desktop_Progress_Cb cb_progress, @@ -1176,11 +1176,12 @@ { Efreet_Desktop_Command *command; char *file; + void *ret = NULL; - if (!desktop || !cb_command || !desktop->exec) return 0; + if (!desktop || !cb_command || !desktop->exec) return NULL; command = NEW(Efreet_Desktop_Command, 1); - if (!command) return 0; + if (!command) return NULL; command->cb_command = cb_command; command->cb_progress = cb_progress; @@ -1211,12 +1212,12 @@ { Ecore_List *execs; execs = efreet_desktop_command_build(command); - efreet_desktop_command_execs_process(command, execs); + ret = efreet_desktop_command_execs_process(command, execs); ecore_list_destroy(execs); efreet_desktop_command_free(command); } - return 1; + return ret; } /** @@ -1283,17 +1284,20 @@ * @param command * @param execs */ -static void +static void * efreet_desktop_command_execs_process(Efreet_Desktop_Command *command, Ecore_List *execs) { char *exec; int num; + void *ret = NULL; + num = ecore_list_count(execs); ecore_list_first_goto(execs); while ((exec = ecore_list_next(execs))) { - command->cb_command(command->data, command->desktop, exec, --num); + ret = command->cb_command(command->data, command->desktop, exec, --num); } + return ret; } =================================================================== RCS file: /cvs/e/e17/libs/efreet/src/lib/efreet_desktop.h,v retrieving revision 1.16 retrieving revision 1.17 diff -u -3 -r1.16 -r1.17 --- efreet_desktop.h 4 Nov 2007 12:29:36 -0000 1.16 +++ efreet_desktop.h 20 Feb 2008 04:10:02 -0000 1.17 @@ -29,7 +29,7 @@ /** * A callback used with efreet_desktop_command_get() */ -typedef void (*Efreet_Desktop_Command_Cb) (void *data, Efreet_Desktop *desktop, +typedef void *(*Efreet_Desktop_Command_Cb) (void *data, Efreet_Desktop *desktop, char *command, int remaining); /** @@ -112,12 +112,12 @@ EAPI void efreet_desktop_environment_set(const char *environment); EAPI const char *efreet_desktop_environment_get(void); -EAPI int efreet_desktop_command_progress_get(Efreet_Desktop *desktop, +EAPI void *efreet_desktop_command_progress_get(Efreet_Desktop *desktop, Ecore_List *files, Efreet_Desktop_Command_Cb cb_command, Efreet_Desktop_Progress_Cb cb_prog, void *data); -EAPI int efreet_desktop_command_get(Efreet_Desktop *desktop, +EAPI void *efreet_desktop_command_get(Efreet_Desktop *desktop, Ecore_List *files, Efreet_Desktop_Command_Cb func, void *data); ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs