~ubuntu-branches/debian/sid/glib2.0/sid

« back to all changes in this revision

Viewing changes to glib/gspawn.h

  • Committer: Package Import Robot
  • Author(s): Martin Pitt
  • Date: 2013-05-08 06:25:57 UTC
  • mfrom: (1.27.14) (3.1.181 experimental)
  • Revision ID: package-import@ubuntu.com-20130508062557-i7gbku66mls70gi2
Tags: 2.36.1-2
Merge experimental branch, upload to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 * Boston, MA 02111-1307, USA.
19
19
 */
20
20
 
21
 
#if defined(G_DISABLE_SINGLE_INCLUDES) && !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
22
 
#error "Only <glib.h> can be included directly."
23
 
#endif
24
 
 
25
21
#ifndef __G_SPAWN_H__
26
22
#define __G_SPAWN_H__
27
23
 
 
24
#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
 
25
#error "Only <glib.h> can be included directly."
 
26
#endif
 
27
 
28
28
#include <glib/gerror.h>
29
29
 
30
30
G_BEGIN_DECLS
97
97
} GSpawnError;
98
98
 
99
99
/**
 
100
 * G_SPAWN_EXIT_ERROR:
 
101
 *
 
102
 * Error domain used by g_spawn_check_exit_status().  The code
 
103
 * will be the program exit code.
 
104
 */
 
105
#define G_SPAWN_EXIT_ERROR g_spawn_exit_error_quark ()
 
106
 
 
107
/**
100
108
 * GSpawnChildSetupFunc:
101
109
 * @user_data: user data to pass to the function.
102
110
 *
155
163
 *   vector to pass to the file. Normally g_spawn_async_with_pipes() uses
156
164
 *   <literal>argv[0]</literal> as the file to execute, and passes all of
157
165
 *   <literal>argv</literal> to the child.
 
166
 * @G_SPAWN_SEARCH_PATH_FROM_ENVP: if <literal>argv[0]</literal> is not an abolute path,
 
167
 *   it will be looked for in the <envar>PATH</envar> from the passed child 
 
168
 *   environment. Since: 2.34
158
169
 *
159
170
 * Flags passed to g_spawn_sync(), g_spawn_async() and g_spawn_async_with_pipes().
160
171
 */
168
179
  G_SPAWN_STDOUT_TO_DEV_NULL     = 1 << 3,
169
180
  G_SPAWN_STDERR_TO_DEV_NULL     = 1 << 4,
170
181
  G_SPAWN_CHILD_INHERITS_STDIN   = 1 << 5,
171
 
  G_SPAWN_FILE_AND_ARGV_ZERO     = 1 << 6
 
182
  G_SPAWN_FILE_AND_ARGV_ZERO     = 1 << 6,
 
183
  G_SPAWN_SEARCH_PATH_FROM_ENVP  = 1 << 7
172
184
} GSpawnFlags;
173
185
 
 
186
GLIB_AVAILABLE_IN_ALL
174
187
GQuark g_spawn_error_quark (void);
175
 
 
176
 
#ifndef __GTK_DOC_IGNORE__
177
 
#ifdef G_OS_WIN32
178
 
#define g_spawn_async g_spawn_async_utf8
179
 
#define g_spawn_async_with_pipes g_spawn_async_with_pipes_utf8
180
 
#define g_spawn_sync g_spawn_sync_utf8
181
 
#define g_spawn_command_line_sync g_spawn_command_line_sync_utf8
182
 
#define g_spawn_command_line_async g_spawn_command_line_async_utf8
183
 
#endif
184
 
#endif
185
 
 
 
188
GLIB_AVAILABLE_IN_ALL
 
189
GQuark g_spawn_exit_error_quark (void);
 
190
 
 
191
GLIB_AVAILABLE_IN_ALL
186
192
gboolean g_spawn_async (const gchar           *working_directory,
187
193
                        gchar                **argv,
188
194
                        gchar                **envp,
196
202
/* Opens pipes for non-NULL standard_output, standard_input, standard_error,
197
203
 * and returns the parent's end of the pipes.
198
204
 */
 
205
GLIB_AVAILABLE_IN_ALL
199
206
gboolean g_spawn_async_with_pipes (const gchar          *working_directory,
200
207
                                   gchar               **argv,
201
208
                                   gchar               **envp,
213
220
 * standard output or error of the command will be placed there.
214
221
 */
215
222
 
 
223
GLIB_AVAILABLE_IN_ALL
216
224
gboolean g_spawn_sync         (const gchar          *working_directory,
217
225
                               gchar               **argv,
218
226
                               gchar               **envp,
224
232
                               gint                 *exit_status,
225
233
                               GError              **error);
226
234
 
 
235
GLIB_AVAILABLE_IN_ALL
227
236
gboolean g_spawn_command_line_sync  (const gchar          *command_line,
228
237
                                     gchar               **standard_output,
229
238
                                     gchar               **standard_error,
230
239
                                     gint                 *exit_status,
231
240
                                     GError              **error);
 
241
GLIB_AVAILABLE_IN_ALL
232
242
gboolean g_spawn_command_line_async (const gchar          *command_line,
233
243
                                     GError              **error);
234
244
 
 
245
GLIB_AVAILABLE_IN_2_34
 
246
gboolean g_spawn_check_exit_status (gint      exit_status,
 
247
                                    GError  **error);
 
248
 
 
249
GLIB_AVAILABLE_IN_ALL
235
250
void g_spawn_close_pid (GPid pid);
236
251
 
 
252
#ifdef G_OS_WIN32
 
253
#define g_spawn_async              g_spawn_async_utf8
 
254
#define g_spawn_async_with_pipes   g_spawn_async_with_pipes_utf8
 
255
#define g_spawn_sync               g_spawn_sync_utf8
 
256
#define g_spawn_command_line_sync  g_spawn_command_line_sync_utf8
 
257
#define g_spawn_command_line_async g_spawn_command_line_async_utf8
 
258
 
 
259
GLIB_AVAILABLE_IN_ALL
 
260
gboolean g_spawn_async_utf8              (const gchar           *working_directory,
 
261
                                          gchar                **argv,
 
262
                                          gchar                **envp,
 
263
                                          GSpawnFlags            flags,
 
264
                                          GSpawnChildSetupFunc   child_setup,
 
265
                                          gpointer               user_data,
 
266
                                          GPid                  *child_pid,
 
267
                                          GError               **error);
 
268
GLIB_AVAILABLE_IN_ALL
 
269
gboolean g_spawn_async_with_pipes_utf8   (const gchar           *working_directory,
 
270
                                          gchar                **argv,
 
271
                                          gchar                **envp,
 
272
                                          GSpawnFlags            flags,
 
273
                                          GSpawnChildSetupFunc   child_setup,
 
274
                                          gpointer               user_data,
 
275
                                          GPid                  *child_pid,
 
276
                                          gint                  *standard_input,
 
277
                                          gint                  *standard_output,
 
278
                                          gint                  *standard_error,
 
279
                                          GError               **error);
 
280
GLIB_AVAILABLE_IN_ALL
 
281
gboolean g_spawn_sync_utf8               (const gchar           *working_directory,
 
282
                                          gchar                **argv,
 
283
                                          gchar                **envp,
 
284
                                          GSpawnFlags            flags,
 
285
                                          GSpawnChildSetupFunc   child_setup,
 
286
                                          gpointer               user_data,
 
287
                                          gchar                **standard_output,
 
288
                                          gchar                **standard_error,
 
289
                                          gint                  *exit_status,
 
290
                                          GError               **error);
 
291
 
 
292
GLIB_AVAILABLE_IN_ALL
 
293
gboolean g_spawn_command_line_sync_utf8  (const gchar           *command_line,
 
294
                                          gchar                **standard_output,
 
295
                                          gchar                **standard_error,
 
296
                                          gint                  *exit_status,
 
297
                                          GError               **error);
 
298
GLIB_AVAILABLE_IN_ALL
 
299
gboolean g_spawn_command_line_async_utf8 (const gchar           *command_line,
 
300
                                          GError               **error);
 
301
#endif
 
302
 
237
303
G_END_DECLS
238
304
 
239
305
#endif /* __G_SPAWN_H__ */