extern "C" { #include #include #include "localization.h" #include static const char fname[] = "octave_fun"; int sci_octave_fun(scilabEnv env, int nin, scilabVar* in, int nopt, scilabOpt* opt, int nout, scilabVar* out) { if (nin != 0) { Scierror(77, _("%s: Wrong number of input argument(s): %d expected.\n"), fname, 2); return 1; } if (nout != 1) { Scierror(77, _("%s: Wrong number of output argument(s): %d expected.\n"), fname, 1); return 1; } double x = fun(); out[0] = scilab_createDouble( env, x); return 0; } }