add more help pages related to CAPI - check parameters - optional parameters
[scilab.git] / scilab / modules / core / help / en_US / capi / CheckSameDims.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <refentry version="5.0-subset Scilab" xml:id="CheckSameDims" xml:lang="en"
3           xmlns="http://docbook.org/ns/docbook"
4           xmlns:xlink="http://www.w3.org/1999/xlink"
5           xmlns:svg="http://www.w3.org/2000/svg"
6           xmlns:mml="http://www.w3.org/1998/Math/MathML"
7           xmlns:html="http://www.w3.org/1999/xhtml"
8           xmlns:db="http://docbook.org/ns/docbook">
9   <refnamediv>
10     <refname>CheckSameDims</refname>
11
12     <refpurpose>C interface function which checks if two parameters send to
13     the C function have the same size</refpurpose>
14   </refnamediv>
15
16   <refsynopsisdiv>
17     <title>Calling Sequence</title>
18
19     <synopsis>CheckSameDims(StackPos_var1,StackPos_var2,m_var1,n_var1,m_var2,n_var2)</synopsis>
20   </refsynopsisdiv>
21
22   <refsection>
23     <title>Parameters</title>
24
25     <variablelist>
26       <varlistentry>
27         <term>StackPos_var1</term>
28
29         <listitem>
30           <para>the position on the stack of the first variable for which we
31           want to perform the check (input parameter)</para>
32         </listitem>
33       </varlistentry>
34
35       <varlistentry>
36         <term>StackPos_var2</term>
37
38         <listitem>
39           <para>the position on the stack of the second variable for which we
40           want to perform the check (input parameter)</para>
41         </listitem>
42       </varlistentry>
43
44       <varlistentry>
45         <term>m_var1</term>
46
47         <listitem>
48           <para>the number of lines of the parameter at position StackPos_var1
49           on the stack</para>
50         </listitem>
51       </varlistentry>
52
53       <varlistentry>
54         <term>n_var1</term>
55
56         <listitem>
57           <para>the number of columns of the parameter at position
58           StackPos_var1 on the stack</para>
59         </listitem>
60       </varlistentry>
61
62       <varlistentry>
63         <term>m_var2</term>
64
65         <listitem>
66           <para>the number of lines of the parameter at position StackPos_var2
67           on the stack</para>
68         </listitem>
69       </varlistentry>
70
71       <varlistentry>
72         <term>n_var2</term>
73
74         <listitem>
75           <para>the number of columns of the parameter at position
76           StackPos_var2 on the stack</para>
77         </listitem>
78       </varlistentry>
79     </variablelist>
80   </refsection>
81
82   <refsection>
83     <title>Description</title>
84
85     <para>C interface function which checks if two parameters send to the C
86     function have the same size. You must include stack-c.h to benefit from
87     this function. If the test fails, we return from the C interface and an
88     adequate error message is printed in the Scilab console.</para>
89   </refsection>
90
91   <refsection>
92     <title>Examples</title>
93
94     <para>In this example, the C interface function takes one input parameters
95     and prints the integer corresponding to the type of the variable sent as
96     parameter in the Scilab console.</para>
97
98     <programlisting role="example"> 
99 #include &lt;stack-c.h&gt;
100
101 int sci_check_properties(char * fname)
102 {
103   int m1, n1, l1;
104   int m2, n2, l2;
105
106   CheckRhs(2,2);
107
108   GetRhsVar(1, "d", &amp;m1, &amp;n1, &amp;l1);
109   GetRhsVar(2, "d", &amp;m2, &amp;n2, &amp;l2);
110
111   CheckSameDims(1,2,m1,n1,m2,n2); // Check that both vectors have the same size
112
113   return 0;
114 }
115  </programlisting>
116   </refsection>
117
118   <refsection>
119     <title>See Also</title>
120
121     <simplelist type="inline">
122       <member><link linkend="CheckColumn">CheckColumn</link></member>
123       <member><link linkend="CheckDims">CheckDims</link></member>
124       <member><link linkend="CheckRow">CheckRow</link></member>
125       <member><link linkend="CheckScalar">CheckScalar</link></member>
126       <member><link linkend="CheckVector">CheckVector</link></member>
127       <member><link linkend="OverLoad">CheckOverLoad</link></member>
128       <member><link linkend="CheckDimProp">CheckDimProp</link></member>
129       <member><link linkend="CheckLength">CheckLength</link></member>
130       <member><link linkend="CheckSquare">CheckSquare</link></member>
131       <member><link linkend="How to check parameters">HowToCheckParameters</link></member>
132     </simplelist>
133   </refsection>
134 </refentry>