1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
2 /* gnome-vfs-process.h - Unified method for executing external processes.
4 Copyright (C) 1999 Free Software Foundation
6 The Gnome Library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Library General Public License as
8 published by the Free Software Foundation; either version 2 of the
9 License, or (at your option) any later version.
11 The Gnome 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 Library General Public License for more details.
16 You should have received a copy of the GNU Library General Public
17 License along with the Gnome Library; see the file COPYING.LIB. If not,
18 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA.
21 Author: Ettore Perazzoli <ettore@gnu.org>
24 #ifndef GNOME_VFS_PROCESS_H
25 #define GNOME_VFS_PROCESS_H
27 #include <glib/gtypes.h>
28 #include <signal.h> /* For the signal values. */
32 GNOME_VFS_PROCESS_ERROR_UNKNOWN,
33 GNOME_VFS_PROCESS_ERROR_INVALIDSIGNAL,
34 GNOME_VFS_PROCESS_ERROR_NOPERM,
35 GNOME_VFS_PROCESS_ERROR_NOPROCESS
36 } GnomeVFSProcessResult;
39 GNOME_VFS_PROCESS_RUN_OK,
40 GNOME_VFS_PROCESS_RUN_ERROR,
41 GNOME_VFS_PROCESS_RUN_CANCELLED,
42 GNOME_VFS_PROCESS_RUN_SIGNALED,
43 GNOME_VFS_PROCESS_RUN_STOPPED
44 } GnomeVFSProcessRunResult;
47 GNOME_VFS_PROCESS_DEFAULT = 0,
48 GNOME_VFS_PROCESS_USEPATH = 1 << 0,
49 GNOME_VFS_PROCESS_CLOSEFDS = 1 << 1,
50 GNOME_VFS_PROCESS_SETSID = 1 << 2
51 } GnomeVFSProcessOptions;
53 typedef struct _GnomeVFSProcess GnomeVFSProcess;
55 typedef void (* GnomeVFSProcessInitFunc) (gpointer data);
57 typedef void (* GnomeVFSProcessCallback) (GnomeVFSProcess *process,
61 gboolean _gnome_vfs_process_init (void);
62 GnomeVFSProcess * _gnome_vfs_process_new (const gchar *file_name,
63 const gchar * const argv[],
64 GnomeVFSProcessOptions options,
65 GnomeVFSProcessInitFunc init_func,
67 GnomeVFSProcessCallback callback,
68 gpointer callback_data);
69 GnomeVFSProcessResult _gnome_vfs_process_signal (GnomeVFSProcess *process,
71 void _gnome_vfs_process_free (GnomeVFSProcess *process);
73 #endif /* GNOME_VFS_PROCESS_H */