~ubuntu-branches/ubuntu/raring/scilab/raring-proposed

« back to all changes in this revision

Viewing changes to modules/api_scilab/help/en_US/low_level_functions/CheckInputArgument.xml

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2012-08-30 14:42:38 UTC
  • mfrom: (1.4.7)
  • Revision ID: package-import@ubuntu.com-20120830144238-c1y2og7dbm7m9nig
Tags: 5.4.0-beta-3-1~exp1
* New upstream release
* Update the scirenderer dep
* Get ride of libjhdf5-java dependency

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
<?xml version="1.0" encoding="UTF-8"?>
2
2
<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" version="5.0-subset Scilab" xml:id="CheckInputArgument" xml:lang="en">
3
 
  <refnamediv>
4
 
    <refname>CheckInputArgument</refname>
5
 
    <refpurpose>
6
 
      C function which checks the number of input arguments present in
7
 
      the calling Scilab function.
8
 
    </refpurpose>
9
 
  </refnamediv>
10
 
  <refsynopsisdiv>
11
 
    <title>Calling Sequence</title>
12
 
    <synopsis>CheckInputArgument(void* pvCtx, int iMin, int iMax)</synopsis>
13
 
  </refsynopsisdiv>
14
 
  <refsection>
15
 
    <title>Arguments</title>
16
 
    <variablelist>
17
 
      <varlistentry>
18
 
        <term>pvApiCtx</term>
19
 
        <listitem>
20
 
          <para>
21
 
            Scilab environment pointer, pass in "pvApiCtx" provided by api_scilab.h
22
 
          </para>
23
 
        </listitem>
24
 
      </varlistentry>
25
 
      <varlistentry>
26
 
        <term>iMin</term>
27
 
        <listitem>
28
 
          <para>
29
 
            the minimum number of input arguments which must be present
30
 
            in the calling Scilab function
31
 
          </para>
32
 
        </listitem>
33
 
      </varlistentry>
34
 
      <varlistentry>
35
 
        <term>iMax</term>
36
 
        <listitem>
37
 
          <para>
38
 
            the maximum number of input arguments which must be present
39
 
            in the calling Scilab function
40
 
          </para>
41
 
        </listitem>
42
 
      </varlistentry>
43
 
    </variablelist>
44
 
  </refsection>
45
 
  <refsection>
46
 
    <title>Description</title>
47
 
    <para>
48
 
      C function which checks the number of input arguments present in the
49
 
      calling Scilab function. You must include api_scilab.h to benefit from this
50
 
      function.
51
 
    </para>
52
 
    <para>
53
 
      If the number of arguments is not between _iMin and
54
 
      _iMax, we quit the C interface (<literal>return 0;</literal>) and
55
 
      an error is returned in the Scilab console.
56
 
    </para>
57
 
    <para>
58
 
      Since <literal>CheckInputArgument</literal> is doing a <literal>
59
 
        return
60
 
        0;
61
 
      </literal>
62
 
      within the gateway function, it is important to call this
63
 
      function before any memory allocation in order to avoid any memory
64
 
      leak.
65
 
    </para>
66
 
    <para>
67
 
      This function replaces the deprecated <literal>CheckLhs</literal> function
68
 
    </para>
69
 
  </refsection>
70
 
  <refsection>
71
 
    <title>Examples</title>
72
 
    <para>
73
 
      In this example, the C gateway function checks for a number of
74
 
      input arguments which must be between 2 and 3.
75
 
    </para>
76
 
    <programlisting role="example"><![CDATA[ 
 
3
    <refnamediv>
 
4
        <refname>CheckInputArgument</refname>
 
5
        <refpurpose>
 
6
            C function which checks the number of input arguments present in
 
7
            the calling Scilab function.
 
8
        </refpurpose>
 
9
    </refnamediv>
 
10
    <refsynopsisdiv>
 
11
        <title>Calling Sequence</title>
 
12
        <synopsis>CheckInputArgument(void* pvCtx, int iMin, int iMax)</synopsis>
 
13
    </refsynopsisdiv>
 
14
    <refsection>
 
15
        <title>Arguments</title>
 
16
        <variablelist>
 
17
            <varlistentry>
 
18
                <term>pvApiCtx</term>
 
19
                <listitem>
 
20
                    <para>
 
21
                        Scilab environment pointer, pass in "pvApiCtx" provided by api_scilab.h
 
22
                    </para>
 
23
                </listitem>
 
24
            </varlistentry>
 
25
            <varlistentry>
 
26
                <term>iMin</term>
 
27
                <listitem>
 
28
                    <para>
 
29
                        the minimum number of input arguments which must be present
 
30
                        in the calling Scilab function
 
31
                    </para>
 
32
                </listitem>
 
33
            </varlistentry>
 
34
            <varlistentry>
 
35
                <term>iMax</term>
 
36
                <listitem>
 
37
                    <para>
 
38
                        the maximum number of input arguments which must be present
 
39
                        in the calling Scilab function
 
40
                    </para>
 
41
                </listitem>
 
42
            </varlistentry>
 
43
        </variablelist>
 
44
    </refsection>
 
45
    <refsection>
 
46
        <title>Description</title>
 
47
        <para>
 
48
            C function which checks the number of input arguments present in the
 
49
            calling Scilab function. You must include api_scilab.h to benefit from this
 
50
            function.
 
51
        </para>
 
52
        <para>
 
53
            If the number of arguments is not between _iMin and
 
54
            _iMax, we quit the C interface (<literal>return 0;</literal>) and
 
55
            an error is returned in the Scilab console.
 
56
        </para>
 
57
        <para>
 
58
            Since <literal>CheckInputArgument</literal> is doing a <literal>
 
59
                return
 
60
                0;
 
61
            </literal>
 
62
            within the gateway function, it is important to call this
 
63
            function before any memory allocation in order to avoid any memory
 
64
            leak.
 
65
        </para>
 
66
        <para>
 
67
            This function replaces the deprecated <literal>CheckLhs</literal> function
 
68
        </para>
 
69
    </refsection>
 
70
    <refsection>
 
71
        <title>Examples</title>
 
72
        <para>
 
73
            In this example, the C gateway function checks for a number of
 
74
            input arguments which must be between 2 and 3.
 
75
        </para>
 
76
        <programlisting role="example"><![CDATA[ 
77
77
#include <api_scilab.h>
78
78
 
79
79
int sci_mycheckrhs(char * fname)
89
89
  return 0;
90
90
}
91
91
 ]]></programlisting>
92
 
    <para>Now, some functions testing this interface:</para>
93
 
    <programlisting role="example"><![CDATA[ 
 
92
        <para>Now, some functions testing this interface:</para>
 
93
        <programlisting role="example"><![CDATA[ 
94
94
mycheckrhs(A,B); // OK, 2 input arguments
95
95
mycheckrhs(A,B,C); // OK, 3 input arguments
96
96
mycheckrhs(A); // ERROR, 1 input argument
97
97
mycheckrhs(A,B,C,D); // ERROR, 4 input arguments]]></programlisting>
98
 
  </refsection>
99
 
  <refsection role="see also">
100
 
    <title>See Also</title>
101
 
    <simplelist type="inline">
102
 
      <member>
103
 
        <link linkend="CheckOutputArgument">CheckOutputArgument</link>
104
 
      </member>
105
 
    </simplelist>
106
 
  </refsection>
 
98
    </refsection>
 
99
    <refsection role="see also">
 
100
        <title>See Also</title>
 
101
        <simplelist type="inline">
 
102
            <member>
 
103
                <link linkend="CheckOutputArgument">CheckOutputArgument</link>
 
104
            </member>
 
105
        </simplelist>
 
106
    </refsection>
107
107
</refentry>