summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xsci_gateway/cpp/libscilab_toolbox.sobin17192 -> 17408 bytes
-rw-r--r--sci_gateway/cpp/sci_matrix.cpp61
-rwxr-xr-xthirdparty/linux/lib/x64/libfun.sobin2664856 -> 2664424 bytes
3 files changed, 23 insertions, 38 deletions
diff --git a/sci_gateway/cpp/libscilab_toolbox.so b/sci_gateway/cpp/libscilab_toolbox.so
index 807cf0d..523db58 100755
--- a/sci_gateway/cpp/libscilab_toolbox.so
+++ b/sci_gateway/cpp/libscilab_toolbox.so
Binary files differ
diff --git a/sci_gateway/cpp/sci_matrix.cpp b/sci_gateway/cpp/sci_matrix.cpp
index 9508ef3..f2622b8 100644
--- a/sci_gateway/cpp/sci_matrix.cpp
+++ b/sci_gateway/cpp/sci_matrix.cpp
@@ -1,5 +1,7 @@
#include <string>
-#include <ctype.h>
+#include "wchar.h"
+#include <cstdlib>
+//#include <ctype.h>
extern "C"
{
#include<Scierror.h>
@@ -13,44 +15,31 @@ extern "C"
#include "os_string.h"
-//#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;
- 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};
+ double* n;
+
+ wchar_t* in1 = 0;
+
+ char str[20];
+
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);
-
+
+ scilab_getString(env, in[1], &in1);
+ //printf("%S\n", in1);
+
+ wcstombs(str, in1, sizeof(str));
+ //printf("%s\n", str);
+
+
+
//if (nin != 0)
// {
// Scierror(77, _("%s: Wrong number of input argument(s): %d expected.\n"), fname, 1);
@@ -62,16 +51,12 @@ if (nout != 1)
Scierror(77, _("%s: Wrong number of output argument(s): %d expected.\n"), fname, 1);
return 1;
}
- //std::wstring ws(in1);
- //string str(ws.begin(), ws.end());
- //printf("%s\n",str);
- fun(ar, n[0],"hamming");
+
+ fun(ar, n[0],str);
*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[0]; i++)
{
diff --git a/thirdparty/linux/lib/x64/libfun.so b/thirdparty/linux/lib/x64/libfun.so
index 6e3275e..9bfdae5 100755
--- a/thirdparty/linux/lib/x64/libfun.so
+++ b/thirdparty/linux/lib/x64/libfun.so
Binary files differ