B Tree Library - A History

The B Tree routines in this library were originally written in Fortran 77 during the late 1980's for use in a gazetteer.

The routines were ported to C over a number years (as time permitted), but still very much organised as the original Fortran. This version was utilised in the anag and dict programs, for anagram solving.

The source was re-organised in early 2001 to adopt more closely a C organisation style (note the source code itself still has a Fortran flavour). This was known as "bt_new".

The original B Tree implementation was designed solely as an index handler. Data was expected to be managed by the client application. In addition, the routines were only able to manage exclusive access to the index file - shared access would result in corrupt index files. Lastly, only one index file could be open at a time - effectively preventing any application-mediated copying capability.

"bt_shared" was derived to resolve these three issues: to provide a combined index and data file (yes, something like CP-V/CP-6 keyed files), to allow shared access to a B Tree file by concurrent processes, and to permit a single process to open multiple index files concurrently.

These capabilities were provided in a 32 bit implementation, meaning the largest file that could be supported was 2GiB. Version 3.0 was developed to add support for larger files, i.e those requiring 64 bit addressing. This is dependent on kernel and gcc Large File Support.