From adc1d0f3e225ce6f143e8d46793d018950ae0a6f Mon Sep 17 00:00:00 2001 From: Samuel GOUGEON Date: Wed, 26 Jun 2019 23:07:52 +0200 Subject: [PATCH] [doc] libraryinfo() page overhauled Moved from the master @ https://codereview.scilab.org/21027 PDF version: please remove it from the commit before merging. Change-Id: Id86b35c0860e486acfca238e312d2ec6363eb967 --- .../functions/help/en_US/libraries/libraryinfo.xml | 186 +++++++++++++-- .../functions/help/ja_JP/libraries/libraryinfo.xml | 236 ++++++++++++++------ .../functions/help/pt_BR/libraries/libraryinfo.xml | 178 +++++++++++++-- .../functions/help/ru_RU/libraries/libraryinfo.xml | 225 +++++++++++++++++++ 4 files changed, 721 insertions(+), 104 deletions(-) create mode 100644 scilab/modules/functions/help/ru_RU/libraries/libraryinfo.xml diff --git a/scilab/modules/functions/help/en_US/libraries/libraryinfo.xml b/scilab/modules/functions/help/en_US/libraries/libraryinfo.xml index cc9fc3b..d686637 100644 --- a/scilab/modules/functions/help/en_US/libraries/libraryinfo.xml +++ b/scilab/modules/functions/help/en_US/libraries/libraryinfo.xml @@ -1,59 +1,215 @@ - + + libraryinfo - get macros and path of a scilab library + gets the path and the set of primary functions of a loaded library Syntax - macros = libraryinfo(libraryname) - [macros,path] = libraryinfo(libraryname) + + macros = libraryinfo(libraryname) + [macros, libpath] = libraryinfo(libraryname) Arguments - macros + libraryname - a string matrix (all main functions of the library) + string: name of the loaded library. - path + macros - a string (path of library) + column of strings: names of main functions belonging to the library. - libraryname + libpath - a string (library name) + string: path to the lib file of the library. Description - 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. + + 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. + + Only loaded libraries can be addressed by libraryinfo(). + + + Getting some library info from its handle + + 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: + + + Getting the path: + libpath = string(iolib)(1) + + + Getting the column vector of members functions: + functions = string(iolib)(2:$) + + + Getting the literal name of the library: + libraryname = xmlGetValues("//scilablib", "name", libpath) + + + + + + Unloaded library: getting info through its path + + If the considered library is not loaded, neither libraryinfo() + nor string() can work. + + + Provided that we know its libpath, we then can + + + get its literal name: + xmlGetValues("//scilablib", "name", libpath+"/lib") + + + get the column vector of members functions: + functions = xmlGetValues("//scilablib/macro", "name", libpath+"/lib") + + + + Examples + + 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: + + + 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 +]]> See also + string + + + load + + librarieslist diff --git a/scilab/modules/functions/help/ja_JP/libraries/libraryinfo.xml b/scilab/modules/functions/help/ja_JP/libraries/libraryinfo.xml index 5bf15e7..bdf1f6f 100644 --- a/scilab/modules/functions/help/ja_JP/libraries/libraryinfo.xml +++ b/scilab/modules/functions/help/ja_JP/libraries/libraryinfo.xml @@ -1,127 +1,215 @@ - - - + + - libraryinfo - マクロとscilabライブラリのパスを取得 - - - 呼び出し手順 - macros = libraryinfo(libraryname) - [macros,path] = libraryinfo(libraryname) - - - - 引数 - - - - macros - + libraryname - - 文字列行列 (ライブラリの全ての主関数) - + 文字列 (ライブラリ名) - - - - - - - - path - + macros - - 文字列 (ライブラリのパス) - + 文字列行列 (ライブラリの全ての主関数) - - - - - - - - libraryname - + path - - 文字列 (ライブラリ名) - + 文字列 (ライブラリのパス) - - - - - 説明 - - 指定したScilabライブラリの関数名とパスを取得します. - 返される関数名は対応する .sci または .bin のファイルの名前 - に一致します. - その他の名前は補助関数です. - + + Only loaded libraries can be addressed by libraryinfo(). + - + + Getting some library info from its handle + + 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: + + + Getting the path: + libpath = string(iolib)(1) + + + Getting the column vector of members functions: + functions = string(iolib)(2:$) + + + Getting the literal name of the library: + libraryname = xmlGetValues("//scilablib", "name", libpath) + + + + + + Unloaded library: getting info through its path + + If the considered library is not loaded, neither libraryinfo() + nor string() can work. + + + Provided that we know its libpath, we then can + + + get its literal name: + xmlGetValues("//scilablib", "name", libpath+"/lib") + + + get the column vector of members functions: + functions = xmlGetValues("//scilablib/macro", "name", libpath+"/lib") + + + + - - 例 - + + With libraryinfo(), from the literal library name: + - +[f, p] = libraryinfo("iolib") + ]]> + [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 + + 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: + + + libname = xmlGetValues("//scilablib", "name", path+"/lib") + libname = + Hydraulicslib + +--> functions = xmlGetValues("//scilablib/macro", "name", path+"/lib") + functions = +!Bache ! +!Flowmeter ! +!PerteDP ! +!PuitsP ! +!SourceP ! +!VanneReglante ! + +--> Hydraulicslib +未定義の変数: Hydraulicslib +]]> - - 参照 - - - + string + + + load + + librarieslist - whereis - - - - diff --git a/scilab/modules/functions/help/pt_BR/libraries/libraryinfo.xml b/scilab/modules/functions/help/pt_BR/libraries/libraryinfo.xml index bc9f046..e919080 100644 --- a/scilab/modules/functions/help/pt_BR/libraries/libraryinfo.xml +++ b/scilab/modules/functions/help/pt_BR/libraries/libraryinfo.xml @@ -1,9 +1,25 @@ - + + libraryinfo - retorna macros e endereço de uma biblioteca - Scilab + retorna macros e endereço de uma biblioteca Scilab @@ -16,6 +32,12 @@ Parâmetros + libraryname + + string (nome da biblioteca) + + + macros uma matriz de strings (todas as funções principais da @@ -23,8 +45,6 @@ - - path @@ -32,32 +52,160 @@ - - - libraryname - - string (nome da biblioteca) - - - Descrição 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(). + + + Getting some library info from its handle + + 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: + + + Getting the path: + libpath = string(iolib)(1) + + + Getting the column vector of members functions: + functions = string(iolib)(2:$) + + + Getting the literal name of the library: + libraryname = xmlGetValues("//scilablib", "name", libpath) + + + + + + Unloaded library: getting info through its path + + If the considered library is not loaded, neither libraryinfo() + nor string() can work. + + + Provided that we know its libpath, we then can + + + get its literal name: + xmlGetValues("//scilablib", "name", libpath+"/lib") + + + get the column vector of members functions: + functions = xmlGetValues("//scilablib/macro", "name", libpath+"/lib") + + + + Exemplos + + 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: + + + 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 +]]> Ver Também + string + + + load + + librarieslist 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 index 0000000..a8d332e --- /dev/null +++ b/scilab/modules/functions/help/ru_RU/libraries/libraryinfo.xml @@ -0,0 +1,225 @@ + + + + + libraryinfo + + получает путь и устанавливает главные функции загруженной библиотеки + + + + Синтаксис + + macros = libraryinfo(libraryname) + [macros, libpath] = libraryinfo(libraryname) + + + + Аргументы + + + libraryname + + строка: имя загруженной библиотеки. + + + + + + macros + + + столбец строк: имена главных функций, принадлежащих библиотеке. + + + + + + + libpath + + строка: путь до файла в библиотеке. + + + + + + Описание + + Получает имена функций (написанных на языке Scilab), принадлежаних указанной + библиотеке, и путь до директории, где хранятся их *.sci-файлы и + файлы библиотеки. Вспомогательные функции, которые могут следовать за главными + функциями в *.sci-файлах, являются приватными и не возвращаются. + + Только загруженные библиотеки могут быть адресованы с помощью libraryinfo(). + + + + Получение некоторой информации о библиотеки из её дескриптора + + libraryinfo() работает по литеральному имени библиотеки. + В некоторых случаях в наличии может быть только их дескриптор, определённый при + загрузке библиотеки. Например, libraryinfo("iolib") работает, + а libraryinfo(iolib) - нет. Как же использовать дескриптор для + получения какой-либо информации? Продолжим с примером iolib: + + + Получение пути: + libpath = string(iolib)(1) + + + Получение вектор-столбца составляющих функций: + functions = string(iolib)(2:$) + + + Получение литерального имени библиотеки: + libraryname = xmlGetValues("//scilablib", "name", libpath) + + + + + + Незагруженная библиотека: получение информации по своему пути + + Если рассматриваемая библиотека не загружена, то ни + libraryinfo(), ни string() не будут + работать. + + + При условии, что известен путь libpath, можно + + + получить его литеральное имя: + xmlGetValues("//scilablib", "name", libpath+"/lib") + + + получить вектор-столбец составляющих + функций: + functions = xmlGetValues("//scilablib/macro", "name", libpath+"/lib") + + + + + + + Примеры + + C libraryinfo() по литеральному имени библиотеки: + + + [f, p] = libraryinfo("iolib") + p = + SCI\modules\io\macros\ + + f = +!input ! +!unix_g ! +!unix_w ! +!%_sodload ! +!unix_x ! +!unix_s ! +]]> + + + По дескриптору библиотеки: + + + // Просто для отображения: +--> 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 +]]> + + + Для незагруженной библиотеки, по её пути: + + + 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 +]]> + + + Смотрите также + + + string + + + load + + + librarieslist + + + whereis + + + + -- 1.7.9.5