bitvector
Version 0.0.1
1/01/02
- UPDATE: 3/18/02 *
- VERSION: 1.0.0 **
I added some checking to insure that everything that can fail is checked. That fixes the only known and reported bug.
I have received no feature requests, therefore it is assumed that no more are wanted.
I have no plans to update this library any further because it does not need to do anything more.
This release has therefore no needed features or bugs: it is now 1.0.0 and considered release and stable. This will, unless someone pipes up and says something, the final release.
- END UPDATE ******
Bitvector is a library for storing sets of bits. The primary reason for my creating it was to allow the usual bit operations (currently, assignment, and, or, xor, not. See below for a discussion on shifts) on more bits than primitive data types allow (i.e. for theoretically arbitrarily large bitvectors, as opposed to 32-bit integers). For the documentation, see the excelently commented header file, bitvector.h.
See the file HACKING before modifying the code.
Supported operations
AND
OR
XOR
NOT - Unary
LSHIFT
RSHIFT
Note that bit rotation operations are unsupported. The reason for this is that it makes no sense. Consider the LSHIFT operation on an integer: The overflow bits are merely discarded. On a bitvector, as implemented here, the vector is resized to be big enough. In this context, there are no bits falling off into nowhere on the edges to rotate, therefore, I have not written code to do that.
Supported systems
The code is written pretty generically and uses only standard C library calls (basically malloc() and free()) and no system dependant stuff. Therefore, it ought to compile on any system. However, I only have a Linux dev. environment, therefore, I have not tested it on any other platform.
Any other questions, contact me.
Mike Swieton
mike@swieton.net
