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:xi="http://www.w3.org/2001/XInclude" 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="ReturnArguments">
4
<refname>ReturnArguments</refname>
6
A C gateway function which returns the various variables.
10
<title>Calling Sequence</title>
11
<synopsis>ReturnArguments();</synopsis>
14
<title>Description</title>
16
ReturnArguments() will return the various variables declared through
17
AssignOutputVariable(X).
21
<title>Examples</title>
22
<para>This example takes a matrix of doubles as input and returns:</para>
25
<para>the number of lines (first output argument)</para>
28
<para>the number of rows (second output argument)</para>
31
<programlisting role="example"><![CDATA[
4
<refname>ReturnArguments</refname>
6
A C gateway function which returns the various variables.
10
<title>Calling Sequence</title>
11
<synopsis>ReturnArguments(pvApiCtx);</synopsis>
14
<title>Description</title>
16
ReturnArguments(pvApiCtx) will return the various variables declared through
17
AssignOutputVariable(pvApiCtx, X).
21
<title>Examples</title>
22
<para>This example takes a matrix of doubles as input and returns:</para>
25
<para>the number of lines (first output argument)</para>
28
<para>the number of rows (second output argument)</para>
31
<programlisting role="example">
32
33
#include "api_scilab.h"
33
34
int sci_mysizedouble(char * fname, unsigned long fname_len)
56
sciErr = createMatrixOfInteger32(pvApiCtx, nbInputArgument + 1, 1, 1, &m_in_row); // the m_in_row parameter handles the number of lines of the matrix sent as argument
57
sciErr = createMatrixOfInteger32(pvApiCtx, nbInputArgument + 2, 1, 1, &m_in_row); // store a same value, but will neither be used nor returned to Scilab
58
sciErr = createMatrixOfInteger32(pvApiCtx, nbInputArgument + 3, 1, 1, &n_in_col); // the n_in_col parameter handles the number of columns of the matrix sent as argument
57
sciErr = createMatrixOfInteger32(pvApiCtx, nbInputArgument(pvApiCtx) + 1, 1, 1, &m_in_row); // the m_in_row parameter handles the number of lines of the matrix sent as argument
58
sciErr = createMatrixOfInteger32(pvApiCtx, nbInputArgument(pvApiCtx) + 2, 1, 1, &m_in_row); // store a same value, but will neither be used nor returned to Scilab
59
sciErr = createMatrixOfInteger32(pvApiCtx, nbInputArgument(pvApiCtx) + 3, 1, 1, &n_in_col); // the n_in_col parameter handles the number of columns of the matrix sent as argument
60
AssignOutputVariable(1) = nbInputArgument + 1; // We set the parameter "nbInputArgument + 1" as an output argument
61
AssignOutputVariable(2) = nbInputArgument + 3; // We set the parameter "nbInputArgument + 3" as an output argument
61
AssignOutputVariable(pvApiCtx, 1) = nbInputArgument(pvApiCtx) + 1; // We set the parameter "nbInputArgument(pvApiCtx) + 1" as an output argument
62
AssignOutputVariable(pvApiCtx, 2) = nbInputArgument(pvApiCtx) + 3; // We set the parameter "nbInputArgument(pvApiCtx) + 3" as an output argument
63
ReturnArguments(pvApiCtx);