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 | |
---|
31 | /* WARNING: These types should go into "gnome-vfs-private-types.h", but we have |
---|
32 | decided to make these API calls public for now, so I prefer to leave them |
---|
33 | here. */ |
---|
34 | |
---|
35 | enum _GnomeVFSProcessResult { |
---|
36 | GNOME_VFS_PROCESS_OK, |
---|
37 | GNOME_VFS_PROCESS_ERROR_UNKNOWN, |
---|
38 | GNOME_VFS_PROCESS_ERROR_INVALIDSIGNAL, |
---|
39 | GNOME_VFS_PROCESS_ERROR_NOPERM, |
---|
40 | GNOME_VFS_PROCESS_ERROR_NOPROCESS |
---|
41 | }; |
---|
42 | typedef enum _GnomeVFSProcessResult GnomeVFSProcessResult; |
---|
43 | |
---|
44 | enum _GnomeVFSProcessRunResult { |
---|
45 | GNOME_VFS_PROCESS_RUN_OK, |
---|
46 | GNOME_VFS_PROCESS_RUN_ERROR, |
---|
47 | GNOME_VFS_PROCESS_RUN_CANCELLED, |
---|
48 | GNOME_VFS_PROCESS_RUN_SIGNALED, |
---|
49 | GNOME_VFS_PROCESS_RUN_STOPPED |
---|
50 | }; |
---|
51 | typedef enum _GnomeVFSProcessRunResult GnomeVFSProcessRunResult; |
---|
52 | |
---|
53 | enum _GnomeVFSProcessOptions { |
---|
54 | GNOME_VFS_PROCESS_DEFAULT = 0, |
---|
55 | GNOME_VFS_PROCESS_USEPATH = 1 << 0, |
---|
56 | GNOME_VFS_PROCESS_CLOSEFDS = 1 << 1, |
---|
57 | GNOME_VFS_PROCESS_SETSID = 1 << 2 |
---|
58 | }; |
---|
59 | typedef enum _GnomeVFSProcessOptions GnomeVFSProcessOptions; |
---|
60 | |
---|
61 | typedef struct _GnomeVFSProcess GnomeVFSProcess; |
---|
62 | |
---|
63 | typedef void (* GnomeVFSProcessInitFunc) (gpointer data); |
---|
64 | |
---|
65 | typedef void (* GnomeVFSProcessCallback) (GnomeVFSProcess *process, |
---|
66 | gint status, |
---|
67 | gpointer data); |
---|
68 | |
---|
69 | |
---|
70 | gboolean gnome_vfs_process_init (void); |
---|
71 | |
---|
72 | GnomeVFSProcess *gnome_vfs_process_new (const gchar *file_name, |
---|
73 | const gchar * const argv[], |
---|
74 | GnomeVFSProcessOptions options, |
---|
75 | GnomeVFSProcessInitFunc init_func, |
---|
76 | gpointer init_data, |
---|
77 | GnomeVFSProcessCallback callback, |
---|
78 | gpointer callback_data); |
---|
79 | |
---|
80 | GnomeVFSProcessResult |
---|
81 | gnome_vfs_process_signal |
---|
82 | (GnomeVFSProcess *process, |
---|
83 | guint signal_number); |
---|
84 | |
---|
85 | void gnome_vfs_process_free (GnomeVFSProcess *process); |
---|
86 | |
---|
87 | #endif /* _GNOME_VFS_PROCESS_H */ |
---|