2 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3 * Copyright (C) INRIA - Allan CORNET
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 /*--------------------------------------------------------------------------*/
18 #include "system_setproperty.h"
20 #include "localization.h"
21 /*--------------------------------------------------------------------------*/
22 int sci_system_setproperty(char *fname, unsigned long fname_len)
28 if ( (GetType(1) == sci_strings) && (GetType(2) == sci_strings) )
30 static int m1, n1 = 0, l1 = 0;
31 static int m2, n2 = 0, l2 = 0;
32 char *propertyName = NULL;
33 char *propertyValue = NULL;
34 char *previousValue = NULL;
36 GetRhsVar(1, STRING_DATATYPE, &m1, &n1, &l1);
37 propertyName = cstk(l1);
39 GetRhsVar(2, STRING_DATATYPE, &m2, &n2, &l2);
40 propertyValue = cstk(l2);
42 previousValue = system_setproperty(propertyName, propertyValue);
47 m1 = (int)strlen(propertyValue);
48 CreateVarFromPtr(Rhs + 1, STRING_DATATYPE, &m1, &n1, &previousValue);
55 CreateVar(Rhs + 1, MATRIX_OF_DOUBLE_DATATYPE, &n1, &m1, &l1);
67 Scierror(999, _("%s: Wrong type for input argument #%d or #%d: String expected.\n"), fname, 1, 2);
71 /*--------------------------------------------------------------------------*/