From a938a95dd5b903f2e1f242e70b9db368ff422f41 Mon Sep 17 00:00:00 2001 From: detailer Date: Tue, 11 May 2021 11:32:12 +0530 Subject: fixed str_count --- sci_gateway/cpp/libscilab_octave.so | Bin 27944 -> 32008 bytes src/fun.cpp | 6 ++++-- src/fun.o | Bin 4565488 -> 4836152 bytes src/libfun.so | Bin 2855912 -> 2973816 bytes src/testfun | Bin 40960 -> 41304 bytes thirdparty/linux/include/fun.h | 41 ++++++++++++++++++++++++------------ thirdparty/linux/lib/x64/libfun.so | Bin 2855912 -> 2973816 bytes 7 files changed, 32 insertions(+), 15 deletions(-) diff --git a/sci_gateway/cpp/libscilab_octave.so b/sci_gateway/cpp/libscilab_octave.so index a3f2512..eb7abf5 100755 Binary files a/sci_gateway/cpp/libscilab_octave.so and b/sci_gateway/cpp/libscilab_octave.so differ diff --git a/src/fun.cpp b/src/fun.cpp index 3f72da8..9017584 100644 --- a/src/fun.cpp +++ b/src/fun.cpp @@ -98,17 +98,19 @@ extern "C" char *c = (char *)inp[l].in_data_real; //std::cout << "String is: " << c << '\n'; - if (l == 0) + if (l == 0){ strcpy(str_fun, c); + str_count++; + } else if (l == 1) { strcpy(str_pkg, c); pkg = 1; + str_count++; } else in(l - str_count) = c; - str_count++; //std::cout << "String is: " << c << '\n'; } else if (inp[l].type == TYPE_STRUCT){ diff --git a/src/fun.o b/src/fun.o index 03270cf..372f7ee 100644 Binary files a/src/fun.o and b/src/fun.o differ diff --git a/src/libfun.so b/src/libfun.so index 6c97c22..6dd4f31 100755 Binary files a/src/libfun.so and b/src/libfun.so differ diff --git a/src/testfun b/src/testfun index 500b639..a31b907 100755 Binary files a/src/testfun and b/src/testfun differ diff --git a/thirdparty/linux/include/fun.h b/thirdparty/linux/include/fun.h index e5e1fff..7336957 100644 --- a/thirdparty/linux/include/fun.h +++ b/thirdparty/linux/include/fun.h @@ -15,35 +15,50 @@ extern "C" { - typedef enum - { + typedef enum { TYPE_DOUBLE, + TYPE_COMPLEX, TYPE_STRING, + TYPE_STRUCT, }FUNCTYPE; - typedef struct - { + typedef struct { + FUNCTYPE type; // type of value in struct's field + void* key; // key of struct field + int rows; // rows dimension of struct field's value + int cols; // cols dimension of struct fields' value + void* dataReal; // Real data if struct field's value is real + void* dataImg; // Img data if struct field's value is complex + void* str; // string data if struct field's value is string + } FUNCSTRUCT; + + typedef struct { FUNCTYPE type; int n_in_rows; int n_in_cols; + int n_in_struct_len; // ip struct length int n_out_rows; int n_out_cols; + int n_out_struct_len; // op struct length int is_in_cmplx; int is_out_cmplx; + int is_out_struct; void* in_data_real; void* in_data_img; void* out_data_real; void* out_data_img; - }FUNCARGS; - + FUNCSTRUCT* in_struct; + FUNCSTRUCT* out_struct; + } FUNCARGS; + typedef struct { - int n_in_arguments; // number of input arguments - int n_out_arguments; // number of output arguments - int n_out_user; // number of output arguments - char *err; // Name - //char *package; //Name of octave package to be loaded - FUNCARGS *argument; -} FUNCCALL; + int n_in_arguments; // number of input arguments + int n_out_arguments; // number of output arguments + int n_out_user; // number of output arguments + char *err; // Name + //char *package; //Name of octave package to be loaded + FUNCARGS *argument; + } FUNCCALL; int fun(FUNCARGS *arr, FUNCCALL *call); } diff --git a/thirdparty/linux/lib/x64/libfun.so b/thirdparty/linux/lib/x64/libfun.so index 6c97c22..6dd4f31 100755 Binary files a/thirdparty/linux/lib/x64/libfun.so and b/thirdparty/linux/lib/x64/libfun.so differ -- cgit