MOO_CMD_OPEN_CONSOLE

master
Yevgen Muntyan 2006-05-23 12:27:28 -05:00
parent 52290f476b
commit 75263a83a6
2 changed files with 38 additions and 7 deletions

View File

@ -61,6 +61,17 @@ static gboolean moo_cmd_run_command (MooCmd *cmd,
gpointer user_data,
GError **error);
#if 0 && defined(__WIN32__)
static gboolean moo_win32_spawn_async_with_pipes (const gchar *working_directory,
gchar **argv,
gchar **envp,
GSpawnFlags flags,
GPid *child_pid,
gint *standard_input,
gint *standard_output,
gint *standard_error,
GError **error);
#endif
enum {
@ -482,16 +493,35 @@ moo_cmd_run_command (MooCmd *cmd,
g_return_val_if_fail (!cmd->priv->running, FALSE);
if ((flags & G_SPAWN_STDOUT_TO_DEV_NULL) || (cmd_flags & MOO_CMD_STDOUT_TO_PARENT))
#ifdef __WIN32__
if (cmd_flags & MOO_CMD_OPEN_CONSOLE)
{
outp = NULL;
else
outp = &cmd->priv->stdout;
if ((flags & G_SPAWN_STDERR_TO_DEV_NULL) || (cmd_flags & MOO_CMD_STDERR_TO_PARENT))
errp = NULL;
}
else
errp = &cmd->priv->stderr;
#endif
{
if ((flags & G_SPAWN_STDOUT_TO_DEV_NULL) || (cmd_flags & MOO_CMD_STDOUT_TO_PARENT))
outp = NULL;
else
outp = &cmd->priv->stdout;
if ((flags & G_SPAWN_STDERR_TO_DEV_NULL) || (cmd_flags & MOO_CMD_STDERR_TO_PARENT))
errp = NULL;
else
errp = &cmd->priv->stderr;
}
#if 0 && defined(__WIN32__)
if (!(cmd_flags & MOO_CMD_OPEN_CONSOLE))
result = moo_win32_spawn_async_with_pipes (working_dir,
argv, envp,
flags | G_SPAWN_DO_NOT_REAP_CHILD,
&cmd->priv->pid,
NULL, outp, errp, error);
else
#endif
result = g_spawn_async_with_pipes (working_dir,
argv, envp,
flags | G_SPAWN_DO_NOT_REAP_CHILD,

View File

@ -37,7 +37,8 @@ typedef enum {
MOO_CMD_COLLECT_STDERR = 1 << 1,
MOO_CMD_STDOUT_TO_PARENT = 1 << 2,
MOO_CMD_STDERR_TO_PARENT = 1 << 3,
MOO_CMD_UTF8_OUTPUT = 1 << 4
MOO_CMD_UTF8_OUTPUT = 1 << 4,
MOO_CMD_OPEN_CONSOLE = 1 << 5
} MooCmdFlags;
struct _MooCmd