1 // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3 // Copyright (C) DIGITEO - 2009 - 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
11 function path = get_function_path(name)
13 if type(name) <> 10 then
14 error(999,msprintf(_("%s: Wrong type for input argument #%d: A string expected.\n"),'get_function_path',1));
17 if size(name,'*') <> 1 then
18 error(999,msprintf(_("%s: Wrong size for input argument #%d: A string expected.\n"),'get_function_path',1));
21 libname = whereis(name);
23 warning(" """+ name +'"" is not a library function');
26 execstr('t=string(' + libname + ')');
27 path = t(1) + name + '.sci';
29 if strindex(path,['SCI/','SCI\']) == 1 then
30 path = SCI + part(path,4:length(path));
33 if fileinfo(path) == [] then
34 warning(msprintf(gettext("%s: There is no file named %s.sci in the library directory %s.\n"),"get_function_path",name,t(1)));
37 path = pathconvert(path, %f);