1 /* GIO - GLib Input, Output and Streaming Library
3 * Copyright (C) 2012 Colin Walters <walters@verbum.org>
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General
16 * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
18 * Author: Colin Walters <walters@verbum.org>
21 #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
22 #error "Only <gio/gio.h> can be included directly."
25 #ifndef __G_SUBPROCESS_H__
26 #define __G_SUBPROCESS_H__
28 #include <gio/giotypes.h>
32 #define G_TYPE_SUBPROCESS (g_subprocess_get_type ())
33 #define G_SUBPROCESS(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_SUBPROCESS, GSubprocess))
34 #define G_IS_SUBPROCESS(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_SUBPROCESS))
36 GLIB_AVAILABLE_IN_2_40
37 GType g_subprocess_get_type (void) G_GNUC_CONST;
41 GLIB_AVAILABLE_IN_2_40
42 GSubprocess * g_subprocess_new (GSubprocessFlags flags,
45 ...) G_GNUC_NULL_TERMINATED;
46 GLIB_AVAILABLE_IN_2_40
47 GSubprocess * g_subprocess_newv (const gchar * const *argv,
48 GSubprocessFlags flags,
51 GLIB_AVAILABLE_IN_2_40
52 GOutputStream * g_subprocess_get_stdin_pipe (GSubprocess *subprocess);
54 GLIB_AVAILABLE_IN_2_40
55 GInputStream * g_subprocess_get_stdout_pipe (GSubprocess *subprocess);
57 GLIB_AVAILABLE_IN_2_40
58 GInputStream * g_subprocess_get_stderr_pipe (GSubprocess *subprocess);
60 GLIB_AVAILABLE_IN_2_40
61 const gchar * g_subprocess_get_identifier (GSubprocess *subprocess);
64 GLIB_AVAILABLE_IN_2_40
65 void g_subprocess_send_signal (GSubprocess *subprocess,
69 GLIB_AVAILABLE_IN_2_40
70 void g_subprocess_force_exit (GSubprocess *subprocess);
72 GLIB_AVAILABLE_IN_2_40
73 gboolean g_subprocess_wait (GSubprocess *subprocess,
74 GCancellable *cancellable,
77 GLIB_AVAILABLE_IN_2_40
78 void g_subprocess_wait_async (GSubprocess *subprocess,
79 GCancellable *cancellable,
80 GAsyncReadyCallback callback,
83 GLIB_AVAILABLE_IN_2_40
84 gboolean g_subprocess_wait_finish (GSubprocess *subprocess,
88 GLIB_AVAILABLE_IN_2_40
89 gboolean g_subprocess_wait_check (GSubprocess *subprocess,
90 GCancellable *cancellable,
93 GLIB_AVAILABLE_IN_2_40
94 void g_subprocess_wait_check_async (GSubprocess *subprocess,
95 GCancellable *cancellable,
96 GAsyncReadyCallback callback,
99 GLIB_AVAILABLE_IN_2_40
100 gboolean g_subprocess_wait_check_finish (GSubprocess *subprocess,
101 GAsyncResult *result,
105 GLIB_AVAILABLE_IN_2_40
106 gint g_subprocess_get_status (GSubprocess *subprocess);
108 GLIB_AVAILABLE_IN_2_40
109 gboolean g_subprocess_get_successful (GSubprocess *subprocess);
111 GLIB_AVAILABLE_IN_2_40
112 gboolean g_subprocess_get_if_exited (GSubprocess *subprocess);
114 GLIB_AVAILABLE_IN_2_40
115 gint g_subprocess_get_exit_status (GSubprocess *subprocess);
117 GLIB_AVAILABLE_IN_2_40
118 gboolean g_subprocess_get_if_signaled (GSubprocess *subprocess);
120 GLIB_AVAILABLE_IN_2_40
121 gint g_subprocess_get_term_sig (GSubprocess *subprocess);
123 GLIB_AVAILABLE_IN_2_40
124 gboolean g_subprocess_communicate (GSubprocess *subprocess,
126 GCancellable *cancellable,
130 GLIB_AVAILABLE_IN_2_40
131 void g_subprocess_communicate_async (GSubprocess *subprocess,
133 GCancellable *cancellable,
134 GAsyncReadyCallback callback,
137 GLIB_AVAILABLE_IN_2_40
138 gboolean g_subprocess_communicate_finish (GSubprocess *subprocess,
139 GAsyncResult *result,
144 GLIB_AVAILABLE_IN_2_40
145 gboolean g_subprocess_communicate_utf8 (GSubprocess *subprocess,
146 const char *stdin_buf,
147 GCancellable *cancellable,
151 GLIB_AVAILABLE_IN_2_40
152 void g_subprocess_communicate_utf8_async (GSubprocess *subprocess,
153 const char *stdin_buf,
154 GCancellable *cancellable,
155 GAsyncReadyCallback callback,
158 GLIB_AVAILABLE_IN_2_40
159 gboolean g_subprocess_communicate_utf8_finish (GSubprocess *subprocess,
160 GAsyncResult *result,
167 #endif /* __G_SUBPROCESS_H__ */