1.1 --- a/epoc32/include/stdapis/glib-2.0/glib/gspawn.h Tue Nov 24 13:55:44 2009 +0000
1.2 +++ b/epoc32/include/stdapis/glib-2.0/glib/gspawn.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -1,1 +1,140 @@
1.4 -gspawn.h
1.5 +/* gspawn.h - Process launching
1.6 + *
1.7 + * Copyright 2000 Red Hat, Inc.
1.8 + * Portions copyright (c) 2006 Nokia Corporation. All rights reserved.
1.9 + *
1.10 + * GLib is free software; you can redistribute it and/or
1.11 + * modify it under the terms of the GNU Lesser General Public License as
1.12 + * published by the Free Software Foundation; either version 2 of the
1.13 + * License, or (at your option) any later version.
1.14 + *
1.15 + * GLib is distributed in the hope that it will be useful,
1.16 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
1.17 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1.18 + * Lesser General Public License for more details.
1.19 + *
1.20 + * You should have received a copy of the GNU Lesser General Public
1.21 + * License along with GLib; see the file COPYING.LIB. If not, write
1.22 + * to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
1.23 + * Boston, MA 02111-1307, USA.
1.24 + */
1.25 +
1.26 +#ifndef __G_SPAWN_H__
1.27 +#define __G_SPAWN_H__
1.28 +
1.29 +#include <_ansi.h>
1.30 +#include <glib/gerror.h>
1.31 +
1.32 +G_BEGIN_DECLS
1.33 +
1.34 +/* I'm not sure I remember our proposed naming convention here. */
1.35 +#define G_SPAWN_ERROR g_spawn_error_quark ()
1.36 +
1.37 +typedef enum
1.38 +{
1.39 + G_SPAWN_ERROR_FORK, /* fork failed due to lack of memory */
1.40 + G_SPAWN_ERROR_READ, /* read or select on pipes failed */
1.41 + G_SPAWN_ERROR_CHDIR, /* changing to working dir failed */
1.42 + G_SPAWN_ERROR_ACCES, /* execv() returned EACCES */
1.43 + G_SPAWN_ERROR_PERM, /* execv() returned EPERM */
1.44 + G_SPAWN_ERROR_2BIG, /* execv() returned E2BIG */
1.45 + G_SPAWN_ERROR_NOEXEC, /* execv() returned ENOEXEC */
1.46 + G_SPAWN_ERROR_NAMETOOLONG, /* "" "" ENAMETOOLONG */
1.47 + G_SPAWN_ERROR_NOENT, /* "" "" ENOENT */
1.48 + G_SPAWN_ERROR_NOMEM, /* "" "" ENOMEM */
1.49 + G_SPAWN_ERROR_NOTDIR, /* "" "" ENOTDIR */
1.50 + G_SPAWN_ERROR_LOOP, /* "" "" ELOOP */
1.51 + G_SPAWN_ERROR_TXTBUSY, /* "" "" ETXTBUSY */
1.52 + G_SPAWN_ERROR_IO, /* "" "" EIO */
1.53 + G_SPAWN_ERROR_NFILE, /* "" "" ENFILE */
1.54 + G_SPAWN_ERROR_MFILE, /* "" "" EMFLE */
1.55 + G_SPAWN_ERROR_INVAL, /* "" "" EINVAL */
1.56 + G_SPAWN_ERROR_ISDIR, /* "" "" EISDIR */
1.57 + G_SPAWN_ERROR_LIBBAD, /* "" "" ELIBBAD */
1.58 + G_SPAWN_ERROR_FAILED /* other fatal failure, error->message
1.59 + * should explain
1.60 + */
1.61 +} GSpawnError;
1.62 +
1.63 +typedef void (* GSpawnChildSetupFunc) (gpointer user_data);
1.64 +
1.65 +typedef enum
1.66 +{
1.67 + G_SPAWN_LEAVE_DESCRIPTORS_OPEN = 1 << 0,
1.68 + G_SPAWN_DO_NOT_REAP_CHILD = 1 << 1,
1.69 + /* look for argv[0] in the path i.e. use execvp() */
1.70 + G_SPAWN_SEARCH_PATH = 1 << 2,
1.71 + /* Dump output to /dev/null */
1.72 + G_SPAWN_STDOUT_TO_DEV_NULL = 1 << 3,
1.73 + G_SPAWN_STDERR_TO_DEV_NULL = 1 << 4,
1.74 + G_SPAWN_CHILD_INHERITS_STDIN = 1 << 5,
1.75 + G_SPAWN_FILE_AND_ARGV_ZERO = 1 << 6
1.76 +} GSpawnFlags;
1.77 +
1.78 +IMPORT_C GQuark g_spawn_error_quark (void);
1.79 +
1.80 +#ifdef G_OS_WIN32
1.81 +#define g_spawn_async g_spawn_async_utf8
1.82 +#define g_spawn_async_with_pipes g_spawn_async_with_pipes_utf8
1.83 +#define g_spawn_sync g_spawn_sync_utf8
1.84 +#define g_spawn_command_line_sync g_spawn_command_line_sync_utf8
1.85 +#define g_spawn_command_line_async g_spawn_command_line_async_utf8
1.86 +#endif
1.87 +
1.88 +IMPORT_C gboolean g_spawn_async (const gchar *working_directory,
1.89 + gchar **argv,
1.90 + gchar **envp,
1.91 + GSpawnFlags flags,
1.92 + GSpawnChildSetupFunc child_setup,
1.93 + gpointer user_data,
1.94 + GPid *child_pid,
1.95 + GError **error);
1.96 +
1.97 +
1.98 +/* Opens pipes for non-NULL standard_output, standard_input, standard_error,
1.99 + * and returns the parent's end of the pipes.
1.100 + */
1.101 +IMPORT_C gboolean g_spawn_async_with_pipes (const gchar *working_directory,
1.102 + gchar **argv,
1.103 + gchar **envp,
1.104 + GSpawnFlags flags,
1.105 + GSpawnChildSetupFunc child_setup,
1.106 + gpointer user_data,
1.107 + GPid *child_pid,
1.108 + gint *standard_input,
1.109 + gint *standard_output,
1.110 + gint *standard_error,
1.111 + GError **error);
1.112 +
1.113 +
1.114 +/* If standard_output or standard_error are non-NULL, the full
1.115 + * standard output or error of the command will be placed there.
1.116 + */
1.117 +
1.118 +IMPORT_C gboolean g_spawn_sync (const gchar *working_directory,
1.119 + gchar **argv,
1.120 + gchar **envp,
1.121 + GSpawnFlags flags,
1.122 + GSpawnChildSetupFunc child_setup,
1.123 + gpointer user_data,
1.124 + gchar **standard_output,
1.125 + gchar **standard_error,
1.126 + gint *exit_status,
1.127 + GError **error);
1.128 +
1.129 +IMPORT_C gboolean g_spawn_command_line_sync (const gchar *command_line,
1.130 + gchar **standard_output,
1.131 + gchar **standard_error,
1.132 + gint *exit_status,
1.133 + GError **error);
1.134 +IMPORT_C gboolean g_spawn_command_line_async (const gchar *command_line,
1.135 + GError **error);
1.136 +
1.137 +IMPORT_C void g_spawn_close_pid (GPid pid);
1.138 +
1.139 +
1.140 +G_END_DECLS
1.141 +
1.142 +#endif /* __G_SPAWN_H__ */
1.143 +
1.144 +