1 // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2 // Copyright (C) DIGITEO - 2008-2010 - Yann COLLETTE
4 // This file must be used under the terms of the CeCILL.
5 // This source file is licensed as described in the file COPYING, which
6 // you should have received as part of this distribution. The terms
7 // are also available at
8 // http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
10 function [plist, err] = add_param(list_name, param_name, param_value)
12 [nargout, nargin] = argn();
15 warning(sprintf(_("Second output argument of %s is obsolete.\n"), "add_param"))
16 warning(sprintf(_("This argument will be permanently removed in Scilab %s"), "5.5.1"))
19 if nargin <> 2 & nargin <> 3 then
20 error(sprintf(gettext("%s: Wrong number of input arguments: %d to %d expected.\n"), "add_param", 2, 3));
23 if typeof(list_name) == "plist" then
24 if ~is_param(list_name, param_name) then
25 setfield(1, [getfield(1, list_name) param_name], list_name);
30 list_name(param_name) = param_value;
33 error(sprintf(gettext("%s: Wrong value for input argument #%d: key ""%s"" already defined.\n"), "add_param", 2, param_name));
39 error(sprintf(gettext("%s: Wrong type for input argument #%d: %s expected.\n"), "add_param", 1, "plist"));