• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* GIO - GLib Input, Output and Streaming Library
2  *
3  * Copyright © 2012,2013 Colin Walters <walters@verbum.org>
4  * Copyright © 2012,2013 Canonical Limited
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General
17  * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
18  *
19  * Author: Ryan Lortie <desrt@desrt.ca>
20  * Author: Colin Walters <walters@verbum.org>
21  */
22 
23 #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
24 #error "Only <gio/gio.h> can be included directly."
25 #endif
26 
27 #ifndef __G_SUBPROCESS_LAUNCHER_H__
28 #define __G_SUBPROCESS_LAUNCHER_H__
29 
30 #include <gio/giotypes.h>
31 
32 G_BEGIN_DECLS
33 
34 #define G_TYPE_SUBPROCESS_LAUNCHER         (g_subprocess_launcher_get_type ())
35 #define G_SUBPROCESS_LAUNCHER(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_SUBPROCESS_LAUNCHER, GSubprocessLauncher))
36 #define G_IS_SUBPROCESS_LAUNCHER(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_SUBPROCESS_LAUNCHER))
37 
38 GLIB_AVAILABLE_IN_2_40
39 GType                   g_subprocess_launcher_get_type                  (void) G_GNUC_CONST;
40 
41 GLIB_AVAILABLE_IN_2_40
42 GSubprocessLauncher *   g_subprocess_launcher_new                       (GSubprocessFlags       flags);
43 
44 GLIB_AVAILABLE_IN_2_40
45 GSubprocess *           g_subprocess_launcher_spawn                     (GSubprocessLauncher   *self,
46                                                                          GError               **error,
47                                                                          const gchar           *argv0,
48                                                                          ...) G_GNUC_NULL_TERMINATED;
49 
50 GLIB_AVAILABLE_IN_2_40
51 GSubprocess *           g_subprocess_launcher_spawnv                    (GSubprocessLauncher   *self,
52                                                                          const gchar * const   *argv,
53                                                                          GError               **error);
54 
55 GLIB_AVAILABLE_IN_2_40
56 void                    g_subprocess_launcher_set_environ               (GSubprocessLauncher   *self,
57                                                                          gchar                **env);
58 
59 GLIB_AVAILABLE_IN_2_40
60 void                    g_subprocess_launcher_setenv                    (GSubprocessLauncher   *self,
61                                                                          const gchar           *variable,
62                                                                          const gchar           *value,
63                                                                          gboolean               overwrite);
64 
65 GLIB_AVAILABLE_IN_2_40
66 void                    g_subprocess_launcher_unsetenv                  (GSubprocessLauncher *self,
67                                                                          const gchar         *variable);
68 
69 GLIB_AVAILABLE_IN_2_40
70 const gchar *           g_subprocess_launcher_getenv                    (GSubprocessLauncher   *self,
71                                                                          const gchar           *variable);
72 
73 GLIB_AVAILABLE_IN_2_40
74 void                    g_subprocess_launcher_set_cwd                   (GSubprocessLauncher   *self,
75                                                                          const gchar           *cwd);
76 GLIB_AVAILABLE_IN_2_40
77 void                    g_subprocess_launcher_set_flags                 (GSubprocessLauncher   *self,
78                                                                          GSubprocessFlags       flags);
79 
80 /* Extended I/O control, only available on UNIX */
81 #ifdef G_OS_UNIX
82 GLIB_AVAILABLE_IN_2_40
83 void                    g_subprocess_launcher_set_stdin_file_path       (GSubprocessLauncher   *self,
84                                                                          const gchar           *path);
85 GLIB_AVAILABLE_IN_2_40
86 void                    g_subprocess_launcher_take_stdin_fd             (GSubprocessLauncher   *self,
87                                                                          gint                   fd);
88 GLIB_AVAILABLE_IN_2_40
89 void                    g_subprocess_launcher_set_stdout_file_path      (GSubprocessLauncher   *self,
90                                                                          const gchar           *path);
91 GLIB_AVAILABLE_IN_2_40
92 void                    g_subprocess_launcher_take_stdout_fd            (GSubprocessLauncher   *self,
93                                                                          gint                   fd);
94 GLIB_AVAILABLE_IN_2_40
95 void                    g_subprocess_launcher_set_stderr_file_path      (GSubprocessLauncher   *self,
96                                                                          const gchar           *path);
97 GLIB_AVAILABLE_IN_2_40
98 void                    g_subprocess_launcher_take_stderr_fd            (GSubprocessLauncher   *self,
99                                                                          gint                   fd);
100 
101 GLIB_AVAILABLE_IN_2_40
102 void                    g_subprocess_launcher_take_fd                   (GSubprocessLauncher   *self,
103                                                                          gint                   source_fd,
104                                                                          gint                   target_fd);
105 
106 GLIB_AVAILABLE_IN_2_68
107 void                    g_subprocess_launcher_close                     (GSubprocessLauncher      *self);
108 
109 /* Child setup, only available on UNIX */
110 GLIB_AVAILABLE_IN_2_40
111 void                    g_subprocess_launcher_set_child_setup           (GSubprocessLauncher   *self,
112                                                                          GSpawnChildSetupFunc   child_setup,
113                                                                          gpointer               user_data,
114                                                                          GDestroyNotify         destroy_notify);
115 #endif
116 
117 G_END_DECLS
118 
119 #endif /* __G_SUBPROCESS_H__ */
120