Evolution of Scilab API

classic Classic list List threaded Threaded
3 messages Options
mottelet mottelet
Reply | Threaded
Open this post in threaded view
|

Evolution of Scilab API

Hello,

I am a bit puzzled by the evolution of Scilab api since Scilab 5.x
versions. I have understood that the old stack system has dissapeared,
but now I am very confused because it seems that two different ways of
interfacing C code do exist. For example

#include "api_scilab.h"
#include <localization.h>
#include <string.h>
#include "Scierror.h"
int fun(char *fname, void *pvApiCtx)

or

#include "api_scilab.h"
#include <localization.h>
#include <string.h>
#include "Scierror.h"
int fun(scilabEnv env, int nin, scilabVar* in, int nopt, scilabOpt opt,
int nout, scilabVar* out)

Is the first snipplet of code above considered as obsolete ?

Thanks for help

S.


--
Stéphane Mottelet
Ingénieur de recherche
EA 4297 Transformations Intégrées de la Matière Renouvelable
Département Génie des Procédés Industriels
Sorbonne Universités - Université de Technologie de Compiègne
CS 60319, 60203 Compiègne cedex
Tel : +33(0)344234688
http://www.utc.fr/~mottelet

_______________________________________________
dev mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/dev
Arvid Rosén Arvid Rosén
Reply | Threaded
Open this post in threaded view
|

Re: Evolution of Scilab API

I’m also interested in knowing this since I need to port a bunch of libraries from scilab 4/5 to version 6.
The documentation is a bit confusing in this area.

A tiny example with minimalistic code and a Makefile showing best practices for C and C++ in scilab 6 would be great!

Cheers,
Arvid


From: dev <[hidden email]> on behalf of Stéphane Mottelet <[hidden email]>
Sent: Tuesday, February 13, 2018 4:45:41 PM
To: List dedicated to development questions
Subject: [Scilab-Dev] Evolution of Scilab API
 
Hello,

I am a bit puzzled by the evolution of Scilab api since Scilab 5.x
versions. I have understood that the old stack system has dissapeared,
but now I am very confused because it seems that two different ways of
interfacing C code do exist. For example

#include "api_scilab.h"
#include <localization.h>
#include <string.h>
#include "Scierror.h"
int fun(char *fname, void *pvApiCtx)

or

#include "api_scilab.h"
#include <localization.h>
#include <string.h>
#include "Scierror.h"
int fun(scilabEnv env, int nin, scilabVar* in, int nopt, scilabOpt opt,
int nout, scilabVar* out)

Is the first snipplet of code above considered as obsolete ?

Thanks for help

S.


--
Stéphane Mottelet
Ingénieur de recherche
EA 4297 Transformations Intégrées de la Matière Renouvelable
Département Génie des Procédés Industriels
Sorbonne Universités - Université de Technologie de Compiègne
CS 60319, 60203 Compiègne cedex
Tel : +33(0)344234688
http://www.utc.fr/~mottelet

_______________________________________________
dev mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/dev

_______________________________________________
dev mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/dev
Antoine ELIAS-2 Antoine ELIAS-2
Reply | Threaded
Open this post in threaded view
|

Re: Evolution of Scilab API

Hello,

First one ( API 1 ) was write to be "compatible" between Scilab 5 and Scilab 6. ( except last arg, int -> void*, sorry about that )
So in Scilab 6 we reproduce stack behavior ( Top, Rhs, LhsVar(x) = y), but that produce lot of copy, move of data).
The second ( API 2 ) is the nearest from internal memory of Scilab 6.

@Stéphane: Both API can be used, we don't plan to remove API 1.

@Arvid:
Did you take a look of SCI/contrib/toolbox_skeleton/sci_gateway/c ? (http://cgit.scilab.org/scilab/tree/scilab/contrib/toolbox_skeleton/sci_gateway/c?h=6.0.0)
I wrote same gateways with API 1 and API 2.

Regards,
Antoine
Le 13/02/2018 à 19:10, Arvid Rosén a écrit :
I’m also interested in knowing this since I need to port a bunch of libraries from scilab 4/5 to version 6.
The documentation is a bit confusing in this area.

A tiny example with minimalistic code and a Makefile showing best practices for C and C++ in scilab 6 would be great!

Cheers,
Arvid


From: dev [hidden email] on behalf of Stéphane Mottelet [hidden email]
Sent: Tuesday, February 13, 2018 4:45:41 PM
To: List dedicated to development questions
Subject: [Scilab-Dev] Evolution of Scilab API
 
Hello,

I am a bit puzzled by the evolution of Scilab api since Scilab 5.x
versions. I have understood that the old stack system has dissapeared,
but now I am very confused because it seems that two different ways of
interfacing C code do exist. For example

#include "api_scilab.h"
#include <localization.h>
#include <string.h>
#include "Scierror.h"
int fun(char *fname, void *pvApiCtx)

or

#include "api_scilab.h"
#include <localization.h>
#include <string.h>
#include "Scierror.h"
int fun(scilabEnv env, int nin, scilabVar* in, int nopt, scilabOpt opt,
int nout, scilabVar* out)

Is the first snipplet of code above considered as obsolete ?

Thanks for help

S.


--
Stéphane Mottelet
Ingénieur de recherche
EA 4297 Transformations Intégrées de la Matière Renouvelable
Département Génie des Procédés Industriels
Sorbonne Universités - Université de Technologie de Compiègne
CS 60319, 60203 Compiègne cedex
Tel : +33(0)344234688
http://www.utc.fr/~mottelet

_______________________________________________
dev mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/dev


_______________________________________________
dev mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/dev


_______________________________________________
dev mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/dev