*** empty log message ***
This commit is contained in:
parent
6c99da0073
commit
56d096bc2b
51
ase/awk/Awk.java
Normal file
51
ase/awk/Awk.java
Normal file
@ -0,0 +1,51 @@
|
||||
/*
|
||||
* $Id: Awk.java,v 1.1 2006-10-24 04:57:29 bacon Exp $
|
||||
*/
|
||||
|
||||
package ase.awk;
|
||||
|
||||
import java.io.*;
|
||||
|
||||
public abstract class Awk
|
||||
{
|
||||
// mode for open_source & close_source
|
||||
public static final int SOURCE_READ = 1;
|
||||
public static final int SOURCE_WRITE = 2;
|
||||
|
||||
static
|
||||
{
|
||||
System.load ("c://projects//ase/awk/aseawk.dll");
|
||||
}
|
||||
|
||||
private long __awk;
|
||||
|
||||
public Awk () throws AwkException
|
||||
{
|
||||
open ();
|
||||
}
|
||||
|
||||
public native void close ();
|
||||
public native void parse () throws AwkException;
|
||||
public native void run () throws AwkException;
|
||||
private native void open () throws AwkException;
|
||||
|
||||
/*
|
||||
protected native void set_extio (long extio, Object obj);
|
||||
protected native Object get_extio (long extio);
|
||||
*/
|
||||
|
||||
/* abstrace methods */
|
||||
protected abstract int open_source (int mode);
|
||||
protected abstract int close_source (int mode);
|
||||
protected abstract int read_source (char[] buf, int len);
|
||||
protected abstract int write_source (char[] buf, int len);
|
||||
|
||||
protected abstract int open_console ();
|
||||
protected abstract int close_console ();
|
||||
protected abstract int read_console (char[] buf, int len);
|
||||
protected abstract int write_console (char[] buf, int len);
|
||||
protected abstract int next_console (char[] buf, int len);
|
||||
|
||||
protected abstract int open_file (Extio extio);
|
||||
protected abstract int close_file (String name);
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: jni.c,v 1.15 2006-10-24 04:10:12 bacon Exp $
|
||||
* $Id: jni.c,v 1.16 2006-10-24 04:57:29 bacon Exp $
|
||||
*/
|
||||
|
||||
#include <ase/awk/jni.h>
|
||||
@ -377,7 +377,7 @@ static ase_ssize_t __call_java_open_extio (
|
||||
jmethodID extio_cons;
|
||||
jobject extio_object;
|
||||
|
||||
extio_class = (*env)->FindClass (env, "ssekit/ssej/awk/Extio");
|
||||
extio_class = (*env)->FindClass (env, "ase/awk/Extio");
|
||||
if (extio_class == NULL) return -1;
|
||||
|
||||
extio_cons = (*env)->GetMethodID (
|
||||
@ -385,7 +385,7 @@ static ase_ssize_t __call_java_open_extio (
|
||||
if (extio_cons == NULL) return -1;
|
||||
|
||||
mid = (*env)->GetMethodID (
|
||||
env, class, meth, "(Lssekit/ssej/awk/Extio;)I");
|
||||
env, class, meth, "(Lase/awk/Extio;)I");
|
||||
if (mid == NULL) return -1;
|
||||
|
||||
extio_object = (*env)->NewObject (
|
||||
|
@ -1,10 +1,10 @@
|
||||
LIBRARY "sseawk.dll"
|
||||
LIBRARY "aseawk.dll"
|
||||
|
||||
EXPORTS
|
||||
Java_sse_awk_Awk_open
|
||||
Java_sse_awk_Awk_close
|
||||
Java_sse_awk_Awk_parse
|
||||
Java_sse_awk_Awk_run
|
||||
Java_sse_awk_Awk_get_1extio
|
||||
Java_sse_awk_Awk_set_1extio
|
||||
Java_ase_awk_Awk_open
|
||||
Java_ase_awk_Awk_close
|
||||
Java_ase_awk_Awk_parse
|
||||
Java_ase_awk_Awk_run
|
||||
Java_ase_awk_Awk_get_1extio
|
||||
Java_ase_awk_Awk_set_1extio
|
||||
|
||||
|
@ -26,9 +26,16 @@ dll: $(OBJS)
|
||||
|
||||
jni: $(OBJS) jni.obj
|
||||
$(LD) /dll /def:jni.def /subsystem:console /version:0.1 /release @<<
|
||||
/nologo /out:$(OUT).dll $(OBJS) jni.obj ..\bas\xpbas.lib
|
||||
/nologo /out:$(OUT).dll $(OBJS) jni.obj
|
||||
<<
|
||||
|
||||
java:
|
||||
javac -classpath ../.. Awk.java TestAwk.java Extio.java AwkException.java
|
||||
|
||||
jrun:
|
||||
java -classpath ../.. ase.awk.TestAwk
|
||||
|
||||
|
||||
clean:
|
||||
del $(OBJS) $(OUT) *.obj
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user