Enlightenment CVS committal
Author : raster
Project : e17
Module : libs/ecore
Dir : e17/libs/ecore/src/lib/ecore
Modified Files:
Ecore.h ecore_exe.c
Log Message:
add new ecore_Exe control calls (interrupt and quit) and dont ertror dialog
on all exits of apps (sigint/quit/.term can be ignored i think).
===================================================================
RCS file: /cvs/e/e17/libs/ecore/src/lib/ecore/Ecore.h,v
retrieving revision 1.65
retrieving revision 1.66
diff -u -3 -r1.65 -r1.66
--- Ecore.h 26 May 2008 05:31:20 -0000 1.65
+++ Ecore.h 29 Jul 2008 22:07:19 -0000 1.66
@@ -252,6 +252,8 @@
EAPI void *ecore_exe_data_get(Ecore_Exe *exe);
EAPI void ecore_exe_pause(Ecore_Exe *exe);
EAPI void ecore_exe_continue(Ecore_Exe *exe);
+ EAPI void ecore_exe_interrupt(Ecore_Exe *exe);
+ 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);
===================================================================
RCS file: /cvs/e/e17/libs/ecore/src/lib/ecore/ecore_exe.c,v
retrieving revision 1.71
retrieving revision 1.72
diff -u -3 -r1.71 -r1.72
--- ecore_exe.c 10 Mar 2008 06:44:32 -0000 1.71
+++ ecore_exe.c 29 Jul 2008 22:07:19 -0000 1.72
@@ -47,6 +47,7 @@
static int _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_dead_attach(Ecore_Exe *exe);
EAPI int ECORE_EXE_EVENT_ADD = 0;
EAPI int ECORE_EXE_EVENT_DEL = 0;
@@ -1007,32 +1008,53 @@
}
/**
- * Sends the given spawned process a terminate (@c SIGTERM) signal.
+ * Sends the given spawned process a interrupt (@c SIGINT) signal.
* @param exe Process handle to the given process.
* @ingroup Ecore_Exe_Signal_Group
*/
EAPI void
-ecore_exe_terminate(Ecore_Exe * exe)
+ecore_exe_interrupt(Ecore_Exe * exe)
{
- struct _ecore_exe_dead_exe *dead;
-
if (!ECORE_MAGIC_CHECK(exe, ECORE_MAGIC_EXE))
{
- ECORE_MAGIC_FAIL(exe, ECORE_MAGIC_EXE, "ecore_exe_terminate");
+ ECORE_MAGIC_FAIL(exe, ECORE_MAGIC_EXE, "ecore_exe_interrupt");
return;
}
+ _ecore_exe_dead_attach(exe);
+ kill(exe->pid, SIGINT);
+}
- dead = calloc(1, sizeof(struct _ecore_exe_dead_exe));
- if (dead)
+/**
+ * Sends the given spawned process a quit (@c SIGQUIT) signal.
+ * @param exe Process handle to the given process.
+ * @ingroup Ecore_Exe_Signal_Group
+ */
+EAPI void
+ecore_exe_quit(Ecore_Exe * exe)
+{
+ if (!ECORE_MAGIC_CHECK(exe, ECORE_MAGIC_EXE))
{
- dead->pid = exe->pid;
- dead->cmd = strdup(exe->cmd);
- IF_FN_DEL(ecore_timer_del, exe->doomsday_clock);
- exe->doomsday_clock =
- ecore_timer_add(10.0, _ecore_exe_make_sure_its_dead, dead);
- exe->doomsday_clock_dead = dead;
+ ECORE_MAGIC_FAIL(exe, ECORE_MAGIC_EXE, "ecore_exe_quit");
+ return;
}
+ _ecore_exe_dead_attach(exe);
+ kill(exe->pid, SIGQUIT);
+}
+/**
+ * Sends the given spawned process a terminate (@c SIGTERM) signal.
+ * @param exe Process handle to the given process.
+ * @ingroup Ecore_Exe_Signal_Group
+ */
+EAPI void
+ecore_exe_terminate(Ecore_Exe * exe)
+{
+ if (!ECORE_MAGIC_CHECK(exe, ECORE_MAGIC_EXE))
+ {
+ ECORE_MAGIC_FAIL(exe, ECORE_MAGIC_EXE, "ecore_exe_terminate");
+ return;
+ }
+ _ecore_exe_dead_attach(exe);
printf("Sending TERM signal to %s (%d).\n", exe->cmd, exe->pid);
kill(exe->pid, SIGTERM);
}
@@ -1589,6 +1611,24 @@
if (e->exe)
ecore_exe_free(e->exe);
free(e);
+}
+
+static void
+_ecore_exe_dead_attach(Ecore_Exe *exe)
+{
+ struct _ecore_exe_dead_exe *dead;
+
+ if (exe->doomsday_clock_dead) return;
+ dead = calloc(1, sizeof(struct _ecore_exe_dead_exe));
+ if (dead)
+ {
+ dead->pid = exe->pid;
+ dead->cmd = strdup(exe->cmd);
+ IF_FN_DEL(ecore_timer_del, exe->doomsday_clock);
+ exe->doomsday_clock =
+ ecore_timer_add(10.0, _ecore_exe_make_sure_its_dead, dead);
+ exe->doomsday_clock_dead = dead;
+ }
}
#endif
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs