package com.perforce.client;
//javah -classpath "c:\src\perforce\paul_krause\java;.;c:\Apps\Jrefactory\jrefactory.jar;s:\Lib\junit.jar" -o "c:\src\perforce\paul_krause\include\jniclient.h" com.perforce.client.JniClient
import java.util.HashSet;
import java.io.IOException;
import java.util.Properties;
import java.util.Set;
/**
* @author Paul Krause <pkrause@soundbite.com>
* @version $Id: //guest/paul_krause/perforce/api/java/com/perforce/client/JniClient.java#1 $
*/
public class JniClient {
/**
* The Set of changed filenames.
*/
protected Set changeList = new HashSet();
protected String changeNum = "";
protected Properties p4Env;
/**
*
* @exception java.lang.Throwable <description>
*/
public void finalize() throws Throwable {
try {
p4destroy();
} finally {
super.finalize();
}
}
public void p4cmd (String command, String[] args) throws IOException {
byte[][] argv = new byte[args.length][];
for (int i=0; i<argv.length; argv[i] = args[i++].getBytes());
p4cmd(command.getBytes(), argv);
}
// native interface for p4api
private native long p4create();
private native void p4cmd (byte[] command, byte[][] argv) throws IOException;
public native String p4change() throws IOException;
public native void p4connect(Properties env) throws IOException;
public native void p4close() throws IOException;
private native void p4destroy() throws IOException;
private final long clientApiHandle = p4create();
/** Test harness for JniClient*/
static void main(String args[]) {
junit.textui.TestRunner.run(JniClient.TestCase.class);
}
static {
System.loadLibrary("p4scc"); // contains p4api functions
//System.loadLibrary("p4jni"); // bridge generated from JniClient.java
}
public static class TestCase extends junit.framework.TestCase {
public TestCase (String name) {
super(name);
}
public void test0() throws Throwable {
}
}
/** $Id: //guest/paul_krause/perforce/api/java/com/perforce/client/JniClient.java#1 $ */
public static final String __version__ =
"$Id: //guest/paul_krause/perforce/api/java/com/perforce/client/JniClient.java#1 $";
}// JniClient