build library from functions in given directory
Scilab string. The variable name of the library to (re)create.
dir_name:Scilab string. The name of the directory to look for .sci-files.
Forceboolean value (default value is %f). Set it to %t to force the sci-files recompilation.
verbboolean values (default value is %f). Set it to %t to get information.
Namesa vector of strings, the names of function to include in the library. By default all the sci-files are taken into account
For each .sci file in dir_name (or only those specified by the Names argument), genlib executes a exec and saves the functions to the corresponding .bin file. The .sci file must not contain anything but Scilab functions. If a .bin file is newer than the associated .sci file, genlib does not translate and save the file.
This default behaviour can be changed if force is given and set to %t. In this latter case the recompilation is always performed for each .sci file.
When all .sci files have been processed, genlib creates a library variable named lib_name and saves it in the file lib in dir_name. If the Scilab variable lib_name is not protected (see predef) this variable is updated.
If verbose is et to %t information are displayed during the build process.
If dir_name argument is not given and if lib_name Scilab variable exists and it is a library dir_name is taken equal to the lib_name library path (update mode).
Scilab tacitly assumes that file foo.sci defines at least a function named foo. If subsidiary functions are included, they are made known to Scilab only after the function foo had been referenced.
library definition
character string
nameliblibrary variable returned by 'lib'.
lib-dir is a character string defining a directory that contains compiled Scilab function (.bin) files.
In addition to these files lib-dir must have a file called names, that contains the names of the functions defined in lib-dir. On success, all functions in lib-dir are available from within Scilab. They are loaded on demand when called for the first time.
Binary files can be created from within Scilab with the command save. A library variable usually is saved for later loading, either on-line or from the user-specific startup file (see startup).
value returned by 'lib' must be insert in a variable 'namelib' to access to macro functions of this library.
Scilab tacitly assumes that each xxxx.bin file defines a variable named xxxx.
library datatype description
A library is a data type with type number 14. It contains a path-name and a set of names. It allows automatic loading of variables using the following algorithm:
Suppose the Scilab user references the variable named foo. Scilab first looks if foo is the name of a primitive or of an already defined variable. If not, it looks for foo sequentially (the newest first) in all defined library .
Suppose foo belongs to the set of names of the library xlib then Scilab tries to load the file <xlib-path-name>/foo.bin. <xlib-path-name>/foo.bin must have been created using the save function
Library are often used for collection of functions, but they can also be used for any collection of scilab variables
If a function is defined in more than one library, the default search algorithm loads thode contained in the newest. It possible to force the use of a specific library using dot notation:
xlib.foo loads the variable foo contained in xlib. if foo is a function and xlib.foo(args) executes the functions