Enlightenment CVS committal
Author : raster
Project : e17
Module : libs/ecore
Dir : e17/libs/ecore/src/lib/ecore
Modified Files:
Ecore.h ecore_exe.c ecore_private.h
Log Message:
allow tagging of exe's
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore/Ecore.h,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -3 -r1.25 -r1.26
--- Ecore.h 6 Sep 2005 19:26:19 -0000 1.25
+++ Ecore.h 28 Sep 2005 13:09:09 -0000 1.26
@@ -175,16 +175,18 @@
#ifndef WIN32
- EAPI Ecore_Exe *ecore_exe_run(const char *exe_cmd, const void *data);
- EAPI void *ecore_exe_free(Ecore_Exe *exe);
- EAPI pid_t ecore_exe_pid_get(Ecore_Exe *exe);
- 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_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 Ecore_Exe *ecore_exe_run(const char *exe_cmd, const void *data);
+ EAPI void *ecore_exe_free(Ecore_Exe *exe);
+ EAPI pid_t ecore_exe_pid_get(Ecore_Exe *exe);
+ EAPI void ecore_exe_tag_set(Ecore_Exe *exe, const char *tag);
+ EAPI char *ecore_exe_tag_get(Ecore_Exe *exe);
+ 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_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);
#endif
EAPI Ecore_Idler *ecore_idler_add(int (*func) (void *data), const void
*data);
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore/ecore_exe.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -3 -r1.10 -r1.11
--- ecore_exe.c 6 Sep 2005 23:10:24 -0000 1.10
+++ ecore_exe.c 28 Sep 2005 13:09:09 -0000 1.11
@@ -53,6 +53,49 @@
}
/**
+ * Sets the string tag for the given process handle
+ *
+ * @param exe The given process handle.
+ * @param tag The string tag to set on the process handle.
+ * @ingroup Ecore_Exe_Basic_Group
+ */
+void
+ecore_exe_tag_set(Ecore_Exe *exe, const char *tag)
+{
+ if (!ECORE_MAGIC_CHECK(exe, ECORE_MAGIC_EXE))
+ {
+ ECORE_MAGIC_FAIL(exe, ECORE_MAGIC_EXE,
+ "ecore_exe_tag_set");
+ return NULL;
+ }
+ if (exe->tag) free(exe->tag);
+ exe->tag = NULL;
+ if (tag) exe->tag = strdup(tag);
+}
+
+/**
+ * Retrieves the tag attached to the given process handle. There is no need to
+ * free it as it just returns the internal pointer value. This value is only
+ * valid as long as the @p exe is valid or until the tag is set to something
+ * else on this @p exe.
+ *
+ * @param exe The given process handle.
+ * @return The string attached to @p exe.
+ * @ingroup Ecore_Exe_Basic_Group
+ */
+char *
+ecore_exe_tag_get(Ecore_Exe *exe)
+{
+ if (!ECORE_MAGIC_CHECK(exe, ECORE_MAGIC_EXE))
+ {
+ ECORE_MAGIC_FAIL(exe, ECORE_MAGIC_EXE,
+ "ecore_exe_tag_get");
+ return NULL;
+ }
+ return exe->tag;
+}
+
+/**
* Frees the given process handle.
*
* Note that the process that the handle represents is unaffected by this
@@ -253,6 +296,7 @@
data = exe->data;
exes = _ecore_list2_remove(exes, exe);
ECORE_MAGIC_SET(exe, ECORE_MAGIC_NONE);
+ if (exe->tag) free(exe->tag);
free(exe);
return data;
}
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore/ecore_private.h,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -3 -r1.18 -r1.19
--- ecore_private.h 6 Sep 2005 19:26:19 -0000 1.18
+++ ecore_private.h 28 Sep 2005 13:09:09 -0000 1.19
@@ -137,6 +137,7 @@
ECORE_MAGIC;
pid_t pid;
void *data;
+ char *tag;
};
#endif
-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs