<?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="cutter-Experimental">
<refmeta>
<refentrytitle role="top_of_page" id="cutter-Experimental.top_of_page">Experimental</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>
  CUTTER Library
</refmiscinfo>
</refmeta>
<refnamediv>
<refname>Experimental</refname>
<refpurpose>Experimental API.</refpurpose>
</refnamediv>

<refsynopsisdiv id="cutter-Experimental.synopsis" role="synopsis">
<title role="synopsis.title">Synopsis</title>

<synopsis>#define             <link linkend="cut-fork">cut_fork</link>
#define             <link linkend="cut-wait-process">cut_wait_process</link>                    (pid,
                                                         usec_timeout)
#define             <link linkend="cut-fork-get-stdout-message">cut_fork_get_stdout_message</link>         (pid)
#define             <link linkend="cut-fork-get-stderr-message">cut_fork_get_stderr_message</link>         (pid)
</synopsis>
</refsynopsisdiv>

<refsect1 id="cutter-Experimental.description" role="desc">
<title role="desc.title">Description</title>
<para>
This API may be changed in the future.
</para>
</refsect1>
<refsect1 id="cutter-Experimental.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="cut-fork" role="macro" condition="since:0.8">
<title>cut_fork</title>
<indexterm zone="cut-fork" role="0.8"><primary>cut_fork</primary></indexterm>
<programlisting>#define             cut_fork()</programlisting>
<para>
Makes child process.
</para>
<para>
e.g.:
<informalexample><programlisting>
int pid;
pid = cut_fork();
cut_assert_errno();

if (pid == 0) {
  do_something_for_child_process();
  _exit(EXIT_SUCCESS);
}

do_something_for_parent_process();
</programlisting></informalexample>
</para><variablelist role="params">
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> Process ID.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 0.8</para></refsect2>
<refsect2 id="cut-wait-process" role="macro" condition="since:0.8">
<title>cut_wait_process()</title>
<indexterm zone="cut-wait-process" role="0.8"><primary>cut_wait_process</primary></indexterm>
<programlisting>#define             cut_wait_process(pid, usec_timeout)</programlisting>
<para>
Waits a process specified by <parameter>pid</parameter>.
</para>
<para>
e.g.:
<informalexample><programlisting>
int pid;
pid = cut_fork();
cut_assert_errno();

if (pid == 0) {
  do_something_for_child_process();
  _exit(EXIT_SUCCESS);
}

do_something_for_parent_process();
cut_assert_equal_int(EXIT_SUCCESS, cut_wait_process(pid, 100));
</programlisting></informalexample>
</para><variablelist role="params">
<varlistentry><term><parameter>pid</parameter>&#160;:</term>
<listitem><simpara>Process ID to wait.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>usec_timeout</parameter>&#160;:</term>
<listitem><simpara>Timeout in usec.
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 0.8</para></refsect2>
<refsect2 id="cut-fork-get-stdout-message" role="macro" condition="since:0.8">
<title>cut_fork_get_stdout_message()</title>
<indexterm zone="cut-fork-get-stdout-message" role="0.8"><primary>cut_fork_get_stdout_message</primary></indexterm>
<programlisting>#define             cut_fork_get_stdout_message(pid)</programlisting>
<para>
Reads a message from a process specified by <parameter>pid</parameter>.
</para>
<para>
e.g.:
<informalexample><programlisting>
int pid;
pid = cut_fork();
cut_assert_errno();

if (pid == 0) {
  g_print("I'm a child.");
  _exit(EXIT_SUCCESS);
}

cut_assert_equal_string("I'm a child.", cut_fork_get_stdout_message(pid));
cut_assert_equal_int(EXIT_SUCCESS, cut_wait_process(pid, 100));
</programlisting></informalexample>
</para><variablelist role="params">
<varlistentry><term><parameter>pid</parameter>&#160;:</term>
<listitem><simpara>Process ID.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a message read from stdout of a process specified by <parameter>pid</parameter>.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 0.8</para></refsect2>
<refsect2 id="cut-fork-get-stderr-message" role="macro" condition="since:0.8">
<title>cut_fork_get_stderr_message()</title>
<indexterm zone="cut-fork-get-stderr-message" role="0.8"><primary>cut_fork_get_stderr_message</primary></indexterm>
<programlisting>#define             cut_fork_get_stderr_message(pid)</programlisting>
<para>
Reads a message from a process specified by <parameter>pid</parameter>.
</para>
<para>
e.g.:
<informalexample><programlisting>
int pid;
pid = cut_fork();
cut_assert_errno();

if (pid == 0) {
  g_print("I'm a child.");
  _exit(EXIT_SUCCESS);
}

cut_assert_equal_string("I'm a child.", cut_fork_get_stderr_message(pid));
cut_assert_equal_int(EXIT_SUCCESS, cut_wait_process(pid, 100));
</programlisting></informalexample>
</para><variablelist role="params">
<varlistentry><term><parameter>pid</parameter>&#160;:</term>
<listitem><simpara>Process ID.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a message read from stderr of a process specified by <parameter>pid</parameter>.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 0.8</para></refsect2>

</refsect1>

</refentry>
