25#define ws_pipe_handle HANDLE
26#define ws_get_pipe_handle(pipe_fd) ((HANDLE)_get_osfhandle(pipe_fd))
28#define ws_pipe_handle int
29#define ws_get_pipe_handle(pipe_fd) (pipe_fd)
40 GSList *other_sources;
54WS_DLL_PUBLIC
bool ws_pipe_spawn_sync(
const char * working_directory,
const char * command,
unsigned argc,
char ** args,
char ** command_output);
65static inline bool ws_pipe_valid(
ws_pipe_t *ws_pipe)
67 return ws_pipe && ws_pipe->
pid && ws_pipe->
pid != WS_INVALID_PID;
86WS_DLL_PUBLIC
bool ws_pipe_wait_for_pipe(HANDLE * pipe_handles,
int num_pipe_handles, HANDLE pid);
Represents a spawned child process and its associated I/O channels for inter-process communication.
Definition ws_pipe.h:35
GPid pid
Definition ws_pipe.h:36
GIOChannel * stdout_io
Definition ws_pipe.h:38
GIOChannel * stderr_io
Definition ws_pipe.h:39
GIOChannel * stdin_io
Definition ws_pipe.h:37
WS_DLL_PUBLIC GPid ws_pipe_spawn_async(ws_pipe_t *ws_pipe, GPtrArray *args)
Start a process using g_spawn_sync on UNIX and Linux, and CreateProcess on Windows.
Definition ws_pipe.c:521
struct _ws_pipe_t ws_pipe_t
Represents a spawned child process and its associated I/O channels for inter-process communication.
WS_DLL_PUBLIC void ws_pipe_init(ws_pipe_t *ws_pipe)
Initialize a ws_pipe_t struct. Sets .pid to WS_INVALID_PID and all other members to 0 or NULL.
Definition ws_pipe.c:514
WS_DLL_PUBLIC bool ws_pipe_data_available(int pipe_fd)
Check to see if a file descriptor has data available.
Definition ws_pipe.c:818
WS_DLL_PUBLIC bool ws_pipe_spawn_sync(const char *working_directory, const char *command, unsigned argc, char **args, char **command_output)
Run a process using g_spawn_sync on UNIX and Linux, and CreateProcess on Windows. Wait for it to fini...
Definition ws_pipe.c:229