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

« back to all changes in this revision

Viewing changes to examples/link-examples-so/ext12f.dia.ref

  • 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
 
 
2
// Demo file for ext12f example
 
3
 
 
4
 
 
5
// builder code for ext12f.c
 
6
 
 
7
link_name = 'ext12f';    // functions to be added to the call table
 
8
 
 
9
flag  = "f";             // ext12f is a C function
 
10
 
 
11
files = ['ext12f.o' ];   // objects files for ext12f
 
12
 
 
13
libs  = [];              // other libs needed for linking
 
14
 
 
15
 
 
16
// the next call generates files (Makelib,loader.sce) used
 
17
 
 
18
// for compiling and loading ext12f and performs the compilation
 
19
 
 
20
 
 
21
ilib_for_link(link_name,files,libs,flag);
 
22
   generate a loader file
 
23
   generate a Makefile: Makelib
 
24
   running the makefile
 
25
 
 
26
 
 
27
// load new function code in the scope of call
 
28
 
 
29
// using the previously generated loader
 
30
 
 
31
exec loader.sce
 
32
 
 
33
// generated by builder.sce: Please do not edit this file
 
34
 
 
35
// ------------------------------------------------------
 
36
 
 
37
ext12f_path=get_file_path('loader.sce');
 
38
 
 
39
link(ext12f_path+'/libext12f.so',['ext12f'],'f');
 
40
Loading shared executable0./libext12f.so
 
41
 
 
42
shared archive loaded
 
43
 
 
44
Linking ext12f 
 
45
 
 
46
Link done
 
47
 
 
48
 
 
49
 
 
50
 
 
51
// test new function through the ode function
 
52
 
 
53
//same example as # 10 with call to matptr
 
54
 
 
55
//param must be defined as a scilab variable
 
56
 
 
57
 
 
58
param=[0.04,10000,3d+7];
 
59
 
 
60
y=ode([1;0;0],0,[0.4,4],'ext12f');
 
61
 
 
62
 
 
63