C/C++
This section provides C/C++ module information for the Btrieve API.
The C/C++ interface facilitates writing platform-independent applications. This interface supports development for the following operating systems: DOS, Windows, and Linux. These modules also are documented in Table 27.
Interface Modules
This section describes in detail the modules that comprise the C language interface.
BTRAPI.C
The file BTRAPI.C is the actual implementation of the C application interface. It 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 operating system on which your application runs. Table 29 lists these operating system switches.
16-bit

32-bit with Tenberry Extender and BStub.exe
1

32-bit with Phar Lap 6

32-bit with Embarcadero PowerPack
BTRSAMP.C
The source file BTRSAMP.C is a sample Btrieve program that you can compile, link, and run on any of the operating systems described in Table 29.
Programming Requirements
If you use the C application interface to make your application platform independent, you must use the data types described in BTITYPES.H. To see how these data types are used, see the file BTRSAMP.C.
*Note: You must also specify a directive that identifies the operating system on which the program executes. The available values for the directive are listed in the header file BTITYPES.H. Specify the directive using the appropriate command line option for your compiler.