2 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3 * Copyright (C) 2012 - Scilab Enterprises - Calixte DENIZET
4 * Copyright (C) 2013 - Scilab Enterprises - Sylvestre Ledru
6 * This file must be used under the terms of the CeCILL.
7 * This source file is licensed as described in the file COPYING, which
8 * you should have received as part of this distribution. The terms
9 * are also available at
10 * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
14 #include "ScilabJavaEnvironment.hxx"
15 #include "ScilabGateway.hxx"
18 #include "warningmode.h"
20 #include "gw_external_objects_java.h"
23 using namespace org_scilab_modules_external_objects_java;
24 using namespace org_modules_external_objects;
26 int sci_jconvMatrixMethod(char * fname, unsigned long fname_len)
31 CheckInputArgument(pvApiCtx, 0, 1);
32 CheckOutputArgument(pvApiCtx, 1, 1);
35 sciprint(_("%s: Function %s is obsolete.\n"), _("Warning"), fname);
36 sciprint(_("%s: Please see documentation for more details.\n"), _("Warning"));
37 sciprint(_("%s: This function will be permanently removed in Scilab %s\n\n"), _("Warning"), "6.0.0");
40 envId = ScilabJavaEnvironment::start();
41 JavaOptionsSetter setter = ScilabJavaEnvironment::getInstance()->getOptionsHelper().getSetter(JavaOptionsSetter::METHODOFCONV);
42 ScilabAbstractEnvironment & env = ScilabEnvironments::getEnvironment(envId);
43 ScilabGatewayOptions & options = env.getGatewayOptions();
44 OptionsHelper::setCopyOccurred(false);
45 ScilabObjects::initialization(env, pvApiCtx);
46 options.setIsNew(false);
50 const char * order = setter.get() ? "rc" : "cr";
51 createMatrixOfString(pvApiCtx, Rhs + 1, 1, 1, &order);
61 type = ScilabObjects::getSingleString(Rhs, pvApiCtx);
63 catch (const std::exception & e)
65 Scierror(999, "%s: String \"rc\" or \"cr\" expected.", fname);
69 if (!strcmp(type, "rc"))
73 else if (!strcmp(type, "cr"))
80 Scierror(999, "%s: Invalid string: \"rc\" or \"cr\" expected.", fname);