samplemain.cc #1

  • //
  • guest/
  • robert_yu/
  • perforce/
  • cdsp4/
  • release/
  • 2.2/
  • skillserver/
  • samplemain.cc
  • View
  • Commits
  • Open Download .zip Download (968 B)
/*
 * samplemain.cc - a p4 client API example
 *
 * This file is part of the p4api.tar distribution.
 *
 * 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 Client API documentation (p4api.txt) at 
 * www.perforce.com/perforce/technical.html for further information.
 *
 * $Id: //depot/r00.2/p4/client/samplemain.cc#2 $
 */

# include "clientapi.h"

int main( int argc, char **argv );
int main( int argc, char **argv )
{
	ClientUser ui;
	ClientApi client;
	Error e;

	// Any special protocol mods

	// client.SetProtocol( "tag", "" );

	// Connect to server

	client.Init( &e );
	e.Abort();

	// Run the command "argv[1] argv[2...]"

	client.SetArgv( argc - 2, argv + 2 );
	client.Run( argv[1], &ui );

	// Close connection

	client.Final( &e );
	e.Abort();
	
	return 0;
}
# Change User Description Committed
#1 4529 robert_yu p4 integrate from public/perforce/cdsp4/release/2.2/...
//guest/perforce_software/cdsp4/release/2.2/skillserver/samplemain.cc
#1 1675 Shiv Sikand New 2.2 tree