1 /* GIO - GLib Input, Output and Streaming Library
3 * Copyright © 2012,2013 Colin Walters <walters@verbum.org>
4 * Copyright © 2012,2013 Canonical Limited
6 * SPDX-License-Identifier: LGPL-2.1-or-later
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General
19 * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
21 * Author: Ryan Lortie <desrt@desrt.ca>
22 * Author: Colin Walters <walters@verbum.org>
25 #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
26 #error "Only <gio/gio.h> can be included directly."
29 #ifndef __G_SUBPROCESS_LAUNCHER_H__
30 #define __G_SUBPROCESS_LAUNCHER_H__
32 #include <gio/giotypes.h>
36 #define G_TYPE_SUBPROCESS_LAUNCHER (g_subprocess_launcher_get_type ())
37 #define G_SUBPROCESS_LAUNCHER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_SUBPROCESS_LAUNCHER, GSubprocessLauncher))
38 #define G_IS_SUBPROCESS_LAUNCHER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_SUBPROCESS_LAUNCHER))
41 GType g_subprocess_launcher_get_type (void) G_GNUC_CONST;
44 GSubprocessLauncher * g_subprocess_launcher_new (GSubprocessFlags flags);
47 GSubprocess * g_subprocess_launcher_spawn (GSubprocessLauncher *self,
50 ...) G_GNUC_NULL_TERMINATED;
53 GSubprocess * g_subprocess_launcher_spawnv (GSubprocessLauncher *self,
54 const gchar * const *argv,
58 void g_subprocess_launcher_set_environ (GSubprocessLauncher *self,
62 void g_subprocess_launcher_setenv (GSubprocessLauncher *self,
63 const gchar *variable,
68 void g_subprocess_launcher_unsetenv (GSubprocessLauncher *self,
69 const gchar *variable);
72 const gchar * g_subprocess_launcher_getenv (GSubprocessLauncher *self,
73 const gchar *variable);
76 void g_subprocess_launcher_set_cwd (GSubprocessLauncher *self,
79 void g_subprocess_launcher_set_flags (GSubprocessLauncher *self,
80 GSubprocessFlags flags);
82 /* Extended I/O control, only available on UNIX */
85 void g_subprocess_launcher_set_stdin_file_path (GSubprocessLauncher *self,
88 void g_subprocess_launcher_take_stdin_fd (GSubprocessLauncher *self,
91 void g_subprocess_launcher_set_stdout_file_path (GSubprocessLauncher *self,
94 void g_subprocess_launcher_take_stdout_fd (GSubprocessLauncher *self,
97 void g_subprocess_launcher_set_stderr_file_path (GSubprocessLauncher *self,
100 void g_subprocess_launcher_take_stderr_fd (GSubprocessLauncher *self,
103 GIO_AVAILABLE_IN_2_40
104 void g_subprocess_launcher_take_fd (GSubprocessLauncher *self,
108 GIO_AVAILABLE_IN_2_68
109 void g_subprocess_launcher_close (GSubprocessLauncher *self);
111 /* Child setup, only available on UNIX */
112 GIO_AVAILABLE_IN_2_40
113 void g_subprocess_launcher_set_child_setup (GSubprocessLauncher *self,
114 GSpawnChildSetupFunc child_setup,
116 GDestroyNotify destroy_notify);
121 #endif /* __G_SUBPROCESS_H__ */