The C/Database Toolchest(TM) is a collection of libraries and tools that enable you to add sophisticated database management capabilities to your own applications. Both C and C++ interfaces are provided so that you can create applications using either of these two popular programming languages.
The libraries are designed to support large databases, limited only by the available disk space. To make efficient use of disk space, the database records are automatically stored in variable lengths. Typical databases contain string fields that vary in length from one record to the next. Storing only the exact length of each string eliminates the wasted disk space that occurs in database systems, such as dBASE®, that support only fixed-length records.
Further efficiency is gained by allowing numeric values to be stored in either string or binary format. In database systems like dBASE , numeric values are always translated to strings of digit characters before being stored in the database, then translated back to binary after being retrieved from the database. When database portability is paramount, this is the preferred method for storing numeric values. However, when efficiency is paramount, the preferred method is to store numeric values using their internal binary representation. This method requires no translation and typically requires much less disk storage space.
The database indexes are implemented using an efficient derivation of the balanced tree algorithm, sometimes referred to as a B+tree. This algorithm makes it possible to find records quickly, even in very large databases. The index management is handled by an independent library, thereby making the B+tree algorithm available to programs that do not need the complete database management facilities.
For use on networks or other multi-user environments, the libraries support file and record locking. An entire database, or one or more records in a database can be locked by a program, thereby blocking access by other programs. Databases may be read-locked or write- locked. When a program read-locks a database, other programs can read but not modify the database. A write-locked database cannot be accessed at all by other programs, not even for reading.
This manual includes two short tutorial chapters (one for C and one for C++) that cover some of the fundamental database library functions. Several example programs illustrate how to create a new database, open an existing database, make indexes, add records , find records, and delete records. Two additional chapters describe all of the C and C++ library functions in alphabetical order. The use of each library function is illustrated by a short example program. The source code for all of the example programs is included on disk.
Several useful tools are provided that perform various database management tasks. There are tools for converting to and from dBASE format files, for compressing unused space from databases, and for displaying the contents of database files. A program named LDM (Little Data Manager) allows you to create new databases or edit existing databases. Since this program calls many of the library functions, it provides a more complex example of how to use the database libraries. The source code for these programs is also included on disk.
Many combinations of compilers and operating systems are currently
supported. For the supported compilers, all you have to do is select
the appropriate compiler when you install the software. Since the C
and C++ source code is included, it is possible to port the libraries
to additional compilers and/or operating systems. Because of the
existing standards for the C and C++ languages, porting the libraries
to any standard compiler is generally quite easy. For many
compilers, no source code changes are necessary. All you have to do
is create the appropriate control files for building the libraries. You
can start by installing the software for one of the supported
compilers, then modify the control files to conform to your particular