Ecore_Exe_Basic_Group (3) - Linux Manuals

Ecore_Exe_Basic_Group: Functions that deal with spawned processes.

NAME

Process Spawning Functions - Functions that deal with spawned processes.

Functions


EAPI Ecore_Exe * ecore_exe_run (const char *exe_cmd, const void *data)
Spawns a child process.
EAPI Ecore_Exe * ecore_exe_pipe_run (const char *exe_cmd, Ecore_Exe_Flags flags, const void *data)
Spawns a child process with its stdin/out available for communication.
EAPI int ecore_exe_send (Ecore_Exe *exe, void *data, int size)
Sends data to the given child process which it recieves on stdin.
EAPI void ecore_exe_close_stdin (Ecore_Exe *exe)
The stdin of the given child process will close when the write buffer is empty.
EAPI void ecore_exe_auto_limits_set (Ecore_Exe *exe, int start_bytes, int end_bytes, int start_lines, int end_lines)
Sets the auto pipe limits for the given process handle.
EAPI Ecore_Exe_Event_Data * ecore_exe_event_data_get (Ecore_Exe *exe, Ecore_Exe_Flags flags)
Gets the auto pipe data for the given process handle.
EAPI void ecore_exe_tag_set (Ecore_Exe *exe, const char *tag)
Sets the string tag for the given process handle.
EAPI char * ecore_exe_tag_get (Ecore_Exe *exe)
Retrieves the tag attached to the given process handle.
EAPI void * ecore_exe_free (Ecore_Exe *exe)
Frees the given process handle.
EAPI void ecore_exe_event_data_free (Ecore_Exe_Event_Data *e)
Frees the given event data.
EAPI pid_t ecore_exe_pid_get (Ecore_Exe *exe)
Retrieves the process ID of the given spawned process.
EAPI char * ecore_exe_cmd_get (Ecore_Exe *exe)
Retrieves the command of the given spawned process.
EAPI void * ecore_exe_data_get (Ecore_Exe *exe)
Retrieves the data attached to the given process handle.

Detailed Description

Functions that deal with spawned processes.

Function Documentation

EAPI void ecore_exe_auto_limits_set (Ecore_Exe * exe, int start_bytes, int end_bytes, int start_lines, int end_lines)

Sets the auto pipe limits for the given process handle.

Parameters:

exe The given process handle.
start_bytes limit of bytes at start of output to buffer.
end_bytes limit of bytes at end of output to buffer.
start_lines limit of lines at start of output to buffer.
end_lines limit of lines at end of output to buffer.

EAPI void ecore_exe_close_stdin (Ecore_Exe * exe)

The stdin of the given child process will close when the write buffer is empty.

Parameters:

exe The child process

EAPI char* ecore_exe_cmd_get (Ecore_Exe * exe)

Retrieves the command of the given spawned process.

Parameters:

exe Handle to the given spawned process.

Returns:

The command on success. NULL otherwise.

EAPI void* ecore_exe_data_get (Ecore_Exe * exe)

Retrieves the data attached to the given process handle.

Parameters:

exe The given process handle.

Returns:

The data pointer attached to exe.

EAPI void ecore_exe_event_data_free (Ecore_Exe_Event_Data * e)

Frees the given event data.

Parameters:

e The given event data.

References _Ecore_Exe_Event_Data::data, and _Ecore_Exe_Event_Data::lines.

EAPI Ecore_Exe_Event_Data* ecore_exe_event_data_get (Ecore_Exe * exe, Ecore_Exe_Flags flags)

Gets the auto pipe data for the given process handle.

Parameters:

exe The given process handle.
flags Is this a ECORE_EXE_PIPE_READ or ECORE_EXE_PIPE_ERROR?

References _Ecore_Exe_Event_Data::data, ECORE_EXE_PIPE_ERROR, ECORE_EXE_PIPE_ERROR_LINE_BUFFERED, ECORE_EXE_PIPE_READ, ECORE_EXE_PIPE_READ_LINE_BUFFERED, _Ecore_Exe_Event_Data::exe, _Ecore_Exe_Event_Data::lines, and _Ecore_Exe_Event_Data::size.

EAPI void* ecore_exe_free (Ecore_Exe * exe)

Frees the given process handle.

Note that the process that the handle represents is unaffected by this function.

Parameters:

exe The given process handle.

Returns:

The data attached to the handle when ecore_exe_run was called.

References ecore_main_fd_handler_del(), and ecore_timer_del().

Referenced by ecore_exe_pipe_run().

EAPI pid_t ecore_exe_pid_get (Ecore_Exe * exe)

Retrieves the process ID of the given spawned process.

Parameters:

exe Handle to the given spawned process.

Returns:

The process ID on success. -1 otherwise.

EAPI Ecore_Exe* ecore_exe_pipe_run (const char * exe_cmd, Ecore_Exe_Flags flags, const void * data)

Spawns a child process with its stdin/out available for communication.

This function forks and runs the given command using /bin/sh.

Note that the process handle is only valid until a child process terminated event is received. After all handlers for the child process terminated event have been called, the handle will be freed by Ecore.

This function does the same thing as ecore_exe_run(), but also makes the standard in and/or out as well as stderr from the child process available for reading or writing. To write use ecore_exe_send(). To read listen to ECORE_EXE_EVENT_DATA or ECORE_EXE_EVENT_ERROR events (set up handlers). Ecore may buffer read and error data until a newline character if asked for with the flags. All data will be included in the events (newlines will be replaced with NULLS if line buffered). ECORE_EXE_EVENT_DATA events will only happen if the process is run with ECORE_EXE_PIPE_READ enabled in the flags. The same with the error version. Writing will only be allowed with ECORE_EXE_PIPE_WRITE enabled in the flags.

Parameters:

exe_cmd The command to run with /bin/sh.
flags The flag parameters for how to deal with inter-process I/O
data Data to attach to the returned process handle.

Returns:

A process handle to the spawned process.

References ecore_event_add(), ECORE_EXE_EVENT_ADD, ecore_exe_free(), ECORE_EXE_PIPE_AUTO, ECORE_EXE_PIPE_ERROR, ECORE_EXE_PIPE_READ, ECORE_EXE_PIPE_WRITE, ecore_exe_terminate(), ECORE_FD_READ, ECORE_FD_WRITE, ecore_main_fd_handler_active_set(), ecore_main_fd_handler_add(), and _Ecore_Exe_Event_Add::exe.

Referenced by ecore_exe_run().

EAPI Ecore_Exe* ecore_exe_run (const char * exe_cmd, const void * data)

Spawns a child process.

This is now just a thin wrapper around ecore_exe_pipe_run()

Parameters:

exe_cmd The command to run with /bin/sh.
data Data to attach to the returned process handle.

Returns:

A process handle to the spawned process.

References ecore_exe_pipe_run().

EAPI int ecore_exe_send (Ecore_Exe * exe, void * data, int size)

Sends data to the given child process which it recieves on stdin.

This function writes to a child processes standard in, with unlimited buffering. This call will never block. It may fail if the system runs out of memory.

Parameters:

exe The child process to send to
data The data to send
size The size of the data to send, in bytes

Returns:

1 if successful, 0 on failure.

References ECORE_FD_WRITE, and ecore_main_fd_handler_active_set().

EAPI char* ecore_exe_tag_get (Ecore_Exe * exe)

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 exe is valid or until the tag is set to something else on this exe.

Parameters:

exe The given process handle.

Returns:

The string attached to exe.

EAPI void ecore_exe_tag_set (Ecore_Exe * exe, const char * tag)

Sets the string tag for the given process handle.

Parameters:

exe The given process handle.
tag The string tag to set on the process handle.

Author

Generated automatically by Doxygen for Ecore from the source code.