[scilab-Users] C->Scilab: Now I'm lost and need some directions

Allan CORNET allan.cornet at scilab.org
Tue Jan 11 16:55:05 CET 2011


Hi,

See help about api_scilab to write a primitive

You can also see example in toolbox_skeleton  SCI/contrib/toolbox_skeleton

Allan



-----Message d'origine-----
De : Antoine Monmayrant [mailto:antoine.monmayrant at laas.fr] 
Envoyé : mardi 11 janvier 2011 16:47
À : users at lists.scilab.org
Objet : [scilab-Users] C->Scilab: Now I'm lost and need some directions

Hi all,

I am fighting to call some C code from within Scilab, or more precisely to
add a primitive to Scilab using some C code I wrote.
I have a working C code and I managed to link it to Scilab by using
"ilib_for_link".
It works, no problem.
Now I would like to bullet-proof it, that is to get it to work like a real
scilab primitive.
For example, at the moment, if I try to open a file that do not exist (from
within my C code), I just kill my Scilab session.
This is due to the way the error is treated in my C code.
I would prefer to get a normal Scilab error: "!--error 241, File does not
exist".
In the end, I would like to handle all the usual scilab error (wrong number
of arguments, wrong type, ...) gracefully.
What should I do?
I found bits and pieces here and there about how to link, what the interface
should be like, how to use call, ... but I can't put the pieces together to
get a big picture of what I should do.
I found "intersci" but it is obsolete. I found some articles but they are
outdated ( http://www.saphir-control.fr/articles/lm15/article.html ).
Does anyone know a proper tutorial or *complete* example ( c_source,
interface_source, build and example of use) on the subject?

Thank you in advance,

Antoine





More information about the users mailing list