diff options
-rw-r--r-- | build.sce | 2 | ||||
-rw-r--r-- | macros/scilab_error.bin | bin | 1951 -> 1951 bytes | |||
-rw-r--r-- | macros/scilab_sum.bin | bin | 913 -> 913 bytes | |||
-rwxr-xr-x | sci_gateway/cpp/libscilab_toolbox.so | bin | 16528 -> 17192 bytes | |||
-rw-r--r-- | sci_gateway/cpp/sci_matrix.cpp | 61 | ||||
-rw-r--r-- | thirdparty/linux/include/fun.h | 2 | ||||
-rwxr-xr-x | thirdparty/linux/lib/x64/libfun.so | bin | 2670672 -> 2664856 bytes |
7 files changed, 50 insertions, 15 deletions
@@ -1,6 +1,6 @@ -cd /home/rupak/scilab-toolbox/scilab_octave/ +//cd /home/rupak/scilab-toolbox/scilab_octave/ if (~isfile("build.sce")) then cd ../../ diff --git a/macros/scilab_error.bin b/macros/scilab_error.bin Binary files differindex 332cba1..41c22ca 100644 --- a/macros/scilab_error.bin +++ b/macros/scilab_error.bin diff --git a/macros/scilab_sum.bin b/macros/scilab_sum.bin Binary files differindex ba64f9e..925a0fc 100644 --- a/macros/scilab_sum.bin +++ b/macros/scilab_sum.bin diff --git a/sci_gateway/cpp/libscilab_toolbox.so b/sci_gateway/cpp/libscilab_toolbox.so Binary files differindex 9cf2138..807cf0d 100755 --- a/sci_gateway/cpp/libscilab_toolbox.so +++ b/sci_gateway/cpp/libscilab_toolbox.so diff --git a/sci_gateway/cpp/sci_matrix.cpp b/sci_gateway/cpp/sci_matrix.cpp index aa45bed..9508ef3 100644 --- a/sci_gateway/cpp/sci_matrix.cpp +++ b/sci_gateway/cpp/sci_matrix.cpp @@ -1,4 +1,5 @@ - +#include <string> +#include <ctype.h> extern "C" { #include<Scierror.h> @@ -8,37 +9,71 @@ extern "C" #include "fun.h" #include <cstdio> #include <math.h> +#include <stdio.h> +#include "os_string.h" -static const char fname[] = "octave_fun"; +//#include<iostream> + +static const char fname[] = "octave_fun"; +///////#####call octave_fun([2],"hamming") ########//////////// int sci_octave_fun(scilabEnv env, int nin, scilabVar* in, int nopt, scilabOpt* opt, int nout, scilabVar* out) { double* out1 = NULL; - int n=5; - double ar[n]; + wchar_t** out11 = NULL; + double* n;//=*in; + wchar_t** in1 = NULL; + wchar_t* in2 = 0; + int inr1 = 0; + int inc1 = 0; + int size1 = 0; + wchar_t temp[128]; + int dim1 = 3; + int dims1[] = {0, 0, 2}; + scilab_getDoubleArray(env, in[0], &n); + //scilab_getStringArray(env, in[0], &in1); + //scilab_getString(env, in[1], &in2); + //dims1[0] = inr1; + //dims1[1] = inc1; + //size1 = scilab_getDim2d(env, in[1], &inr1, &inc1); + //for (int i = 0; i < 3; ++i) + //{ + //wcscpy(temp, in1[i]); + //wcscat(temp, L".one"); + //out1[i] = os_wcsdup(temp); + //} + //scilab_getInteger32(env, in[0], &n); + //std::cout << n << '\n'; + //wchar_t* dummy = L"hello"; + //printf("%S\n",in1); + + double ar[(int)n[0]]; + //printf("%d\n",inr1); -if (nin != 0) - { - Scierror(77, _("%s: Wrong number of input argument(s): %d expected.\n"), fname, 2); - return 1; - } +//if (nin != 0) +// { +// Scierror(77, _("%s: Wrong number of input argument(s): %d expected.\n"), fname, 1); +// return 1; +// } if (nout != 1) { Scierror(77, _("%s: Wrong number of output argument(s): %d expected.\n"), fname, 1); return 1; } - - fun(ar, n); - *out = scilab_createDoubleMatrix2d(env, n, 1, 0); + //std::wstring ws(in1); + //string str(ws.begin(), ws.end()); + //printf("%s\n",str); + fun(ar, n[0],"hamming"); + *out = scilab_createDoubleMatrix2d(env, n[0], 1, 0); //double retval = fun(); //printf("%f\n", retval); //*out1 = retval; scilab_getDoubleArray(env, out[0], &out1); //out1[0]=fun(); - for(int i=0; i<n; i++) + for(int i=0; i<n[0]; i++) { out1[i] = ar[i];//.float_value(); } diff --git a/thirdparty/linux/include/fun.h b/thirdparty/linux/include/fun.h index d2bcdf3..c688c81 100644 --- a/thirdparty/linux/include/fun.h +++ b/thirdparty/linux/include/fun.h @@ -1,3 +1,3 @@ #define fun_h__ -extern "C" int fun (double* answ, int size); +extern "C" int fun (double* answ, int size, std::string name); diff --git a/thirdparty/linux/lib/x64/libfun.so b/thirdparty/linux/lib/x64/libfun.so Binary files differindex 3e8cbca..6e3275e 100755 --- a/thirdparty/linux/lib/x64/libfun.so +++ b/thirdparty/linux/lib/x64/libfun.so |