retorna macros e endereço de uma biblioteca Scilab
macros = libraryinfo(libraryname) [macros,path] = libraryinfo(libraryname)
string (nome da biblioteca)
uma matriz de strings (todas as funções principais da biblioteca)
um string (endereço da biblioteca)
Retorna nomes de funções e o endereço de uma biblioteca Scilab. Os nomes de funções são aqueles que correspondem aos nomes de arquivo associados .sci ou .bin. Os outros são funções subsidiárias.
![]() | Only loaded libraries can be addressed by libraryinfo() . |
libraryinfo()
works from the literal name of the library.
In some cases, we may have only its handle, defined when loading the library.
For instance, libraryinfo("iolib")
works,
libraryinfo(iolib)
does not.
How to use the handle to get any info? Let's go on with the iolib
example:
libpath = string(iolib)(1)
functions = string(iolib)(2:$)
libraryname = xmlGetValues("//scilablib", "name", libpath+"/lib")
If the considered library is not loaded, neither libraryinfo()
nor string()
can work.
Provided that we know its libpath, we then can
xmlGetValues("//scilablib", "name", libpath+"/lib")
functions = xmlGetValues("//scilablib/macro", "name", libpath+"/lib")
With libraryinfo(), from the literal library name:
--> [f, p] = libraryinfo("iolib") p = SCI\modules\io\macros\ f = !input ! !unix_g ! !unix_w ! !%_sodload ! !unix_x ! !unix_s !
From the library handle:
// Just for display: iolib // Catch info into variables: p = string(iolib)(1) f = string(iolib)(2:$) libname = xmlGetValues("//scilablib", "name", p+"/lib") | ![]() | ![]() |
--> // Just for display: --> iolib iolib = Functions files location : SCI\modules\io\macros\. input unix_g unix_w %_sodload unix_x unix_s --> // Catch info into variables: --> p = string(iolib)(1) p = SCI\modules\io\macros\ --> f = string(iolib)(2:$) f = !input ! !unix_g ! !unix_w ! !%_sodload ! !unix_x ! !unix_s ! --> libname = xmlGetValues("//scilablib", "name", p+"/lib") libname = iolib
For a not-loaded library, from its path:
path = fullpath("SCI/modules/scicos_blocks/macros/Hydraulics"); libname = xmlGetValues("//scilablib", "name", path+"/lib") functions = xmlGetValues("//scilablib/macro", "name", path+"/lib") Hydraulicslib // not-loaded (Xcos must have not been run) | ![]() | ![]() |
--> libname = xmlGetValues("//scilablib", "name", path+"/lib") libname = Hydraulicslib --> functions = xmlGetValues("//scilablib/macro", "name", path+"/lib") functions = !Bache ! !Flowmeter ! !PerteDP ! !PuitsP ! !SourceP ! !VanneReglante ! --> Hydraulicslib Undefined variable: Hydraulicslib