1 <?xml version="1.0" encoding="UTF-8"?>
3 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
4 * Copyright (C) DIGITEO - Scilab Consortium
5 * Copyright (C) 2012 - 2016 - Scilab Enterprises
6 * Copyright (C) 2019 - Samuel GOUGEON
8 * This file is hereby licensed under the terms of the GNU GPL v2.0,
9 * pursuant to article 5.3.4 of the CeCILL v.2.1.
10 * This file was originally licensed under the terms of the CeCILL v2.1,
11 * and continues to be available under such terms.
12 * For more information, see the COPYING file which you should have received
13 * along with this program.
16 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
17 xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML"
18 xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org"
19 xml:lang="ja" xml:id="libraryinfo">
21 <refname>libraryinfo</refname>
22 <refpurpose>マクロとscilabライブラリのパスを取得</refpurpose>
26 <synopsis>macros = libraryinfo(libraryname)
27 [macros,path] = libraryinfo(libraryname)
34 <term>libraryname</term>
36 <para>文字列 (ライブラリ名)</para>
42 <para>文字列行列 (ライブラリの全ての主関数)</para>
48 <para>文字列 (ライブラリのパス)</para>
56 指定したScilabライブラリの関数名とパスを取得します.
57 返される関数名は対応する .sci または .bin のファイルの名前
61 Only loaded libraries can be addressed by <literal>libraryinfo()</literal>.
65 <title>Getting some library info from its handle</title>
67 <literal>libraryinfo()</literal> works from the literal name of the library.
68 In some cases, we may have only its handle, defined when loading the library.
69 For instance, <literal>libraryinfo("iolib")</literal> works,
70 <literal>libraryinfo(iolib)</literal> does not.
71 How to use the handle to get any info? Let's go on with the <literal>iolib</literal>
75 <emphasis role="bold">Getting the path</emphasis>:
76 <literal>libpath = string(iolib)(1)</literal>
79 <emphasis role="bold">Getting the column vector of members functions</emphasis>:
80 <literal>functions = string(iolib)(2:$)</literal>
83 <emphasis role="bold">Getting the literal name of the library</emphasis>:
84 <literal>libraryname = xmlGetValues("//scilablib", "name", libpath)</literal>
90 <title>Unloaded library: getting info through its path</title>
92 If the considered library is not loaded, neither <literal>libraryinfo()</literal>
93 nor <literal>string()</literal> can work.
96 Provided that we know its libpath, we then can
99 <emphasis role="bold">get its literal name</emphasis>:
100 <literal>xmlGetValues("//scilablib", "name", libpath+"/lib")</literal>
103 <emphasis role="bold">get the column vector of members functions</emphasis>:
104 <literal>functions = xmlGetValues("//scilablib/macro", "name", libpath+"/lib")</literal>
113 With libraryinfo(), from the literal library name:
115 <programlisting role="example"><![CDATA[
116 [f, p] = libraryinfo("iolib")
119 --> [f, p] = libraryinfo("iolib")
121 SCI\modules\io\macros\
133 From the library handle:
135 <programlisting role="example"><![CDATA[
139 // Catch info into variables:
141 f = string(iolib)(2:$)
142 libname = xmlGetValues("//scilablib", "name", p+"/lib")
145 --> // Just for display:
149 Functions files location : SCI\modules\io\macros\.
150 input unix_g unix_w %_sodload unix_x unix_s
152 --> // Catch info into variables:
153 --> p = string(iolib)(1)
155 SCI\modules\io\macros\
157 --> f = string(iolib)(2:$)
166 --> libname = xmlGetValues("//scilablib", "name", p+"/lib")
172 For a not-loaded library, from its path:
174 <programlisting role="example"><![CDATA[
175 path = fullpath("SCI/modules/scicos_blocks/macros/Hydraulics");
176 libname = xmlGetValues("//scilablib", "name", path+"/lib")
177 functions = xmlGetValues("//scilablib/macro", "name", path+"/lib")
178 Hydraulicslib // not-loaded (Xcos must have not been run)
181 --> libname = xmlGetValues("//scilablib", "name", path+"/lib")
185 --> functions = xmlGetValues("//scilablib/macro", "name", path+"/lib")
195 未定義の変数: Hydraulicslib
198 <refsection role="see also">
200 <simplelist type="inline">
202 <link linkend="string">string</link>
205 <link linkend="load">load</link>
208 <link linkend="librarieslist">librarieslist</link>
211 <link linkend="whereis">whereis</link>