<?xml version="1.0" encoding="UTF-8"?>
<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:html="http://www.w3.org/1999/xhtml" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="getNbOutputArgument" xml:lang="en">
    <refnamediv>
        <refname>getNbOutputArgument (Scilab gateway)</refname>
        <refpurpose>
            A C gateway function which provides the number of output
            arguments present in the calling Scilab function
        </refpurpose>
    </refnamediv>
    <refsynopsisdiv>
        <title>Syntax</title>
        <synopsis>int* nb_params = getNbOutputArgument(void* _pvCtx)</synopsis>
        <synopsis>int nb_params = nbOutputArgument(void* _pvCtx)</synopsis>
        <synopsis>int nb_params = Lhs</synopsis>
    </refsynopsisdiv>
    <refsection>
        <title>Arguments</title>
        <variablelist>
            <varlistentry>
                <term>_pvCtx</term>
                <listitem>
                    <para>
                        Scilab environment pointer, pass in "pvApiCtx" provided by api_scilab.h
                    </para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>nb_params</term>
                <listitem>
                    <para>
                        the pointer on the number of output arguments present in the calling Scilab
                        function
                    </para>
                </listitem>
            </varlistentry>
        </variablelist>
    </refsection>
    <refsection>
        <title>Description</title>
        <para>
            getNbOutputArgument provides a C gateway function which provides the number of
            output arguments present in the calling Scilab function. You must include
            api_scilab.h to benefit from this function.
        </para>
    </refsection>
    <refsection>
        <title>Examples</title>
        <para>
            In this example, the C gateway function can take several output
            arguments and prints in the Scilab console the integer corresponding to
            the number of output arguments detected in the calling Scilab
            function.
        </para>
        <programlisting role="example">
            <![CDATA[
#include "api_scilab.h"
#include "sciprint.h"

int sci_mylhs(char * fname)
{
  sciprint("The number of output arguments is %d\n", *getNbOutputArgument());

  return 0;
}
 ]]>
        </programlisting>
    </refsection>
    <refsection role="see also">
        <title>See also</title>
        <simplelist type="inline">
            <member>
                <link linkend="getNbInputArgument">getNbInputArgument</link>
            </member>
            <member>
                <link linkend="sciprint">sciprint</link>
            </member>
        </simplelist>
    </refsection>
</refentry>
