Getting Started

Chapter Updated 11/21/22


Overview

Welcome to Xbase64 DBMS, a collection of specifications, programs, utilities and a C++ class library for manipulating legacy Xbase (DBF) type data files and indices.

The term Xbase is often used used to describe the format of the original DBase, Clipper and Foxbase (.DBF) files. The XBase file format is well documented and has stood the test of time. Various popular programs still create and read xbase formatted files.

The purpose of the Xbase64 library is to provide reliable and usable programming tools for reading, writing and updating DBF databases, indices and memo fields. Version 4.x.x has been tested for compatability with DBase III (TM) and DBase IV (TM) version data files and indices *.DBF (data), *.NDX (single tag index), *.MDX (multi tag index) and *.DBT (memo).

Version 4.x.x is a major rewrite of the library to strenghen error processing and bring consistency across modules. It includes updates to the locking process and also includes a module to support MDX multi tag indices.

Earlier versions of the library have included NTX and CDX index formats and that code will be re-incorporated into the latest version in the future.



System Requirements

To build the Xbase64 library, the following items are needed:

A computer, a C/C++ compiler and CMAKE.

The original source code was developed on a Linux platform with the GCC public domain C/C++ compiler.

Xbase64 DBMS has been successfully ported and runs on Linux, Mac and and Windows.


Classes and User Interface

Classes and User Interface Documentation via Doxygen


Portability, Type Defs and Structures

To make the Xbase64 library as portable as possible, the following things occurred:

  • The software was developed to compile and run on either 32 or 64 bit architectures.
  • The software was developed to compile and run on either big endian or little endian archtectures.
  • All numeric data is stored in little endian format.
  • The library is built using Cmake to provide support on a wide variety of platforms.
  • Field types were defined to be consistent across various OS and CPU configurations. Xbase64 defines the following field types:


    Field Types

    TypeDescription
    xbInt1616 bit int
    xbUInt1616 bit unsigned int
    xbInt3232 bit int
    xbUInt3232 bit unsigned int
    xbInt6464 bit int
    xbUInt6464 bit unsigned int
    xbDoubledouble
    charchar
    voidvoid
    struct SCHEMAUsed for defining record structures


    Xbase64 was designed for portability utilizing standard ANSI-C/C++ compliant code. If you decide to write updates to the Xbase64 project, please try to keep your work to standard C/C++ generic calls and use the above predefined field types.


    Compilation Overview

    To build the xbase64 library, verify you have:
  • Xbase64 source code
  • cmake 2.6 or LATER
  • Compiler and linker

    Verify you have access rights to the target location of the library

    For Linux:

  • cd xbase/Linux
  • cmake .
  • make
  • make test
  • sudo make install
  • Verify the ld.so.conf file has the library target directory. For example update file /etc/ld.so.conf to include /usr/local/lib and run ldconfig.

    For Mac:

  • Verify you have xcode installed and operational.
  • cd xbase/Mac
  • cmake . -DCMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk
  • make
  • make test

    For Windows 64 bit with Visual Studio:

  • Open a Visual Studio 64 bit Shell
  • cd xbase\Win64VS
  • buildwin.bat
  • nmake test
  • From a VS Studio 64 bit shell in admin mode: nmake install

    For Windows 32 bit with Visual Studio:

  • Open a Visual Studio 32 bit Shell
  • cd xbase\Win32VS
  • buildwin.bat
  • nmake test
  • From a VS Studio 32 bit shell in admin mode: nmake install

    For Windows 32 bit with Borland 5.5 free compiler

  • cd xbase\Win32Borland
  • BuildBorland.bat
  • make test

    For other platforms:

    Here is something to start with...
  • cd xbase
  • md MyPlatform
  • cd MyPlatform
  • cp ../Cmake/CmakeLists.txt.
  • Enter the appropriate make command for your environment. Check the cmake web site for help.
    On Linux, it is .cmake, then make your mileage may vary Send your results to the library maintainer so it can be added to this library To use the Xbase classes, include the following header file in the program:

    #include <xbase.h>

    For more information on getting started, check out the sample programs in the src/examples folder.



    System Limitations


    Maximum size of a database file is the size of LONG - 2,147,483,647 bytes
    Total number of fields in a database - 255
    Total number of characters in all fields - 32767
    Maximum number of characters in a field - 254
    Total number of records in a file - 1 billion
    Maximum index key length - 100 bytes
    Maximum .DBT file memo block size - 32256
    Maximum expression result length - 100 bytes
    Maximum NDX index key length - 100 bytes