DOS (Btrieve)
This section explains how a DOS application can use the Btrieve API.
Interface Modules
The following modules comprise the language interface for DOS applications using the Btrieve API.
BTRAPI.C
The file BTRAPI.C is the implementation of the C application interface. This file also contains the DOS interface:
#if defined( BTI_DOS )
BTI_API BTRVID(
BTI_WORD operation,
BTI_VOID_PTR posBlock,
BTI_VOID_PTR dataBuffer,
BTI_WORD_PTR dataLength,
BTI_VOID_PTR keyBuffer,
BTI_SINT keyNumber,
BTI_BUFFER_PTR clientID )
BTRAPI.C provides support for all applications that call BTRV and BTRVID. When making a Btrieve call with either of these functions, compile BtrApi.c and link its object with the other modules in your application.
The BTRAPI.C file contains #include directives that instruct your compiler to include BTRAPI.H, BTRCONST.H, BLOBHDR.H, and BTITYPES.H. By including these files, BTRAPI.C takes advantage of the data types that provide the platform independence associated with the interface.
BTRAPI.H
The file BTRAPI.H contains the prototypes of the Btrieve functions. The prototype definitions use the platform-independent data types defined in the file BTITYPES.H. BTRAPI.H provides support for all applications calling the BTRV and BTRVID functions.
BTRCONST.H
The file BTRCONST.H contains useful constants specific to Btrieve. These constants can help you standardize references to Btrieve operation codes, status codes, file specification flags, key specification flags, and many more items.
You can use the C application interface without taking advantage of BTRCONST.H, however, including the file may simplify your programming effort.
BTITYPES.H
The file BTITYPES.H defines the platform-independent data types. By using the data types in BTITYPES.H on your Btrieve function calls, your application ports among operating systems.
BTITYPES.H also describes the switches you must use to indicate the DOS operating system on which your application runs. The following table lists these switches.
16-bit

32-bit with Tenberry Extender and BStub.exe
1

32-bit with Phar Lap 6

32-bit with Embarcadero PowerPack