diff options
Diffstat (limited to 'sci_gateway/cpp')
-rw-r--r-- | sci_gateway/cpp/builder_gateway_cpp.sce | 4 | ||||
-rw-r--r-- | sci_gateway/cpp/cleaner.sce | 16 | ||||
-rw-r--r-- | sci_gateway/cpp/libscilab_octave.cpp (renamed from sci_gateway/cpp/libscilab_toolbox.cpp) | 8 | ||||
-rw-r--r-- | sci_gateway/cpp/libscilab_octave.h | 8 | ||||
-rw-r--r-- | sci_gateway/cpp/libscilab_octave.hxx | 18 | ||||
-rwxr-xr-x | sci_gateway/cpp/libscilab_octave.so (renamed from sci_gateway/cpp/libscilab_toolbox.so) | bin | 17160 -> 17160 bytes | |||
-rw-r--r-- | sci_gateway/cpp/libscilab_toolbox.h | 8 | ||||
-rw-r--r-- | sci_gateway/cpp/libscilab_toolbox.hxx | 18 | ||||
-rw-r--r-- | sci_gateway/cpp/loader.sce | 8 | ||||
-rw-r--r-- | sci_gateway/cpp/result.txt | 4 | ||||
-rw-r--r-- | sci_gateway/cpp/sci_matrix.c | 38 | ||||
-rw-r--r-- | sci_gateway/cpp/sci_matrix_bkup.cpp | 32 | ||||
-rw-r--r-- | sci_gateway/cpp/sci_matrix_old.cpp | 52 | ||||
-rw-r--r-- | sci_gateway/cpp/sci_octave.cpp (renamed from sci_gateway/cpp/sci_matrix.cpp) | 4 |
14 files changed, 46 insertions, 172 deletions
diff --git a/sci_gateway/cpp/builder_gateway_cpp.sce b/sci_gateway/cpp/builder_gateway_cpp.sce index b39f612..f4747d1 100644 --- a/sci_gateway/cpp/builder_gateway_cpp.sce +++ b/sci_gateway/cpp/builder_gateway_cpp.sce @@ -12,7 +12,7 @@ mode(-1) lines(0) -toolbox_title = "scilab_toolbox"; +toolbox_title = "scilab_octave"; Build_64Bits = %t; @@ -26,7 +26,7 @@ Function_Names = [ //Name of all the files to be compiled Files = [ - "sci_matrix.cpp" + "sci_octave.cpp" ] diff --git a/sci_gateway/cpp/cleaner.sce b/sci_gateway/cpp/cleaner.sce index 74db4be..5e177af 100644 --- a/sci_gateway/cpp/cleaner.sce +++ b/sci_gateway/cpp/cleaner.sce @@ -10,20 +10,20 @@ if fileinfo('loader.sce') <> [] then mdelete('loader.sce'); end // ------------------------------------------------------ -if fileinfo('libscilab_toolbox.so') <> [] then - mdelete('libscilab_toolbox.so'); +if fileinfo('libscilab_octave.so') <> [] then + mdelete('libscilab_octave.so'); end // ------------------------------------------------------ -if fileinfo('libscilab_toolbox.cpp') <> [] then - mdelete('libscilab_toolbox.cpp'); +if fileinfo('libscilab_octave.cpp') <> [] then + mdelete('libscilab_octave.cpp'); end // ------------------------------------------------------ -if fileinfo('libscilab_toolbox.hxx') <> [] then - mdelete('libscilab_toolbox.hxx'); +if fileinfo('libscilab_octave.hxx') <> [] then + mdelete('libscilab_octave.hxx'); end // ------------------------------------------------------ -if fileinfo('libscilab_toolbox.h') <> [] then - mdelete('libscilab_toolbox.h'); +if fileinfo('libscilab_octave.h') <> [] then + mdelete('libscilab_octave.h'); end // ------------------------------------------------------ chdir(curdir); diff --git a/sci_gateway/cpp/libscilab_toolbox.cpp b/sci_gateway/cpp/libscilab_octave.cpp index 564874c..7cd692a 100644 --- a/sci_gateway/cpp/libscilab_toolbox.cpp +++ b/sci_gateway/cpp/libscilab_octave.cpp @@ -1,14 +1,14 @@ #include <wchar.h> -#include "libscilab_toolbox.hxx" +#include "libscilab_octave.hxx" extern "C" { -#include "libscilab_toolbox.h" +#include "libscilab_octave.h" #include "addfunction.h" } -#define MODULE_NAME L"libscilab_toolbox" +#define MODULE_NAME L"libscilab_octave" -int libscilab_toolbox(wchar_t* _pwstFuncName) +int libscilab_octave(wchar_t* _pwstFuncName) { if(wcscmp(_pwstFuncName, L"octave_fun") == 0){ addCFunction(L"octave_fun", &sci_octave_fun, MODULE_NAME); } diff --git a/sci_gateway/cpp/libscilab_octave.h b/sci_gateway/cpp/libscilab_octave.h new file mode 100644 index 0000000..16c5bc2 --- /dev/null +++ b/sci_gateway/cpp/libscilab_octave.h @@ -0,0 +1,8 @@ +#ifndef __LIBSCILAB_OCTAVE_GW_H__ +#define __LIBSCILAB_OCTAVE_GW_H__ + +#include "c_gateway_prototype.h" + +C_GATEWAY_PROTOTYPE(sci_octave_fun); + +#endif /* __LIBSCILAB_OCTAVE_GW_H__ */ diff --git a/sci_gateway/cpp/libscilab_octave.hxx b/sci_gateway/cpp/libscilab_octave.hxx new file mode 100644 index 0000000..416c8f8 --- /dev/null +++ b/sci_gateway/cpp/libscilab_octave.hxx @@ -0,0 +1,18 @@ +#ifndef __LIBSCILAB_OCTAVE_GW_HXX__ +#define __LIBSCILAB_OCTAVE_GW_HXX__ + +#ifdef _MSC_VER +#ifdef LIBSCILAB_OCTAVE_GW_EXPORTS +#define LIBSCILAB_OCTAVE_GW_IMPEXP __declspec(dllexport) +#else +#define LIBSCILAB_OCTAVE_GW_IMPEXP __declspec(dllimport) +#endif +#else +#define LIBSCILAB_OCTAVE_GW_IMPEXP +#endif + +extern "C" LIBSCILAB_OCTAVE_GW_IMPEXP int libscilab_octave(wchar_t* _pwstFuncName); + + + +#endif /* __LIBSCILAB_OCTAVE_GW_HXX__ */ diff --git a/sci_gateway/cpp/libscilab_toolbox.so b/sci_gateway/cpp/libscilab_octave.so Binary files differindex 1349c2f..32f1555 100755 --- a/sci_gateway/cpp/libscilab_toolbox.so +++ b/sci_gateway/cpp/libscilab_octave.so diff --git a/sci_gateway/cpp/libscilab_toolbox.h b/sci_gateway/cpp/libscilab_toolbox.h deleted file mode 100644 index 3035e8b..0000000 --- a/sci_gateway/cpp/libscilab_toolbox.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef __LIBSCILAB_TOOLBOX_GW_H__ -#define __LIBSCILAB_TOOLBOX_GW_H__ - -#include "c_gateway_prototype.h" - -C_GATEWAY_PROTOTYPE(sci_octave_fun); - -#endif /* __LIBSCILAB_TOOLBOX_GW_H__ */ diff --git a/sci_gateway/cpp/libscilab_toolbox.hxx b/sci_gateway/cpp/libscilab_toolbox.hxx deleted file mode 100644 index a36a14c..0000000 --- a/sci_gateway/cpp/libscilab_toolbox.hxx +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef __LIBSCILAB_TOOLBOX_GW_HXX__ -#define __LIBSCILAB_TOOLBOX_GW_HXX__ - -#ifdef _MSC_VER -#ifdef LIBSCILAB_TOOLBOX_GW_EXPORTS -#define LIBSCILAB_TOOLBOX_GW_IMPEXP __declspec(dllexport) -#else -#define LIBSCILAB_TOOLBOX_GW_IMPEXP __declspec(dllimport) -#endif -#else -#define LIBSCILAB_TOOLBOX_GW_IMPEXP -#endif - -extern "C" LIBSCILAB_TOOLBOX_GW_IMPEXP int libscilab_toolbox(wchar_t* _pwstFuncName); - - - -#endif /* __LIBSCILAB_TOOLBOX_GW_HXX__ */ diff --git a/sci_gateway/cpp/loader.sce b/sci_gateway/cpp/loader.sce index dd2e723..d9123cf 100644 --- a/sci_gateway/cpp/loader.sce +++ b/sci_gateway/cpp/loader.sce @@ -2,19 +2,19 @@ // Generated by builder.sce : Please, do not edit this file // ---------------------------------------------------------------------------- // -libscilab_toolbox_path = get_absolute_file_path('loader.sce'); +libscilab_octave_path = get_absolute_file_path('loader.sce'); // // ulink previous function with same name -[bOK, ilib] = c_link('libscilab_toolbox'); +[bOK, ilib] = c_link('libscilab_octave'); if bOK then ulink(ilib); end // list_functions = [ 'octave_fun'; ]; -addinter(libscilab_toolbox_path + filesep() + 'libscilab_toolbox' + getdynlibext(), 'libscilab_toolbox', list_functions); +addinter(libscilab_octave_path + filesep() + 'libscilab_octave' + getdynlibext(), 'libscilab_octave', list_functions); // remove temp. variables on stack -clear libscilab_toolbox_path; +clear libscilab_octave_path; clear bOK; clear ilib; clear list_functions; diff --git a/sci_gateway/cpp/result.txt b/sci_gateway/cpp/result.txt deleted file mode 100644 index 94c6830..0000000 --- a/sci_gateway/cpp/result.txt +++ /dev/null @@ -1,4 +0,0 @@ -00000000000f7820 g DF .text 0000000000000005 Base dfftw_set_timelimit__ -00000000000f6730 g DF .text 0000000000000009 Base dfftw_set_timelimit_ -00000000000f5ec0 g DF .text 000000000000000f Base fftw_set_planner_hooks -00000000000f98d0 g DF .text 0000000000000022 Base fftw_set_timelimit diff --git a/sci_gateway/cpp/sci_matrix.c b/sci_gateway/cpp/sci_matrix.c deleted file mode 100644 index cf217d6..0000000 --- a/sci_gateway/cpp/sci_matrix.c +++ /dev/null @@ -1,38 +0,0 @@ - -#include<Scierror.h> -#include<sciprint.h> -#include<api_scilab.h> -#include "localization.h" -#include "fun.h" -#include <stdio.h> -#include <math.h> - -static const char fname[] = "octave_fun"; - -int sci_octave_fun(scilabEnv env, int nin, scilabVar* in, int nopt, scilabOpt* opt, int nout, scilabVar* out) - -{ -double retval; -double* out1 = NULL; - -if (nin != 0) - { - Scierror(77, _("%s: Wrong number of input argument(s): %d expected.\n"), fname, 2); - return 1; - } - -if (nout != 1) - { - Scierror(77, _("%s: Wrong number of output argument(s): %d expected.\n"), fname, 1); - return 1; - } - *out = scilab_createDoubleMatrix2d(env, 1, 1, 5); - fun(&retval); - printf("%f\n", retval); - *out1 = retval; - scilab_getDoubleArray(env, out[0], &out1); - - - - return 0; -} diff --git a/sci_gateway/cpp/sci_matrix_bkup.cpp b/sci_gateway/cpp/sci_matrix_bkup.cpp deleted file mode 100644 index 071d330..0000000 --- a/sci_gateway/cpp/sci_matrix_bkup.cpp +++ /dev/null @@ -1,32 +0,0 @@ -extern "C" -{ -#include<Scierror.h> -#include<api_scilab.h> -#include "localization.h" -#include<fun.h> - -static const char fname[] = "octave_fun"; - -int sci_octave_fun(scilabEnv env, int nin, scilabVar* in, int nopt, scilabOpt* opt, int nout, scilabVar* out) - -{ - -if (nin != 0) - { - Scierror(77, _("%s: Wrong number of input argument(s): %d expected.\n"), fname, 2); - return 1; - } - -if (nout != 1) - { - Scierror(77, _("%s: Wrong number of output argument(s): %d expected.\n"), fname, 1); - return 1; - } - - double x = fun(); - - out[0] = scilab_createDouble( env, x); - - return 0; -} -} diff --git a/sci_gateway/cpp/sci_matrix_old.cpp b/sci_gateway/cpp/sci_matrix_old.cpp deleted file mode 100644 index fd45445..0000000 --- a/sci_gateway/cpp/sci_matrix_old.cpp +++ /dev/null @@ -1,52 +0,0 @@ -extern "C" -{ -#include<Scierror.h> -#include<api_scilab.h> -#include "localization.h" -#include<fun.h> - -static const char fname[] = "octave_fun"; - -int sci_octave_fun(scilabEnv env, int nin, scilabVar* in, int nopt, scilabOpt* opt, int nout, scilabVar* out) - -{ - int i = 0; - int row1 = 0; - int col1 = 0; - int size1 = 0; - double* in1 = NULL; - double* out1 = NULL; - - int row2 = 0; - int col2 = 0; - int size2 = 0; - double* in2 = NULL; - double* out2 = NULL; - - -if (nin != 0) - { - Scierror(77, _("%s: Wrong number of input argument(s): %d expected.\n"), fname, 2); - return 1; - } - -if (nout != 1) - { - Scierror(77, _("%s: Wrong number of output argument(s): %d expected.\n"), fname, 1); - return 1; - } - - out1 = fun(); - size1 = sizeof(out1)/sizeof(out1[0]); - - //Creating scilab matrix and saving in pointers out[0] and out[1] - out[0] = scilab_createDoubleMatrix2d(env, size1, 1, 0); - - //saving the output in out1 and out2 - scilab_getDoubleArray(env, out[0], &out1); - - - - return 0; -} -} diff --git a/sci_gateway/cpp/sci_matrix.cpp b/sci_gateway/cpp/sci_octave.cpp index 2346bdd..0e9c228 100644 --- a/sci_gateway/cpp/sci_matrix.cpp +++ b/sci_gateway/cpp/sci_octave.cpp @@ -22,9 +22,9 @@ int sci_octave_fun(scilabEnv env, int nin, scilabVar* in, int nopt, scilabOpt* o { //printf("nin: %d\n", nin); - if (nin < 1) + if (nin < 2) { - Scierror(999, _("%s: Wrong number of input arguments. Atleast %d expected.\n"), fname, 1); + Scierror(999, _("%s: Wrong number of input arguments. Atleast %d expected.\n"), fname, 2); return STATUS_ERROR; } |