2
// Demo file for ext6f example
5
// builder code for ext6f.c
7
link_name = 'ext6f'; // functions to be added to the call table
9
flag = "f"; // ext6f is a C function
11
files = ['ext6f.o' ]; // objects files for ext6f
13
libs = []; // other libs needed for linking
16
// the next call generates files (Makelib,loader.sce) used
18
// for compiling and loading ext6f and performs the compilation
21
ilib_for_link(link_name,files,libs,flag);
22
generate a loader file
23
generate a Makefile: Makelib
27
// load new function code in the scope of call
29
// using the previously generated loader
33
// generated by builder.sce: Please do not edit this file
35
// ------------------------------------------------------
37
ext6f_path=get_file_path('loader.sce');
39
link(ext6f_path+'/libext6f.so',['ext6f'],'f');
40
Loading shared executable0./libext6f.so
51
// test new function through the call function
53
//reading vector with name='a' in scilab internal stack
58
c=call('ext6f','a',1,'c',b,2,'d','out',[1,3],3,'d');
60
if norm(c-(a+2*b)) > %eps then bugmes();quit;end