Getting ready for fork'n'pipe.

SVN revision: 18399
This commit is contained in:
David Walter Seikel 2005-11-09 13:59:03 +00:00
parent 69cc1760ef
commit a2bc838d20
3 changed files with 17 additions and 9 deletions

View File

@ -78,7 +78,8 @@ extern "C" {
{
ECORE_EXE_PIPE_READ = 1, /**< Exe Pipe Read mask */
ECORE_EXE_PIPE_WRITE = 2, /**< Exe Pipe Write mask */
ECORE_EXE_PIPE_READ_LINE_BUFFERED = 4 /**< Reads are buffered until a newline and delivered 1 event per line */
ECORE_EXE_PIPE_READ_LINE_BUFFERED = 4, /**< Reads are buffered until a newline and delivered 1 event per line */
ECORE_EXE_RESPAWN = 8 /**< Exe is restarted if it dies */
};
typedef enum _Ecore_Exe_Flags Ecore_Exe_Flags;
@ -205,6 +206,7 @@ extern "C" {
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_maybe(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);

View File

@ -119,8 +119,9 @@ typedef enum _Ecore_Fd_Handler_Flags Ecore_Fd_Handler_Flags;
enum _Ecore_Exe_Flags
{
ECORE_EXE_PIPE_READ = 1,
ECORE_EXE_PIPE_WRITE = 2,
ECORE_EXE_PIPE_READ_LINE_BUFFERED = 4
ECORE_EXE_PIPE_WRITE = 2,
ECORE_EXE_PIPE_READ_LINE_BUFFERED = 4,
ECORE_EXE_RESPAWN = 8
};
typedef enum _Ecore_Exe_Flags Ecore_Exe_Flags;
@ -145,14 +146,16 @@ struct _Ecore_Exe
pid_t pid;
void *data;
char *tag;
char *cmd;
Ecore_Exe_Flags flags;
char *args[4]; /* Arguments for child */
Ecore_Fd_Handler *fd_handler; /* FIXME: the fd_handler to handle read/write to child - if this was used, or NULL if not */
void *write_data_buf; /* FIXME: a data buffer for data to write to the child - realloced as needed for more data and flushed when the fd handler says writes are possible */
int write_data_size; /* FIXME: the size in bytes of the data buffer */
void *read_data_buf; /* FIXME: data read from the child awating delivery to an event */
int read_data_size; /* FIXME: data read from child in bytes */
int child_fd_write; /* FIXME: fd to write TO to send data to the child */
int child_fd_read; /* FIXME: fd to read FROM whne child has send us (parent) data */
void *write_data_buf; /* FIXME: a data buffer for data to write to the child - realloced as needed for more data and flushed when the fd handler says writes are possible */
int write_data_size; /* FIXME: the size in bytes of the data buffer */
void *read_data_buf; /* FIXME: data read from the child awating delivery to an event */
int read_data_size; /* FIXME: data read from child in bytes */
int child_fd_write; /* fd to write TO to send data to the child */
int child_fd_read; /* fd to read FROM whne child has send us (parent) data */
};
#endif

View File

@ -166,6 +166,9 @@ _ecore_signal_call(void)
* errors - THEN report and exe - so store this exe value in the
* ecore_exe struct waiting for the read fd to die then report
* final read data, THEN this exit event
*
* If this process is set respawn, respawn with a suitable backoff
* for those that need too much respawning.
*/
e = _ecore_event_exe_exit_new();
if (e)