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

« back to all changes in this revision

Viewing changes to examples/link-examples-so/ext14c.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 ext14c example 
 
2
 
 
3
// builder code for ext14c.c 
 
4
// functions to be added to the call table 
 
5
link_name = ['ext14cI']; 
 
6
flag  = "c";             // ext14c is a C function 
 
7
files = ['ext14c.o' ];   // objects files for ext14c 
 
8
libs  = [];              // other libs needed for linking 
 
9
 
 
10
// the next call generates files (Makelib,loader.sce) used
 
11
// for compiling and loading ext14c and performs the compilation
 
12
 
 
13
ilib_for_link(link_name,files,libs,flag);
 
14
 
 
15
// load new function code in the scope of call 
 
16
// using the previously generated loader 
 
17
exec loader.sce 
 
18
 
 
19
// test new function through the call function 
 
20
//(very) simple example 1
 
21
 
 
22
a=[1,2,3];b=[4,5,6];n=3;
 
23
c=call('ext14cI',a,b);
 
24
if norm(c-(a+b)) > %eps then pause,end
 
25
 
 
26