gsubprocesslauncher: Use "env" instead of "environ"
[platform/upstream/glib.git] / gio / gsubprocesslauncher.h
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 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, write to the
18  * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
19  * Boston, MA 02111-1307, USA.
20  *
21  * Author: Ryan Lortie <desrt@desrt.ca>
22  * Author: Colin Walters <walters@verbum.org>
23  */
24
25 #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
26 #error "Only <gio/gio.h> can be included directly."
27 #endif
28
29 #ifndef __G_SUBPROCESS_LAUNCHER_H__
30 #define __G_SUBPROCESS_LAUNCHER_H__
31
32 #include <gio/giotypes.h>
33
34 G_BEGIN_DECLS
35
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))
39
40 GLIB_AVAILABLE_IN_2_40
41 GType                   g_subprocess_launcher_get_type                  (void) G_GNUC_CONST;
42
43 GLIB_AVAILABLE_IN_2_40
44 GSubprocessLauncher *   g_subprocess_launcher_new                       (GSubprocessFlags       flags);
45
46 GLIB_AVAILABLE_IN_2_40
47 GSubprocess *           g_subprocess_launcher_spawn                     (GSubprocessLauncher   *self,
48                                                                          GError               **error,
49                                                                          const gchar           *argv0,
50                                                                          ...);
51
52 GLIB_AVAILABLE_IN_2_40
53 GSubprocess *           g_subprocess_launcher_spawnv                    (GSubprocessLauncher   *self,
54                                                                          const gchar * const   *argv,
55                                                                          GError               **error);
56
57 GLIB_AVAILABLE_IN_2_40
58 void                    g_subprocess_launcher_set_environ               (GSubprocessLauncher   *self,
59                                                                          gchar                **env);
60
61 GLIB_AVAILABLE_IN_2_40
62 void                    g_subprocess_launcher_setenv                    (GSubprocessLauncher   *self,
63                                                                          const gchar           *variable,
64                                                                          const gchar           *value,
65                                                                          gboolean               overwrite);
66
67 GLIB_AVAILABLE_IN_2_40
68 void                    g_subprocess_launcher_unsetenv                  (GSubprocessLauncher *self,
69                                                                          const gchar         *variable);
70
71 GLIB_AVAILABLE_IN_2_40
72 const gchar *           g_subprocess_launcher_getenv                    (GSubprocessLauncher   *self,
73                                                                          const gchar           *variable);
74
75 GLIB_AVAILABLE_IN_2_40
76 void                    g_subprocess_launcher_set_cwd                   (GSubprocessLauncher   *self,
77                                                                          const gchar           *cwd);
78 GLIB_AVAILABLE_IN_2_40
79 void                    g_subprocess_launcher_set_flags                 (GSubprocessLauncher   *self,
80                                                                          GSubprocessFlags       flags);
81
82 /* Extended I/O control, only available on UNIX */
83 #ifdef G_OS_UNIX
84 GLIB_AVAILABLE_IN_2_40
85 void                    g_subprocess_launcher_set_stdin_file_path       (GSubprocessLauncher   *self,
86                                                                          const gchar           *path);
87 GLIB_AVAILABLE_IN_2_40
88 void                    g_subprocess_launcher_take_stdin_fd             (GSubprocessLauncher   *self,
89                                                                          gint                   fd);
90 GLIB_AVAILABLE_IN_2_40
91 void                    g_subprocess_launcher_set_stdout_file_path      (GSubprocessLauncher   *self,
92                                                                          const gchar           *path);
93 GLIB_AVAILABLE_IN_2_40
94 void                    g_subprocess_launcher_take_stdout_fd            (GSubprocessLauncher   *self,
95                                                                          gint                   fd);
96 GLIB_AVAILABLE_IN_2_40
97 void                    g_subprocess_launcher_set_stderr_file_path      (GSubprocessLauncher   *self,
98                                                                          const gchar           *path);
99 GLIB_AVAILABLE_IN_2_40
100 void                    g_subprocess_launcher_take_stderr_fd            (GSubprocessLauncher   *self,
101                                                                          gint                   fd);
102
103 GLIB_AVAILABLE_IN_2_40
104 void                    g_subprocess_launcher_take_fd                   (GSubprocessLauncher   *self,
105                                                                          gint                   source_fd,
106                                                                          gint                   target_fd);
107
108 /* Child setup, only available on UNIX */
109 GLIB_AVAILABLE_IN_2_40
110 void                    g_subprocess_launcher_set_child_setup           (GSubprocessLauncher   *self,
111                                                                          GSpawnChildSetupFunc   child_setup,
112                                                                          gpointer               user_data,
113                                                                          GDestroyNotify         destroy_notify);
114 #endif
115
116 G_END_DECLS
117
118 #endif /* __G_SUBPROCESS_H__ */