PreviousBtrieve API Guide (9.1 revision 1) Next

Btrieve Functions

Show this topic in Library frames

Btrieve offers a single-function API, in which most program actions are determined by an operation code parameter, rather than a function name. You should choose the API for your application based on whether you are most interested in cross-platform portability of code or the best possible performance on a particular platform.

Your Btrieve application should never perform any standard I/O against a data file. Your application should perform all file I/O using a Btrieve function.

Following are the Btrieve functions.

Table 1-1 Btrieve Functions
Function
Operating Systems
Description
BTRV
BTRVID
All
Use for complete code portability between operating systems. For most developers, this advantage offsets a very slight performance decrease.
BTRCALL
BTRCALLID
Windows NT, and Windows 9X/ME only
Use these functions to achieve a slight performance increase or backward compatibility with existing source code.
BTRCALL32
BTRCALLID32
For 32-bit OS/2 applications only
Use these functions to achieve a slight performance increase or backward compatibility with existing source code.

To find the language-specific syntax required when calling a Btrieve function, refer to the following section in Pervasive.SQL Programmer's Guide: Btrieve API Programming .

BTRV Function

BTRV allows an application to make Btrieve calls. All the language interface modules provided with the Programming Interfaces installation option support the BTRV function. In some cases, the BTRV function actually calls the BTRCALL function. However, BTRV is the preferred function because of the platform independence it provides.

BTRVID Function

BTRVID allows an application to make a single Btrieve call that contains a clientID parameter, which the application can control. An application can use BTRVID to assign itself more than one client identity to Btrieve and to execute operations for one client without affecting the state of the other clients. For more information, refer to Client ID.

In some cases, the BTRVID function actually calls another function. In 16-bit applications, it calls the BTRCALLID function. In 32-bit applications, it calls the BTRCALLID32 function (OS/2) or the BTRCALLID function (Windows NT/9X/ME). However, in both cases, BTRVID is the preferred function because of the platform independence it provides.

In DOS applications, you must load the DOS Requester with the appropriate /T value. Set /T to equal the number of client IDs you use in the application. For more information about the DOS Requester, refer to Pervasive's Getting Started with Pervasive.SQL manual.

BTRCALL Function

For Windows NT and Windows 9X/ME, the BTRCALL function is a 32-bit function. You should use the BTRV function instead of BTRCALL unless you cannot afford the slight performance decrease that occurs with BTRV.

BTRCALL32 Function

The BTRCALL32 function is the same as BTRCALL function, except that BTRCALL32 is a 32-bit function.

BTRCALLID Function

Use the BTRCALLID function if you need client-level control and your application operates only in the Windows NT and Windows 9X/ME environments.

This function is similar to the BTRVID function, except that it does not call an intermediate function. For Windows NT and Windows 9X/ME, BTRCALLID is a 32-bit function.

BTRCALLID32 Function

The BTRCALLID32 function is the same as the BTRCALLID function, except that the BTRCALLID32 is a 32-bit function.

Obsolete Functions

The following historical functions are supported to maintain compatibility with applications written for previous Btrieve releases:

While these functions are now obsolete, older applications that call these functions will still run with 6.15 and later MicroKernels.


Chapter contents
Publication contents

Prev topic: Introduction to Btrieve APIs
Next topic: Btrieve Function Parameters