~ubuntu-branches/ubuntu/karmic/scilab/karmic

« back to all changes in this revision

Viewing changes to examples/link-examples-so/ext2f.sce

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2002-03-21 16:57:43 UTC
  • Revision ID: james.westby@ubuntu.com-20020321165743-e9mv12c1tb1plztg
Tags: upstream-2.6
ImportĀ upstreamĀ versionĀ 2.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Demo file for ext2f example 
 
2
 
 
3
// builder code for ext2f.c 
 
4
link_name = 'ext2f';    // functions to be added to the call table 
 
5
flag  = "f";            // ext2f is a C function 
 
6
files = ['ext2f.o' ];   // objects files for ext2f 
 
7
libs  = [];             // other libs needed for linking 
 
8
 
 
9
// the next call generates files (Makelib,loader.sce) used
 
10
// for compiling and loading ext2f and performs the compilation
 
11
 
 
12
ilib_for_link(link_name,files,libs,flag);
 
13
 
 
14
// load new function code in the scope of call 
 
15
// using the previously generated loader 
 
16
exec loader.sce 
 
17
 
 
18
// test new function through the call function 
 
19
 
 
20
a=[1,2,3];b=[4,5,6];n=3;
 
21
c=call('ext2f',n,1,'i',a,2,'d',b,3,'d','out',[1,3],4,'d');
 
22
if norm(c-(sin(a)+cos(b))) > %eps then pause,end