B Tree: Library for indexed file management

B Tree 5.0 API Reference Manual

Mark Willson

Revision History
Revision 5.0.11st July, 2020mpw
Minor bug fixes. Modifications to accomodate changes in the toolchain since 2012 (GNU Make and C compilers).
Revision 5.0.026th November, 2012mpw
Revised duplicate key handling to remove index navigation restrictions when in shared mode.
Revision 4.0.024th June, 2011mpw
Add support for btree index recovery.
Revision 3.1.23rd January, 2011mpw
Document revised handling of duplicate keys in shared mode.
Revision 3.1.121st December, 2010mpw
Bump rev to match library version. No other changes.
Revision 3.1.010th December, 2010mpw
Added support for previous key search, duplicate keys. Programs that link against the 3.0.x library will operate unchanged with 3.1.0.
Revision 3.0.12nd July, 2010mpw
Enhanced BT test harness; bug fixes.
Revision 3.0.04th June, 2010mpw
Added support for large files (> 2GiB)
Revision 2.0.410th May, 2008mpw
Shared access sleep time added as implementation constant
Revision 2.0.327th December, 2005mpw
Changes to reflect that zero-length data records are valid
Revision 2.0.23rd October, 2004mpw
New text on implementation constants and file sizes
Revision 2.01st June, 2004mpw
Reflect changes to API in version 2.0
Revision 1.013th April, 2003mpw
First release

Table of Contents

B Tree Library - A History
1. Introduction
2. System Description
Overview
Opening multiple B Tree files
Shared Access
Large File Support
Duplicate Keys
Sample Program
3. Function Descriptions
Introduction
Initialising the B Tree library
Creating a B Tree File
Opening a B Tree File
Closing a B Tree File
Set/unset support for duplicate keys
Set write through threshold for index file blocks
Inserting a key
Finding a key
Finding a sequence of keys
Finding a reverse sequence of keys
Setting the position within a B Tree index
Deleting a key
Updating the value of a key
Creating a root
Changing the current root
Deleting a root
Gaining exclusive access to a B Tree file
Releasing exclusive access on a B Tree file
Inserting a key and data
Updating data for an existing key
Locating data for an existing key
Deleting a key and associated data
Locating data for the next key in sequence
Locating data for the previous key in sequence
Determine size of data record for specific key
Debugging information
Retrieving error message text
4. Error Messages
5. B Tree Test Harness
6. B Tree Recovery
btr — B Tree index recovery
7. Customisation
8. Building and installing the BT Library

List of Tables

3.1. Debug Options
4.1. B Tree Error Messages
5.1. B Tree Commands
6.1. Command Arguments