Ecore exe: Move more structs and enums to Eolian.
authorTom Hacohen <tom@stosb.com>
Fri, 12 Feb 2016 13:48:24 +0000 (13:48 +0000)
committerTom Hacohen <tom@stosb.com>
Fri, 12 Feb 2016 14:29:27 +0000 (14:29 +0000)
src/lib/ecore/Ecore_Common.h
src/lib/ecore/ecore_exe.eo

index e958cce..8e704ca 100644 (file)
@@ -938,26 +938,6 @@ EAPI extern int ECORE_EXE_EVENT_DATA;    /**< Data from a child process. */
 EAPI extern int ECORE_EXE_EVENT_ERROR;    /**< Errors from a child process. */
 
 /**
- * @enum _Ecore_Exe_Flags
- * Flags for executing a child with its stdin and/or stdout piped back.
- */
-enum _Ecore_Exe_Flags    /* flags for executing a child with its stdin and/or stdout piped back */
-{
-   ECORE_EXE_NONE = 0, /**< No exe flags at all */
-   ECORE_EXE_PIPE_READ = 1, /**< Exe Pipe Read mask */
-   ECORE_EXE_PIPE_WRITE = 2, /**< Exe Pipe Write mask */
-   ECORE_EXE_PIPE_ERROR = 4, /**< Exe Pipe error mask */
-   ECORE_EXE_PIPE_READ_LINE_BUFFERED = 8, /**< Reads are buffered until a newline and split 1 line per Ecore_Exe_Event_Data_Line */
-   ECORE_EXE_PIPE_ERROR_LINE_BUFFERED = 16, /**< Errors are buffered until a newline and split 1 line per Ecore_Exe_Event_Data_Line */
-   ECORE_EXE_PIPE_AUTO = 32, /**< stdout and stderr are buffered automatically */
-   ECORE_EXE_RESPAWN = 64, /**< FIXME: Exe is restarted if it dies */
-   ECORE_EXE_USE_SH = 128, /**< Use /bin/sh to run the command. */
-   ECORE_EXE_NOT_LEADER = 256, /**< Do not use setsid() to have the executed process be its own session leader */
-   ECORE_EXE_TERM_WITH_PARENT = 512 /**< Makes child receive SIGTERM when parent dies. */
-};
-typedef enum _Ecore_Exe_Flags Ecore_Exe_Flags;
-
-/**
  * @enum _Ecore_Exe_Win32_Priority
  * Defines the priority of the process.
  */
@@ -972,7 +952,7 @@ enum _Ecore_Exe_Win32_Priority
 };
 typedef enum _Ecore_Exe_Win32_Priority Ecore_Exe_Win32_Priority;
 
-typedef Eo              Ecore_Exe; /**< A handle for spawned processes */
+#include "ecore_exe.eo.h"
 
 #define _ECORE_EXE_EO_CLASS_TYPE
 
@@ -985,8 +965,6 @@ typedef void                            (*Ecore_Exe_Cb)(void *data, const Ecore_
 
 typedef struct _Ecore_Exe_Event_Add       Ecore_Exe_Event_Add; /**< Spawned Exe add event */
 typedef struct _Ecore_Exe_Event_Del       Ecore_Exe_Event_Del; /**< Spawned Exe exit event */
-typedef struct _Ecore_Exe_Event_Data_Line Ecore_Exe_Event_Data_Line; /**< Lines from a child process */
-typedef struct _Ecore_Exe_Event_Data      Ecore_Exe_Event_Data; /**< Data from a child process */
 
 /**
  * @struct _Ecore_Exe_Event_Add
@@ -1017,28 +995,6 @@ struct _Ecore_Exe_Event_Del
 };
 
 /**
- * @struct _Ecore_Exe_Event_Data_Line
- * @brief A structure that stores information of lines data from a child process.
- */
-struct _Ecore_Exe_Event_Data_Line
-{
-   char *line; /**< The bytes of a line of buffered data */
-   int   size; /**< The size of the line buffer in bytes */
-};
-
-/**
- * @struct _Ecore_Exe_Event_Data
- * @brief A structure that stores information of data from a child process event.
- */
-struct _Ecore_Exe_Event_Data
-{
-   Ecore_Exe                 *exe; /**< The handle to the process */
-   void                      *data; /**< the raw binary data from the child process that was received */
-   int                        size; /**< the size of this data in bytes */
-   Ecore_Exe_Event_Data_Line *lines; /**< an array of line data if line buffered, the last one has it's line member set to @c NULL */
-};
-
-/**
  * Sets the priority at which to launch processes
  *
  * This sets the priority of processes run by ecore_exe_run() and
index d8b630a..e85b4d1 100644 (file)
@@ -1,3 +1,42 @@
+/* FIXME: The structures are not namespaced correctly. */
+
+struct Ecore.Exe_Event_Data_Line
+{
+   [[A structure that stores information of lines data from a child process.]]
+   line: char *; [[The bytes of a line of buffered data]]
+   size: int; [[The size of the line buffer in bytes]]
+}
+
+/**
+ * @struct _Ecore_Exe_Event_Data
+ * @brief A structure that stores information of data from a child process event.
+ */
+struct Ecore.Exe_Event_Data
+{
+   exe: Eo.Base *;  [[The handle to the process. FIXME: should actually be Ecore.Exe, workaround cyclic]]
+   data: void *; [[the raw binary data from the child process that was received]]
+   size: int; [[the size of this data in bytes]]
+   lines: Ecore.Exe_Event_Data_Line *; [[an array of line data if line buffered, the last one has it's line member set to $NULL]]
+}
+
+enum Ecore.Exe_Flags
+{
+   [[Flags for executing a child with its stdin and/or stdout piped back.]]
+   legacy: ECORE_EXE;
+
+   none = 0, [[No exe flags at all]]
+   pipe_read = 1, [[Exe Pipe Read mask]]
+   pipe_write = 2, [[Exe Pipe Write mask]]
+   pipe_error = 4, [[Exe Pipe error mask]]
+   pipe_read_line_buffered = 8, [[Reads are buffered until a newline and split 1 line per Ecore_Exe_Event_Data_Line]]
+   pipe_error_line_buffered = 16, [[Errors are buffered until a newline and split 1 line per Ecore_Exe_Event_Data_Line]]
+   pipe_auto = 32, [[stdout and stderr are buffered automatically]]
+   respawn = 64, [[FIXME: Exe is restarted if it dies]]
+   use_sh = 128, [[Use /bin/sh to run the command.]]
+   not_leader = 256, [[Do not use setsid() to have the executed process be its own session leader]]
+   term_with_parent = 512 [[Makes child receive SIGTERM when parent dies.]]
+}
+
 class Ecore.Exe (Eo.Base, Efl.Control)
 {
    eo_prefix: ecore_obj_exe;
@@ -12,7 +51,7 @@ class Ecore.Exe (Eo.Base, Efl.Control)
              }
              values {
                   exe_cmd: const(char) *; [[The command to execute.]]
-                  flags: Ecore_Exe_Flags; [[The execution flags.]]
+                  flags: Ecore.Exe_Flags; [[The execution flags.]]
              }
         }
    }
@@ -25,8 +64,8 @@ class Ecore.Exe (Eo.Base, Efl.Control)
       .command;
    }
    events {
-        data,get: Ecore_Exe_Event_Data;
-        data,error: Ecore_Exe_Event_Data;
+        data,get: Ecore.Exe_Event_Data;
+        data,error: Ecore.Exe_Event_Data;
    }
 }