[doc] libraryinfo() page overhauled
[scilab.git] / scilab / modules / functions / help / ja_JP / libraries / libraryinfo.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
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
7  *
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.
14  *
15  -->
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">
20     <refnamediv>
21         <refname>libraryinfo</refname>
22         <refpurpose>マクロとscilabライブラリのパスを取得</refpurpose>
23     </refnamediv>
24     <refsynopsisdiv>
25         <title>呼び出し手順</title>
26         <synopsis>macros = libraryinfo(libraryname)
27             [macros,path] = libraryinfo(libraryname)
28         </synopsis>
29     </refsynopsisdiv>
30     <refsection>
31         <title>引数</title>
32         <variablelist>
33             <varlistentry>
34                 <term>libraryname</term>
35                 <listitem>
36                     <para>文字列 (ライブラリ名)</para>
37                 </listitem>
38             </varlistentry>
39             <varlistentry>
40                 <term>macros</term>
41                 <listitem>
42                     <para>文字列行列 (ライブラリの全ての主関数)</para>
43                 </listitem>
44             </varlistentry>
45             <varlistentry>
46                 <term>path</term>
47                 <listitem>
48                     <para>文字列 (ライブラリのパス)</para>
49                 </listitem>
50             </varlistentry>
51         </variablelist>
52     </refsection>
53     <refsection>
54         <title>説明</title>
55         <para>
56             指定したScilabライブラリの関数名とパスを取得します.
57             返される関数名は対応する .sci または .bin のファイルの名前
58             に一致します.
59             その他の名前は補助関数です.
60             <warning>
61                 Only loaded libraries can be addressed by <literal>libraryinfo()</literal>.
62             </warning>
63         </para>
64         <refsect3>
65             <title>Getting some library info from its handle</title>
66             <para>
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>
72                 example:
73                 <itemizedlist>
74                     <listitem>
75                         <emphasis role="bold">Getting the path</emphasis>:
76                         <literal>libpath = string(iolib)(1)</literal>
77                     </listitem>
78                     <listitem>
79                         <emphasis role="bold">Getting the column vector of members functions</emphasis>:
80                         <literal>functions = string(iolib)(2:$)</literal>
81                     </listitem>
82                     <listitem>
83                         <emphasis role="bold">Getting the literal name of the library</emphasis>:
84                         <literal>libraryname = xmlGetValues("//scilablib", "name", libpath)</literal>
85                     </listitem>
86                 </itemizedlist>
87             </para>
88         </refsect3>
89         <refsect3>
90             <title>Unloaded library: getting info through its path</title>
91             <para>
92                 If the considered library is not loaded, neither <literal>libraryinfo()</literal>
93                 nor  <literal>string()</literal> can work.
94             </para>
95             <para>
96                 Provided that we know its libpath, we then can
97                 <itemizedlist>
98                     <listitem>
99                         <emphasis role="bold">get its literal name</emphasis>:
100                         <literal>xmlGetValues("//scilablib", "name", libpath+"/lib")</literal>
101                     </listitem>
102                     <listitem>
103                         <emphasis role="bold">get the column vector of members functions</emphasis>:
104                         <literal>functions = xmlGetValues("//scilablib/macro", "name", libpath+"/lib")</literal>
105                     </listitem>
106                 </itemizedlist>
107             </para>
108         </refsect3>
109     </refsection>
110     <refsection>
111         <title>例</title>
112         <para>
113             With libraryinfo(), from the literal library name:
114         </para>
115         <programlisting role="example"><![CDATA[
116 [f, p] = libraryinfo("iolib")
117      ]]></programlisting>
118     <screen><![CDATA[
119 --> [f, p] = libraryinfo("iolib")
120  p  =
121  SCI\modules\io\macros\
122
123  f  =
124 !input      !
125 !unix_g     !
126 !unix_w     !
127 !%_sodload  !
128 !unix_x     !
129 !unix_s     !
130 ]]></screen>
131         <para/>
132         <para>
133             From the library handle:
134         </para>
135         <programlisting role="example"><![CDATA[
136 // Just for display:
137 iolib
138
139 // Catch info into variables:
140 p = string(iolib)(1)
141 f = string(iolib)(2:$)
142 libname = xmlGetValues("//scilablib", "name", p+"/lib")
143      ]]></programlisting>
144     <screen><![CDATA[
145 --> // Just for display:
146 --> iolib
147
148  iolib  =
149 Functions files location : SCI\modules\io\macros\.
150 input  unix_g  unix_w  %_sodload  unix_x  unix_s
151
152 --> // Catch info into variables:
153 --> p = string(iolib)(1)
154  p  =
155  SCI\modules\io\macros\
156
157 --> f = string(iolib)(2:$)
158  f  =
159 !input      !
160 !unix_g     !
161 !unix_w     !
162 !%_sodload  !
163 !unix_x     !
164 !unix_s     !
165
166 --> libname = xmlGetValues("//scilablib", "name", p+"/lib")
167  libname  =
168  iolib
169 ]]></screen>
170     <para/>
171         <para>
172             For a not-loaded library, from its path:
173         </para>
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)
179      ]]></programlisting>
180     <screen><![CDATA[
181 --> libname = xmlGetValues("//scilablib", "name", path+"/lib")
182  libname  =
183  Hydraulicslib
184
185 --> functions = xmlGetValues("//scilablib/macro", "name", path+"/lib")
186  functions  =
187 !Bache          !
188 !Flowmeter      !
189 !PerteDP        !
190 !PuitsP         !
191 !SourceP        !
192 !VanneReglante  !
193
194 --> Hydraulicslib
195 未定義の変数: Hydraulicslib
196 ]]></screen>
197     </refsection>
198     <refsection role="see also">
199         <title>参照</title>
200         <simplelist type="inline">
201             <member>
202                 <link linkend="string">string</link>
203             </member>
204             <member>
205                 <link linkend="load">load</link>
206             </member>
207             <member>
208                 <link linkend="librarieslist">librarieslist</link>
209             </member>
210             <member>
211                 <link linkend="whereis">whereis</link>
212             </member>
213         </simplelist>
214     </refsection>
215 </refentry>