summaryrefslogtreecommitdiff
path: root/glib/src/spawn.hg
diff options
context:
space:
mode:
Diffstat (limited to 'glib/src/spawn.hg')
-rw-r--r--glib/src/spawn.hg69
1 files changed, 37 insertions, 32 deletions
diff --git a/glib/src/spawn.hg b/glib/src/spawn.hg
index bb53a087..c10e44bf 100644
--- a/glib/src/spawn.hg
+++ b/glib/src/spawn.hg
@@ -35,10 +35,15 @@ _WRAP_ENUM(SpawnFlags, GSpawnFlags, NO_GTYPE)
* @{
*/
-/** Exception class for errors occuring when spawning processes.
+/** %Exception class for errors occuring when spawning processes.
*/
_WRAP_GERROR(SpawnError, GSpawnError, G_SPAWN_ERROR, NO_GTYPE, s#^2BIG$#TOOBIG#)
+/** For instance,<br>
+ * void on_child_setup();
+ */
+typedef sigc::slot<void> SlotSpawnChildSetup;
+
/** Executes a child program asynchronously (your program will not
* block waiting for the child to exit). The child program is
* specified by the only argument that must be provided, @a argv.
@@ -175,7 +180,7 @@ _WRAP_GERROR(SpawnError, GSpawnError, G_SPAWN_ERROR, NO_GTYPE, s#^2BIG$#TOOBIG#)
* @param argv Child's argument vector.
* @param envp Child's environment.
* @param flags Flags from SpawnFlags
- * @param child_setup Slot to run in the child just before exec().
+ * @param child_setup Slot to run in the child just before exec(), or an empty slot.
* @param child_pid Return location for child process ID, or NULL.
* @param standard_input Return location for file descriptor to write to child's stdin, or NULL.
* @param standard_output Return location for file descriptor to read child's stdout, or NULL.
@@ -191,18 +196,18 @@ void spawn_async_with_pipes(const std::string& working_directory,
const Glib::ArrayHandle<std::string>& argv,
const Glib::ArrayHandle<std::string>& envp,
SpawnFlags flags = SPAWN_DEFAULT,
- const sigc::slot<void>& child_setup = sigc::slot<void>(),
- Pid* child_pid = 0,
- int* standard_input = 0,
- int* standard_output = 0,
- int* standard_error = 0);
+ const SlotSpawnChildSetup& child_setup = SlotSpawnChildSetup(),
+ Pid* child_pid = nullptr,
+ int* standard_input = nullptr,
+ int* standard_output = nullptr,
+ int* standard_error = nullptr);
/** Like the main spawn_async_with_pipes() method, but inheriting the parent's environment.
*
* @param working_directory Child's current working directory, or an empty string to inherit the parent's, in the GLib file name encoding.
* @param argv Child's argument vector.
* @param flags Flags from SpawnFlags
- * @param child_setup Slot to run in the child just before exec().
+ * @param child_setup Slot to run in the child just before exec(), or an empty slot.
* @param child_pid Return location for child process ID, or NULL.
* @param standard_input Return location for file descriptor to write to child's stdin, or NULL.
* @param standard_output Return location for file descriptor to read child's stdout, or NULL.
@@ -217,11 +222,11 @@ void spawn_async_with_pipes(const std::string& working_directory,
void spawn_async_with_pipes(const std::string& working_directory,
const Glib::ArrayHandle<std::string>& argv,
SpawnFlags flags = SPAWN_DEFAULT,
- const sigc::slot<void>& child_setup = sigc::slot<void>(),
- Pid* child_pid = 0,
- int* standard_input = 0,
- int* standard_output = 0,
- int* standard_error = 0);
+ const SlotSpawnChildSetup& child_setup = SlotSpawnChildSetup(),
+ Pid* child_pid = nullptr,
+ int* standard_input = nullptr,
+ int* standard_output = nullptr,
+ int* standard_error = nullptr);
/** See spawn_async_with_pipes() for a full description. This function
* simply calls the spawn_async_with_pipes() without any pipes.
@@ -236,7 +241,7 @@ void spawn_async_with_pipes(const std::string& working_directory,
* @param argv Child's argument vector.
* @param envp Child's environment.
* @param flags Flags from SpawnFlags.
- * @param child_setup Slot to run in the child just before exec().
+ * @param child_setup Slot to run in the child just before exec(), or an empty slot.
* @param child_pid Return location for child process ID, or NULL
*
* @throws SpawnError Errors are reported even if they occur in the child (for example if the
@@ -248,15 +253,15 @@ void spawn_async(const std::string& working_directory,
const Glib::ArrayHandle<std::string>& argv,
const Glib::ArrayHandle<std::string>& envp,
SpawnFlags flags = SPAWN_DEFAULT,
- const sigc::slot<void>& child_setup = sigc::slot<void>(),
- Pid* child_pid = 0);
+ const SlotSpawnChildSetup& child_setup = SlotSpawnChildSetup(),
+ Pid* child_pid = nullptr);
/** Like the main spawn_async() method, but inheriting the parent's environment.
*
* @param working_directory Child's current working directory, or an empty string to inherit parent's.
* @param argv Child's argument vector.
* @param flags Flags from SpawnFlags.
- * @param child_setup Slot to run in the child just before exec().
+ * @param child_setup Slot to run in the child just before exec(), or an empty slot.
* @param child_pid Return location for child process ID, or NULL
*
* @throws SpawnError Errors are reported even if they occur in the child (for example if the
@@ -267,8 +272,8 @@ void spawn_async(const std::string& working_directory,
void spawn_async(const std::string& working_directory,
const Glib::ArrayHandle<std::string>& argv,
SpawnFlags flags = SPAWN_DEFAULT,
- const sigc::slot<void>& child_setup = sigc::slot<void>(),
- Pid* child_pid = 0);
+ const SlotSpawnChildSetup& child_setup = SlotSpawnChildSetup(),
+ Pid* child_pid = nullptr);
/** Executes a child synchronously (waits for the child to exit before returning).
* All output from the child is stored in @a standard_output and @a standard_error,
@@ -291,7 +296,7 @@ void spawn_async(const std::string& working_directory,
* @param argv Child's argument vector.
* @param envp Child's environment.
* @param flags Flags from SpawnFlags
- * @param child_setup Slot to run in the child just before exec().
+ * @param child_setup Slot to run in the child just before exec(), or an empty slot.
* @param standard_output Return location for file descriptor to read child's stdout, or NULL.
* @param standard_error Return location for file descriptor to read child's stderr, or NULL.
* @param exit_status Return location for child exit status, as returned by waitpid(), or NULL
@@ -306,17 +311,17 @@ void spawn_sync(const std::string& working_directory,
const Glib::ArrayHandle<std::string>& argv,
const Glib::ArrayHandle<std::string>& envp,
SpawnFlags flags = SPAWN_DEFAULT,
- const sigc::slot<void>& child_setup = sigc::slot<void>(),
- std::string* standard_output = 0,
- std::string* standard_error = 0,
- int* exit_status = 0);
+ const SlotSpawnChildSetup& child_setup = SlotSpawnChildSetup(),
+ std::string* standard_output = nullptr,
+ std::string* standard_error = nullptr,
+ int* exit_status = nullptr);
/** Like the main spawn_sync() method, but inheriting the parent's environment.
*
* @param working_directory Child's current working directory, or an empty string to inherit the parent's, in the GLib file name encoding.
* @param argv Child's argument vector.
* @param flags Flags from SpawnFlags
- * @param child_setup Slot to run in the child just before exec().
+ * @param child_setup Slot to run in the child just before exec(), or an empty slot.
* @param standard_output Return location for file descriptor to read child's stdout, or NULL.
* @param standard_error Return location for file descriptor to read child's stderr, or NULL.
* @param exit_status Return location for child exit status, as returned by waitpid(), or NULL
@@ -330,10 +335,10 @@ void spawn_sync(const std::string& working_directory,
void spawn_sync(const std::string& working_directory,
const Glib::ArrayHandle<std::string>& argv,
SpawnFlags flags = SPAWN_DEFAULT,
- const sigc::slot<void>& child_setup = sigc::slot<void>(),
- std::string* standard_output = 0,
- std::string* standard_error = 0,
- int* exit_status = 0);
+ const SlotSpawnChildSetup& child_setup = SlotSpawnChildSetup(),
+ std::string* standard_output = nullptr,
+ std::string* standard_error = nullptr,
+ int* exit_status = nullptr);
/** A simple version of spawn_async() that parses a command line with
* shell_parse_argv() and passes it to spawn_async(). It runs a
@@ -388,9 +393,9 @@ void spawn_command_line_async(const std::string& command_line);
* @throws ShellError If the command line could not be parsed.
*/
void spawn_command_line_sync(const std::string& command_line,
- std::string* standard_output = 0,
- std::string* standard_error = 0,
- int* exit_status = 0);
+ std::string* standard_output = nullptr,
+ std::string* standard_error = nullptr,
+ int* exit_status = nullptr);
/** On some platforms, notably WIN32, the Pid type represents a resource
* which must be closed to prevent resource leaking. close_pid()