From 3949f2171492554c9039b4b813f6f7dd871cd510 Mon Sep 17 00:00:00 2001 From: shag527 Date: Fri, 7 May 2021 11:22:00 +0530 Subject: Retrieved Struct Data --- sci_gateway/cpp/sci_octave.cpp | 79 +++++++++++++++++++++++++++++++++++++++--- 1 file changed, 75 insertions(+), 4 deletions(-) (limited to 'sci_gateway/cpp/sci_octave.cpp') diff --git a/sci_gateway/cpp/sci_octave.cpp b/sci_gateway/cpp/sci_octave.cpp index e773c65..da56af1 100644 --- a/sci_gateway/cpp/sci_octave.cpp +++ b/sci_gateway/cpp/sci_octave.cpp @@ -74,7 +74,7 @@ extern "C" ins[i].type = TYPE_DOUBLE; if (scilab_isComplex(env, in[i]) == 1) { - //printf("input %d is complex \n", i); + //printf("input %d is complex1 \n", i); ins[i].is_in_cmplx = 1; size = scilab_getDim2d(env, in[i], &row, &col); ins[i].n_in_rows = row; @@ -95,8 +95,8 @@ extern "C" rd[k] = in_real[p + q * row]; cd[k] = in_img[p + q * row]; k++; - //printf("%d\n",in_real[k]); - //printf("%d\n",in_img[k]); + printf("%d\n",in_real[k]); + printf("%d\n",in_img[k]); } } } @@ -126,7 +126,7 @@ extern "C" } ///////////////////////////////////////// } - else if (scilab_getType(env, in[i]) == 10) + else if (scilab_getType(env, in[i]) == 10) // Checking for String Argument { ins[i].is_in_cmplx = 0; wchar_t *in1 = 0; @@ -152,12 +152,83 @@ extern "C" //printf("in scilab strin is: %s\n", c); } } + else if (scilab_getType(env, in[i]) == 18) //Checking for Struct input + { + wchar_t** fields = NULL; + scilabVar struct_out; + int dims=0; + + dims=scilab_getFields(env,in[i],&fields); // Retrieving Struct Fields + //std::cout<