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::getMethods(char * fname, const int envId, void * pvApiCtx)
22 int tmpvar[2] = {0, 0};
25 CheckInputArgument(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);
33 err = getVarAddressFromPosition(pvApiCtx, 1, &addr);
36 throw ScilabAbstractEnvironmentException(__LINE__, __FILE__, gettext("Invalid variable: cannot retrieve the data"));
39 if (!ScilabObjects::isExternalObjOrClass(addr, pvApiCtx))
41 throw ScilabAbstractEnvironmentException(__LINE__, __FILE__, gettext("Wrong type for input argument #%d: An External Object expected."), 1);
44 idObj = ScilabObjects::getArgumentId(addr, tmpvar, false, false, envId, pvApiCtx);
46 env.getaccessiblemethods(idObj, ScilabStringStackAllocator(pvApiCtx, Rhs + 1));