[doc] libraryinfo() page overhauled 13/21413/4
Samuel GOUGEON [Wed, 26 Jun 2019 21:07:52 +0000 (23:07 +0200)]
  Moved from the master @ https://codereview.scilab.org/21027

  PDF version: please remove it from the commit before merging.

Change-Id: Id86b35c0860e486acfca238e312d2ec6363eb967

scilab/modules/functions/help/en_US/libraries/libraryinfo.xml
scilab/modules/functions/help/ja_JP/libraries/libraryinfo.xml
scilab/modules/functions/help/pt_BR/libraries/libraryinfo.xml
scilab/modules/functions/help/ru_RU/libraries/libraryinfo.xml [new file with mode: 0644]

index cc9fc3b..d686637 100644 (file)
 <?xml version="1.0" encoding="UTF-8"?>
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="en" xml:id="libraryinfo">
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) DIGITEO - Scilab Consortium
+ * Copyright (C) 2012 - 2016 - Scilab Enterprises
+ * Copyright (C) 2019 - Samuel GOUGEON
+ *
+ * This file is hereby licensed under the terms of the GNU GPL v2.0,
+ * pursuant to article 5.3.4 of the CeCILL v.2.1.
+ * This file was originally licensed under the terms of the CeCILL v2.1,
+ * and continues to be available under such terms.
+ * For more information, see the COPYING file which you should have received
+ * along with this program.
+ *
+ -->
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
+          xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML"
+          xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org"
+          xml:lang="en" xml:id="libraryinfo">
     <refnamediv>
         <refname>libraryinfo</refname>
-        <refpurpose>get macros and path of a scilab library</refpurpose>
+        <refpurpose>gets the path and the set of primary functions of a loaded library</refpurpose>
     </refnamediv>
     <refsynopsisdiv>
         <title>Syntax</title>
-        <synopsis>macros = libraryinfo(libraryname)
-            [macros,path] = libraryinfo(libraryname)
+        <synopsis>
+            macros = libraryinfo(libraryname)
+            [macros, libpath] = libraryinfo(libraryname)
         </synopsis>
     </refsynopsisdiv>
     <refsection>
         <title>Arguments</title>
         <variablelist>
             <varlistentry>
-                <term>macros</term>
+                <term>libraryname</term>
                 <listitem>
-                    <para>a string matrix (all main functions of the library)</para>
+                    <para>string: name of the loaded library.</para>
                 </listitem>
             </varlistentry>
         </variablelist>
         <variablelist>
             <varlistentry>
-                <term>path</term>
+                <term>macros</term>
                 <listitem>
-                    <para>a string (path of library)</para>
+                    <para>column of strings: names of main functions belonging to the library.</para>
                 </listitem>
             </varlistentry>
         </variablelist>
         <variablelist>
             <varlistentry>
-                <term>libraryname</term>
+                <term>libpath</term>
                 <listitem>
-                    <para>a string (library name)</para>
+                    <para>string: path to the lib file of the library.</para>
                 </listitem>
             </varlistentry>
         </variablelist>
     </refsection>
     <refsection>
         <title>Description</title>
-        <para>get functions names  and path of a scilab library.The function names
-            returned correspond to those which correspond to the associated .sci or .bin
-            file names. The other ones are subsidiary functions.
+        <para>
+            gets the names of the functions (written in Scilab language) belonging to the given
+            library, and the path of the directory where their *.sci files and the lib file
+            are stored. Subsidiary functions that may follow the main ones in .sci files
+            are private and are not returned.
+            <warning>
+                Only loaded libraries can be addressed by <literal>libraryinfo()</literal>.
+            </warning>
         </para>
+        <refsect3>
+            <title>Getting some library info from its handle</title>
+            <para>
+                <literal>libraryinfo()</literal> works from the literal name of the library.
+                In some cases, we may have only its handle, defined when loading the library.
+                For instance, <literal>libraryinfo("iolib")</literal> works,
+                <literal>libraryinfo(iolib)</literal> does not.
+                How to use the handle to get any info? Let's go on with the <literal>iolib</literal>
+                example:
+                <itemizedlist>
+                    <listitem>
+                        <emphasis role="bold">Getting the path</emphasis>:
+                        <literal>libpath = string(iolib)(1)</literal>
+                    </listitem>
+                    <listitem>
+                        <emphasis role="bold">Getting the column vector of members functions</emphasis>:
+                        <literal>functions = string(iolib)(2:$)</literal>
+                    </listitem>
+                    <listitem>
+                        <emphasis role="bold">Getting the literal name of the library</emphasis>:
+                        <literal>libraryname = xmlGetValues("//scilablib", "name", libpath)</literal>
+                    </listitem>
+                </itemizedlist>
+            </para>
+        </refsect3>
+        <refsect3>
+            <title>Unloaded library: getting info through its path</title>
+            <para>
+                If the considered library is not loaded, neither <literal>libraryinfo()</literal>
+                nor  <literal>string()</literal> can work.
+            </para>
+            <para>
+                Provided that we know its libpath, we then can
+                <itemizedlist>
+                    <listitem>
+                        <emphasis role="bold">get its literal name</emphasis>:
+                        <literal>xmlGetValues("//scilablib", "name", libpath+"/lib")</literal>
+                    </listitem>
+                    <listitem>
+                        <emphasis role="bold">get the column vector of members functions</emphasis>:
+                        <literal>functions = xmlGetValues("//scilablib/macro", "name", libpath+"/lib")</literal>
+                    </listitem>
+                </itemizedlist>
+            </para>
+        </refsect3>
     </refsection>
     <refsection>
         <title>Examples</title>
+        <para>
+            With libraryinfo(), from the literal library name:
+        </para>
+        <programlisting role="example"><![CDATA[
+[f, p] = libraryinfo("iolib")
+     ]]></programlisting>
+    <screen><![CDATA[
+--> [f, p] = libraryinfo("iolib")
+ p  =
+ SCI\modules\io\macros\
+
+ f  =
+!input      !
+!unix_g     !
+!unix_w     !
+!%_sodload  !
+!unix_x     !
+!unix_s     !
+]]></screen>
+        <para/>
+        <para>
+            From the library handle:
+        </para>
         <programlisting role="example"><![CDATA[
-[m,p]=libraryinfo('corelib')
- ]]></programlisting>
+// Just for display:
+iolib
+
+// Catch info into variables:
+p = string(iolib)(1)
+f = string(iolib)(2:$)
+libname = xmlGetValues("//scilablib", "name", p+"/lib")
+     ]]></programlisting>
+    <screen><![CDATA[
+--> // 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
+]]></screen>
+    <para/>
+        <para>
+            For a not-loaded library, from its path:
+        </para>
+        <programlisting role="example"><![CDATA[
+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)
+     ]]></programlisting>
+    <screen><![CDATA[
+--> 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
+]]></screen>
     </refsection>
     <refsection role="see also">
         <title>See also</title>
         <simplelist type="inline">
             <member>
+                <link linkend="string">string</link>
+            </member>
+            <member>
+                <link linkend="load">load</link>
+            </member>
+            <member>
                 <link linkend="librarieslist">librarieslist</link>
             </member>
             <member>
index 5bf15e7..bdf1f6f 100644 (file)
 <?xml version="1.0" encoding="UTF-8"?>
-
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="ja" xml:id="libraryinfo">
-
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) DIGITEO - Scilab Consortium
+ * Copyright (C) 2012 - 2016 - Scilab Enterprises
+ * Copyright (C) 2019 - Samuel GOUGEON
+ *
+ * This file is hereby licensed under the terms of the GNU GPL v2.0,
+ * pursuant to article 5.3.4 of the CeCILL v.2.1.
+ * This file was originally licensed under the terms of the CeCILL v2.1,
+ * and continues to be available under such terms.
+ * For more information, see the COPYING file which you should have received
+ * along with this program.
+ *
+ -->
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
+          xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML"
+          xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org"
+          xml:lang="ja" xml:id="libraryinfo">
     <refnamediv>
-
         <refname>libraryinfo</refname>
-
         <refpurpose>マクロとscilabライブラリのパスを取得</refpurpose>
-
     </refnamediv>
-
     <refsynopsisdiv>
-
         <title>呼び出し手順</title>
-
         <synopsis>macros = libraryinfo(libraryname)
-
             [macros,path] = libraryinfo(libraryname)
-
         </synopsis>
-
     </refsynopsisdiv>
-
     <refsection>
-
         <title>引数</title>
-
         <variablelist>
-
             <varlistentry>
-
-                <term>macros</term>
-
+                <term>libraryname</term>
                 <listitem>
-
-                    <para>文字列行列 (ライブラリの全ての主関数)</para>
-
+                    <para>文字列 (ライブラリ名)</para>
                 </listitem>
-
             </varlistentry>
-
-        </variablelist>
-
-        <variablelist>
-
             <varlistentry>
-
-                <term>path</term>
-
+                <term>macros</term>
                 <listitem>
-
-                    <para>文字列 (ライブラリのパス)</para>
-
+                    <para>文字列行列 (ライブラリの全ての主関数)</para>
                 </listitem>
-
             </varlistentry>
-
-        </variablelist>
-
-        <variablelist>
-
             <varlistentry>
-
-                <term>libraryname</term>
-
+                <term>path</term>
                 <listitem>
-
-                    <para>文字列 (ライブラリ名)</para>
-
+                    <para>文字列 (ライブラリのパス)</para>
                 </listitem>
-
             </varlistentry>
-
         </variablelist>
-
     </refsection>
-
     <refsection>
-
         <title>説明</title>
-
         <para>
-
             指定したScilabライブラリの関数名とパスを取得します.
-
             返される関数名は対応する .sci または .bin のファイルの名前
-
             に一致します.
-
             その他の名前は補助関数です.
-
+            <warning>
+                Only loaded libraries can be addressed by <literal>libraryinfo()</literal>.
+            </warning>
         </para>
-
+        <refsect3>
+            <title>Getting some library info from its handle</title>
+            <para>
+                <literal>libraryinfo()</literal> works from the literal name of the library.
+                In some cases, we may have only its handle, defined when loading the library.
+                For instance, <literal>libraryinfo("iolib")</literal> works,
+                <literal>libraryinfo(iolib)</literal> does not.
+                How to use the handle to get any info? Let's go on with the <literal>iolib</literal>
+                example:
+                <itemizedlist>
+                    <listitem>
+                        <emphasis role="bold">Getting the path</emphasis>:
+                        <literal>libpath = string(iolib)(1)</literal>
+                    </listitem>
+                    <listitem>
+                        <emphasis role="bold">Getting the column vector of members functions</emphasis>:
+                        <literal>functions = string(iolib)(2:$)</literal>
+                    </listitem>
+                    <listitem>
+                        <emphasis role="bold">Getting the literal name of the library</emphasis>:
+                        <literal>libraryname = xmlGetValues("//scilablib", "name", libpath)</literal>
+                    </listitem>
+                </itemizedlist>
+            </para>
+        </refsect3>
+        <refsect3>
+            <title>Unloaded library: getting info through its path</title>
+            <para>
+                If the considered library is not loaded, neither <literal>libraryinfo()</literal>
+                nor  <literal>string()</literal> can work.
+            </para>
+            <para>
+                Provided that we know its libpath, we then can
+                <itemizedlist>
+                    <listitem>
+                        <emphasis role="bold">get its literal name</emphasis>:
+                        <literal>xmlGetValues("//scilablib", "name", libpath+"/lib")</literal>
+                    </listitem>
+                    <listitem>
+                        <emphasis role="bold">get the column vector of members functions</emphasis>:
+                        <literal>functions = xmlGetValues("//scilablib/macro", "name", libpath+"/lib")</literal>
+                    </listitem>
+                </itemizedlist>
+            </para>
+        </refsect3>
     </refsection>
-
     <refsection>
-
         <title>例</title>
-
+        <para>
+            With libraryinfo(), from the literal library name:
+        </para>
         <programlisting role="example"><![CDATA[
-[m,p]=libraryinfo('corelib')
- ]]></programlisting>
-
+[f, p] = libraryinfo("iolib")
+     ]]></programlisting>
+    <screen><![CDATA[
+--> [f, p] = libraryinfo("iolib")
+ p  =
+ SCI\modules\io\macros\
+
+ f  =
+!input      !
+!unix_g     !
+!unix_w     !
+!%_sodload  !
+!unix_x     !
+!unix_s     !
+]]></screen>
+        <para/>
+        <para>
+            From the library handle:
+        </para>
+        <programlisting role="example"><![CDATA[
+// Just for display:
+iolib
+
+// Catch info into variables:
+p = string(iolib)(1)
+f = string(iolib)(2:$)
+libname = xmlGetValues("//scilablib", "name", p+"/lib")
+     ]]></programlisting>
+    <screen><![CDATA[
+--> // 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
+]]></screen>
+    <para/>
+        <para>
+            For a not-loaded library, from its path:
+        </para>
+        <programlisting role="example"><![CDATA[
+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)
+     ]]></programlisting>
+    <screen><![CDATA[
+--> libname = xmlGetValues("//scilablib", "name", path+"/lib")
+ libname  =
+ Hydraulicslib
+
+--> functions = xmlGetValues("//scilablib/macro", "name", path+"/lib")
+ functions  =
+!Bache          !
+!Flowmeter      !
+!PerteDP        !
+!PuitsP         !
+!SourceP        !
+!VanneReglante  !
+
+--> Hydraulicslib
+未定義の変数: Hydraulicslib
+]]></screen>
     </refsection>
-
     <refsection role="see also">
-
         <title>参照</title>
-
         <simplelist type="inline">
-
             <member>
-
+                <link linkend="string">string</link>
+            </member>
+            <member>
+                <link linkend="load">load</link>
+            </member>
+            <member>
                 <link linkend="librarieslist">librarieslist</link>
-
             </member>
             <member>
                 <link linkend="whereis">whereis</link>
             </member>
-
         </simplelist>
-
     </refsection>
-
 </refentry>
-
index bc9f046..e919080 100644 (file)
@@ -1,9 +1,25 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns3="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="libraryinfo" xml:lang="pt">
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) DIGITEO - Scilab Consortium
+ * Copyright (C) 2012 - 2016 - Scilab Enterprises
+ * Copyright (C) 2019 - Samuel GOUGEON
+ *
+ * This file is hereby licensed under the terms of the GNU GPL v2.0,
+ * pursuant to article 5.3.4 of the CeCILL v.2.1.
+ * This file was originally licensed under the terms of the CeCILL v2.1,
+ * and continues to be available under such terms.
+ * For more information, see the COPYING file which you should have received
+ * along with this program.
+ *
+ -->
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
+          xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns3="http://www.w3.org/1999/xhtml"
+          xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook"
+          xmlns:scilab="http://www.scilab.org" xml:id="libraryinfo" xml:lang="pt">
     <refnamediv>
         <refname>libraryinfo</refname>
-        <refpurpose>retorna macros e endereço de uma biblioteca
-            Scilab
+        <refpurpose>retorna macros e endereço de uma biblioteca Scilab
         </refpurpose>
     </refnamediv>
     <refsynopsisdiv>
         <title>Parâmetros</title>
         <variablelist>
             <varlistentry>
+                <term>libraryname</term>
+                <listitem>
+                    <para>string (nome da biblioteca)</para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
                 <term>macros</term>
                 <listitem>
                     <para>uma matriz de strings (todas as funções principais da
@@ -23,8 +45,6 @@
                     </para>
                 </listitem>
             </varlistentry>
-        </variablelist>
-        <variablelist>
             <varlistentry>
                 <term>path</term>
                 <listitem>
                 </listitem>
             </varlistentry>
         </variablelist>
-        <variablelist>
-            <varlistentry>
-                <term>libraryname</term>
-                <listitem>
-                    <para>string (nome da biblioteca)</para>
-                </listitem>
-            </varlistentry>
-        </variablelist>
     </refsection>
     <refsection>
         <title>Descrição</title>
         <para>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.
+            <warning>
+                Only loaded libraries can be addressed by <literal>libraryinfo()</literal>.
+            </warning>
         </para>
+        <refsect3>
+            <title>Getting some library info from its handle</title>
+            <para>
+                <literal>libraryinfo()</literal> works from the literal name of the library.
+                In some cases, we may have only its handle, defined when loading the library.
+                For instance, <literal>libraryinfo("iolib")</literal> works,
+                <literal>libraryinfo(iolib)</literal> does not.
+                How to use the handle to get any info? Let's go on with the <literal>iolib</literal>
+                example:
+                <itemizedlist>
+                    <listitem>
+                        <emphasis role="bold">Getting the path</emphasis>:
+                        <literal>libpath = string(iolib)(1)</literal>
+                    </listitem>
+                    <listitem>
+                        <emphasis role="bold">Getting the column vector of members functions</emphasis>:
+                        <literal>functions = string(iolib)(2:$)</literal>
+                    </listitem>
+                    <listitem>
+                        <emphasis role="bold">Getting the literal name of the library</emphasis>:
+                        <literal>libraryname = xmlGetValues("//scilablib", "name", libpath)</literal>
+                    </listitem>
+                </itemizedlist>
+            </para>
+        </refsect3>
+        <refsect3>
+            <title>Unloaded library: getting info through its path</title>
+            <para>
+                If the considered library is not loaded, neither <literal>libraryinfo()</literal>
+                nor  <literal>string()</literal> can work.
+            </para>
+            <para>
+                Provided that we know its libpath, we then can
+                <itemizedlist>
+                    <listitem>
+                        <emphasis role="bold">get its literal name</emphasis>:
+                        <literal>xmlGetValues("//scilablib", "name", libpath+"/lib")</literal>
+                    </listitem>
+                    <listitem>
+                        <emphasis role="bold">get the column vector of members functions</emphasis>:
+                        <literal>functions = xmlGetValues("//scilablib/macro", "name", libpath+"/lib")</literal>
+                    </listitem>
+                </itemizedlist>
+            </para>
+        </refsect3>
     </refsection>
     <refsection>
         <title>Exemplos</title>
+        <para>
+            With libraryinfo(), from the literal library name:
+        </para>
+        <programlisting role="example"><![CDATA[
+[f, p] = libraryinfo("iolib")
+     ]]></programlisting>
+    <screen><![CDATA[
+--> [f, p] = libraryinfo("iolib")
+ p  =
+ SCI\modules\io\macros\
+
+ f  =
+!input      !
+!unix_g     !
+!unix_w     !
+!%_sodload  !
+!unix_x     !
+!unix_s     !
+]]></screen>
+        <para/>
+        <para>
+            From the library handle:
+        </para>
         <programlisting role="example"><![CDATA[
-[m,p]=libraryinfo('corelib')
- ]]></programlisting>
+// Just for display:
+iolib
+
+// Catch info into variables:
+p = string(iolib)(1)
+f = string(iolib)(2:$)
+libname = xmlGetValues("//scilablib", "name", p+"/lib")
+     ]]></programlisting>
+    <screen><![CDATA[
+--> // 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
+]]></screen>
+    <para/>
+        <para>
+            For a not-loaded library, from its path:
+        </para>
+        <programlisting role="example"><![CDATA[
+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)
+     ]]></programlisting>
+    <screen><![CDATA[
+--> 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
+]]></screen>
     </refsection>
     <refsection role="see also">
         <title>Ver Também</title>
         <simplelist type="inline">
             <member>
+                <link linkend="string">string</link>
+            </member>
+            <member>
+                <link linkend="load">load</link>
+            </member>
+            <member>
                 <link linkend="librarieslist">librarieslist</link>
             </member>
             <member>
diff --git a/scilab/modules/functions/help/ru_RU/libraries/libraryinfo.xml b/scilab/modules/functions/help/ru_RU/libraries/libraryinfo.xml
new file mode 100644 (file)
index 0000000..a8d332e
--- /dev/null
@@ -0,0 +1,225 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) DIGITEO - Scilab Consortium
+ * Copyright (C) 2012 - 2016 - Scilab Enterprises
+ * Copyright (C) 2019 - Samuel GOUGEON
+ *
+ * This file is hereby licensed under the terms of the GNU GPL v2.0,
+ * pursuant to article 5.3.4 of the CeCILL v.2.1.
+ * This file was originally licensed under the terms of the CeCILL v2.1,
+ * and continues to be available under such terms.
+ * For more information, see the COPYING file which you should have received
+ * along with this program.
+ *
+ -->
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
+          xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML"
+          xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org"
+          xml:lang="ru" xml:id="libraryinfo">
+    <refnamediv>
+        <refname>libraryinfo</refname>
+        <refpurpose>
+            получает путь и устанавливает главные функции загруженной библиотеки
+        </refpurpose>
+    </refnamediv>
+    <refsynopsisdiv>
+        <title>Синтаксис</title>
+        <synopsis>
+            macros = libraryinfo(libraryname)
+            [macros, libpath] = libraryinfo(libraryname)
+        </synopsis>
+    </refsynopsisdiv>
+    <refsection>
+        <title>Аргументы</title>
+        <variablelist>
+            <varlistentry>
+                <term>libraryname</term>
+                <listitem>
+                    <para>строка: имя загруженной библиотеки.</para>
+                </listitem>
+            </varlistentry>
+        </variablelist>
+        <variablelist>
+            <varlistentry>
+                <term>macros</term>
+                <listitem>
+                    <para>
+                        столбец строк: имена главных функций, принадлежащих библиотеке.
+                    </para>
+                </listitem>
+            </varlistentry>
+        </variablelist>
+        <variablelist>
+            <varlistentry>
+                <term>libpath</term>
+                <listitem>
+                    <para>строка: путь до файла в библиотеке.</para>
+                </listitem>
+            </varlistentry>
+        </variablelist>
+    </refsection>
+    <refsection>
+        <title>Описание</title>
+        <para>
+            Получает имена функций (написанных на языке Scilab), принадлежаних указанной
+            библиотеке, и путь до директории, где хранятся их <literal>*.sci</literal>-файлы и
+            файлы библиотеки. Вспомогательные функции, которые могут следовать за главными
+            функциями в <literal>*.sci</literal>-файлах, являются приватными и не возвращаются.
+            <warning>
+                Только загруженные библиотеки могут быть адресованы с помощью <literal>libraryinfo()</literal>.
+            </warning>
+        </para>
+        <refsect3>
+            <title>Получение некоторой информации о библиотеки из её дескриптора</title>
+            <para>
+                <literal>libraryinfo()</literal> работает по литеральному имени библиотеки.
+                В некоторых случаях в наличии может быть только их дескриптор, определённый при
+                загрузке библиотеки. Например, <literal>libraryinfo("iolib")</literal> работает,
+                а <literal>libraryinfo(iolib)</literal> - нет. Как же использовать дескриптор для 
+                получения какой-либо информации? Продолжим с примером <literal>iolib</literal>:
+                <itemizedlist>
+                    <listitem>
+                        <emphasis role="bold">Получение пути</emphasis>:
+                        <literal>libpath = string(iolib)(1)</literal>
+                    </listitem>
+                    <listitem>
+                        <emphasis role="bold">Получение вектор-столбца составляющих функций</emphasis>:
+                        <literal>functions = string(iolib)(2:$)</literal>
+                    </listitem>
+                    <listitem>
+                        <emphasis role="bold">Получение литерального имени библиотеки</emphasis>:
+                        <literal>libraryname = xmlGetValues("//scilablib", "name", libpath)</literal>
+                    </listitem>
+                </itemizedlist>
+            </para>
+        </refsect3>
+        <refsect3>
+            <title>Незагруженная библиотека: получение информации по своему пути</title>
+            <para>
+                Если рассматриваемая библиотека не загружена, то ни
+                <literal>libraryinfo()</literal>, ни <literal>string()</literal> не будут
+                работать.
+            </para>
+            <para>
+                При условии, что известен путь <varname>libpath</varname>, можно
+                <itemizedlist>
+                    <listitem>
+                        <emphasis role="bold">получить его литеральное имя</emphasis>:
+                        <literal>xmlGetValues("//scilablib", "name", libpath+"/lib")</literal>
+                    </listitem>
+                    <listitem>
+                        <emphasis role="bold">получить вектор-столбец составляющих
+                        функций</emphasis>:
+                        <literal>functions = xmlGetValues("//scilablib/macro", "name", libpath+"/lib")</literal>
+                    </listitem>
+                </itemizedlist>
+            </para>
+        </refsect3>
+    </refsection>
+    <refsection>
+        <title>Примеры</title>
+        <para>
+            C <literal>libraryinfo()</literal> по литеральному имени библиотеки:
+        </para>
+        <programlisting role="example"><![CDATA[
+[f, p] = libraryinfo("iolib")
+     ]]></programlisting>
+    <screen><![CDATA[
+--> [f, p] = libraryinfo("iolib")
+ p  =
+ SCI\modules\io\macros\
+
+ f  =
+!input      !
+!unix_g     !
+!unix_w     !
+!%_sodload  !
+!unix_x     !
+!unix_s     !
+]]></screen>
+        <para/>
+        <para>
+            По дескриптору библиотеки:
+        </para>
+        <programlisting role="example"><![CDATA[
+// Просто для отображения:
+iolib
+
+// Перехватить информацию в переменных:
+p = string(iolib)(1)
+f = string(iolib)(2:$)
+libname = xmlGetValues("//scilablib", "name", p+"/lib")
+     ]]></programlisting>
+    <screen><![CDATA[
+--> // Просто для отображения:
+--> iolib
+
+ iolib  =
+Functions files location : SCI\modules\io\macros\.
+input  unix_g  unix_w  %_sodload  unix_x  unix_s
+
+--> // Перехватить информацию в переменных:
+--> 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
+]]></screen>
+    <para/>
+        <para>
+            Для незагруженной библиотеки, по её пути:
+        </para>
+        <programlisting role="example"><![CDATA[
+path = fullpath("SCI/modules/scicos_blocks/macros/Hydraulics");
+libname = xmlGetValues("//scilablib", "name", path+"/lib")
+functions = xmlGetValues("//scilablib/macro", "name", path+"/lib")
+Hydraulicslib  // незагруженная (Xcos не должен быть запущен)
+     ]]></programlisting>
+    <screen><![CDATA[
+--> 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
+]]></screen>
+    </refsection>
+    <refsection role="see also">
+        <title>Смотрите также</title>
+        <simplelist type="inline">
+            <member>
+                <link linkend="string">string</link>
+            </member>
+            <member>
+                <link linkend="load">load</link>
+            </member>
+            <member>
+                <link linkend="librarieslist">librarieslist</link>
+            </member>
+            <member>
+                <link linkend="whereis">whereis</link>
+            </member>
+        </simplelist>
+    </refsection>
+</refentry>