2 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3 * Copyright (C) 2012 - Scilab Enterprises - Calixte DENIZET
5 * This file must be used under the terms of the CeCILL.
6 * This source file is licensed as described in the file COPYING, which
7 * you should have received as part of this distribution. The terms
8 * are also available at
9 * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
13 #include "ScilabGateway.hxx"
15 namespace org_modules_external_objects
18 int ScilabGateway::getsetOptions(char * fname, const int envId, ScilabAbstractOptionsSetter & setter, void * pvApiCtx)
24 CheckInputArgument(pvApiCtx, 0, 1);
25 CheckOutputArgument(pvApiCtx, 1, 1);
27 ScilabAbstractEnvironment & env = ScilabEnvironments::getEnvironment(envId);
28 ScilabGatewayOptions & options = env.getGatewayOptions();
29 OptionsHelper::setCopyOccured(false);
30 ScilabObjects::initialization(env, pvApiCtx);
31 options.setIsNew(false);
35 createScalarBoolean(pvApiCtx, 1, (int)setter.get());
43 sciErr = getVarAddressFromPosition(pvApiCtx, 1, &addr);
46 throw ScilabAbstractEnvironmentException(__LINE__, __FILE__, gettext("Invalid variable: cannot retrieve the data"));
49 if (!isBooleanType(pvApiCtx, addr))
51 throw ScilabAbstractEnvironmentException(__LINE__, __FILE__, gettext("Wrong type for input argument #%d: A boolean expected."), 1);
54 if (!isScalar(pvApiCtx, addr))
56 throw ScilabAbstractEnvironmentException(__LINE__, __FILE__, gettext("Wrong type for input argument #%d: A single boolean expected."), 1);
59 getScalarBoolean(pvApiCtx, addr, &val);