Typo fixes
[scilab.git] / scilab / modules / dynamic_link / examples / dynamic_link_c_and_fortran / ext3f.sce
1
2 // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3 // Copyright (C) INRIA -
4 //
5 // This file must be used under the terms of the CeCILL.
6 // This source file is licensed as described in the file COPYING, which
7 // you should have received as part of this distribution.  The terms
8 // are also available at
9 // http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
10
11 // Demo file for ext3f example
12
13 // builder code for ext3f.c
14 link_name = "ext3f";    // functions to be added to the call table
15 flag  = "f";            // ext3f is a Fortran function
16 files = ["ext3f.f" ];   // objects files for ext3f
17 libs  = [];             // other libs needed for linking
18
19 // the next call generates files (Makelib,loader.sce) used
20 // for compiling and loading ext3f and performs the compilation
21
22 ilib_for_link(link_name,files,libs,flag);
23
24 // load new function code in the scope of call
25 // using the previously generated loader
26 exec loader.sce;
27
28 // test new function through the call function
29 //reading  vector with name='a' in scilab internal stack
30
31 a=[1,2,3];b=[4,5,6];n=3;
32 c=call("ext3f","yes",1,"c",n,2,"i",a,3,"d",b,4,"d","out",[1,3],5,"d");
33 if norm(c-(sin(a)+cos(b)))> %eps then pause,end
34 c=call("ext3f","no",1,"c",n,2,"i",a,3,"d",b,4,"d","out",[1,3],5,"d");
35 if norm(c-(a+b)) > %eps then pause,end
36