No need to craft an error message when a non-boolean value is passed to
procedures as the Tcl_GetBooleanFromObj function already set the
accurate message when it returns non-OK.
When looking for modulefiles in enabled modulepaths, take .modulerc file
found at the root of a modulepath directory into account. Which means
these RC files are now evaluated like global rc files and can be used to
define module aliases targeting modulefiles stored in the underlying
file tree.
findModules procedure has been adapted to return any .modulerc file
found at the root of the directory. Code that look at modulepath root
has been adapted to use the getFilesInDirectory procedure or command.
A fetch_dotversion argument is added to the getFilesInDirectory Tcl
procedure and its libtclenvmodules counterpart. This argument is
disabled when looking at modulepath root content to avoid returning
eventual .version file stored there.
Shorthand version notation (ex: /1.0) cannot be used in a modulepath rc
file as a module name cannot be determined from this location.
Add function in libtclenvmodules to implement getFilesInDirectory as a
command, which provides a more IO-optimized way than native Tcl commands
perform by avoiding specific additional queries to get hidden files like
.modulerc and .version. As a result 1 stat and 2 access syscalls are
saved per directory read.
Add code to Tcl extension library to report error specifically when
built against Tcl8.4. This version of Tcl does not propose a
Tcl_ObjPrintf function, so the Tcl_AppendResult function is used instead
when the library is built against this version.
Introduce Modules Tcl extension library (written in C) to extend Tcl
language in order to provide more optimized I/O commands than native Tcl
commands do.
This library first provides a 'readFile' command which performs an open,
read, close of a given modulefile to fetch its content. Compared to the
Tcl native open, read, close commands it saves 1 ioctl + 1 fcntl + N
lstat system calls per modulefile.