Enlightenment CVS committal

Author  : onefang
Project : e17
Module  : libs/ecore

Dir     : e17/libs/ecore/src/lib/ecore


Modified Files:
        Ecore.h ecore.c ecore_exe.c ecore_private.h 


Log Message:
* Preperation before making the exe events consistant.
* Inlining a function that is only used once.
* More comments.

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore/Ecore.h,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -3 -r1.39 -r1.40
--- Ecore.h     10 Jan 2006 12:26:31 -0000      1.39
+++ Ecore.h     13 Jan 2006 04:31:38 -0000      1.40
@@ -71,7 +71,7 @@
 #define ECORE_EVENT_EXE_DATA        7 /**< Data from a child process */
 #define ECORE_EVENT_EXE_ERROR       8 /**< Error from a child process */
 #define ECORE_EVENT_COUNT           9
-   
+
 #ifndef _ECORE_PRIVATE_H   
    enum _Ecore_Fd_Handler_Flags
      {
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore/ecore.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -3 -r1.14 -r1.15
--- ecore.c     6 Jan 2006 18:04:25 -0000       1.14
+++ ecore.c     13 Jan 2006 04:31:41 -0000      1.15
@@ -54,6 +54,7 @@
        if (getenv("ECORE_FPS_DEBUG")) _ecore_fps_debug = 1;
        if (_ecore_fps_debug) _ecore_fps_debug_init();
        _ecore_signal_init();
+        _ecore_exe_init();
 #endif
      }
 
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore/ecore_exe.c,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -3 -r1.39 -r1.40
--- ecore_exe.c 10 Jan 2006 18:36:19 -0000      1.39
+++ ecore_exe.c 13 Jan 2006 04:31:41 -0000      1.40
@@ -11,7 +11,7 @@
    char        *cmd;
 };
 
-static void _ecore_exe_exec_it(const char *exe_cmd);
+static inline void _ecore_exe_exec_it(const char *exe_cmd);
 
 static int _ecore_exe_data_generic_handler(void *data, Ecore_Fd_Handler 
*fd_handler, Ecore_Fd_Handler_Flags flags);
 static int _ecore_exe_data_error_handler(void *data, Ecore_Fd_Handler 
*fd_handler);
@@ -794,6 +794,11 @@
 
 
 void
+_ecore_exe_init(void)
+{
+}
+
+void
 _ecore_exe_shutdown(void)
 {
    while (exes) _ecore_exe_free(exes);
@@ -814,7 +819,7 @@
    return NULL;
 }
 
-static void
+static inline void
 _ecore_exe_exec_it(const char *exe_cmd)
 {
    char use_sh = 1;
@@ -822,6 +827,12 @@
    char** args = NULL;
    int save_errno = 0;
    
+   /* So what is this doing?
+    *
+    * We are trying to avoid wrapping the exe call with /bin/sh -c.
+    * We conservatively search for certain shell meta characters,
+    * If we don't find them, we can call the exe directly.
+    */
    if (!strpbrk(exe_cmd, "|&;<>()$`\\\"'*?#"))
      {
        char* token;
@@ -1012,7 +1023,7 @@
                                 e->size = inbuf_num;
 
                                  if (is_buffered)
-                                   {
+                                   {   /* Deal with line buffering. */
                                       int max = 0;
                                       int count = 0;
                                       int i;
@@ -1026,6 +1037,7 @@
                                                {
                                                   if (count >= max)
                                                      {
+                                                        /* In testing, the 
lines seem to arrive in batches of 500 to 1000 lines at most, roughly speaking. 
*/
                                                         max += 10;  /* FIXME: 
Maybe keep track of the largest number of lines ever sent, and add half that 
many instead of 10. */
                                                         e->lines = 
realloc(e->lines, sizeof(Ecore_Event_Exe_Data_Line) * (max + 1)); /* Allow room 
for the NULL termination. */
                                                      }
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore/ecore_private.h,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -3 -r1.35 -r1.36
--- ecore_private.h     10 Jan 2006 16:46:07 -0000      1.35
+++ ecore_private.h     13 Jan 2006 04:31:41 -0000      1.36
@@ -408,6 +408,7 @@
 void          _ecore_signal_call(void);
 
 #ifndef WIN32
+void          _ecore_exe_init(void);
 void          _ecore_exe_shutdown(void);
 Ecore_Exe    *_ecore_exe_find(pid_t pid);
 void         *_ecore_exe_free(Ecore_Exe *exe);




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to