<?xml version="1.0" encoding="UTF-8"?>
<!--
 * Scilab ( https://www.scilab.org/ ) - This file is part of Scilab
 * Copyright (C) DIGITEO - Pierre MARECHAL <pierre.marechal@scilab.org>
 *
 * Copyright (C) 2012 - 2016 - Scilab Enterprises
 *
 * This file is hereby licensed under the terms of the GNU GPL v2.0,
 * pursuant to article 5.3.4 of the CeCILL v.2.1.
 * This file was originally licensed under the terms of the CeCILL v2.1,
 * and continues to be available under such terms.
 * For more information, see the COPYING file which you should have received
 * along with this program.
 *
 -->
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
          xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML"
          xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org"
          xml:lang="en" xml:id="atomsIsInstalled">
    <refnamediv>
        <refname>atomsIsInstalled</refname>
        <refpurpose>Determines whether the module is installed. Returns true if the module is installed, false otherwise.</refpurpose>
    </refnamediv>
    <!-- ===================================================================== -->
    <!-- Syntax -->
    <!-- ===================================================================== -->
    <refsynopsisdiv>
        <title>Syntax</title>
        <synopsis>
            res = atomsIsInstalled(modules)
            res = atomsIsInstalled(modules, section)
        </synopsis>
    </refsynopsisdiv>
    <!-- ===================================================================== -->
    <!-- Parameters -->
    <!-- ===================================================================== -->
    <refsection>
        <title>Arguments</title>
        <variablelist>
            <!-- 1st input parameter -->
            <varlistentry>
                <term>modules</term>
                <listitem>
                    <para>
                        mx1, mx2 Matrix of strings:
                    </para>
                    <informaltable border="1">
                        <!-- Technical name -->
                        <tr>
                            <td>
                                <emphasis>1st Col.</emphasis>
                            </td>
                            <td>
                                <emphasis role="strong">Technical name</emphasis>
                            </td>
                            <td>
                                Mandatory
                            </td>
                            <td>
                            </td>
                        </tr>
                        <!-- Version -->
                        <tr>
                            <td>
                                <emphasis>2nd Col.</emphasis>
                            </td>
                            <td>
                                <emphasis role="strong">Version</emphasis>
                            </td>
                            <td>
                                Optional
                            </td>
                            <td>
                                If this field is empty or is not present,
                                module's version is ignored.
                            </td>
                        </tr>
                        <!-- Section -->
                        <tr>
                            <td>
                                <emphasis>3rd Col.</emphasis>
                            </td>
                            <td>
                                <emphasis role="strong">Section</emphasis>
                            </td>
                            <td>
                                Optional
                            </td>
                            <td>
                                If this field is empty or is not present,
                                module's section is ignored.
                            </td>
                        </tr>
                    </informaltable>
                </listitem>
            </varlistentry>
            <!-- 2nd input parameter -->
            <varlistentry>
                <term>section</term>
                <listitem>
                    <para>
                        This argument controls the list of searched modules.
                    </para>
                    <para>
                        <literal>section</literal> is a single-string and its value should be :
                    </para>
                    <itemizedlist>
                        <listitem>
                            <para>
                                <literal>"all"</literal>: atomsIsInstalled() searches external
                                modules installed in both "user" and "allusers" sections.
                            </para>
                        </listitem>
                        <listitem>
                            <para>
                                <literal>"allusers"</literal>: atomsIsInstalled() searches external
                                modules installed in the "allusers" section.
                            </para>
                        </listitem>
                        <listitem>
                            <para>
                                <literal>"user"</literal>: atomsIsInstalled() searches external
                                modules installed in the "user" section.
                            </para>
                        </listitem>
                    </itemizedlist>
                    <para>
                        The default value is "all".
                    </para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>res</term>
                <listitem>
                    <para>
                    </para>
                </listitem>
            </varlistentry>
        </variablelist>
    </refsection>
    <!-- ===================================================================== -->
    <!-- Description -->
    <!-- ===================================================================== -->
    <refsection>
        <title>Description</title>
        <para>

        </para>
    </refsection>
    <!-- ===================================================================== -->
    <!-- Examples -->
    <!-- ===================================================================== -->
    <refsection>
        <title>Examples</title>
        <programlisting role="example"><![CDATA[
atomsSetConfig("Verbose","True");
atomsRepositoryAdd("https://scene1.test.atoms.scilab.org");

// Install the needed module for the purpose of the example
atomsInstall("toolbox_5","user");

// simplest way
atomsIsInstalled("toolbox_5");

// Check several modules ...
atomsIsInstalled(["toolbox_5" "toolbox_4"])

// ... with a specific version
atomsIsInstalled(["toolbox_5" "1.0" ; "toolbox_4" "1.0" ; "toolbox_5" "1.1"])

// ... installed in a specific section
atomsIsInstalled(["toolbox_5" "1.0" ; "toolbox_4" "1.0" ; "toolbox_5" "1.1"],"user")
atomsIsInstalled(["toolbox_5" "1.0" ; "toolbox_4" "1.0" ; "toolbox_5" "1.1"],"allusers")

// Some cleaning ...
atomsRepositoryDel("https://scene2.test.atoms.scilab.org");
atomsRemove("toolbox_2");
]]></programlisting>
    </refsection>
    <!-- ===================================================================== -->
    <!-- See also -->
    <!-- ===================================================================== -->
    <refsection role="see also">
        <title>See also</title>
        <simplelist type="inline">
            <member>
                <link linkend="atomsInstall">atomsInstall</link>
            </member>
            <member>
                <link linkend="atomsGetInstalled">atomsGetInstalled</link>
            </member>
        </simplelist>
    </refsection>
    <!-- ===================================================================== -->
    <!-- Authors -->
    <!-- ===================================================================== -->
</refentry>
