/* * p4api.cc - a p4 client API example * * This file is part of the p4api distribution package. * * This barebones example simply mimics the regular p4 command line * program. * * Generally, compiling with the C++ compiler and linking with the * three provided libraries is sufficient to build this sample program. * * See the Perforce C/C++ API User's Guide at * www.perforce.com/perforce/technical.html for further information. * * $Id: //depot/r10.2/p4/api/p4api.cc#2 $ */ # include "clientapi.h" int main( int argc, char **argv ); int main( int argc, char **argv ) { ClientUser ui; ClientApi client; StrBuf msg; Error e; // Any special protocol mods // client.SetProtocol( "tag" ); // Connect to server client.Init( &e ); if( e.Test() ) { e.Fmt( &msg ); fprintf( stderr, "%s\n", msg.Text() ); return 1; } // Run the command "argv[1] argv[2...]" client.SetArgv( argc - 2, argv + 2 ); client.Run( argv[1], &ui ); // Close connection client.Final( &e ); if( e.Test() ) { e.Fmt( &msg ); fprintf( stderr, "%s\n", msg.Text() ); return 1; } return 0; }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 7893 | Johan Nilsson |
OFFLINE CHANGELIST 10 - SUBMITTED ON 2011/03/23 11:18:27 Upgrade project files to VS2010 and switching to msbuild for the entire project. Retargeted everything to .NET4 Client Profile for the time being, due to VS2010 C++ limitations (can't target anything other than 4.0 without complicating the setup too much). Shouldn't be too hard to retarget later if push comes to shove. Added VS2010 P4API stuff directly inside this project also to make things easier to get up and running for the moment. Removed old static P4API libraries. ____________________________________________________________ OFFLINE CHANGELIST 9 - SUBMITTED ON 2011/03/22 07:35:31 Converted to VS2010 |