path: root/src/lib/ecore/ecore_exe.eo
blob: 899d8a04437bb21056743501af93ab073feefca0 (plain) (tree)
















/* FIXME: The structures are not namespaced correctly. */

struct Ecore.Exe.Event_Data.Line
   [[A structure which stores information on lines data from a child process.]]
   line: ptr(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
   [[Ecore exe event data structure]]
   exe: Efl.Object;  [[The handle to the process. FIXME: should actually be Ecore.Exe, workaround cyclic]]
   data: void_ptr; [[The raw binary data from the child process received]]
   size: int; [[The size of this data in bytes]]
   lines: ptr(Ecore.Exe.Event_Data.Line); [[An array of line data if line buffered. The last one has its 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 set the executed process as its own session leader]]
   term_with_parent = 512, [[Makes child receive SIGTERM when parent dies.]]
   isolate_io = 1024, [[Try and isolate stdin/out and err of the process so it isn't shared with the parent.]]

class Ecore.Exe extends Efl.Object implements Efl.Control
   [[Ecore.Exe is responsible for managing portable process spawning.

   With this module you are able to spawn, pause and quit spawned processes.
   Interaction between your process and those spawned is possible using pipes or signals.

   legacy_prefix: ecore_exe;
   eo_prefix: ecore_obj_exe;
   event_prefix: ecore_exe;
   methods {
        @property command {
             [[Controls the command that's executed. FIXME: May need a split/rename.]]
             set {
                  legacy: null;
             get {
                  legacy: null;
             values {
                  exe_cmd: string; [[The command to execute.]]
                  flags: Ecore.Exe_Flags; [[The execution flags.]]
   implements {
        Efl.Control.suspend { set; }
   constructors {
   events {
        data,get: Ecore.Exe.Event_Data; [[Data received event from the child process]]
        data,error: Ecore.Exe.Event_Data; [[Error received event from the child process]]

/* FIXME: Notes:
   Should run_priority be a class function?
   Instead of having quit, interrupt, bla bla bla, just have an enum and one function? As it's essentially a signal send.

   Rename the events.