I have been talking about this since quite a long time. It is (maybe)
time to offer the first release.
The URL is:
http://www.cs.virginia.edu/~lcc-win32/container.html
There you can download a zip file containing
(1) The specifications of the library
(2) The source code of the sample implementation
(3) a makefile for Unix systems
Here is the output of compilation:
c:\tmp\container>cl -Dinline= -I . /W4 /Ox *.c
Microsoft (R) C/C++ Optimizing Compiler Version 15.00.30729.01 for x64
Copyright (C) Microsoft Corporation. All rights reserved.
arraylist.c
bitstrings.c
bitstrings.c(786) : warning C4100: 'Args' : unreferenced formal
parameter
bitstrings.c(791) : warning C4100: 'ExtraArgs' : unreferenced formal
parameter
bitstrings.c(969) : warning C4127: conditional expression is constant
bitstrings.c(1109) : warning C4100: 'arg' : unreferenced formal
parameter
bitstrings.c(1109) : warning C4100: 'saveFn' : unreferenced formal
parameter
bitstrings.c(1118) : warning C4100: 'arg' : unreferenced formal
parameter
bitstrings.c(1118) : warning C4100: 'readFn' : unreferenced formal
parameter
bloom.c
containererror.c
containererror.c(37) : warning C4100: 'errcode' : unreferenced formal
parameter
containererror.c(37) : warning C4100: 'fnname' : unreferenced formal
parameter
deque.c
dictionary.c
dictionary.c(128) : warning C4996: 'sprintf': This function or variable
may be unsafe. Consider using sprintf_s instead. To disable deprecation,
use _CRT_SECURE_NO_WARNINGS. See online help for details. c:\Program
Files (x86)\Microsoft Visual Studio 9.0\VC\INCLUDE\stdio.h(366) : see
declaration of 'sprintf'
dictionary.c(325) : warning C4996: 'strcpy': This function or variable
may be unsafe. Consider using strcpy_s instead. To disable deprecation,
use _CRT_SECURE_NO_WARNINGS. See online help for details.
dlist.c
fgetline.c
hashtable.c
hashtable.c(64) : warning C4996: 'sprintf': This function or variable
may be unsafe. Consider using sprintf_s instead. To disable deprecation,
use _CRT_SECURE_NO_WARNINGS. See online help for details. c:\Program
Files (x86)\Microsoft Visual Studio 9.0\VC\INCLUDE\stdio.h(366) : see
declaration of 'sprintf'
heap.c
list.c
malloc_debug.c
pool.c
pool.c(414) : warning C4127: conditional expression is constant
pool.c(427) : warning C4127: conditional expression is constant
pool.c(444) : warning C4127: conditional expression is constant
pool.c(445) : warning C4127: conditional expression is constant
pooldebug.c
pooldebug.c(325) : warning C4100: 'pool' : unreferenced formal parameter
pooldebug.c(334) : warning C4100: 'file_line' : unreferenced formal
parameter
pooldebug.c(400) : warning C4100: 'file_line' : unreferenced formal
parameter
qsort_r.c
qsort_r.c(40) : warning C4005: 'min' : macro redefinition c:\Program
Files (x86)\Microsoft Visual Studio 9.0\VC\INCLUDE\stdlib.h(850) : see
previous definition of 'min'
qsort_r.c(103) : warning C4267: 'function' : conversion from 'size_t' to
'int', possible loss of data
qsort_r.c(118) : warning C4267: 'function' : conversion from 'size_t' to
'int', possible loss of data
qsort_r.c(126) : warning C4267: 'function' : conversion from 'size_t' to
'int', possible loss of data
qsort_r.c(134) : warning C4267: 'function' : conversion from 'size_t' to
'int', possible loss of data
qsort_r.c(141) : warning C4267: 'function' : conversion from 'size_t' to
'int', possible loss of data
qsort_r.c(151) : warning C4267: 'function' : conversion from 'size_t' to
'int', possible loss of data
qsort_r.c(157) : warning C4267: 'function' : conversion from 'size_t' to
'int', possible loss of data
qsort_r.c(158) : warning C4018: '<' : signed/unsigned mismatch
qsort_r.c(159) : warning C4267: 'function' : conversion from 'size_t' to
'int', possible loss of data
qsortex.c
redblacktree.c
redblacktree.c(45) : warning C4100: 'KeySize' : unreferenced formal
parameter
redblacktree.c(663) : warning C4100: 'p' : unreferenced formal parameter
redblacktree.c(666) : warning C4100: 'it' : unreferenced formal
parameter
redblacktree.c(668) : warning C4100: 'arg' : unreferenced formal
parameter
redblacktree.c(668) : warning C4100: 'Applyfn' : unreferenced formal
parameter
redblacktree.c(668) : warning C4100: 'ST' : unreferenced formal
parameter
redblacktree.c(672) : warning C4100: 't' : unreferenced formal parameter
redblacktree.c(675) : warning C4100: 't' : unreferenced formal parameter
scapegoat.c
scapegoat.c(319) : warning C4267: 'function' : conversion from 'size_t'
to 'unsigned long', possible loss of data
scapegoat.c(323) : warning C4267: 'function' : conversion from 'size_t'
to 'unsigned long', possible loss of data
scapegoat.c(447) : warning C4267: 'function' : conversion from 'size_t'
to 'int', possible loss of data
scapegoat.c(501) : warning C4100: 'data' : unreferenced formal parameter
scapegoat.c(517) : warning C4100: 'element' : unreferenced formal
parameter
searchtree.c
searchtree.c(776) : warning C4100: 'tree' : unreferenced formal
parameter
searchtree.c(781) : warning C4100: 'tree' : unreferenced formal
parameter
smallpool.c
smallpool.c(387) : warning C4127: conditional expression is constant
smallpool.c(400) : warning C4127: conditional expression is constant
smallpool.c(417) : warning C4127: conditional expression is constant
smallpool.c(418) : warning C4127: conditional expression is constant
Generating Code...
c:\tmp\container\hashtable.c(474) : warning C4706: assignment within
conditional expression
c:\tmp\container\hashtable.c(498) : warning C4706: assignment within
conditional expression
c:\tmp\container\hashtable.c(580) : warning C4706: assignment within
conditional expression
Compiling...
strcollection.c
strcollection.c(41) : warning C4996: 'sprintf': This function or
variable may be unsafe. Consider using sprintf_s instead. To disable
deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\INCLUDE\stdio.h
(366) : see declaration of 'sprintf'
strcollection.c(79) : warning C4996: 'strcpy': This function or variable
may be unsafe. Consider using strcpy_s instead. To disable deprecation,
use _CRT_SECURE_NO_WARNINGS. See online help for details.
strcollection.c(603) : warning C4100: 'arg' : unreferenced formal
parameter
strcollection.c(684) : warning C4996: 'fopen': This function or variable
may be unsafe. Consider using fopen_s instead. To disable deprecation,
use _CRT_SECURE_NO_WARNINGS. See online help for details. c:\Program
Files (x86)\Microsoft Visual Studio 9.0\VC\INCLUDE\stdio.h(237) : see
declaration of 'fopen'
strcollection.c(704) : warning C4996: 'fopen': This function or variable
may be unsafe. Consider using fopen_s instead. To disable deprecation,
use _CRT_SECURE_NO_WARNINGS. See online help for details. c:\Program
Files (x86)\Microsoft Visual Studio 9.0\VC\INCLUDE\stdio.h(237) : see
declaration of 'fopen'
test.c
test.c(17) : warning C4244: '=' : conversion from 'size_t' to 'double',
possible loss of data
test.c(78) : warning C4100: 'ExtraArgs' : unreferenced formal parameter
test.c(308) : warning C4100: 'arg' : unreferenced formal parameter
test.c(336) : warning C4244: '=' : conversion from 'size_t' to 'double',
possible loss of data
test.c(345) : warning C4244: '=' : conversion from 'size_t' to 'double',
possible loss of data
Generating Code...
Microsoft (R) Incremental Linker Version 9.00.30729.01
Copyright (C) Microsoft Corporation. All rights reserved.
/out:arraylist.exe
arraylist.obj
bitstrings.obj
bloom.obj
containererror.obj
deque.obj
dictionary.obj
dlist.obj
fgetline.obj
hashtable.obj
heap.obj
list.obj
malloc_debug.obj
pool.obj
pooldebug.obj
qsort_r.obj
qsortex.obj
redblacktree.obj
scapegoat.obj
searchtree.obj
smallpool.obj
strcollection.obj
test.obj
I suggest that the unused parameters and type conversions should get
examination. This is especially true in a case like size_t to int
truncation in qsort_r().
An int seems pretty large but I often deal with sets larger than 2
billion items (no, really) and so I would suggest that anything that
carries a dimension should be retained as a size_t throughout.