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. |
---|
3 | |
---|
4 | Copyright (C) 1999 Free Software Foundation |
---|
5 | |
---|
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. |
---|
10 | |
---|
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. |
---|
15 | |
---|
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. |
---|
20 | |
---|
21 | Author: Ettore Perazzoli <ettore@gnu.org> |
---|
22 | */ |
---|
23 | |
---|
24 | #ifndef GNOME_VFS_PROCESS_H |
---|
25 | #define GNOME_VFS_PROCESS_H |
---|
26 | |
---|
27 | #include <glib.h> |
---|
28 | #include <signal.h> /* For the signal values. */ |
---|
29 | |
---|
30 | typedef enum { |
---|
31 | GNOME_VFS_PROCESS_OK, |
---|
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; |
---|
37 | |
---|
38 | typedef enum { |
---|
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; |
---|
45 | |
---|
46 | typedef enum { |
---|
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; |
---|
52 | |
---|
53 | typedef struct _GnomeVFSProcess GnomeVFSProcess; |
---|
54 | |
---|
55 | typedef void (* GnomeVFSProcessInitFunc) (gpointer data); |
---|
56 | |
---|
57 | typedef void (* GnomeVFSProcessCallback) (GnomeVFSProcess *process, |
---|
58 | gint status, |
---|
59 | gpointer data); |
---|
60 | |
---|
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, |
---|
66 | gpointer init_data, |
---|
67 | GnomeVFSProcessCallback callback, |
---|
68 | gpointer callback_data); |
---|
69 | GnomeVFSProcessResult gnome_vfs_process_signal (GnomeVFSProcess *process, |
---|
70 | guint signal_number); |
---|
71 | void gnome_vfs_process_free (GnomeVFSProcess *process); |
---|
72 | |
---|
73 | #endif /* GNOME_VFS_PROCESS_H */ |
---|