| 1 | package uk.org.distorted.tripe; |
| 2 | |
| 3 | class JNI { |
| 4 | static { System.loadLibrary("toy"); } |
| 5 | static class NativeObjectTypeException extends RuntimeException { |
| 6 | NativeObjectTypeException() { super(); } |
| 7 | NativeObjectTypeException(String msg) { super(msg); } |
| 8 | } |
| 9 | |
| 10 | static final int CF_CLOSERD = 1, CF_CLOSEWR = 2; |
| 11 | static final int CF_CLOSEMASK = CF_CLOSERD | CF_CLOSEWR; |
| 12 | |
| 13 | static native void test(); |
| 14 | |
| 15 | static native Object make(); |
| 16 | static native void check(Object toy); |
| 17 | |
| 18 | static native Object connect(); |
| 19 | static native void send(Object conn, byte[] buf, int start, int len); |
| 20 | static native int recv(Object conn, byte[] buf, int start, int len); |
| 21 | static native void close(Object conn, int how); |
| 22 | } |