Overview
Release compatibility of the API
The Perforce C/C++ API is subject to change from release to release, and is not guaranteed to be source-code compatible from one release to the next. However, applications that you create using the API can run against previous releases of Perforce and will probably run against later releases of Perforce.
Support for specific features depends on the version of Perforce and the API that you use.
Purpose of the API
The Perforce C/C++ API enables you to create applications that interact with end users, send commands to the Perforce server and process data returned from the versioning service. The API is a programmatic interface, and does not send commands directly to the server.
Architecture of the API
The basic client session is managed by a C++ class called ClientApi
. All
user interaction is channeled through the ClientUser
C++ class. The default
methods of ClientUser
implement the p4
command line interface. To create
custom client applications, create subclasses based on ClientUser
.
API files
The Perforce C/C++ API consists of header files, link libraries, and the reference
implementation of the ClientUser
class. Only the libraries are platform-specific.
The API is packaged as an archive or zip file. The source code for the libraries is proprietary and is not included. To download the API, go to the Perforce FTP site and download the file for your platform. For example, to obtain the OS X version using a Web browser, use the following URL:
ftp://ftp.perforce.com/perforce/r15.1/bin.macosx105x86_64/
and download p4api.tgz
.
(Specific API files can vary from release to release, and so are not individually described here.)