Returns the name of the loaded library/module a given function belongs to
libmod = whereis(function)
Name (text) or handle of a Scilab "macro" or builtin function. Both kinds of input are equivalent.
If function
points to
libmod
returns the name of the library.libmod
returns "script"
.function
belongs to is returned.libmod
returns []
.whereis
allows to identify the library of Scilab macros or the
module a given function belongs to.
When the function is
it may be not loaded (not yet called), but its library must be so.
When the same function name is registered in several loaded libraries of
macros, whereis
returns the name of all of them.
libraryinfo(..) allows to retrieve the path to definition files of a library.
![]() |
|
but defined
deff(..)
or by
function ... endfunction
, orexec(functionfile.sci)
or with
getd(..)
,whereis
returns "script"
.
When this function is defined in a file, there is no way to retrieve the file
path and name.
whereis
returns the name of the module the function
belongs to.
The gateway file where the builtin function is declared to belong to the
module is located at
SCI/modules/moduleName/gateway/moduleName_gateway.xml
,
where moduleName
must be replaced with the actual
module name.
![]() | In the case that the function name is simultaneously defined as a unregistered function
("script"), and as a registered one in a library and as a builtin,
whereis returns only one kind of answer with the likely priorities:
builtin's module > macro's library > "script" for unregistered macro .
However, the actual result may vary (and be []). |
// Case of an unregistered macro: function myTest(), disp("Unregistered function"), endfunction whereis myTest // => "script" // Case of a registered macro: r = whereis("ls") // => "fileiolib" [?,path]= libraryinfo(r); path // => "SCI\modules\fileio\macros\" // Let's define another ls() in another library: path = TMPDIR+"/myls"; mkdir(path); mputl("function ls(), disp(""my other ls() in lslib""), endfunction", path+"/ls.sci"); genlib("lslib", path); whereis ls // => ["fileiolib"; "lslib"] // Case of a builtin function whereis sin // => "elementary_functions" whereis conv2 // => "signal_processing" // Case of an unregistered macro defined/loaded after a registered one: clear ls lslib whereis ls // "fileiolib" : OK function ls(), disp("my local ls()"), endfunction ls // => "my local ls()" whereis ls // => "fileiolib", still clear ls // (cleaning up) // Dependencies are ignored: // chfact() has some private dependency functions blkfc1(), inpnv(), etc: edit chfact // chfact() is registered: whereis chfact // => "sparselib" // .. but not its dependencies: whereis blkfc1 // => [] // Sublibraries may be loaded only after the first call to a main driving function: // CLR() is a public function related to the CLR Xcos block belonging to the // Linear palette and declared in the Linearlib library. // But this sublibrary is loaded only after a first call to xcos(): whereis xcos // => "xcoslib" whereis CLR // => [], if you never called xcos() in the session yet. xcos() // => loads all its sublibraries. Please ignore the interfaces. // You may even close them. whereis CLR // => "Linearlib" non-empty answer, now | ![]() | ![]() |
Version | Description |
6.0 |
|