1
<?xml version="1.0" encoding="UTF-8"?>
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:db="http://docbook.org/ns/docbook" version="5.0-subset Scilab" xml:lang="en" xml:id="funptr">
4
<refname>funptr</refname>
5
<refpurpose> coding of primitives ( wizard stuff ) </refpurpose>
8
<title>Calling Sequence</title>
9
<synopsis>[numptr] = funptr(name)</synopsis>
12
<title>Arguments</title>
17
<para>a string, the name of a primitive</para>
23
<para>the internal routine number of the primitive</para>
29
<title>Description</title>
31
Utility function (for experts only) to get the internal routine number <literal>numptr</literal>
32
of the primitive <literal>'name'</literal>. <literal>numptr</literal> is formed from the interface
33
number <literal>fun</literal> and the routine number <literal>fin</literal> of the primitive in its interface
34
by <literal>numptr = 1000*fun + fin</literal> (fin < 1000). From <literal>numptr</literal> you can get
35
the interface number <literal>fun = floor(numptr/1000)</literal> which may be useful to link a
36
dynamical interface with arguments passed by reference (see example section).
40
<title>Examples</title>
41
<programlisting role="example"><![CDATA[
42
// Suppose you want to load some codes via the dynamic
43
// loading facilities offers by addinter. By default
44
// arguments are passed by values but if you want to
45
// pass them by reference you can do the following
46
// (name being the scilab name of one of the interfaced
49
// addinter(files,spnames,fcts) // args passed by values
50
// num_interface = floor(funptr(name)/1000)
51
// intppty(num_interface) // args now passed by reference
53
// Note that if you enter the following
57
// you will see all the interfaces working by reference
60
<refsection role="see also">
61
<title>See Also</title>
62
<simplelist type="inline">
64
<link linkend="clearfun">clearfun</link>
67
<link linkend="newfun">newfun</link>
70
<link linkend="intppty">intppty</link>
73
<link linkend="addinter">addinter</link>