<?xml version="1.0"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.1.2//EN"
  "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">

<!-- $Id$ -->

<refentry id="gfarm-initialize.3">

<refentryinfo><date>26 Jun 2010</date></refentryinfo>

<refmeta>
<refentrytitle>gfarm_initialize</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>Gfarm</refmiscinfo>
</refmeta>

<refnamediv id="name">
<refname>gfarm_initialize</refname>
<refpurpose>initialize the Gfarm execution environment for client</refpurpose>
</refnamediv>
<refsynopsisdiv id="synopsis">
<funcsynopsis>
<funcsynopsisinfo format="linespecific">
#include &lt;gfarm/gfarm.h&gt;
</funcsynopsisinfo>

<funcprototype>
  <funcdef><function moreinfo="none"><returnvalue>gfarm_error_t</returnvalue> gfarm_initialize</function></funcdef>
    <paramdef>int *<parameter moreinfo="none">argcp</parameter></paramdef>
    <paramdef>char *** <parameter moreinfo="none">argvp</parameter></paramdef>
</funcprototype>

</funcsynopsis>
</refsynopsisdiv>

<!-- body begins here -->

<refsect1 id="description"><title>DESCRIPTION</title>
<para><function moreinfo="none">gfarm_initialize()</function> initializes the Gfarm
execution environment for client application.
This function should be called before any Gfarm library API.
<parameter moreinfo="none">argcp</parameter> is a pointer to the number of
arguments and <parameter moreinfo="none">argvp</parameter> is a pointer to the argument vector.</para>

</refsect1>

<refsect1 id="return-values"><title>RETURN VALUES</title>
<variablelist>

<varlistentry>
<term><constant>GFARM_ERR_NO_ERROR</constant></term>
<listitem>
<para>The function terminated successfully.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>GFARM_ERR_NO_MEMORY</constant></term>
<listitem>
<para>Insufficient memory was available.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>GFARM_ERR_UNKNOWN_HOST</constant></term>
<listitem>
<para>The metadata server cannot be resolved.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>GFARM_ERR_NETWORK_IS_UNREACHABLE</constant></term>
<listitem>
<para>Network is unrechable.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>GFARM_ERR_OPERATION_TIMED_OUT</constant></term>
<listitem>
<para>Connetion timeout occurs.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>GFARM_ERR_PROTOCOL</constant></term>
<listitem>
<para>Protocol error occurs.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>GFARM_ERR_BROKEN_PIPE</constant></term>
<listitem>
<para>Connection to the metadata server is broken.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>GFARM_ERR_PERMISSION_DENIED</constant></term>
<listitem>
<para>The requested access to the file is not allowed, or one of the
directories in <parameter moreinfo="none">gfarm_url</parameter> did not allow search (execute)
permission.  Or, the authentication to the metadata server fails.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>GFARM_ERR_PROTOCOL_NOT_SUPPORTED</constant></term>
<listitem>
<para>Specified authentication protocol is not supported.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>GFARM_ERR_AUTHENTICATION</constant></term>
<listitem>
<para>User authentication failed when connecting to the metadata server.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>Others</term>
<listitem>
<para>An error except the above occurred.  The reason is shown by its
<citerefentry><refentrytitle>gfarm_error_string</refentrytitle><manvolnum>3</manvolnum></citerefentry>.</para>
</listitem>
</varlistentry>

</variablelist>
</refsect1>

<refsect1 id="see-also"><title>SEE ALSO</title>
<para>
<citerefentry><refentrytitle>gfarm_terminate</refentrytitle><manvolnum>3</manvolnum></citerefentry>
</para>
</refsect1>
</refentry>

