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)
35 GIOChannel *stdout_io;
36 GIOChannel *stderr_io;
50WS_DLL_PUBLIC
bool ws_pipe_spawn_sync(
const char * working_directory,
const char * command,
int argc,
char ** args,
char ** command_output);
61static inline bool ws_pipe_valid(
ws_pipe_t *ws_pipe)
63 return ws_pipe && ws_pipe->pid && ws_pipe->pid != WS_INVALID_PID;
82WS_DLL_PUBLIC
bool ws_pipe_wait_for_pipe(HANDLE * pipe_handles,
int num_pipe_handles, HANDLE pid);
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
WS_DLL_PUBLIC bool ws_pipe_spawn_sync(const char *working_directory, const char *command, int 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
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:808