summaryrefslogtreecommitdiffstats
path: root/scilab_doc
diff options
context:
space:
mode:
authorPierre Marechal <pierre.marechal@scilab.org>2006-04-19 15:07:08 +0000
committerPierre Marechal <pierre.marechal@scilab.org>2006-04-19 15:07:08 +0000
commit9ff1d16ecc3eb564f15dac268cebcd997d83d27c (patch)
treec0c1761088f4d2c8318af706ac3c199ef959c63c /scilab_doc
parentdc4e81ea5fd17409810ba72c25ac67a6f090e010 (diff)
downloadscilab-9ff1d16ecc3eb564f15dac268cebcd997d83d27c.zip
scilab-9ff1d16ecc3eb564f15dac268cebcd997d83d27c.tar.gz
- Indentation
- table replaced by a adding a style to <pre> TAG
Diffstat (limited to 'scilab_doc')
-rw-r--r--scilab_doc/toolbox_guide/html/toolbox.css45
-rw-r--r--scilab_doc/toolbox_guide/html/toolbox.html1095
2 files changed, 537 insertions, 603 deletions
diff --git a/scilab_doc/toolbox_guide/html/toolbox.css b/scilab_doc/toolbox_guide/html/toolbox.css
index 1651fc0..dc5db14 100644
--- a/scilab_doc/toolbox_guide/html/toolbox.css
+++ b/scilab_doc/toolbox_guide/html/toolbox.css
@@ -1,7 +1,38 @@
1<style type="text/css"> 1/* ====================================================== */
2var {font-style:italic;} 2/* body
3table.entete {background-color:"#CCCCCC"; 3/* ====================================================== */
4 border:thin solid black;} 4
5.souligne {text-decoration:underline;} 5 body {
6P EM {text-decoration:underline;} 6 color: black;
7</style> \ No newline at end of file 7 background: white;
8 font-family: arial,helvetica,sans-serif;
9 font-size : 95%;
10 padding : 10px;
11 margin : 0;
12 }
13
14/* ====================================================== */
15/* Element contenant du code afficher tel quel
16/* ====================================================== */
17
18 pre.entete{
19 background-color:#EEEEEE;
20 border:thin solid black;
21 padding : 5px;
22 font-size : 85%;
23 font-family:"Courier New", Courier, monospace;
24 }
25
26/* ====================================================== */
27/* other
28/* ====================================================== */
29
30 var {
31 font-style:italic;
32 }
33
34 .souligne {
35 text-decoration:underline;
36 }
37
38 P EM {text-decoration:underline;}
diff --git a/scilab_doc/toolbox_guide/html/toolbox.html b/scilab_doc/toolbox_guide/html/toolbox.html
index e4d9869..73cec11 100644
--- a/scilab_doc/toolbox_guide/html/toolbox.html
+++ b/scilab_doc/toolbox_guide/html/toolbox.html
@@ -1,295 +1,275 @@
1<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 1<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<html> 2<html>
3<head> 3 <head>
4 4 <title>toolbox_example</title>
5<title>toolbox_example</title> 5 <link rel="stylesheet" href="toolbox.css" type="text/css">
6<LINK rel=STYLESHEET href="toolbox.css" type="text/css"> 6 </head>
7</head> 7
8 8 <body>
9<body> 9 <h1 center>Guide for the toolboxes contribution (general application)</h1>
10 10 <p>
11<h1 center>Guide for the toolboxes contribution (general application)</h1> 11 This article describes a standart method to create a Scilab toolbox.<br />
12<p>This article describes a standart method to create a Scilab toolbox.<br> 12 The objective is to help the contributors to build a toolbox easily, but also that the users are able to install it with just the execution of a main builder and a main loader script.<br />
13The objective is to help the contributors to build a toolbox easily, but also that the users are able to install it with just the execution of a main builder and a main loader script.<br> 13 We show in first time how to structure your toolbox (sub-directories contents, files, ...), in second time how to customize the templates to create the builder(s), the loader(s), and the Scilab help files. To finish we explain how to upload your contribution on the scilab website.<br />
14We show in first time how to structure your toolbox (sub-directories contents, files, ...), in second time how to customize the templates to create the builder(s), the loader(s), and the Scilab help files. To finish we explain how to upload your contribution on the scilab website.<br> 14 For this article the reference toolbox name is <b>toolbox_example</b>.
15For this article the reference toolbox name is <b>toolbox_example</b>. 15 (The above standarisation is not mandatory)
16(The above standarisation is not mandatory) </p> 16 </p>
17 17
18<a href="#chap1">1. Toolbox composition</a><br><br> 18 <a href="#chap1">1. Toolbox composition</a><br /><br />
19 19 <a href="#chap2">2. Sub-builders and sub-loaders</a><br />
20<a href="#chap2">2. Sub-builders and sub-loaders</a><br> 20 <ul>
21<ul> 21 <li><a href="#chap2.1">2.1 The macros directory</a><br /></li>
22<li><a href="#chap2.1">2.1 The macros directory</a><br></li> 22 <ul>
23<ul> 23 <li><a href="#chap2.1.1">2.1.1 Creation of the builder</a><br /></li>
24<li><a href="#chap2.1.1">2.1.1 Creation of the builder</a><br></li> 24 <li><a href="#chap2.1.2">2.1.2 Creation of the loader</a><br /></li>
25<li><a href="#chap2.1.2">2.1.2 Creation of the loader</a><br></li> 25 </ul>
26</ul> 26 <li><a href="#chap2.2">2.2 The src directory</a><br /></li>
27<li><a href="#chap2.2">2.2 The src directory</a><br></li> 27 <ul>
28<ul> 28 <li><a href="#chap2.2.1">2.2.1 Interface</a><br /></li>
29<li><a href="#chap2.2.1">2.2.1 Interface</a><br></li> 29 <li><a href="#chap2.2.2">2.2.2 Creation of the builder</a><br /></li>
30<li><a href="#chap2.2.2">2.2.2 Creation of the builder</a><br></li> 30 </ul>
31</ul> 31 <li><a href="#chap2.3">2.3 The man directory</a><br />
32<li><a href="#chap2.3">2.3 The man directory</a><br> 32 <ul>
33<ul> 33 <li><a href="#chap2.3.1">2.3.1 Creation of .xml files</a><br /></li>
34<li><a href="#chap2.3.1">2.3.1 Creation of .xml files</a><br></li> 34 <li><a href="#chap2.3.2">2.3.2 Creation of the builder</a><br /></li>
35<li><a href="#chap2.3.2">2.3.2 Creation of the builder</a><br></li> 35 <li><a href="#chap2.3.3">2.3.3 Creation of the loader</a><br /><br /></li>
36<li><a href="#chap2.3.3">2.3.3 Creation of the loader</a><br><br></li> 36 </ul>
37</ul> 37 </ul>
38</ul> 38 <a href="#chap3">3. The main builder and loader</a><br /><br />
39<a href="#chap3">3. The main builder and loader</a><br><br> 39 <a href="#chap4">4. Upload your toolbox</a><br />
40<a href="#chap4">4. Upload your toolbox</a><br> 40
41 41 <a name="#chap1"></a>
42 42 <h2 class=souligne>1. Toolbox composition</h2>
43<a name="#chap1"></a> 43 <p>The root directory has the generic name of the toolbox (here <b>toolbox_example</b>), it contains 7 sub-directories:</p>
44<h2 class=souligne>1. Toolbox composition</h2> 44
45<p>The root directory has the generic name of the toolbox (here <b>toolbox_example</b>), it contains 7 sub-directories:</p> 45 <ul style="list-style-type: disc">
46 46 <li><b>macros</b>: Scilab macros (all .sci files),the builder and loader scripts</li>
47<ul style="list-style-type: disc"> 47 <li><b>src</b>: code source (all .c and .f files), a builder script</li>
48<li><b>macros</b>: Scilab macros (all .sci files),the builder and loader scripts</li> 48 <li><b>interface</b>: interface programs, a builder</li>
49<li><b>src</b>: code source (all .c and .f files), a builder script</li> 49 <li><b>man</b>: all .xml files, the builder and loader scripts</li>
50<li><b>interface</b>: interface programs, a builder</li> 50 <li><b>doc</b>: .html, .pdf, .txt, .jpeg, ...</li>
51<li><b>man</b>: all .xml files, the builder and loader scripts</li> 51 <li><b>tests</b>: scripts to test your toolbox</li>
52<li><b>doc</b>: .html, .pdf, .txt, .jpeg, ...</li> 52 <li><b>demos</b>: different examples to illustrate your toolbox</li>
53<li><b>tests</b>: scripts to test your toolbox</li> 53 </ul>
54<li><b>demos</b>: different examples to illustrate your toolbox</li> 54
55</ul> 55 and 3 files:
56and 3 files: 56
57<ul style="list-style-type: disc"> 57 <ul style="list-style-type: disc">
58<li><b>README</b>: toolbox description and installation</li> 58 <li><b>README</b>: toolbox description and installation</li>
59<li><b>builder.sce</b></li> 59 <li><b>builder.sce</b></li>
60<li><b>loader.sce</b></li> 60 <li><b>loader.sce</b></li>
61</ul> 61 </ul>
62 62
63<a name="#chap2"></a> 63 <a name="#chap2"></a>
64<h2 class=souligne>2. Sub-builders and sub-loaders</h2> 64 <h2 class=souligne>2. Sub-builders and sub-loaders</h2>
65<p>The main builder and main loader scripts launch respectively the sub-builders and sub-loaders included in the sub-directories (macros, src, man, ...), to generate and to load the necessary libraries and the Scilab help files. 65 <p>
66</p> 66 The main builder and main loader scripts launch respectively the sub-builders and sub-loaders included in the sub-directories (macros, src, man, ...), to generate and to load the necessary libraries and the Scilab help files.
67 67 </p>
68<a name="#chap2.1"></a> 68
69<h3 class=souligne>2.1 The macros directoy</h3> 69 <a name="#chap2.1"></a>
70<p>The main builder and main loader scripts launche respectively the sub-builders and sub-loaders included in the sub-directories (macros, man, ...), to generate and to load the necessary libraries and the Scilab help files. 70 <h3 class=souligne>2.1 The macros directoy</h3>
71This directory included macros Scilab functions, a builder and a loader script.<br> 71 <p>
72A macros is a function written in Scilab code (included in .sci file)<br> 72 The main builder and main loader scripts launche respectively the sub-builders and sub-loaders included in the sub-directories (macros, man, ...), to generate and to load the necessary libraries and the Scilab help files.
73We consider that the macros directory of the toolbox <b>toolbox_example</b> contains just one .sci file: the function <var><strong>foo1</strong></var> (see above script). Given a matrix A, this function returns the positive components of the A diagonal. 73 This directory included macros Scilab functions, a builder and a loader script.<br />
74</p> 74 A macros is a function written in Scilab code (included in .sci file)<br />
75foo1.sci<br /> 75 We consider that the macros directory of the toolbox <b>toolbox_example</b> contains just one .sci file: the function <var><strong>foo1</strong></var> (see above script). Given a matrix A, this function returns the positive components of the A diagonal.
76 76 </p>
77<table class=entete> 77 foo1.sci<br />
78 <tr> 78
79 <td> 79 <pre class="entete">
80<pre>
81function [X]=foo1(A) 80function [X]=foo1(A)
82// This function returns the positive components of the A diagonal 81 // This function returns the positive components of the A diagonal
83 82
84// Check the type and the size of A 83 // Check the type and the size of A
85if type(A)<>1 then 84 if type(A)<>1 then
86 error("type of input argument must be a double"); 85 error("type of input argument must be a double");
87end 86 end
88if size(A,1)<>size(A,2) then 87 if size(A,1)<>size(A,2) then
89 error("input argument must be a square matrix"); 88 error("input argument must be a square matrix");
90end 89 end
91//Extraction of the positive components 90 //Extraction of the positive components
92X=[]; 91 X=[];
93for i=1:size(A,1) 92 for i=1:size(A,1)
94 if A(i,i)>0 then 93 if A(i,i)>0 then
95 X($+1)=A(i,i); 94 X($+1)=A(i,i);
96 end 95 end
97end 96 end
98endfunction 97endfunction
99</pre> 98 </pre>
100 </td> 99
101 </tr> 100 <a name="#chap2.1.1"></a>
102</table> 101 <h4 class=souligne>2.1.1 Creation of the builder</h4>
103 102 <p>
104 103 The builder (see above script) creates a library variable, (named here: toolbox_examplelib= toolbox name +'lib')
105<a name="#chap2.1.1"></a> 104 from functions .sci include in the directory macros, and saves it in the file lib.
106<h4 class=souligne>2.1.1 Creation of the builder</h4> 105 The builder code is generic, it's done in 2 steps, the first to locate macrosbuilder.sce script
107<p>The builder (see above script) creates a library variable, (named here: toolbox_examplelib= toolbox name +'lib') from functions .sci include in the directory macros, and saves it in the file lib. 106 (see help <var><strong>get_absolute_file_path</strong></var> function), and the second to generate the library
108 The builder code is generic, it's done in 2 steps, the first to locate macrosbuilder.sce script (see help <var><strong>get_absolute_file_path</strong></var> function), and the second to generate the library (see help <strong><var>genlib</strong></var> function). 107 (see help <strong><var>genlib</strong></var> function).
109 108 </p>
110</p> 109 builder.sce
111builder.sce 110 <pre class="entete">
112<table class=entete>
113 <tr>
114 <td>
115<pre>
116mode(-1) 111mode(-1)
117toolboxname='toolbox_example' 112toolboxname='toolbox_example'
118pathB=get_absolute_file_path('builder.sce') 113pathB=get_absolute_file_path('builder.sce')
119disp('Building macros in ' +pathB) 114disp('Building macros in ' +pathB)
120genlib(toolboxname+'lib',pathB,%t) 115genlib(toolboxname+'lib',pathB,%t)
121clear pathB genlib toolboxname 116clear pathB genlib toolboxname
122</pre> 117 </pre>
123 </td> 118
124 </tr> 119 <br />
125</table> 120 To customize this template, replace the characters string 'toolbox_example' by the name of your toolbox.
126 121
127<br> 122 <a name="#chap2.1.2"></a>
128To customize this template, replace the characters string 'toolbox_example' by the name of your toolbox. 123 <h4 class=souligne>2.1.2 Creation of the loader</h4>
129 124 <p>
130<a name="#chap2.1.2"></a> 125 The loader (see above script) loads the library lib included in the directory macros. Like the builder, the code is generic, the first step to locate macrosloader.sce script, and the second to load the library (see help <strong><var>load</strong></var> function)
131<h4 class=souligne>2.1.2 Creation of the loader</h4> 126 </p>
132<p>The loader (see above script) loads the library lib included in the directory macros. Like the builder, the code is generic, the first step to locate macrosloader.sce script, and the second to load the library (see help <strong><var>load</strong></var> function) 127
133</p> 128 loader.sce
134 129 <pre class="entete">
135loader.sce
136<table class=entete>
137 <tr>
138 <td>
139<pre>
140mode(-1) 130mode(-1)
141pathL=get_absolute_file_path('loader.sce') 131pathL=get_absolute_file_path('loader.sce')
142disp('Loading macros in ' +pathL) 132disp('Loading macros in ' +pathL)
143load(pathL+'/lib') 133load(pathL+'/lib')
144clear pathL 134clear pathL
145</pre> 135 </pre>
146 </td> 136
147 </tr> 137 <a name="#chap2.2"></a>
148</table> 138 <h3 class=souligne>2.2 The src directory</h3>
149 139 <p>
150 140 This directory included .c files and a builder script<br />
151<a name="#chap2.2"></a> 141 A Scilab primitive is a Scilab function which calls a function written in C or fortran code (using an interface program)<br />
152<h3 class=souligne>2.2 The src directory</h3> 142 Before to write the builder, its necessary to create for each primitives the corresponding interface programs. When a Scilab primitive is called, the interface program checks that the number, the type and the size of inputs/outputs arguments is correct (using CheckRhs and CheckLhs functions), and get the adress of the rhs arguments which are in Scilab internal stack to give this information at the interfaced function. So in the first part we explain, thanks to template, how to implement some interfaces programs (written in C code). In this article we don't describe all the possibilities of the interface programs, for more explanations see the directory SCI/examples.
153<p>This directory included .c files and a builder script<br> 143 </p>
154A Scilab primitive is a Scilab function which calls a function written in C or fortran code (using an interface program)<br> 144
155Before to write the builder, its necessary to create for each primitives the corresponding interface programs. When a Scilab primitive is called, the interface program checks that the number, the type and the size of inputs/outputs arguments is correct (using CheckRhs and CheckLhs functions), and get the adress of the rhs arguments which are in Scilab internal stack to give this information at the interfaced function. So in the first part we explain, thanks to template, how to implement some interfaces programs (written in C code). In this article we don't describe all the possibilities of the interface programs, for more explanations see the directory SCI/examples. 145 <a name="#chap2.2.1"></a>
156</p> 146 <h4 class=souligne>2.2.1 Interface</h4>
157 147 <p>
158<a name="#chap2.2.1"></a> 148 Here two examples which enable to write many interfaces, so it's important to understand it, and know how to customize it for your toolbox.
159<h4 class=souligne>2.2.1 Interface</h4> 149 </p>
160<p>Here two examples which enable to write many interfaces, so it's important to understand it, and know how to customize it for your toolbox. 150
161</p> 151 <p>
162 152 <EM>Example a</EM>: <br />
163<p> 153 We consider an C routine sumab which returns the sum of two vectors. I suppose that the name of the corresponding primitive is
164<EM>Example a</EM>: <br> 154 <var><strong>scisum</strong></var>. We can keep the same name that the C routine (sumab) or try an other name.<br />
165We consider an C routine sumab which returns the sum of two vectors. I suppose that the name of the corresponding primitive is <var><strong>scisum</strong></var>. We can keep the same name that the C routine (sumab) or try an other name.<br> 155 The both following scripts represent the C code of <var><strong>sumab</strong></var> and its associated interface program when
166The both following scripts represent the C code of <var><strong>sumab</strong></var> and its associated interface program when we call the primitive <var><strong>scisum </strong></var>in a Scilab window as follows:<br> 156 we call the primitive <var><strong>scisum </strong></var>in a Scilab window as follows:<br />
167<var><strong>--> Y=scisum(A,B )</strong></var> <br><br> 157 <var><strong>--> Y=scisum(A,B )</strong></var> <br /><br />
168 158 </p>
169</p> 159
170 160 sumab.c
171sumab.c 161 <pre class="entete">
172<table class=entete>
173 <tr>
174 <td>
175<pre>
176void sumab(int n, double * a, double * b, double * y) 162void sumab(int n, double * a, double * b, double * y)
177{ 163{
178int k; 164 int k;
179for (k = 0; k < n; ++k) 165 for (k = 0; k < n; ++k)
180 y[k] = a[k] + b[k]; 166 y[k] = a[k] + b[k];
181} 167}
182</pre> 168 </pre>
183 </td> 169
184 </tr> 170 <br />
185</table> 171 intsumab.c<br />
186 172 <pre class="entete">
187<br>
188intsumab.c<br>
189<table class=entete>
190 <tr>
191 <td>
192<pre>
193#include "stack-c.h" 173#include "stack-c.h"
194extern int sumab(int n, double * a, double * b, double * y); 174extern int sumab(int n, double * a, double * b, double * y);
195 175
196void intsumab(char *fname){ 176void intsumab(char *fname){
197 int l1, m1, n1, l2, m2, n2, l3, n; 177int l1, m1, n1, l2, m2, n2, l3, n;
198 178
199/* 1 - Check the nuumber of input/output arguments */ 179/* 1 - Check the nuumber of input/output arguments */
200 int minlhs=1, maxlhs=1, minrhs=2, maxrhs=2; 180int minlhs=1, maxlhs=1, minrhs=2, maxrhs=2;
201 CheckRhs(minrhs,maxrhs) ; 181CheckRhs(minrhs,maxrhs) ;
202 CheckLhs(minlhs,maxlhs) ; 182CheckLhs(minlhs,maxlhs) ;
203 183
204/* 2 - Check input arguments type and get input arguments adress in the Scilab stack */ 184/* 2 - Check input arguments type and get input arguments adress in the Scilab stack */
205 GetRhsVar(1, "d", &m1, &n1, &l1); 185GetRhsVar(1, "d", &m1, &n1, &l1);
206 GetRhsVar(2, "d", &m2, &n2, &l2); 186GetRhsVar(2, "d", &m2, &n2, &l2);
207 187
208/* 3 - Check that the input arguments have the same size */ 188/* 3 - Check that the input arguments have the same size */
209 n=m2*n2; 189n=m2*n2;
210 if( n1!=n2 || m1!=m2) 190if( n1!=n2 || m1!=m2)
191{
192 cerro("input arguments must have the same size");
193 return 0;
194}
195if(n1!=0 && m1!=0)
196 if(n1!=1 && m1!=1)
211 { 197 {
212 cerro("input arguments must have the same size");
213 return 0;
214 }
215 if(n1!=0 && m1!=0)
216 if(n1!=1 && m1!=1)
217 {
218 cerro("input arguments must be vectors"); 198 cerro("input arguments must be vectors");
219 return(0); 199 return(0);
220 } 200 }
221 201
222/* it's possible to use the chekdims and getscalar functions: a completer ................*/ 202/* it's possible to use the chekdims and getscalar functions: a completer ................*/
223 203
224/* 4 - Create the output argument */ 204/* 4 - Create the output argument */
225 CreateVar(3,"d",&m2,&n2,&l3); 205CreateVar(3,"d",&m2,&n2,&l3);
226 sumab(n,stk(l1),stk(l2),stk(l3)); 206sumab(n,stk(l1),stk(l2),stk(l3));
227 207
228/* 5 - Specif the ouput argument */ 208/* 5 - Specif the ouput argument */
229 LhsVar(1) = 3; 209LhsVar(1) = 3;
230 return 0; 210return 0;
231} 211}
232</pre> 212 </pre>
233 </td> 213
234 </tr> 214 <br />
235</table> 215 <p>
236 216 <EM>In Step 1</EM>: call the instructions <var><strong>CheckRhsVar(minrhs,maxrhs)</strong></var> and <var><strong>
237<br> 217 CheckLhsVar(minlhs,maxlhs)</strong></var><br />
238<p> 218 <var><strong>CheckRhsVar</strong></var> function uses the arguments <strong><var>minrhs</strong></var>
239<EM>In Step 1</EM>: call the instructions <var><strong>CheckRhsVar(minrhs,maxrhs)</strong></var> and <var><strong>CheckLhsVar(minlhs,maxlhs)</strong></var><br> 219 and <var><strong>maxrhs</strong></var> to check that:<br />
240<var><strong>CheckRhsVar</strong></var> function uses the arguments <strong><var>minrhs</strong></var> and <var><strong>maxrhs</strong></var> to check that:<br> 220 <var><strong>minrhs <= number of input arguments <= maxrhs</strong></var><br />
241<var><strong>minrhs <= number of input arguments <= maxrhs</strong></var><br> 221 In this example the numbers of input (=2) and output (=1) arguments are constant, but for certains functions (see example2)
242In this example the numbers of input (=2) and output (=1) arguments are constant, but for certains functions (see example2) they can be variable, in this case the variables <var><strong>minrhs/minlhs</strong></var> and <var><strong>maxrhs/maxlhs</strong></var> are different.<br> 222 they can be variable, in this case the variables <var><strong>minrhs/minlhs</strong></var> and <var><strong>maxrhs/maxlhs</strong>
243We can use directly the defined variables <var><strong>Rhs</strong></var>(=number of inputs) and <var><strong>Lhs</strong></var>(=number of outputs) instead of the functions <var><strong>CheckRhsVar</strong></var> and </var><strong>CheckLhsVar</strong></var>.<br> 223 </var> are different.<br /> We can use directly the defined variables <var><strong>Rhs</strong></var>(=number of inputs) and
244 224 <var><strong>Lhs</strong></var>(=number of outputs) instead of the functions <var><strong>CheckRhsVar</strong></var> and
245<br> 225 </var><strong>CheckLhsVar</strong></var>.<br />
246 226
247<EM>In Step 2</EM>: call the instruction <b><i>GetRhsVar(1,"d",&m1,&n1,&l1)</b></i><br> 227 <br />
248<b><i>GetRhsVar</b></i> function checks that the type of inputs argument is correct, and gets their size and their adress in the Scilab stack.<br> 228
249We describe above all arguments of <b><i>GetRhsVar</b></i> function:<br> 229 <EM>In Step 2</EM>: call the instruction <b><i>GetRhsVar(1,"d",&m1,&n1,&l1)</b></i><br />
250<b><i>1</b></i> : corresponds to the position of the first input argument of scisum(A,B ), i.e A, (2 corresponds to B,...)<br> 230 <b><i>GetRhsVar</b></i> function checks that the type of inputs argument is correct, and gets their size and their adress in the Scilab stack.<br />
251<b><i>m1 </b></i>: gets the rows number of A (m2 for B)<br> 231 We describe above all arguments of <b><i>GetRhsVar</b></i> function:<br />
252<b><i>n1 </b></i>: gets the columns number of A (n2 for B)<br> 232 <b><i>1</b></i> : corresponds to the position of the first input argument of scisum(A,B ), i.e A, (2 corresponds to B,...)<br />
253<b><i>l1 </b></i>: gets the adress of A in the Scilab stack (l2 for B)<br> 233 <b><i>m1 </b></i>: gets the rows number of A (m2 for B)<br />
254 234 <b><i>n1 </b></i>: gets the columns number of A (n2 for B)<br />
255<br> 235 <b><i>l1 </b></i>: gets the adress of A in the Scilab stack (l2 for B)<br />
256 236
257<EM>In Step 3</EM>: instruction <b><i>CreateVar(3,"d",&m2,&n2,&l3)</b></i><br> 237 <br />
258<b><i>CreateVar</b></i> function creates the ouput argument (here Y) at the 3th position<br> 238
259<b><i>3 </b></i>: corresponds to the position of the first output argument Y. We should take the number which follows immediatly the last position of the input arguments (which is 2)<br> 239 <EM>In Step 3</EM>: instruction <b><i>CreateVar(3,"d",&m2,&n2,&l3)</b></i><br />
260<b><i>"d"</b></i>: sets the type of the output argument, a double <br> 240 <b><i>CreateVar</b></i> function creates the ouput argument (here Y) at the 3th position<br />
261<b><i>m2</b></i>: sets the rows number of the output argument (here equal to the rows number of the second input argument B: m2)<br> 241 <b><i>3 </b></i>: corresponds to the position of the first output argument Y. We should take the number which follows
262<b><i>n2</b></i>: sets the columns number of the first output argument (here equal to the columns number of the second input argument B: n2)<br> 242 immediatly the last position of the input arguments (which is 2)<br />
263<b><i>l3</b></i>: gets the adress of the lhs in the Scilab stack <br> 243 <b><i>"d"</b></i>: sets the type of the output argument, a double <br />
264 244 <b><i>m2</b></i>: sets the rows number of the output argument (here equal to the rows number of the second input argument B: m2)<br />
265<br> 245 <b><i>n2</b></i>: sets the columns number of the first output argument (here equal to the columns number of the second input argument B: n2)<br />
266 246 <b><i>l3</b></i>: gets the adress of the lhs in the Scilab stack <br />
267<EM>In Step 4</EM>: instruction <b><i>LhsVar(1) = 3</b></i><br> 247
268The instruction <b><i>LhsVar(1) = 3</b></i> means the first output argument take the value of the variable placed in the 3th position (i.e Y)<br> 248 <br />
269 249
270<br> 250 <EM>In Step 4</EM>: instruction <b><i>LhsVar(1) = 3</b></i><br />
271<br> 251 The instruction <b><i>LhsVar(1) = 3</b></i> means the first output argument take the value of the variable placed in the 3th position (i.e Y)<br />
272 252
273<EM>Example b</EM>:<br> 253 <br />
274 In the second example we describe the interface program (see above script) of the primitive </b></i>scifun1</b></i> which uses the C functions <b><i>fun1</b></i> and <b><i>fun2</b></i> (see above script). This primitive have two syntaxes:<br> 254 <br />
275 255
276<br> 256 <EM>Example b</EM>:<br />
277the first syntax is:</b></i><br> 257 In the second example we describe the interface program (see above script) of the primitive </b></i>scifun1</b></i> which uses the C functions <b><i>fun1</b></i> and <b><i>fun2</b></i> (see above script). This primitive have two syntaxes:<br />
278<b><i>--> [X, Y ]=scifun1(A);</b></i><br> 258
279Given a vector <b><i>A</b></i>, this function returns the positive components of <b><i>A</b></i> in a vector <b><i>X</b></i> and the sum of its positive components in a scalar <b><i>Y</b></i>. In this case the number of output arguments (=Lhs) is 2.<br> 259 <br />
280 260 the first syntax is:</b></i><br />
281<br> 261 <b><i>--> [X, Y ]=scifun1(A);</b></i><br />
282the second syntax is:<br> 262 Given a vector <b><i>A</b></i>, this function returns the positive components of <b><i>A</b></i> in a vector <b><i>X</b></i> and the sum of its positive components in a scalar <b><i>Y</b></i>. In this case the number of output arguments (=Lhs) is 2.<br />
283<b><i>--> [X ]=scifun1(A);</b></i><br> 263
284Given a vector <b><i>A</b></i>, this function returns the positive components of <b><i>A</b></i> in a vector <b><i>X</b></i>. In this case <b><i>Lhs=1</b></i>.<br> 264 <br />
285</p> 265 the second syntax is:<br />
286 266 <b><i>--> [X ]=scifun1(A);</b></i><br />
287<br> 267 Given a vector <b><i>A</b></i>, this function returns the positive components of <b><i>A</b></i> in a vector <b><i>X</b></i>. In this case <b><i>Lhs=1</b></i>.<br />
288fun1.c 268 </p>
289<table class=entete> 269
290 <tr> 270 <br />
291 <td> 271 fun1.c
292<pre> 272 <pre class="entete">
293extern void fun2(double *, int, int *); 273extern void fun2(double *, int, int *);
294 274
295void fun1(double * a, int na, int * nb, double ** b , double * positive_sum){ 275void fun1(double * a, int na, int * nb, double ** b , double * positive_sum){
@@ -300,43 +280,31 @@ void fun1(double * a, int na, int * nb, double ** b , double * positive_sum){
300 *positive_sum=0; 280 *positive_sum=0;
301 for(i=0;i<na;i++) 281 for(i=0;i<na;i++)
302 if(a[i]>0) { 282 if(a[i]>0) {
303 *(*b+k1)=a[i]; 283 *(*b+k1)=a[i];
304 *positive_sum += a[i]; 284 *positive_sum += a[i];
305 k1++; 285 k1++;
306 }; 286 };
307} 287}
308</pre> 288 </pre>
309 </td> 289
310 </tr> 290 <br />
311</table> 291
312 292 fun2.c
313<br> 293 <pre class="entete">
314
315fun2.c
316<table class=entete>
317 <tr>
318 <td>
319<pre>
320void fun2(double * a, int na, int * m) 294void fun2(double * a, int na, int * m)
321{ 295{
322int i; 296 int i;
323*m=0; 297 *m=0;
324for(i=0;i<na;i++) 298 for(i=0;i<na;i++)
325 if (a[i]>0) 299 if (a[i]>0)
326 (*m)++; 300 (*m)++;
327} 301}
328</pre> 302 </pre>
329 </td> 303
330 </tr> 304 <br />
331</table> 305
332 306 intfun1.c
333<br> 307 <pre class="entete">
334
335intfun1.c
336<table class=entete>
337 <tr>
338 <td>
339<pre>
340#include "stack-c.h" 308#include "stack-c.h"
341 309
342extern void fun1(double * , int, int *, double **, double *); 310extern void fun1(double * , int, int *, double **, double *);
@@ -345,373 +313,308 @@ int intfun1(char *fname)
345{ 313{
346 int l1, m1, n1, m=1, nX, i, l2, l3; 314 int l1, m1, n1, m=1, nX, i, l2, l3;
347 double * X, S; 315 double * X, S;
348
349/* 1 - Check the number of inputs and outputs arguments */
350/* You can use the variables: Lhs and Rhs */
351 int minlhs=1, maxlhs=2, minrhs=1, maxrhs=1;
352 CheckRhs(minrhs,maxrhs) ;
353 CheckLhs(minlhs,maxlhs) ;
354 316
355/* 2 - Check rhs type, get the rows number (m1) and the columns number (n1) of rhs, and its adress (l1) in the Scilab stack */ 317 /* 1 - Check the number of inputs and outputs arguments */
318 /* You can use the variables: Lhs and Rhs */
319 int minlhs=1, maxlhs=2, minrhs=1, maxrhs=1;
320 CheckRhs(minrhs,maxrhs) ;
321 CheckLhs(minlhs,maxlhs) ;
322
323 /* 2 - Check rhs type, get the rows number (m1) and the columns number (n1) of rhs, and its adress (l1) in the Scilab stack */
356 GetRhsVar(1, "d", &m1, &n1, &l1); 324 GetRhsVar(1, "d", &m1, &n1, &l1);
357 325
358/* 3 - Check rhs is a vector */ 326 /* 3 - Check rhs is a vector */
359 if(m1!=0 && n1!=0 ) 327 if(m1!=0 && n1!=0 )
360 { 328 {
361 if(m1!=1 && n1!=1) 329 if(m1!=1 && n1!=1)
362 { 330 {
363 cerro("input argument must be a vector"); 331 cerro("input argument must be a vector");
364 return(0); 332 return(0);
365 } 333 }
366 } 334 }
367 335
368 fun1(stk(l1), n1*m1, &nX, &X, &S); 336 fun1(stk(l1), n1*m1, &nX, &X, &S);
369 337
370/* 4 - Create the place for the first output X ( a vector of doubles, size: m*n ) to the adress l2 in the Scilab stack */ 338 /* 4 - Create the place for the first output X ( a vector of doubles, size: m*n ) to the adress l2 in the Scilab stack */
371 CreateVar(2, "d", &m, &nX, &l2); 339 CreateVar(2, "d", &m, &nX, &l2);
372 340
373/* if there are two outputs variable then: Create the place for the second output S ( a double, size 1*1) to the adress l3 in the Scilab stack */ 341 /* if there are two outputs variable then: Create the place for the second output S ( a double, size 1*1) to the adress l3 in the Scilab stack */
374/* get the value of S, and put it in the Scilab stack */ 342 /* get the value of S, and put it in the Scilab stack */
375 if(Lhs==2) 343 if(Lhs==2)
376 { 344 {
377 CreateVar(3, "d", &m, &m, &l3); 345 CreateVar(3, "d", &m, &m, &l3);
378 *stk(l3)=S; 346 *stk(l3)=S;
379 } 347 }
380 348
381/* get the components of X, and put them in the Scilab stack */ 349 /* get the components of X, and put them in the Scilab stack */
382 for(i=0;i&gt;nX;i++) 350 for(i=0;i&gt;nX;i++)
383 stk(l2)[i]=X[i]; 351 stk(l2)[i]=X[i];
384 352
385/* free memory */ 353 /* free memory */
386 free(X); 354 free(X);
387 355
388/* 5 - Specification of outputs variables */ 356 /* 5 - Specification of outputs variables */
389 LhsVar(1) = 2; 357 LhsVar(1) = 2;
390 if(Lhs==2) 358 if(Lhs==2)
391 LhsVar(2) = 3; 359 LhsVar(2) = 3;
392 return 0; 360 return 0;
393} 361}
394</pre> 362 </pre>
395 </td> 363
396 </tr> 364 <br />
397</table> 365
398 366 <a name="#chap2.2.2"></a>
399<br> 367 <h4 class=souligne>2.2.2 Creation of the builder</h4>
400 368 <p>
401<a name="#chap2.2.2"></a> 369 Now the src directory of the toolbox toolbox_example contains all the necessary files (<b><i>fun1.c</b></i>,
402<h4 class=souligne>2.2.2 Creation of the builder</h4> 370 <b><i>fun2.c</b></i>, <b><i>intfun1.c</b></i>, <b><i>sumab.c</b></i>, <b><i>intsumab.c</b></i>) to create the
403<p>Now the src directory of the toolbox toolbox_example contains all the necessary files (<b><i>fun1.c</b></i>, <b><i>fun2.c</b></i>, <b><i>intfun1.c</b></i>, <b><i>sumab.c</b></i>, <b><i>intsumab.c</b></i>) to create the builder (see above template) for the primitives scifun1 and scisum. 371 builder (see above template) for the primitives scifun1 and scisum.
404<br> 372 <br />
405We need to write two builders: one the hand, the src builder (see above script) which creates a shared libraries (see help <i><b>ilib_for_link</b></i> function) corresponding to the .c functions. 373 We need to write two builders: one the hand, the src builder (see above script) which creates a shared libraries (see help <i><b>ilib_for_link</b></i> function) corresponding to the .c functions.
406And the other hand, the interface builder (see above script) which creates new shared libraries to link the compiled C or Fortran 374 And the other hand, the interface builder (see above script) which creates new shared libraries to link the compiled C or Fortran
407new Scilab interface routines (thanks to src libraries), and generates a loader (see help <i><b>ilib_build</b></i> function). 375 new Scilab interface routines (thanks to src libraries), and generates a loader (see help <i><b>ilib_build</b></i> function).
408This loader file calls the addinter function to dynamically load the shared library (see help <i><b>addinter</b></i> function)</p> 376 This loader file calls the addinter function to dynamically load the shared library (see help <i><b>addinter</b></i> function)
409 377 </p>
410the src builder 378
411<table class=entete> 379 the src builder
412 <tr> 380 <pre class="entete">
413 <td>
414<pre>
415ilib_for_link('toolboxsrc',['fun1.o' 'fun2.o','sumab.o'],[],"c") 381ilib_for_link('toolboxsrc',['fun1.o' 'fun2.o','sumab.o'],[],"c")
416</pre> 382 </pre>
417 </td> 383
418 </tr> 384 <br />
419</table> 385 the interface builder<br />
420 386
421<br> 387 <pre class="entete">
422the interface builder<br>
423
424<table class=entete>
425 <tr>
426 <td>
427<pre>
428// must be run from this directory 388// must be run from this directory
429ilib_name = 'libtoolbox_example' // interface library name 389ilib_name = 'libtoolbox_example' // interface library name
430files = ['intfun1.o', 'intsumab.o']; // objects files 390files = ['intfun1.o', 'intsumab.o']; // objects files
431libs = ["../src/libtooloxsrc"] // other libs needed for linking 391libs = ["../src/libtooloxsrc"] // other libs needed for linking
432table = [ 'scifun1', 'intfun1'; 392table = [ 'scifun1', 'intfun1';
433 'scisum','intsumab']; // table of (scilab_name,interface-name) 393 'scisum','intsumab']; // table of (scilab_name,interface-name)
434// do not modify below 394// do not modify below
435ilib_build(ilib_name,table,files,libs) 395ilib_build(ilib_name,table,files,libs)
436</pre> 396 </pre>
437 </td> 397
438 </tr> 398 <br />
439</table> 399 <br />
440 400
441<br> 401 <a name="#chap2.2.2"></a>
442 402 <h4 class=souligne>2.2.2 Creation of the builder</h4>
443 <td> 403 <p>Now the src directory of the toolbox toolbox_example contains all the necessary files (<b><i>fun1.c</b></i>, <b><i>fun2.c</b></i>, <b><i>intfun1.c</b></i>, <b><i>sumab.c</b></i>, <b><i>intsumab.c</b></i>) to create the builder (see above template) for the primitives scifun1 and scisum.
444 <tr> 404 <br />
445</table> 405 We need to write two builders: one the hand, the src builder (see above script) which creates a shared libraries (see help <i><b>ilib_for_link</b></i> function) corresponding to the .c functions.
446 406 And the other hand, the interface builder (see above script) which creates new shared libraries to link the compiled C or Fortran
447<br> 407 new Scilab interface routines (thanks to src libraries), and generates a loader (see help <i><b>ilib_build</b></i> function).
448 408 This loader file calls the addinter function to dynamically load the shared library (see help <i><b>addinter</b></i> function)</p>
449<a name="#chap2.2.2"></a> 409
450<h4 class=souligne>2.2.2 Creation of the builder</h4> 410 the src builder
451<p>Now the src directory of the toolbox toolbox_example contains all the necessary files (<b><i>fun1.c</b></i>, <b><i>fun2.c</b></i>, <b><i>intfun1.c</b></i>, <b><i>sumab.c</b></i>, <b><i>intsumab.c</b></i>) to create the builder (see above template) for the primitives scifun1 and scisum. 411 <pre class="entete">
452<br>
453We need to write two builders: one the hand, the src builder (see above script) which creates a shared libraries (see help <i><b>ilib_for_link</b></i> function) corresponding to the .c functions.
454And the other hand, the interface builder (see above script) which creates new shared libraries to link the compiled C or Fortran
455new Scilab interface routines (thanks to src libraries), and generates a loader (see help <i><b>ilib_build</b></i> function).
456This loader file calls the addinter function to dynamically load the shared library (see help <i><b>addinter</b></i> function)</p>
457
458the src builder
459<table class=entete>
460 <tr>
461 <td>
462<pre>
463ilib_for_link('toolbox_examplesrc',['fun1.o' 'fun2.o','sumab.o'],[],"c") 412ilib_for_link('toolbox_examplesrc',['fun1.o' 'fun2.o','sumab.o'],[],"c")
464</pre> 413 </pre>
465 </td> 414
466 </tr> 415 <br />
467</table> 416 the interface builder<br />
468 417
469<br> 418 <pre class="entete">
470the interface builder<br>
471
472<table class=entete>
473 <tr>
474 <td>
475<pre>
476// must be run from this directory 419// must be run from this directory
477ilib_name = 'libtoolbox_example' // interface library name 420ilib_name = 'libtoolbox_example' // interface library name
478files = ['intfun1.o', 'intsumab.o']; // objects files 421files = ['intfun1.o', 'intsumab.o']; // objects files
479libs = ["../src/libtoolbox_examplesrc"] // other libs needed for linking 422libs = ["../src/libtoolbox_examplesrc"] // other libs needed for linking
480table = [ 'scifun1', 'intfun1'; 423table = [ 'scifun1', 'intfun1';
481 'scisum','intsumab']; // table of (scilab_name,interface-name) 424 'scisum','intsumab']; // table of (scilab_name,interface-name)
482// do not modify below 425// do not modify below
483ilib_build(ilib_name,table,files,libs) 426ilib_build(ilib_name,table,files,libs)
484</pre> 427 </pre>
485 </td> 428
486 </tr> 429 <br />
487</table> 430 The <i><b>ilib_name</b></i> value is the interface library name, the vector <i><b>files</b></i> contains all the object interface files,
488 431 the vector <i><b>libs</b></i> contains the libraries needed for linking (here the library included in the src directory),
489 432 the variable <i><b>table</b></i> contains the primitives names (first column) and the corresponding interface program names (second column)
490 433
491<br> 434 <a name="#chap2.3"></a>
492The <i><b>ilib_name</b></i> value is the interface library name, the vector <i><b>files</b></i> contains all the object interface files, 435 <h3 class=souligne>2.3 The man directory</h3>
493the vector <i><b>libs</b></i> contains the libraries needed for linking (here the library included in the src directory), 436 <p>This directory included .xml files, a manbuilder and a manloader scripts
494the variable <i><b>table</b></i> contains the primitives names (first column) and the corresponding interface program names (second column) 437 On Unix/Linux systems: to create the manual pages you need 'sabcmd', an XML parser which is part of the Sablotron package.<br />
495 438 (here link to download it:<A href="http://www.scilab.org/download/index_download.php?page=related_tool.html"> http://www.scilab.org/download/index_download.php?page=related_tool.html</A>)<br />
496<a name="#chap2.3"></a> 439 (.................... a completer ............................)
497<h3 class=souligne>2.3 The man directory</h3> 440 </p>
498<p>This directory included .xml files, a manbuilder and a manloader scripts 441
499 On Unix/Linux systems: to create the manual pages you need 'sabcmd', an XML parser which is part of the Sablotron package.<br> 442 <a name="#chap2.3.1"></a>
500 (here link to download it:<A href="http://www.scilab.org/download/index_download.php?page=related_tool.html"> http://www.scilab.org/download/index_download.php?page=related_tool.html</A>)<br> 443 <h4 class=souligne>2.3.1 Creation of .xml files</h4>
501 (.................... a completer ............................) 444 <p>
502</p> 445 Here a template which helps you to write the .xml help files. You should just fill the different items(Langage, title, type, date, short description, ...) for the .xml files of your functions (here <b><i>foo1.xml</i></b>, <b><i>scifun1.xml</i></b>, <b><i>scisum.xml</i></b>) and put them in the man directory.
503 446 </p>
504<a name="#chap2.3.1"></a> 447
505<h4 class=souligne>2.3.1 Creation of .xml files</h4> 448 <pre class="entete">
506<p>
507Here a template which helps you to write the .xml help files. You should just fill the different items(Langage, title, type, date, short description, ...) for the .xml files of your functions (here <b><i>foo1.xml</i></b>, <b><i>scifun1.xml</i></b>, <b><i>scisum.xml</i></b>) and put them in the man directory.
508</p>
509
510<table class=entete>
511 <tr>
512 <td>
513<pre>
514&lt;?xml version=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot; standalone=&quot;no&quot;?&gt; 449&lt;?xml version=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot; standalone=&quot;no&quot;?&gt;
515&lt;!DOCTYPE MAN SYSTEM &quot;/home/scilab/scilab-3.0/man/manrev.dtd&quot;&gt; 450&lt;!DOCTYPE MAN SYSTEM &quot;/home/scilab/scilab-3.0/man/manrev.dtd&quot;&gt;
516&lt;MAN&gt; 451&lt;MAN&gt;
517 &lt;LANGUAGE&gt;eng&lt;/LANGUAGE&gt; 452&lt;LANGUAGE&gt;eng&lt;/LANGUAGE&gt;
518 &lt;TITLE&gt;scifoo2&lt;/TITLE&gt; 453&lt;TITLE&gt;scifoo2&lt;/TITLE&gt;
519 &lt;TYPE&gt;Scilab Function &lt;/TYPE&gt; 454&lt;TYPE&gt;Scilab Function &lt;/TYPE&gt;
520 &lt;DATE&gt;20-Mar-2006&lt;/DATE&gt; 455&lt;DATE&gt;20-Mar-2006&lt;/DATE&gt;
521 &lt;SHORT_DESCRIPTION name=&quot;add function name&quot;&gt; add short decription here&lt;/SHORT_DESCRIPTION&gt; 456&lt;SHORT_DESCRIPTION name=&quot;add function name&quot;&gt; add short decription here&lt;/SHORT_DESCRIPTION&gt;
522 457
523 &lt;CALLING_SEQUENCE&gt; 458&lt;CALLING_SEQUENCE&gt;
524 &lt;CALLING_SEQUENCE_ITEM&gt;add function syntax&lt;/CALLING_SEQUENCE_ITEM&gt; 459&lt;CALLING_SEQUENCE_ITEM&gt;add function syntax&lt;/CALLING_SEQUENCE_ITEM&gt;
525 &lt;/CALLING_SEQUENCE&gt; 460&lt;/CALLING_SEQUENCE&gt;
526 461
527 &lt;PARAM&gt; 462&lt;PARAM&gt;
528 &lt;PARAM_INDENT&gt; 463&lt;PARAM_INDENT&gt;
529 &lt;PARAM_ITEM&gt; 464&lt;PARAM_ITEM&gt;
530 &lt;PARAM_NAME&gt;add param name&lt;/PARAM_NAME&gt; 465&lt;PARAM_NAME&gt;add param name&lt;/PARAM_NAME&gt;
531 &lt;PARAM_DESCRIPTION&gt; 466&lt;PARAM_DESCRIPTION&gt;
532 &lt;SP&gt; 467&lt;SP&gt;
533 : add here the parameter description 468: add here the parameter description
534 &lt;/SP&gt; 469&lt;/SP&gt;
535 &lt;/PARAM_DESCRIPTION&gt; 470&lt;/PARAM_DESCRIPTION&gt;
536 471
537 &lt;PARAM_ITEM&gt; 472&lt;PARAM_ITEM&gt;
538 &lt;PARAM_NAME&gt;add param name&lt;/PARAM_NAME&gt; 473&lt;PARAM_NAME&gt;add param name&lt;/PARAM_NAME&gt;
539 &lt;PARAM_DESCRIPTION&gt; 474&lt;PARAM_DESCRIPTION&gt;
540 &lt;SP&gt; 475&lt;SP&gt;
541 : add here the parameter description 476: add here the parameter description
542 &lt;/SP&gt; 477&lt;/SP&gt;
543 &lt;/PARAM_DESCRIPTION&gt; 478&lt;/PARAM_DESCRIPTION&gt;
544 &lt;/PARAM_ITEM&gt; 479&lt;/PARAM_ITEM&gt;
545 &lt;/PARAM_INDENT&gt; 480&lt;/PARAM_INDENT&gt;
546 &lt;/PARAM&gt; 481&lt;/PARAM&gt;
547 482
548 &lt;DESCRIPTION&gt; 483&lt;DESCRIPTION&gt;
549 &lt;DESCRIPTION_INDENT&gt; 484&lt;DESCRIPTION_INDENT&gt;
550 &lt;DESCRIPTION_ITEM&gt; 485&lt;DESCRIPTION_ITEM&gt;
551 &lt;P&gt; 486&lt;P&gt;
552 Add here a paragraph of the function description. 487Add here a paragraph of the function description.
553 Other paragraph can be added 488Other paragraph can be added
554 &lt;/P&gt; 489&lt;/P&gt;
555 &lt;/DESCRIPTION_ITEM&gt; 490&lt;/DESCRIPTION_ITEM&gt;
556 &lt;DESCRIPTION_ITEM&gt; 491&lt;DESCRIPTION_ITEM&gt;
557 &lt;P&gt; 492&lt;P&gt;
558 Add here a paragraph of the function description 493Add here a paragraph of the function description
559 &lt;/P&gt; 494&lt;/P&gt;
560 &lt;/DESCRIPTION_ITEM&gt; 495&lt;/DESCRIPTION_ITEM&gt;
561 &lt;/DESCRIPTION_INDENT&gt; 496&lt;/DESCRIPTION_INDENT&gt;
562 &lt;/DESCRIPTION&gt; 497&lt;/DESCRIPTION&gt;
563 498
564 &lt;EXAMPLE&gt;&lt;![CDATA[ 499&lt;EXAMPLE&gt;&lt;![CDATA[
565 Add here scilab instructions and comments 500Add here scilab instructions and comments
566 ]]&gt;&lt;/EXAMPLE&gt; 501]]&gt;&lt;/EXAMPLE&gt;
567 502
568 &lt;SEE_ALSO&gt; 503&lt;SEE_ALSO&gt;
569 &lt;SEE_ALSO_ITEM&gt; &lt;LINK&gt; add a key here&lt;/LINK&gt; &lt;/SEE_ALSO_ITEM&gt; 504&lt;SEE_ALSO_ITEM&gt; &lt;LINK&gt; add a key here&lt;/LINK&gt; &lt;/SEE_ALSO_ITEM&gt;
570 &lt;SEE_ALSO_ITEM&gt; &lt;LINK&gt; add a key here&lt;/LINK&gt; &lt;/SEE_ALSO_ITEM&gt; 505&lt;SEE_ALSO_ITEM&gt; &lt;LINK&gt; add a key here&lt;/LINK&gt; &lt;/SEE_ALSO_ITEM&gt;
571 &lt;/SEE_ALSO&gt; 506&lt;/SEE_ALSO&gt;
572 507
573 &lt;BIBLIO&gt; 508&lt;BIBLIO&gt;
574 Add here the function bibliography if any 509Add here the function bibliography if any
575 &lt;/BIBLIO&gt; 510&lt;/BIBLIO&gt;
576 511
577 &lt;AUTHORS&gt; 512&lt;AUTHORS&gt;
578 &lt;AUTHORS_ITEM label='enter here the author name'&gt; 513&lt;AUTHORS_ITEM label='enter here the author name'&gt;
579 Add here the author references 514Add here the author references
580 &lt;/AUTHORS_ITEM&gt; 515&lt;/AUTHORS_ITEM&gt;
581 &lt;/AUTHORS&gt; 516&lt;/AUTHORS&gt;
582 &lt;USED_FUNCTIONS&gt; 517&lt;USED_FUNCTIONS&gt;
583 Add here the used function name and references 518Add here the used function name and references
584 &lt;/USED_FUNCTIONS&gt; 519&lt;/USED_FUNCTIONS&gt;
585&lt;/MAN&gt; 520&lt;/MAN&gt;
586</pre> 521 </pre>
587 </td> 522
588 </tr> 523 <a name="#chap2.3.2"></a>
589</table> 524 <h4 class=souligne>2.3.2 Creation of the builder</h4>
590 525 <p>The manbuilder (see above) creates a whatis.htm file which is a short description of the functions, and translates the xml files to html (see help xmltohtml function)
591<a name="#chap2.3.2"></a> 526 </p>
592<h4 class=souligne>2.3.2 Creation of the builder</h4> 527
593<p>The manbuilder (see above) creates a whatis.htm file which is a short description of the functions, and translates the xml files to html (see help xmltohtml function) 528 <br />
594</p> 529
595 530 builder.sce
596<br> 531 <pre class="entete">
597
598builder.sce
599<table class=entete>
600 <tr>
601 <td>
602<pre>
603mode(-1) //force silent execution 532mode(-1) //force silent execution
604path=get_absolute_file_path('builder.sce');//get the absolute path of this file 533path=get_absolute_file_path('builder.sce');//get the absolute path of this file
605add_help_chapter("Title1",path);//add help chapter 534add_help_chapter("Title1",path);//add help chapter
606xmltohtml(path,"Title1") 535xmltohtml(path,"Title1")
607//clear the variable stack 536//clear the variable stack
608clear path add_help_chapter get_absolute_file_path 537clear path add_help_chapter get_absolute_file_path
609</pre> 538 </pre>
610 </td> 539
611 </tr> 540 <a name="#chap2.3.3"></a>
612</table> 541 <h4 class=souligne>2.3.3 Creation of the loader</h4>
613 542 <p>The loader(see above script) add your help functions files in the help Scilab browser
614 543 </p>
615<a name="#chap2.3.3"></a> 544
616<h4 class=souligne>2.3.3 Creation of the loader</h4> 545 loader.sce
617<p>The loader(see above script) add your help functions files in the help Scilab browser 546 <pre class="entete">
618</p>
619
620loader.sce
621<table class=entete>
622 <tr>
623 <td>
624<pre>
625mode(-1) //force silent execution 547mode(-1) //force silent execution
626path=get_absolute_file_path('loader.sce');//get the absolute path of this file 548path=get_absolute_file_path('loader.sce');//get the absolute path of this file
627add_help_chapter("Title1",path);//add help chapter 549add_help_chapter("Title1",path);//add help chapter
628clear path add_help_chapter get_absolute_file_ 550clear path add_help_chapter get_absolute_file_
629</pre> 551 </pre>
630 </td> 552
631 </tr> 553 <a name="#chap3"></a>
632</table> 554 <h2 class=souligne>3. The main builder and loader</h2>
633 555 The builder and loader are generic, they execute all sub-builder(s) and sub-loader(s), here the both scripts:<br /><br />
634<a name="#chap3"></a> 556
635<h2 class=souligne>3. The main builder and loader</h2> 557 builder.sce
636The builder and loader are generic, they execute all sub-builder(s) and sub-loader(s), here the both scripts:<br><br> 558 <pre class="entete">
637
638builder.sce
639<table class=entete>
640 <tr>
641 <td>
642<pre>
643mode(-1); 559mode(-1);
644mainpathB=get_absolute_file_path('builder.sce'); 560mainpathB=get_absolute_file_path('builder.sce');
645chdir(mainpathB); 561chdir(mainpathB);
646if isdir('src') then 562if isdir('src') then
647 chdir('src'); 563chdir('src');
648 exec('builder.sce'); 564exec('builder.sce');
649 chdir('..'); 565chdir('..');
650end 566end
651if isdir('interface') then 567if isdir('interface') then
652 chdir('interface'); 568chdir('interface');
653 exec('builder.sce'); 569exec('builder.sce');
654 chdir('..'); 570chdir('..');
655end 571end
656if isdir('macros') then 572if isdir('macros') then
657 chdir('macros'); 573chdir('macros');
658 exec('builder.sce'); 574exec('builder.sce');
659 chdir('..'); 575chdir('..');
660end 576end
661if isdir('man') then 577if isdir('man') then
662 chdir('man'); 578chdir('man');
663 exec('builder.sce'); 579exec('builder.sce');
664 chdir('..'); 580chdir('..');
665end 581end
666clear mainpathB 582clear mainpathB
667</pre> 583 </pre>
668 </td> 584
669 </tr> 585 <br />
670</table> 586
671 587 loader.sce
672<br> 588 <pre class="entete">
673
674loader.sce
675<table class=entete>
676 <tr>
677 <td>
678<pre>
679mode(-1); 589mode(-1);
680mainpathL=get_absolute_file_path('loader.sce'); 590mainpathL=get_absolute_file_path('loader.sce');
681chdir(mainpathL); 591chdir(mainpathL);
682if isdir('interface') then 592if isdir('interface') then
683 chdir('interface'); 593chdir('interface');
684 exec('loader.sce'); 594exec('loader.sce');
685 chdir('..'); 595chdir('..');
686end 596end
687if isdir('macros') then 597if isdir('macros') then
688 chdir('macros'); 598chdir('macros');
689 exec('loader.sce'); 599exec('loader.sce');
690 chdir('..'); 600chdir('..');
691end 601end
692if isdir('man') then 602if isdir('man') then
693 chdir('man'); 603chdir('man');
694 exec('loader.sce'); 604exec('loader.sce');
695 chdir('..'); 605chdir('..');
696end 606end
697clear mainpathL 607clear mainpathL
698</pre> 608 </pre>
699 </td> 609
700 </tr> 610 <a name="#chap4"></a>
701</table> 611 <h2 class=souligne>4. Upload your toolbox</h2>
702 612 <ul style="list-style-type: disc">
703 613 <li>Read the instructions about how to contribute , see the link:
704<a name="#chap4"></a> 614 <A href="http://www.scilab.org/contrib/index_contrib.php?page=howto.html">http://www.scilab.org/contrib/index_contrib.php?page=howto.html </A></li>
705<h2 class=souligne>4. Upload your toolbox</h2> 615 <li>Archive and Compress your toolbox: </li>
706<ul style="list-style-type: disc"> 616 <li>Complete the submission form document and add your package (here <b>toolbox_example.tar.gz</b> and <b>toolbox_example.zip</b>),
707<li>Read the instructions about how to contribute , see the link: <A href="http://www.scilab.org/contrib/index_contrib.php?page=howto.html 617 see the link: <A href="http://www.scilab.fr/contrib/index_contrib.php?page=upload.html">http://www.scilab.fr/contrib/index_contrib.php?page=upload.html </A></li>
708">http://www.scilab.org/contrib/index_contrib.php?page=howto.html </A></li> 618 </ul>
709<li>Archive and Compress your toolbox: </li> 619 </body>
710<li>Complete the submission form document and add your package (here <b>toolbox_example.tar.gz</b> and <b>toolbox_example.zip</b>),
711see the link: <A href="http://www.scilab.fr/contrib/index_contrib.php?page=upload.html">http://www.scilab.fr/contrib/index_contrib.php?page=upload.html </A> </li>
712</ul>
713<p>
714
715</body>
716
717</html> \ No newline at end of file 620</html> \ No newline at end of file