summaryrefslogtreecommitdiff
path: root/sci_gateway
diff options
context:
space:
mode:
Diffstat (limited to 'sci_gateway')
-rwxr-xr-xsci_gateway/cpp/libscilab_octave.sobin27400 -> 27400 bytes
-rw-r--r--sci_gateway/cpp/sci_octave.cpp39
2 files changed, 19 insertions, 20 deletions
diff --git a/sci_gateway/cpp/libscilab_octave.so b/sci_gateway/cpp/libscilab_octave.so
index 5802301..e5c4f0f 100755
--- a/sci_gateway/cpp/libscilab_octave.so
+++ b/sci_gateway/cpp/libscilab_octave.so
Binary files differ
diff --git a/sci_gateway/cpp/sci_octave.cpp b/sci_gateway/cpp/sci_octave.cpp
index 2e22b97..5f1f685 100644
--- a/sci_gateway/cpp/sci_octave.cpp
+++ b/sci_gateway/cpp/sci_octave.cpp
@@ -58,7 +58,7 @@ int sci_octave_fun(scilabEnv env, int nin, scilabVar* in, int nopt, scilabOpt* o
char* c;
double* n = NULL;
int row = 0;
- int col = 0;
+ int col = 0;
double* in_real;
double* in_img;
@@ -149,27 +149,26 @@ int sci_octave_fun(scilabEnv env, int nin, scilabVar* in, int nopt, scilabOpt* o
}
}
else
- {
- Scierror(999, _("%s: Wrong type of input argument %d.\n"), fname, i);
- return STATUS_ERROR;
- }
+ {
+ Scierror(999, _("%s: Wrong type of input argument %d.\n"), fname, i);
+ return STATUS_ERROR;
+ }
}
- // Capturing Errors and warnings
- std::stringstream buffer_err;
-
- // set our error buffer
- std::cerr.rdbuf(buffer_err.rdbuf());
+ // Capturing Errors and warnings
+ std::stringstream buffer_err;
- int status_fun = fun(argptr, funptr);
+ // set our error buffer
+ std::cerr.rdbuf(buffer_err.rdbuf());
- // grab error buffer contents
- std::string err = buffer_err.str();
- if(!err.empty())
- sciprint("%s", err.c_str());
- buffer_err.str("");
+ int status_fun = fun(argptr, funptr);
+ // grab error buffer contents
+ std::string err = buffer_err.str();
+ if(!err.empty() && status_fun==0)
+ sciprint("Warning from Octave\n%s", err.c_str());
+ buffer_err.str("");
//printf("in scilab status_fun is: %d\n", status_fun);
//printf("in scilab funcall.n_out_arguments is: %d\n", funcall.n_out_arguments);
//printf("in scilab funcall.n_out_user is: %d\n", funcall.n_out_user);
@@ -180,7 +179,7 @@ int sci_octave_fun(scilabEnv env, int nin, scilabVar* in, int nopt, scilabOpt* o
//printf("in scilab ouput args are: %d\n", funcall.n_out_arguments);
if(status_fun==1)
{
- Scierror(999, "");
+ Scierror(999,"Error from Octave\n%s", err.c_str());
return 1;
}
else if(funcall.n_out_user <= funcall.n_out_arguments)
@@ -227,9 +226,9 @@ int sci_octave_fun(scilabEnv env, int nin, scilabVar* in, int nopt, scilabOpt* o
}
else
{
- Scierror(77, _("%s: Wrong number of output arguments: This function can return a maximum of %d output(s).\n"), fname, funcall.n_out_arguments);
- return 1;
- }
+ Scierror(77, _("%s: Wrong number of output arguments: This function can return a maximum of %d output(s).\n"), fname, funcall.n_out_arguments);
+ return 1;
+ }