<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
<!ENTITY version SYSTEM "version.xml">
]>
<refentry id="GCutEgg">
<refmeta>
<refentrytitle role="top_of_page" id="GCutEgg.top_of_page">External command (deprecated)</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>
  CUTTER Library
</refmiscinfo>
</refmeta>
<refnamediv>
<refname>External command (deprecated)</refname>
<refpurpose>Convenience API for using external
command. (deprecated)</refpurpose>
</refnamediv>

<refsynopsisdiv id="GCutEgg.synopsis" role="synopsis">
<title role="synopsis.title">Synopsis</title>

<synopsis>#define             <link linkend="GCUT-EGG-ERROR:CAPS">GCUT_EGG_ERROR</link>
struct              <link linkend="GCutEgg-struct">GCutEgg</link>;
struct              <link linkend="GCutEggClass">GCutEggClass</link>;
enum                <link linkend="GCutEggError">GCutEggError</link>;
<link linkend="GQuark"><returnvalue>GQuark</returnvalue></link>              <link linkend="gcut-egg-error-quark">gcut_egg_error_quark</link>                (<parameter><type>void</type></parameter>);
<link linkend="GCutEgg"><returnvalue>GCutEgg</returnvalue></link> *           <link linkend="gcut-egg-new">gcut_egg_new</link>                        (<parameter>const <link linkend="gchar"><type>gchar</type></link> *command</parameter>,
                                                         <parameter>...</parameter>);
<link linkend="GCutEgg"><returnvalue>GCutEgg</returnvalue></link> *           <link linkend="gcut-egg-new-va-list">gcut_egg_new_va_list</link>                (<parameter>const <link linkend="gchar"><type>gchar</type></link> *command</parameter>,
                                                         <parameter><link linkend="va-list"><type>va_list</type></link> args</parameter>);
<link linkend="GCutEgg"><returnvalue>GCutEgg</returnvalue></link> *           <link linkend="gcut-egg-new-argv">gcut_egg_new_argv</link>                   (<parameter><link linkend="gint"><type>gint</type></link> argc</parameter>,
                                                         <parameter><link linkend="gchar"><type>gchar</type></link> **argv</parameter>);
<link linkend="GCutEgg"><returnvalue>GCutEgg</returnvalue></link> *           <link linkend="gcut-egg-new-strings">gcut_egg_new_strings</link>                (<parameter>const <link linkend="gchar"><type>gchar</type></link> **command</parameter>);
<link linkend="GCutEgg"><returnvalue>GCutEgg</returnvalue></link> *           <link linkend="gcut-egg-new-array">gcut_egg_new_array</link>                  (<parameter><link linkend="GArray"><type>GArray</type></link> *command</parameter>);
<link linkend="void"><returnvalue>void</returnvalue></link>                <link linkend="gcut-egg-set-flags">gcut_egg_set_flags</link>                  (<parameter><link linkend="GCutEgg"><type>GCutEgg</type></link> *egg</parameter>,
                                                         <parameter><link linkend="GSpawnFlags"><type>GSpawnFlags</type></link> flags</parameter>);
<link linkend="GSpawnFlags"><returnvalue>GSpawnFlags</returnvalue></link>         <link linkend="gcut-egg-get-flags">gcut_egg_get_flags</link>                  (<parameter><link linkend="GCutEgg"><type>GCutEgg</type></link> *egg</parameter>);
<link linkend="void"><returnvalue>void</returnvalue></link>                <link linkend="gcut-egg-set-env">gcut_egg_set_env</link>                    (<parameter><link linkend="GCutEgg"><type>GCutEgg</type></link> *egg</parameter>,
                                                         <parameter>const <link linkend="gchar"><type>gchar</type></link> *name</parameter>,
                                                         <parameter>...</parameter>);
<link linkend="gchar"><returnvalue>gchar</returnvalue></link> **            <link linkend="gcut-egg-get-env">gcut_egg_get_env</link>                    (<parameter><link linkend="GCutEgg"><type>GCutEgg</type></link> *egg</parameter>);
<link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>            <link linkend="gcut-egg-hatch">gcut_egg_hatch</link>                      (<parameter><link linkend="GCutEgg"><type>GCutEgg</type></link> *egg</parameter>,
                                                         <parameter><link linkend="GError"><type>GError</type></link> **error</parameter>);
<link linkend="void"><returnvalue>void</returnvalue></link>                <link linkend="gcut-egg-close">gcut_egg_close</link>                      (<parameter><link linkend="GCutEgg"><type>GCutEgg</type></link> *egg</parameter>);
<link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>            <link linkend="gcut-egg-write">gcut_egg_write</link>                      (<parameter><link linkend="GCutEgg"><type>GCutEgg</type></link> *egg</parameter>,
                                                         <parameter>const <link linkend="gchar"><type>gchar</type></link> *chunk</parameter>,
                                                         <parameter><link linkend="gsize"><type>gsize</type></link> size</parameter>,
                                                         <parameter><link linkend="GError"><type>GError</type></link> **error</parameter>);
<link linkend="GPid"><returnvalue>GPid</returnvalue></link>                <link linkend="gcut-egg-get-pid">gcut_egg_get_pid</link>                    (<parameter><link linkend="GCutEgg"><type>GCutEgg</type></link> *egg</parameter>);
<link linkend="gint"><returnvalue>gint</returnvalue></link>                <link linkend="gcut-egg-wait">gcut_egg_wait</link>                       (<parameter><link linkend="GCutEgg"><type>GCutEgg</type></link> *egg</parameter>,
                                                         <parameter><link linkend="guint"><type>guint</type></link> timeout</parameter>,
                                                         <parameter><link linkend="GError"><type>GError</type></link> **error</parameter>);
<link linkend="void"><returnvalue>void</returnvalue></link>                <link linkend="gcut-egg-kill">gcut_egg_kill</link>                       (<parameter><link linkend="GCutEgg"><type>GCutEgg</type></link> *egg</parameter>,
                                                         <parameter><link linkend="gint"><type>gint</type></link> signal_number</parameter>);
<link linkend="GIOChannel"><returnvalue>GIOChannel</returnvalue></link> *        <link linkend="gcut-egg-get-input">gcut_egg_get_input</link>                  (<parameter><link linkend="GCutEgg"><type>GCutEgg</type></link> *egg</parameter>);
<link linkend="GIOChannel"><returnvalue>GIOChannel</returnvalue></link> *        <link linkend="gcut-egg-get-output">gcut_egg_get_output</link>                 (<parameter><link linkend="GCutEgg"><type>GCutEgg</type></link> *egg</parameter>);
<link linkend="GIOChannel"><returnvalue>GIOChannel</returnvalue></link> *        <link linkend="gcut-egg-get-error">gcut_egg_get_error</link>                  (<parameter><link linkend="GCutEgg"><type>GCutEgg</type></link> *egg</parameter>);
<link linkend="guint"><returnvalue>guint</returnvalue></link>               <link linkend="gcut-egg-get-forced-termination-wait-time">gcut_egg_get_forced_termination_wait_time</link>
                                                        (<parameter><link linkend="GCutEgg"><type>GCutEgg</type></link> *egg</parameter>);
<link linkend="void"><returnvalue>void</returnvalue></link>                <link linkend="gcut-egg-set-forced-termination-wait-time">gcut_egg_set_forced_termination_wait_time</link>
                                                        (<parameter><link linkend="GCutEgg"><type>GCutEgg</type></link> *egg</parameter>,
                                                         <parameter><link linkend="guint"><type>guint</type></link> timeout</parameter>);
</synopsis>
</refsynopsisdiv>
<refsect1 id="GCutEgg.object-hierarchy" role="object_hierarchy">
<title role="object_hierarchy.title">Object Hierarchy</title>
<synopsis>
  <link linkend="GObject">GObject</link>
   +----GCutEgg
</synopsis>

</refsect1>
<refsect1 id="GCutEgg.properties" role="properties">
<title role="properties.title">Properties</title>
<synopsis>
  &quot;<link linkend="GCutEgg--command">command</link>&quot;                  <link linkend="gpointer"><type>gpointer</type></link>              : Read / Write
</synopsis>
</refsect1>
<refsect1 id="GCutEgg.signals" role="signal_proto">
<title role="signal_proto.title">Signals</title>
<synopsis>
  &quot;<link linkend="GCutEgg-error">error</link>&quot;                                          : <link linkend="G-SIGNAL-RUN-LAST:CAPS"><literal>Run Last</literal></link>
  &quot;<link linkend="GCutEgg-error-received">error-received</link>&quot;                                 : <link linkend="G-SIGNAL-RUN-LAST:CAPS"><literal>Run Last</literal></link>
  &quot;<link linkend="GCutEgg-output-received">output-received</link>&quot;                                : <link linkend="G-SIGNAL-RUN-LAST:CAPS"><literal>Run Last</literal></link>
  &quot;<link linkend="GCutEgg-reaped">reaped</link>&quot;                                         : <link linkend="G-SIGNAL-RUN-LAST:CAPS"><literal>Run Last</literal></link>
</synopsis>
</refsect1>

<refsect1 id="GCutEgg.description" role="desc">
<title role="desc.title">Description</title>
<para>
<link linkend="GCutEgg"><type>GCutEgg</type></link> encapsulates external command execution,
communication and termination. <link linkend="GCutEgg"><type>GCutEgg</type></link> reports an error
as <link linkend="GError"><type>GError</type></link>. It can be asserted easily by
<link linkend="gcut-assert-error"><function>gcut_assert_error()</function></link>.
</para>
<para>
External command is specified to constructor like
<link linkend="gcut-egg-new"><function>gcut_egg_new()</function></link>, <link linkend="gcut-egg-new-strings"><function>gcut_egg_new_strings()</function></link> and so
on. External command isn't run at the
time. <link linkend="gcut-egg-hatch"><function>gcut_egg_hatch()</function></link> runs specified external command.
</para>
<para>
Standard/Error outputs of external command are passed by
<link linkend="GCutEgg-output-received"><type>"output-received"</type></link>/<link linkend="GCutEgg-error-received"><type>"error-received"</type></link> signals
or <link linkend="GIOChannel"><type>GIOChannel</type></link> returned by
<link linkend="gcut-egg-get-output"><function>gcut_egg_get_output()</function></link>/<link linkend="gcut-egg-get-error"><function>gcut_egg_get_error()</function></link>.
<link linkend="gcut-egg-write"><function>gcut_egg_write()</function></link> writes a chunk to standard input of
external command.
</para>
<para>
To wait external command finished, <link linkend="gcut-egg-wait"><function>gcut_egg_wait()</function></link> can be
used. It accepts timeout to avoid infinite waiting.
</para>
<para>
e.g.:
<informalexample><programlisting>
static GString *output_string;
static GCutEgg *egg;

void
cut_setup (void)
{
    output_string = g_string_new(NULL);
    egg = NULL;
}

void
cut_teardown (void)
{
    if (output_string)
        g_string_free(output_string, TRUE);
    if (egg)
        g_object_unref(egg);
}

static void
cb_output_received (GCutEgg *egg, const gchar *chunk, gsize size,
                    gpointer user_data)
{
    g_string_append_len(output_string, chunk, size);
}

void
test_echo (void)
{
    GError *error = NULL;

    egg = gcut_egg_new("echo", "XXX", NULL);
    g_signal_connect(egg, "output-received",
                     G_CALLBACK(cb_output_received), NULL);

    gcut_egg_hatch(egg, &amp;error);
    gcut_assert_error(error);

    gcut_egg_wait(egg, 1000, &amp;error);
    gcut_assert_error(error);
    cut_assert_equal_string("XXX\n", output_string->str);
}
</programlisting></informalexample>
</para>
</refsect1>
<refsect1 id="GCutEgg.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="GCUT-EGG-ERROR:CAPS" role="macro" condition="deprecated:">
<title>GCUT_EGG_ERROR</title>
<indexterm zone="GCUT-EGG-ERROR:CAPS" role="deprecated"><primary>GCUT_EGG_ERROR</primary></indexterm>
<programlisting>#define GCUT_EGG_ERROR           (gcut_egg_error_quark())
</programlisting>
<warning><para><literal>GCUT_EGG_ERROR</literal> is deprecated and should not be used in newly-written code.</para></warning>
<para>
</para></refsect2>
<refsect2 id="GCutEgg-struct" role="struct">
<title>struct GCutEgg</title>
<indexterm zone="GCutEgg-struct" role="deprecated"><primary>GCutEgg</primary></indexterm>
<programlisting>struct GCutEgg;</programlisting>
<warning><para><literal>GCutEgg</literal> is deprecated and should not be used in newly-written code.</para></warning>
<para>
</para></refsect2>
<refsect2 id="GCutEggClass" role="struct" condition="deprecated:">
<title>struct GCutEggClass</title>
<indexterm zone="GCutEggClass" role="deprecated"><primary>GCutEggClass</primary></indexterm>
<programlisting>struct GCutEggClass {
    GObjectClass parent_class;

    void (*output_received) (GCutEgg     *egg,
                             const gchar *chunk,
                             gsize        size);
    void (*error_received)  (GCutEgg     *egg,
                             const gchar *chunk,
                             gsize        size);
    void (*reaped)          (GCutEgg     *egg,
                             gint         status);
    void (*error)           (GCutEgg     *egg,
                             GError      *error);
};
</programlisting>
<warning><para><literal>GCutEggClass</literal> is deprecated and should not be used in newly-written code.</para></warning>
<para>
</para></refsect2>
<refsect2 id="GCutEggError" role="enum" condition="deprecated:1.1.5: Use #GCutProcessError instead.|since:1.0.6">
<title>enum GCutEggError</title>
<indexterm zone="GCutEggError" role="deprecated"><primary>GCutEggError</primary></indexterm><indexterm zone="GCutEggError" role="1.0.6"><primary>GCutEggError</primary></indexterm>
<programlisting>typedef enum {
    GCUT_EGG_ERROR_COMMAND_LINE,
    GCUT_EGG_ERROR_IO_ERROR,
    GCUT_EGG_ERROR_ALREADY_RUNNING,
    GCUT_EGG_ERROR_NOT_RUNNING,
    GCUT_EGG_ERROR_INVALID_OBJECT,
    GCUT_EGG_ERROR_TIMEOUT
} GCutEggError;
</programlisting>
<warning><para><literal>GCutEggError</literal> has been deprecated since version 1.1.5 and should not be used in newly-written code. Use <link linkend="GCutProcessError"><type>GCutProcessError</type></link> instead.</para></warning>
<para>
Error codes returned by <link linkend="GCutEgg"><type>GCutEgg</type></link> related operations.
</para><variablelist role="enum">
<varlistentry id="GCUT-EGG-ERROR-COMMAND-LINE:CAPS" role="constant">
<term><literal>GCUT_EGG_ERROR_COMMAND_LINE</literal></term>
<listitem><simpara>Command line related error.
</simpara></listitem>
</varlistentry>
<varlistentry id="GCUT-EGG-ERROR-IO-ERROR:CAPS" role="constant">
<term><literal>GCUT_EGG_ERROR_IO_ERROR</literal></term>
<listitem><simpara>IO error.
</simpara></listitem>
</varlistentry>
<varlistentry id="GCUT-EGG-ERROR-ALREADY-RUNNING:CAPS" role="constant">
<term><literal>GCUT_EGG_ERROR_ALREADY_RUNNING</literal></term>
<listitem><simpara>External command is already running.
</simpara></listitem>
</varlistentry>
<varlistentry id="GCUT-EGG-ERROR-NOT-RUNNING:CAPS" role="constant">
<term><literal>GCUT_EGG_ERROR_NOT_RUNNING</literal></term>
<listitem><simpara>External command isn't running.
</simpara></listitem>
</varlistentry>
<varlistentry id="GCUT-EGG-ERROR-INVALID-OBJECT:CAPS" role="constant">
<term><literal>GCUT_EGG_ERROR_INVALID_OBJECT</literal></term>
<listitem><simpara>Invalid <link linkend="GCutEgg"><type>GCutEgg</type></link> object is passed.
</simpara></listitem>
</varlistentry>
<varlistentry id="GCUT-EGG-ERROR-TIMEOUT:CAPS" role="constant">
<term><literal>GCUT_EGG_ERROR_TIMEOUT</literal></term>
<listitem><simpara>Timeout.
</simpara></listitem>
</varlistentry>
</variablelist><para role="since">Since 1.0.6</para></refsect2>
<refsect2 id="gcut-egg-error-quark" role="function" condition="deprecated:">
<title>gcut_egg_error_quark ()</title>
<indexterm zone="gcut-egg-error-quark" role="deprecated"><primary>gcut_egg_error_quark</primary></indexterm>
<programlisting><link linkend="GQuark"><returnvalue>GQuark</returnvalue></link>              gcut_egg_error_quark                (<parameter><type>void</type></parameter>);</programlisting>
<warning><para><literal>gcut_egg_error_quark</literal> is deprecated and should not be used in newly-written code.</para></warning>
<para>
</para></refsect2>
<refsect2 id="gcut-egg-new" role="function" condition="deprecated:1.1.5: Use gcut_process_new() instead.|since:1.0.6">
<title>gcut_egg_new ()</title>
<indexterm zone="gcut-egg-new" role="deprecated"><primary>gcut_egg_new</primary></indexterm><indexterm zone="gcut-egg-new" role="1.0.6"><primary>gcut_egg_new</primary></indexterm>
<programlisting><link linkend="GCutEgg"><returnvalue>GCutEgg</returnvalue></link> *           gcut_egg_new                        (<parameter>const <link linkend="gchar"><type>gchar</type></link> *command</parameter>,
                                                         <parameter>...</parameter>);</programlisting>
<warning><para><literal>gcut_egg_new</literal> has been deprecated since version 1.1.5 and should not be used in newly-written code. Use <link linkend="gcut-process-new"><function>gcut_process_new()</function></link> instead.</para></warning>
<para>
Creates a new <link linkend="GCutEgg"><type>GCutEgg</type></link> object that runs <parameter>command</parameter>.
</para><variablelist role="params">
<varlistentry><term><parameter>command</parameter>&#160;:</term>
<listitem><simpara>the external command name to be ran</simpara></listitem></varlistentry>
<varlistentry><term><parameter>...</parameter>&#160;:</term>
<listitem><simpara>the arguments for <parameter>command</parameter></simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>a new <link linkend="GCutEgg"><type>GCutEgg</type></link>.</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 1.0.6</para></refsect2>
<refsect2 id="gcut-egg-new-va-list" role="function" condition="deprecated:1.1.5: Use gcut_process_new_va_list() instead.|since:1.0.6">
<title>gcut_egg_new_va_list ()</title>
<indexterm zone="gcut-egg-new-va-list" role="deprecated"><primary>gcut_egg_new_va_list</primary></indexterm><indexterm zone="gcut-egg-new-va-list" role="1.0.6"><primary>gcut_egg_new_va_list</primary></indexterm>
<programlisting><link linkend="GCutEgg"><returnvalue>GCutEgg</returnvalue></link> *           gcut_egg_new_va_list                (<parameter>const <link linkend="gchar"><type>gchar</type></link> *command</parameter>,
                                                         <parameter><link linkend="va-list"><type>va_list</type></link> args</parameter>);</programlisting>
<warning><para><literal>gcut_egg_new_va_list</literal> has been deprecated since version 1.1.5 and should not be used in newly-written code. Use <link linkend="gcut-process-new-va-list"><function>gcut_process_new_va_list()</function></link> instead.</para></warning>
<para>
Creates a new <link linkend="GCutEgg"><type>GCutEgg</type></link> object that runs <parameter>command</parameter>.
</para><variablelist role="params">
<varlistentry><term><parameter>command</parameter>&#160;:</term>
<listitem><simpara>the external command name to be ran</simpara></listitem></varlistentry>
<varlistentry><term><parameter>args</parameter>&#160;:</term>
<listitem><simpara>arguments for <parameter>command</parameter></simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>a new <link linkend="GCutEgg"><type>GCutEgg</type></link>.</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 1.0.6</para></refsect2>
<refsect2 id="gcut-egg-new-argv" role="function" condition="deprecated:1.1.5: Use gcut_process_new_argv() instead.|since:1.0.6">
<title>gcut_egg_new_argv ()</title>
<indexterm zone="gcut-egg-new-argv" role="deprecated"><primary>gcut_egg_new_argv</primary></indexterm><indexterm zone="gcut-egg-new-argv" role="1.0.6"><primary>gcut_egg_new_argv</primary></indexterm>
<programlisting><link linkend="GCutEgg"><returnvalue>GCutEgg</returnvalue></link> *           gcut_egg_new_argv                   (<parameter><link linkend="gint"><type>gint</type></link> argc</parameter>,
                                                         <parameter><link linkend="gchar"><type>gchar</type></link> **argv</parameter>);</programlisting>
<warning><para><literal>gcut_egg_new_argv</literal> has been deprecated since version 1.1.5 and should not be used in newly-written code. Use <link linkend="gcut-process-new-argv"><function>gcut_process_new_argv()</function></link> instead.</para></warning>
<para>
Creates a new <link linkend="GCutEgg"><type>GCutEgg</type></link> object that runs <parameter>command</parameter>.
</para><variablelist role="params">
<varlistentry><term><parameter>argc</parameter>&#160;:</term>
<listitem><simpara>the number of elements of <parameter>argv</parameter></simpara></listitem></varlistentry>
<varlistentry><term><parameter>argv</parameter>&#160;:</term>
<listitem><simpara>the external command name to be ran and arguments
of it.</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>a new <link linkend="GCutEgg"><type>GCutEgg</type></link>.</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 1.0.6</para></refsect2>
<refsect2 id="gcut-egg-new-strings" role="function" condition="deprecated:1.1.5: Use gcut_process_new_strings() instead.|since:1.0.6">
<title>gcut_egg_new_strings ()</title>
<indexterm zone="gcut-egg-new-strings" role="deprecated"><primary>gcut_egg_new_strings</primary></indexterm><indexterm zone="gcut-egg-new-strings" role="1.0.6"><primary>gcut_egg_new_strings</primary></indexterm>
<programlisting><link linkend="GCutEgg"><returnvalue>GCutEgg</returnvalue></link> *           gcut_egg_new_strings                (<parameter>const <link linkend="gchar"><type>gchar</type></link> **command</parameter>);</programlisting>
<warning><para><literal>gcut_egg_new_strings</literal> has been deprecated since version 1.1.5 and should not be used in newly-written code. Use <link linkend="gcut-process-new-strings"><function>gcut_process_new_strings()</function></link> instead.</para></warning>
<para>
Creates a new <link linkend="GCutEgg"><type>GCutEgg</type></link> object that runs <parameter>command</parameter>.
</para><variablelist role="params">
<varlistentry><term><parameter>command</parameter>&#160;:</term>
<listitem><simpara>the external command name to be ran and
arguments of it. <link linkend="NULL:CAPS"><literal>NULL</literal></link>-terminated.</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>a new <link linkend="GCutEgg"><type>GCutEgg</type></link>.</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 1.0.6</para></refsect2>
<refsect2 id="gcut-egg-new-array" role="function" condition="deprecated:1.1.5: Use gcut_process_new_array() instead.|since:1.0.6">
<title>gcut_egg_new_array ()</title>
<indexterm zone="gcut-egg-new-array" role="deprecated"><primary>gcut_egg_new_array</primary></indexterm><indexterm zone="gcut-egg-new-array" role="1.0.6"><primary>gcut_egg_new_array</primary></indexterm>
<programlisting><link linkend="GCutEgg"><returnvalue>GCutEgg</returnvalue></link> *           gcut_egg_new_array                  (<parameter><link linkend="GArray"><type>GArray</type></link> *command</parameter>);</programlisting>
<warning><para><literal>gcut_egg_new_array</literal> has been deprecated since version 1.1.5 and should not be used in newly-written code. Use <link linkend="gcut-process-new-array"><function>gcut_process_new_array()</function></link> instead.</para></warning>
<para>
Creates a new <link linkend="GCutEgg"><type>GCutEgg</type></link> object that runs <parameter>command</parameter>.
</para><variablelist role="params">
<varlistentry><term><parameter>command</parameter>&#160;:</term>
<listitem><simpara>the external command name to be ran and
arguments of it. The <link linkend="GArray"><type>GArray</type></link> should be zero-terminated.</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>a new <link linkend="GCutEgg"><type>GCutEgg</type></link>.</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 1.0.6</para></refsect2>
<refsect2 id="gcut-egg-set-flags" role="function" condition="deprecated:1.1.5: Use gcut_process_set_flags() instead.|since:1.0.6">
<title>gcut_egg_set_flags ()</title>
<indexterm zone="gcut-egg-set-flags" role="deprecated"><primary>gcut_egg_set_flags</primary></indexterm><indexterm zone="gcut-egg-set-flags" role="1.0.6"><primary>gcut_egg_set_flags</primary></indexterm>
<programlisting><link linkend="void"><returnvalue>void</returnvalue></link>                gcut_egg_set_flags                  (<parameter><link linkend="GCutEgg"><type>GCutEgg</type></link> *egg</parameter>,
                                                         <parameter><link linkend="GSpawnFlags"><type>GSpawnFlags</type></link> flags</parameter>);</programlisting>
<warning><para><literal>gcut_egg_set_flags</literal> has been deprecated since version 1.1.5 and should not be used in newly-written code. Use <link linkend="gcut-process-set-flags"><function>gcut_process_set_flags()</function></link> instead.</para></warning>
<para>
Sets <parameter>flags</parameter> for spawning.
</para><variablelist role="params">
<varlistentry><term><parameter>egg</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GCutEgg"><type>GCutEgg</type></link></simpara></listitem></varlistentry>
<varlistentry><term><parameter>flags</parameter>&#160;:</term>
<listitem><simpara>the flags to be passed to <link linkend="g-spawn-async-with-pipes"><function>g_spawn_async_with_pipes()</function></link>.</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 1.0.6</para></refsect2>
<refsect2 id="gcut-egg-get-flags" role="function" condition="deprecated:1.1.5: Use gcut_process_get_flags() instead.|since:1.0.6">
<title>gcut_egg_get_flags ()</title>
<indexterm zone="gcut-egg-get-flags" role="deprecated"><primary>gcut_egg_get_flags</primary></indexterm><indexterm zone="gcut-egg-get-flags" role="1.0.6"><primary>gcut_egg_get_flags</primary></indexterm>
<programlisting><link linkend="GSpawnFlags"><returnvalue>GSpawnFlags</returnvalue></link>         gcut_egg_get_flags                  (<parameter><link linkend="GCutEgg"><type>GCutEgg</type></link> *egg</parameter>);</programlisting>
<warning><para><literal>gcut_egg_get_flags</literal> has been deprecated since version 1.1.5 and should not be used in newly-written code. Use <link linkend="gcut-process-get-flags"><function>gcut_process_get_flags()</function></link> instead.</para></warning>
<para>
Gets <parameter>flags</parameter> for spawning.
</para><variablelist role="params">
<varlistentry><term><parameter>egg</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GCutEgg"><type>GCutEgg</type></link></simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>the flags for spawning.</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 1.0.6</para></refsect2>
<refsect2 id="gcut-egg-set-env" role="function" condition="deprecated:1.1.5: Use gcut_process_set_env() instead.|since:1.0.6">
<title>gcut_egg_set_env ()</title>
<indexterm zone="gcut-egg-set-env" role="deprecated"><primary>gcut_egg_set_env</primary></indexterm><indexterm zone="gcut-egg-set-env" role="1.0.6"><primary>gcut_egg_set_env</primary></indexterm>
<programlisting><link linkend="void"><returnvalue>void</returnvalue></link>                gcut_egg_set_env                    (<parameter><link linkend="GCutEgg"><type>GCutEgg</type></link> *egg</parameter>,
                                                         <parameter>const <link linkend="gchar"><type>gchar</type></link> *name</parameter>,
                                                         <parameter>...</parameter>);</programlisting>
<warning><para><literal>gcut_egg_set_env</literal> has been deprecated since version 1.1.5 and should not be used in newly-written code. Use <link linkend="gcut-process-set-env"><function>gcut_process_set_env()</function></link> instead.</para></warning>
<para>
Sets environment variable for external command.
</para><variablelist role="params">
<varlistentry><term><parameter>egg</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GCutEgg"><type>GCutEgg</type></link></simpara></listitem></varlistentry>
<varlistentry><term><parameter>name</parameter>&#160;:</term>
<listitem><simpara>the first environment name.</simpara></listitem></varlistentry>
<varlistentry><term><parameter>...</parameter>&#160;:</term>
<listitem><simpara>the value of <parameter>name</parameter>, followed by name and value
pairs. <link linkend="NULL:CAPS"><literal>NULL</literal></link>-terminated.</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 1.0.6</para></refsect2>
<refsect2 id="gcut-egg-get-env" role="function" condition="deprecated:1.1.5: Use gcut_process_get_env() instead.|since:1.0.6">
<title>gcut_egg_get_env ()</title>
<indexterm zone="gcut-egg-get-env" role="deprecated"><primary>gcut_egg_get_env</primary></indexterm><indexterm zone="gcut-egg-get-env" role="1.0.6"><primary>gcut_egg_get_env</primary></indexterm>
<programlisting><link linkend="gchar"><returnvalue>gchar</returnvalue></link> **            gcut_egg_get_env                    (<parameter><link linkend="GCutEgg"><type>GCutEgg</type></link> *egg</parameter>);</programlisting>
<warning><para><literal>gcut_egg_get_env</literal> has been deprecated since version 1.1.5 and should not be used in newly-written code. Use <link linkend="gcut-process-get-env"><function>gcut_process_get_env()</function></link> instead.</para></warning>
<para>
Gets environment variable for external command.
</para><variablelist role="params">
<varlistentry><term><parameter>egg</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GCutEgg"><type>GCutEgg</type></link></simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>a newly-allocated <link linkend="NULL:CAPS"><literal>NULL</literal></link>-terminated environment
variables. ("NAME1=VALUE1", "NAME2=VALUE2",
..., <link linkend="NULL:CAPS"><literal>NULL</literal></link>) It should be freed by <link linkend="g-strfreev"><function>g_strfreev()</function></link> when no longer
needed.</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 1.0.6</para></refsect2>
<refsect2 id="gcut-egg-hatch" role="function" condition="deprecated:1.1.5: Use gcut_process_run() instead.|since:1.0.6">
<title>gcut_egg_hatch ()</title>
<indexterm zone="gcut-egg-hatch" role="deprecated"><primary>gcut_egg_hatch</primary></indexterm><indexterm zone="gcut-egg-hatch" role="1.0.6"><primary>gcut_egg_hatch</primary></indexterm>
<programlisting><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>            gcut_egg_hatch                      (<parameter><link linkend="GCutEgg"><type>GCutEgg</type></link> *egg</parameter>,
                                                         <parameter><link linkend="GError"><type>GError</type></link> **error</parameter>);</programlisting>
<warning><para><literal>gcut_egg_hatch</literal> has been deprecated since version 1.1.5 and should not be used in newly-written code. Use <link linkend="gcut-process-run"><function>gcut_process_run()</function></link> instead.</para></warning>
<para>
Hatches a new external process.
</para><variablelist role="params">
<varlistentry><term><parameter>egg</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GCutEgg"><type>GCutEgg</type></link></simpara></listitem></varlistentry>
<varlistentry><term><parameter>error</parameter>&#160;:</term>
<listitem><simpara>return location for an error, or <link linkend="NULL:CAPS"><literal>NULL</literal></link></simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara><link linkend="TRUE:CAPS"><literal>TRUE</literal></link> on success, otherwise <link linkend="FALSE:CAPS"><literal>FALSE</literal></link></simpara></listitem></varlistentry>
</variablelist><para role="since">Since 1.0.6</para></refsect2>
<refsect2 id="gcut-egg-close" role="function" condition="deprecated:1.1.5: no need to close explicitly on #GCutProcess.|since:1.0.6">
<title>gcut_egg_close ()</title>
<indexterm zone="gcut-egg-close" role="deprecated"><primary>gcut_egg_close</primary></indexterm><indexterm zone="gcut-egg-close" role="1.0.6"><primary>gcut_egg_close</primary></indexterm>
<programlisting><link linkend="void"><returnvalue>void</returnvalue></link>                gcut_egg_close                      (<parameter><link linkend="GCutEgg"><type>GCutEgg</type></link> *egg</parameter>);</programlisting>
<warning><para><literal>gcut_egg_close</literal> has been deprecated since version 1.1.5 and should not be used in newly-written code. no need to close explicitly on <link linkend="GCutProcess"><type>GCutProcess</type></link>.</para></warning>
<para>
Closes a hatched external process. It is closed
implicitly on destroy.
</para><variablelist role="params">
<varlistentry><term><parameter>egg</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GCutEgg"><type>GCutEgg</type></link></simpara></listitem></varlistentry>
</variablelist><para role="since">Since 1.0.6</para></refsect2>
<refsect2 id="gcut-egg-write" role="function" condition="deprecated:1.1.5: Use gcut_process_write() instead.|since:1.0.6">
<title>gcut_egg_write ()</title>
<indexterm zone="gcut-egg-write" role="deprecated"><primary>gcut_egg_write</primary></indexterm><indexterm zone="gcut-egg-write" role="1.0.6"><primary>gcut_egg_write</primary></indexterm>
<programlisting><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>            gcut_egg_write                      (<parameter><link linkend="GCutEgg"><type>GCutEgg</type></link> *egg</parameter>,
                                                         <parameter>const <link linkend="gchar"><type>gchar</type></link> *chunk</parameter>,
                                                         <parameter><link linkend="gsize"><type>gsize</type></link> size</parameter>,
                                                         <parameter><link linkend="GError"><type>GError</type></link> **error</parameter>);</programlisting>
<warning><para><literal>gcut_egg_write</literal> has been deprecated since version 1.1.5 and should not be used in newly-written code. Use <link linkend="gcut-process-write"><function>gcut_process_write()</function></link> instead.</para></warning>
<para>
Writes <parameter>chunk</parameter> to external process's standard input.
</para><variablelist role="params">
<varlistentry><term><parameter>egg</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GCutEgg"><type>GCutEgg</type></link></simpara></listitem></varlistentry>
<varlistentry><term><parameter>chunk</parameter>&#160;:</term>
<listitem><simpara>the data to be wrote</simpara></listitem></varlistentry>
<varlistentry><term><parameter>size</parameter>&#160;:</term>
<listitem><simpara>the size of <parameter>chunk</parameter></simpara></listitem></varlistentry>
<varlistentry><term><parameter>error</parameter>&#160;:</term>
<listitem><simpara>return location for an error, or <link linkend="NULL:CAPS"><literal>NULL</literal></link></simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara><link linkend="TRUE:CAPS"><literal>TRUE</literal></link> on success, otherwise <link linkend="FALSE:CAPS"><literal>FALSE</literal></link></simpara></listitem></varlistentry>
</variablelist><para role="since">Since 1.0.6</para></refsect2>
<refsect2 id="gcut-egg-get-pid" role="function" condition="deprecated:1.1.5: Use gcut_process_get_pid() instead.|since:1.0.6">
<title>gcut_egg_get_pid ()</title>
<indexterm zone="gcut-egg-get-pid" role="deprecated"><primary>gcut_egg_get_pid</primary></indexterm><indexterm zone="gcut-egg-get-pid" role="1.0.6"><primary>gcut_egg_get_pid</primary></indexterm>
<programlisting><link linkend="GPid"><returnvalue>GPid</returnvalue></link>                gcut_egg_get_pid                    (<parameter><link linkend="GCutEgg"><type>GCutEgg</type></link> *egg</parameter>);</programlisting>
<warning><para><literal>gcut_egg_get_pid</literal> has been deprecated since version 1.1.5 and should not be used in newly-written code. Use <link linkend="gcut-process-get-pid"><function>gcut_process_get_pid()</function></link> instead.</para></warning>
<para>
Gets the process ID of running external process. If
external process isn't running, 0 is returned.
</para><variablelist role="params">
<varlistentry><term><parameter>egg</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GCutEgg"><type>GCutEgg</type></link></simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>the process ID of running external process if
external process is running, otherwise 0.</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 1.0.6</para></refsect2>
<refsect2 id="gcut-egg-wait" role="function" condition="deprecated:1.1.5: Use gcut_process_wait() instead.|since:1.0.6">
<title>gcut_egg_wait ()</title>
<indexterm zone="gcut-egg-wait" role="deprecated"><primary>gcut_egg_wait</primary></indexterm><indexterm zone="gcut-egg-wait" role="1.0.6"><primary>gcut_egg_wait</primary></indexterm>
<programlisting><link linkend="gint"><returnvalue>gint</returnvalue></link>                gcut_egg_wait                       (<parameter><link linkend="GCutEgg"><type>GCutEgg</type></link> *egg</parameter>,
                                                         <parameter><link linkend="guint"><type>guint</type></link> timeout</parameter>,
                                                         <parameter><link linkend="GError"><type>GError</type></link> **error</parameter>);</programlisting>
<warning><para><literal>gcut_egg_wait</literal> has been deprecated since version 1.1.5 and should not be used in newly-written code. Use <link linkend="gcut-process-wait"><function>gcut_process_wait()</function></link> instead.</para></warning>
<para>
Waits running external process is finished while <parameter>timeout</parameter>
milliseconds. If external process isn't finished while
<parameter>timeout</parameter> milliseconds, <link linkend="GCUT-EGG-ERROR-TIMEOUT:CAPS"><literal>GCUT_EGG_ERROR_TIMEOUT</literal></link> error is
set and -1 is returned. If external process isn't
running, <link linkend="GCUT-EGG-ERROR-NOT-RUNNING:CAPS"><literal>GCUT_EGG_ERROR_NOT_RUNNING</literal></link> error is set and -1
is returned.
</para><variablelist role="params">
<varlistentry><term><parameter>egg</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GCutEgg"><type>GCutEgg</type></link></simpara></listitem></varlistentry>
<varlistentry><term><parameter>timeout</parameter>&#160;:</term>
<listitem><simpara>the timeout period in milliseconds</simpara></listitem></varlistentry>
<varlistentry><term><parameter>error</parameter>&#160;:</term>
<listitem><simpara>return location for an error, or <link linkend="NULL:CAPS"><literal>NULL</literal></link></simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>an exit status of external process on success,
otherwise -1.</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 1.0.6</para></refsect2>
<refsect2 id="gcut-egg-kill" role="function" condition="deprecated:1.1.5: Use gcut_process_kill() instead.|since:1.0.6">
<title>gcut_egg_kill ()</title>
<indexterm zone="gcut-egg-kill" role="deprecated"><primary>gcut_egg_kill</primary></indexterm><indexterm zone="gcut-egg-kill" role="1.0.6"><primary>gcut_egg_kill</primary></indexterm>
<programlisting><link linkend="void"><returnvalue>void</returnvalue></link>                gcut_egg_kill                       (<parameter><link linkend="GCutEgg"><type>GCutEgg</type></link> *egg</parameter>,
                                                         <parameter><link linkend="gint"><type>gint</type></link> signal_number</parameter>);</programlisting>
<warning><para><literal>gcut_egg_kill</literal> has been deprecated since version 1.1.5 and should not be used in newly-written code. Use <link linkend="gcut-process-kill"><function>gcut_process_kill()</function></link> instead.</para></warning>
<para>
Sends <parameter>signal_number</parameter> signal to external process.
</para><variablelist role="params">
<varlistentry><term><parameter>egg</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GCutEgg"><type>GCutEgg</type></link></simpara></listitem></varlistentry>
<varlistentry><term><parameter>signal_number</parameter>&#160;:</term>
<listitem><simpara>the signal number to be sent to external process</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 1.0.6</para></refsect2>
<refsect2 id="gcut-egg-get-input" role="function" condition="deprecated:1.1.5: Use gcut_process_get_input_channel() instead.|since:1.0.6">
<title>gcut_egg_get_input ()</title>
<indexterm zone="gcut-egg-get-input" role="deprecated"><primary>gcut_egg_get_input</primary></indexterm><indexterm zone="gcut-egg-get-input" role="1.0.6"><primary>gcut_egg_get_input</primary></indexterm>
<programlisting><link linkend="GIOChannel"><returnvalue>GIOChannel</returnvalue></link> *        gcut_egg_get_input                  (<parameter><link linkend="GCutEgg"><type>GCutEgg</type></link> *egg</parameter>);</programlisting>
<warning><para><literal>gcut_egg_get_input</literal> has been deprecated since version 1.1.5 and should not be used in newly-written code. Use <link linkend="gcut-process-get-input-channel"><function>gcut_process_get_input_channel()</function></link> instead.</para></warning>
<para>
Gets a <link linkend="GIOChannel"><type>GIOChannel</type></link> connected with standard input of
external process.
</para><variablelist role="params">
<varlistentry><term><parameter>egg</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GCutEgg"><type>GCutEgg</type></link></simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>a <link linkend="GIOChannel"><type>GIOChannel</type></link> if external process is running,
otherwise <link linkend="NULL:CAPS"><literal>NULL</literal></link>.</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 1.0.6</para></refsect2>
<refsect2 id="gcut-egg-get-output" role="function" condition="deprecated:1.1.5: Use gcut_process_get_output_channel() instead.|since:1.0.6">
<title>gcut_egg_get_output ()</title>
<indexterm zone="gcut-egg-get-output" role="deprecated"><primary>gcut_egg_get_output</primary></indexterm><indexterm zone="gcut-egg-get-output" role="1.0.6"><primary>gcut_egg_get_output</primary></indexterm>
<programlisting><link linkend="GIOChannel"><returnvalue>GIOChannel</returnvalue></link> *        gcut_egg_get_output                 (<parameter><link linkend="GCutEgg"><type>GCutEgg</type></link> *egg</parameter>);</programlisting>
<warning><para><literal>gcut_egg_get_output</literal> has been deprecated since version 1.1.5 and should not be used in newly-written code. Use <link linkend="gcut-process-get-output-channel"><function>gcut_process_get_output_channel()</function></link> instead.</para></warning>
<para>
Gets a <link linkend="GIOChannel"><type>GIOChannel</type></link> connected with standard output of
external process.
</para><variablelist role="params">
<varlistentry><term><parameter>egg</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GCutEgg"><type>GCutEgg</type></link></simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>a <link linkend="GIOChannel"><type>GIOChannel</type></link> if external process is running,
otherwise <link linkend="NULL:CAPS"><literal>NULL</literal></link>.</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 1.0.6</para></refsect2>
<refsect2 id="gcut-egg-get-error" role="function" condition="deprecated:1.1.5: Use gcut_process_get_error_channel() instead.|since:1.0.6">
<title>gcut_egg_get_error ()</title>
<indexterm zone="gcut-egg-get-error" role="deprecated"><primary>gcut_egg_get_error</primary></indexterm><indexterm zone="gcut-egg-get-error" role="1.0.6"><primary>gcut_egg_get_error</primary></indexterm>
<programlisting><link linkend="GIOChannel"><returnvalue>GIOChannel</returnvalue></link> *        gcut_egg_get_error                  (<parameter><link linkend="GCutEgg"><type>GCutEgg</type></link> *egg</parameter>);</programlisting>
<warning><para><literal>gcut_egg_get_error</literal> has been deprecated since version 1.1.5 and should not be used in newly-written code. Use <link linkend="gcut-process-get-error-channel"><function>gcut_process_get_error_channel()</function></link> instead.</para></warning>
<para>
Gets a <link linkend="GIOChannel"><type>GIOChannel</type></link> connected with standard error output
of external process.
</para><variablelist role="params">
<varlistentry><term><parameter>egg</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GCutEgg"><type>GCutEgg</type></link></simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>a <link linkend="GIOChannel"><type>GIOChannel</type></link> if external process is running,
otherwise <link linkend="NULL:CAPS"><literal>NULL</literal></link>.</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 1.0.6</para></refsect2>
<refsect2 id="gcut-egg-get-forced-termination-wait-time" role="function" condition="deprecated:1.1.5: Use gcut_process_get_forced_termination_wait_time() instead.|since:1.0.6">
<title>gcut_egg_get_forced_termination_wait_time ()</title>
<indexterm zone="gcut-egg-get-forced-termination-wait-time" role="deprecated"><primary>gcut_egg_get_forced_termination_wait_time</primary></indexterm><indexterm zone="gcut-egg-get-forced-termination-wait-time" role="1.0.6"><primary>gcut_egg_get_forced_termination_wait_time</primary></indexterm>
<programlisting><link linkend="guint"><returnvalue>guint</returnvalue></link>               gcut_egg_get_forced_termination_wait_time
                                                        (<parameter><link linkend="GCutEgg"><type>GCutEgg</type></link> *egg</parameter>);</programlisting>
<warning><para><literal>gcut_egg_get_forced_termination_wait_time</literal> has been deprecated since version 1.1.5 and should not be used in newly-written code. Use <link linkend="gcut-process-get-forced-termination-wait-time"><function>gcut_process_get_forced_termination_wait_time()</function></link> instead.</para></warning>
<para>
Gets a wait time in milliseconds for forced termination
on dispose.
</para><variablelist role="params">
<varlistentry><term><parameter>egg</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GCutEgg"><type>GCutEgg</type></link></simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>a timeout value for waiting forced terminated
external command on dispose.</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 1.0.6</para></refsect2>
<refsect2 id="gcut-egg-set-forced-termination-wait-time" role="function" condition="deprecated:1.1.5: Use gcut_process_set_forced_termination_wait_time() instead.|since:1.0.6">
<title>gcut_egg_set_forced_termination_wait_time ()</title>
<indexterm zone="gcut-egg-set-forced-termination-wait-time" role="deprecated"><primary>gcut_egg_set_forced_termination_wait_time</primary></indexterm><indexterm zone="gcut-egg-set-forced-termination-wait-time" role="1.0.6"><primary>gcut_egg_set_forced_termination_wait_time</primary></indexterm>
<programlisting><link linkend="void"><returnvalue>void</returnvalue></link>                gcut_egg_set_forced_termination_wait_time
                                                        (<parameter><link linkend="GCutEgg"><type>GCutEgg</type></link> *egg</parameter>,
                                                         <parameter><link linkend="guint"><type>guint</type></link> timeout</parameter>);</programlisting>
<warning><para><literal>gcut_egg_set_forced_termination_wait_time</literal> has been deprecated since version 1.1.5 and should not be used in newly-written code. Use <link linkend="gcut-process-set-forced-termination-wait-time"><function>gcut_process_set_forced_termination_wait_time()</function></link> instead.</para></warning>
<para>
Sets a wait time in milliseconds for forced termination
on dispose. If <parameter>timeout</parameter> is 0, it doesn't wait
termination of external process. The default value is 10.
</para><variablelist role="params">
<varlistentry><term><parameter>egg</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GCutEgg"><type>GCutEgg</type></link></simpara></listitem></varlistentry>
<varlistentry><term><parameter>timeout</parameter>&#160;:</term>
<listitem><simpara>the timeout value in milliseconds</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 1.0.6</para></refsect2>

</refsect1>
<refsect1 id="GCutEgg.property-details" role="property_details">
<title role="property_details.title">Property Details</title>
<refsect2 id="GCutEgg--command" role="property"><title>The <literal>&quot;command&quot;</literal> property</title>
<indexterm zone="GCutEgg--command"><primary>GCutEgg:command</primary></indexterm>
<programlisting>  &quot;command&quot;                  <link linkend="gpointer"><type>gpointer</type></link>              : Read / Write</programlisting>
<para>The command to be ran by the egg.</para></refsect2>

</refsect1>
<refsect1 id="GCutEgg.signal-details" role="signals">
<title role="signals.title">Signal Details</title>
<refsect2 id="GCutEgg-error" role="signal"><title>The <literal>&quot;error&quot;</literal> signal</title>
<indexterm zone="GCutEgg-error" role="1.0.6"><primary>GCutEgg::error</primary></indexterm>
<programlisting><link linkend="void"><returnvalue>void</returnvalue></link>                user_function                      (<link linkend="GCutEgg"><type>GCutEgg</type></link> *egg,
                                                        <link linkend="gpointer"><type>gpointer</type></link> error,
                                                        <link linkend="gpointer"><type>gpointer</type></link> user_data)      : <link linkend="G-SIGNAL-RUN-LAST:CAPS"><literal>Run Last</literal></link></programlisting>
<para>
It is emitted each time an external process causes an
error. (e.g. IO error)
</para><variablelist role="params">
<varlistentry><term><parameter>egg</parameter>&#160;:</term>
<listitem><simpara>the object which received the signal.</simpara></listitem></varlistentry>
<varlistentry><term><parameter>error</parameter>&#160;:</term>
<listitem><simpara>the error of an external process. (<link linkend="GError"><literal>GError</literal></link>)</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter>&#160;:</term>
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 1.0.6</para></refsect2><refsect2 id="GCutEgg-error-received" role="signal"><title>The <literal>&quot;error-received&quot;</literal> signal</title>
<indexterm zone="GCutEgg-error-received" role="1.0.6"><primary>GCutEgg::error-received</primary></indexterm>
<programlisting><link linkend="void"><returnvalue>void</returnvalue></link>                user_function                      (<link linkend="GCutEgg"><type>GCutEgg</type></link> *egg,
                                                        <link linkend="gchar"><type>gchar</type></link>   *chunk,
                                                        <link linkend="guint64"><type>guint64</type></link>  size,
                                                        <link linkend="gpointer"><type>gpointer</type></link> user_data)      : <link linkend="G-SIGNAL-RUN-LAST:CAPS"><literal>Run Last</literal></link></programlisting>
<para>
It is emitted each time an external process outputs
something to its standard error output and it is
read.
</para>
<para>
Note that you need to run GLib's main loop by
<link linkend="g-main-loop-run"><function>g_main_loop_run()</function></link>, <link linkend="g-main-context-iteration"><function>g_main_context_iteration()</function></link> and so
on for detecting an external process's output is
readable.
</para><variablelist role="params">
<varlistentry><term><parameter>egg</parameter>&#160;:</term>
<listitem><simpara>the object which received the signal.</simpara></listitem></varlistentry>
<varlistentry><term><parameter>chunk</parameter>&#160;:</term>
<listitem><simpara>the chunk read from an external process's
standard error output.</simpara></listitem></varlistentry>
<varlistentry><term><parameter>size</parameter>&#160;:</term>
<listitem><simpara>the size of <parameter>chunk</parameter>. (<link linkend="gsize"><literal>gsize</literal></link>)</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter>&#160;:</term>
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 1.0.6</para></refsect2><refsect2 id="GCutEgg-output-received" role="signal"><title>The <literal>&quot;output-received&quot;</literal> signal</title>
<indexterm zone="GCutEgg-output-received" role="1.0.6"><primary>GCutEgg::output-received</primary></indexterm>
<programlisting><link linkend="void"><returnvalue>void</returnvalue></link>                user_function                      (<link linkend="GCutEgg"><type>GCutEgg</type></link> *egg,
                                                        <link linkend="gchar"><type>gchar</type></link>   *chunk,
                                                        <link linkend="guint64"><type>guint64</type></link>  size,
                                                        <link linkend="gpointer"><type>gpointer</type></link> user_data)      : <link linkend="G-SIGNAL-RUN-LAST:CAPS"><literal>Run Last</literal></link></programlisting>
<para>
It is emitted each time an external process outputs
something to its standard output and it is read.
</para>
<para>
Note that you need to run GLib's main loop by
<link linkend="g-main-loop-run"><function>g_main_loop_run()</function></link>, <link linkend="g-main-context-iteration"><function>g_main_context_iteration()</function></link> and so
on for detecting an external process's output is
readable.
</para><variablelist role="params">
<varlistentry><term><parameter>egg</parameter>&#160;:</term>
<listitem><simpara>the object which received the signal.</simpara></listitem></varlistentry>
<varlistentry><term><parameter>chunk</parameter>&#160;:</term>
<listitem><simpara>the chunk read from an external process's
standard output.</simpara></listitem></varlistentry>
<varlistentry><term><parameter>size</parameter>&#160;:</term>
<listitem><simpara>the size of <parameter>chunk</parameter>. (<link linkend="gsize"><literal>gsize</literal></link>)</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter>&#160;:</term>
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 1.0.6</para></refsect2><refsect2 id="GCutEgg-reaped" role="signal"><title>The <literal>&quot;reaped&quot;</literal> signal</title>
<indexterm zone="GCutEgg-reaped" role="1.0.6"><primary>GCutEgg::reaped</primary></indexterm>
<programlisting><link linkend="void"><returnvalue>void</returnvalue></link>                user_function                      (<link linkend="GCutEgg"><type>GCutEgg</type></link> *egg,
                                                        <link linkend="gint"><type>gint</type></link>     status,
                                                        <link linkend="gpointer"><type>gpointer</type></link> user_data)      : <link linkend="G-SIGNAL-RUN-LAST:CAPS"><literal>Run Last</literal></link></programlisting>
<para>
It is emitted when an external process is exited.
</para>
<para>
Note that you need to run GLib's main loop by
<link linkend="g-main-loop-run"><function>g_main_loop_run()</function></link>, <link linkend="g-main-context-iteration"><function>g_main_context_iteration()</function></link> and so
on for detecting an external process is exited.
</para><variablelist role="params">
<varlistentry><term><parameter>egg</parameter>&#160;:</term>
<listitem><simpara>the object which received the signal.</simpara></listitem></varlistentry>
<varlistentry><term><parameter>status</parameter>&#160;:</term>
<listitem><simpara>the exit status of an external process.</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter>&#160;:</term>
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 1.0.6</para></refsect2>
</refsect1>

</refentry>
