2 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3 * Copyright (C) 2011 - DIGITEO - Calixte DENIZET
5 * Copyright (C) 2012 - 2016 - Scilab Enterprises
7 * This file is hereby licensed under the terms of the GNU GPL v2.0,
8 * pursuant to article 5.3.4 of the CeCILL v.2.1.
9 * This file was originally licensed under the terms of the CeCILL v2.1,
10 * and continues to be available under such terms.
11 * For more information, see the COPYING file which you should have received
12 * along with this program.
16 #include "ScilabPreferences.hxx"
17 #include "GiwsException.hxx"
18 #include "preferences_gw.hxx"
23 #include "api_scilab.h"
24 #include "localization.h"
25 #include "getScilabJavaVM.h"
28 using namespace org_scilab_modules_preferences;
30 /*--------------------------------------------------------------------------*/
31 int sci_removeModulePreferences(char * fname, void *pvApiCtx)
41 err = getVarAddressFromPosition(pvApiCtx, 1, &addr);
48 if (!isEmptyMatrix(pvApiCtx, addr))
50 if (!isStringType(pvApiCtx, addr))
52 Scierror(999, gettext("%s: Wrong type for input argument #%i: string expected.\n"), fname, 1);
54 if (getAllocatedSingleString(pvApiCtx, addr, &tbxName))
62 ScilabPreferences::removeToolboxInfos(getScilabJavaVM(), tbxName);
64 catch (const GiwsException::JniException & e)
66 Scierror(999, _("%s: A Java exception arised:\n%s"), fname, e.what());
72 freeAllocatedSingleString(tbxName);
83 /*--------------------------------------------------------------------------*/