1 /* $Id: spawn.hg,v 1.4 2004/03/02 23:29:57 murrayc Exp $ */
3 /* Copyright (C) 2002 The gtkmm Development Team
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
15 * You should have received a copy of the GNU Library General Public
16 * License along with this library; if not, write to the Free
17 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 #include <sigc++/sigc++.h>
24 #include <glibmm/arrayhandle.h>
25 #include <glibmm/error.h>
27 #include <glibmmconfig.h>
28 GLIBMM_USING_STD(string)
36 _WRAP_ENUM(SpawnFlags, GSpawnFlags, NO_GTYPE)
38 /** @defgroup Spawn Spawning Processes
39 * Process launching with fork()/exec().
43 /** Exception class for errors occuring when spawning processes.
45 _WRAP_GERROR(SpawnError, GSpawnError, G_SPAWN_ERROR, NO_GTYPE, s#^2BIG$#TOOBIG#)
48 void spawn_async_with_pipes(const std::string& working_directory,
49 const Glib::ArrayHandle<std::string>& argv,
50 const Glib::ArrayHandle<std::string>& envp,
51 SpawnFlags flags = SpawnFlags(0),
52 const sigc::slot<void>& child_setup = sigc::slot<void>(),
54 int* standard_input = 0,
55 int* standard_output = 0,
56 int* standard_error = 0);
58 void spawn_async_with_pipes(const std::string& working_directory,
59 const Glib::ArrayHandle<std::string>& argv,
60 SpawnFlags flags = SpawnFlags(0),
61 const sigc::slot<void>& child_setup = sigc::slot<void>(),
63 int* standard_input = 0,
64 int* standard_output = 0,
65 int* standard_error = 0);
67 void spawn_async(const std::string& working_directory,
68 const Glib::ArrayHandle<std::string>& argv,
69 const Glib::ArrayHandle<std::string>& envp,
70 SpawnFlags flags = SpawnFlags(0),
71 const sigc::slot<void>& child_setup = sigc::slot<void>(),
74 void spawn_async(const std::string& working_directory,
75 const Glib::ArrayHandle<std::string>& argv,
76 SpawnFlags flags = SpawnFlags(0),
77 const sigc::slot<void>& child_setup = sigc::slot<void>(),
80 void spawn_sync(const std::string& working_directory,
81 const Glib::ArrayHandle<std::string>& argv,
82 const Glib::ArrayHandle<std::string>& envp,
83 SpawnFlags flags = SpawnFlags(0),
84 const sigc::slot<void>& child_setup = sigc::slot<void>(),
85 std::string* standard_output = 0,
86 std::string* standard_error = 0,
87 int* exit_status = 0);
89 void spawn_sync(const std::string& working_directory,
90 const Glib::ArrayHandle<std::string>& argv,
91 SpawnFlags flags = SpawnFlags(0),
92 const sigc::slot<void>& child_setup = sigc::slot<void>(),
93 std::string* standard_output = 0,
94 std::string* standard_error = 0,
95 int* exit_status = 0);
97 void spawn_command_line_async(const std::string& command_line);
99 void spawn_command_line_sync(const std::string& command_line,
100 std::string* standard_output = 0,
101 std::string* standard_error = 0,
102 int* exit_status = 0);
104 void spawn_close_pid(Pid pid);
106 /** @} group Spawn */