Commit Graph

33 Commits

Author SHA1 Message Date
Xavier Delaruelle
c26486718b lib: bump Envmodules lib version to 1.0.1
Bump version of Envmodules library after the small changes made:
- directly return result of Envmodules_Init last operation
- Tcl_GetBooleanFromObj already set error message, no need to rewrite an
error message in case boolean argument is not boolean
2019-08-09 21:17:56 +02:00
Xavier Delaruelle
a5d0c0e3c5 lib: bump copyright year mention 2019-08-09 21:15:10 +02:00
Xavier Delaruelle
dbea39b5bd ts/lib: test tcl ext lib against a failed closedir call
Add an utility library that supersedes the closedir function from libc.
The closedir function from this added library always returns an error
(-1). It is used for coverage test of the closedir call made withing the
Envmodules_GetFilesInDirectoryObjCmd function of the Tcl extension
library.
2019-08-09 20:50:58 +02:00
Xavier Delaruelle
40477f8a3b lib: Tcl_GetBooleanFromObj already set err msg
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.
2019-08-08 21:16:43 +02:00
Xavier Delaruelle
31eafcf860 lib: directly return res of Envmodules_Init last op 2019-08-06 13:24:48 +02:00
Felix Neumärker
a220a7184c install: fix typo on CFLAGS definition in lib/Makefile
Fixes #287.
2019-08-05 17:42:21 +02:00
Xavier Delaruelle
1fc1c01615 install/ts: enable gcov on Modules Tcl ext lib
When coverage is asked (COVERAGE=y) also check lib/envmodules.c (Modules
Tcl extension library) and report obtained coverage result (Codecov
script automatically finds Gcov coverage results).
2019-05-03 14:01:42 +02:00
Xavier Delaruelle
afeae10ec0 Take .modulerc at modulepath root into account
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.
2019-04-30 08:12:47 +02:00
Xavier Delaruelle
9b8e5981a7 Implement getFilesInDirectory in Tcl extension library
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.
2019-04-29 16:02:13 +02:00
Xavier Delaruelle
0356384fb8 install: fix lib/Makefile to ensure CFLAGS is applied
Which is required on FreeBSD to pass include location directives.
2019-04-29 16:02:13 +02:00
Xavier Delaruelle
3b3534089e lib: adapt error report to support Tcl8.4
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.
2019-04-29 16:02:13 +02:00
Xavier Delaruelle
6228cc661a install: adapt lib makefile to build with Tcl8.5
Add @TCL_SHLIB_CFLAGS@ flag to the CFLAGS_DEFAULT to ensure to obtain
the '-fPIC' directive on the resulting compiling command.
2019-04-29 16:02:13 +02:00
Xavier Delaruelle
b7c399c19a Add autotools configs to build libtclenvmodules
Build this extension library against Tcl stub library to be able to
'load' it in modulecmd.tcl script.
2019-04-29 15:56:23 +02:00
Xavier Delaruelle
3c360a9937 Introduce Modules Tcl extension library
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.
2019-04-29 15:56:23 +02:00
rkowen
86f2b63fc0 Merged in the modules_3_2_predeep_branch branch to the main trunk.
Removed the hash library.
2005-11-14 23:51:08 +00:00
harlan
005966c958 * Makefile.am (modulecmd_CFLAGS): Use X_CFLAGS and TCL_INCLUDES.
* lib/tests/Makefile.am (EXTRA_PROGRAMS): Renamed from
noinst_PROGRAMS.  Lose the .x suffixes.

* lib/Makefile.am (ACLOCAL_AMFLAGS): Look in ../config/ .
2002-09-18 05:47:48 +00:00
rkowen
a64995805f 2002-09-16 R.K. Owen <rk@owen.sj.ca.us>
* colcomp.c: removed
	* utility.c: added colcomp.c contents
	* Makefile.am: removed colcomp.c
	* main.c: Added DEF_COLLATE_BY_NUMBER output for --version
	* configure.ac: changed USE_COLCOMP to DEF_COLLATE_BY_NUMBER,
	  and added memdebug
	* locate_module.c: changed USE_COLCOMP and GetModuleName for deep dirs.
	* modules_def.h: check for HAVE_CONFIG_H, and added memdebug
	* ModuleCmd_List.c: Simplified using uvec objects
2002-09-16 16:49:28 +00:00
rkowen
6968b739c5 2002-09-12 R.K. Owen <rk@owen.sj.ca.us>
* .cvsignore: Ignore autogenerated files.
	* doc/.cvsignore: Ignore autogenerated files.
	* etc/.cvsignore: Ignore autogenerated files.
	* ext/.cvsignore: Ignore autogenerated files.
	* lib/.cvsignore: Ignore autogenerated files.
	* lib/tests/.cvsignore: Ignore autogenerated files.
	* modulefiles/.cvsignore: Ignore autogenerated files.
	* lib/tests/Makefile.am: Tweeked for autoreconf
2002-09-13 04:50:41 +00:00
rkowen
7c1163b194 2002-09-12 R.K. Owen <rk@owen.sj.ca.us>
* README: Updated the anonymous CVS invocation.
	* lib/aclocal.m4: Deleted auto* generated file.
	* lib/configure.ac: Tweeked to autoreconf
	* lib/Makefile.am: Tweeked to autoreconf
	* lib/uvec.h: Added uvec_strfree
	* lib/uvec/uvec_copy_str.c: Uses uvec string fns
	* lib/uvec/uvec_copy_vec.c: Uses uvec string fns
	* lib/uvec/uvec_strfree.c: New file: to dealloc uvec2str()
	generated strings
	* lib/tests/tuvec.c: Updated for uvec changes
2002-09-13 04:36:21 +00:00
harlan
a1c4dac800 * doc/Makefile.am: Added file.
* lib/configure: Remove auto*-generated file.
* lib/config.h.in: Ditto.
2002-09-12 06:50:08 +00:00
harlan
12b49d7233 * README: Update the instructions for using the CVS version of
modules.

* modulefiles/Makefile.in: Deleted auto* generated file.
* lib/tests/Makefile.in: Ditto.
* lib/Makefile.in: Ditto.
* init/Makefile.in: Ditto.
* ext/Makefile.in: Ditto.
* etc/Makefile.in: Ditto.
* doc/Makefile.in: Ditto.
* config/mkinstalldirs: Ditto.
* config/missing: Ditto.
* config/install-sh: Ditto.
* config/depcomp: Ditto.
* config/compile: Ditto.
* configure: Ditto.
* config.h.in: Ditto.
* aclocal.m4: Ditto.
* Makefile.in: Ditto.
2002-09-12 06:16:31 +00:00
harlan
200eb4e424 * colcomp.c: New file. Alternative collating algorithm that sorts
numeric substrings numerically (mostly).

* lib/Makefile: Remove auto*-generated file.

* locate_module.c (SortedDirList): Ignore SCCS/ subdirs, too.

* configure.ac: Disable our "look" for RUNTEST; it drives auto*
crazy.  Added the --with-file-collate={string,number} test, which
provides a way to enable USE_COLCOMP.

* ModuleCmd_Avail.c (fi_ent_cmp): USE_COLCOMP when told to do so.
* locate_module.c (filename_compare): Ditto.

* Makefile.am (modulecmd_LDFLAGS): lib is in the builddir, not the
srcdir.
(modulecmd_SOURCES): Added colcomp.c .
2002-09-12 05:59:26 +00:00
rkowen
c753d5a204 Added the memdebug headerfile and sources. 2002-08-27 21:07:44 +00:00
rkowen
ea9f54706e Changed how uvec sets/gets the uvec_strfns. 2002-08-02 21:57:51 +00:00
rkowen
4d63fbeb52 Added the list object for doubly linked lists. 2002-07-29 20:10:32 +00:00
rkowen
27f4e2c10c Need this also. 2002-07-18 22:36:25 +00:00
rkowen
9c6dbfb5a1 Forgot this one. 2002-07-18 22:33:09 +00:00
rkowen
88d3f50c2e Adding in the automake/autoconf files for the modules library. 2002-07-18 22:30:57 +00:00
rkowen
930689a4b1 Added the strmalloc code to the modules library, this will be useful
for creating new strings with aliases expanded.
2002-07-18 22:23:57 +00:00
rkowen
8b7b7af871 Added the uvec code, which provides basic unix vector capabilities.
A unix vector is a NULL terminated array of char * strings.
An example of this is *argv[] or *environ[].
2002-07-18 22:20:42 +00:00
rkowen
51c63e0b00 Adding in the isqrt code to the modules library, this is needed by iprime
(which is needed by avec).
2002-07-18 22:11:16 +00:00
rkowen
b3ff5dc70c Added the iprime code to the modules library. This is needed by avec
to compute the optimal hash size.
2002-07-18 22:07:50 +00:00
rkowen
ad5240a463 Added an associative vector object to the modules library. 2002-07-18 22:03:39 +00:00