From d5d77fe4d8f3cd14dc3083ae0e5687b4f56976e4 Mon Sep 17 00:00:00 2001 From: KRIXUS-alpha Date: Wed, 12 May 2021 14:04:10 +0530 Subject: documentation struct --- sci_gateway/cpp/sci_octave.cpp | 618 ++++++++++++++++++++++++++++------------- 1 file changed, 432 insertions(+), 186 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 5f1f685..f106be3 100644 --- a/sci_gateway/cpp/sci_octave.cpp +++ b/sci_gateway/cpp/sci_octave.cpp @@ -17,9 +17,9 @@ extern "C" { -#include -#include -#include +#include +#include +#include #include "localization.h" #include "fun.h" #include @@ -28,226 +28,472 @@ extern "C" #include "os_string.h" #include + static const char fname[] = "octave_fun"; + + /** + * @brief Function to connect to Scilab's API. + * + * This function will get Data from Scilab, proccess the data + * in Octave then return the output back to Scilab using the + * API. + * + * @param env Scialb env + * @param nin[in] Number of input arguments + * @param in[in] Input Parameters + * @param nopt[in] Number of optional parameters + * @param opt[in] Optional parameters + * @param nout[out] Number of expected output parametets + * @param out[out] Array for output data + * @return int + */ + int sci_octave_fun(scilabEnv env, int nin, scilabVar *in, int nopt, scilabOpt *opt, int nout, scilabVar *out) - -static const char fname[] = "octave_fun"; -int sci_octave_fun(scilabEnv env, int nin, scilabVar* in, int nopt, scilabOpt* opt, int nout, scilabVar* out) - -{ -//printf("nin: %d\n", nin); - if (nin < 2) - { - Scierror(999, _("%s: Wrong number of input arguments. Atleast %d expected.\n"), fname, 2); - return STATUS_ERROR; - } - - FUNCCALL funcall; - FUNCCALL *funptr = &funcall; - funcall.n_in_arguments = nin; - funcall.n_out_user = nout; - - FUNCARGS ins[funcall.n_in_arguments*nout]; - FUNCARGS *argptr = ins; - - int i,j; - double* d; - double* rd = NULL;; - double* cd = NULL;; - int size; - char str[20]; - char* c; - double* n = NULL; - int row = 0; - int col = 0; - double* in_real; - double* in_img; - - for(i=0;i