diff --git a/ase/awk/awk.h b/ase/awk/awk.h index cf55819e..c1ee3df7 100644 --- a/ase/awk/awk.h +++ b/ase/awk/awk.h @@ -1,5 +1,5 @@ /* - * $Id: awk.h,v 1.212 2007-03-20 10:44:44 bacon Exp $ + * $Id: awk.h,v 1.213 2007-03-23 07:45:22 bacon Exp $ * * {License} */ @@ -112,7 +112,7 @@ struct ase_awk_runcbs_t struct ase_awk_runarg_t { - const ase_char_t* ptr; + ase_char_t* ptr; ase_size_t len; }; diff --git a/ase/awk/jni.c b/ase/awk/jni.c index 33130287..ee3e9c8b 100644 --- a/ase/awk/jni.c +++ b/ase/awk/jni.c @@ -1,5 +1,5 @@ /* - * $Id: jni.c,v 1.75 2007-03-19 03:33:53 bacon Exp $ + * $Id: jni.c,v 1.76 2007-03-23 07:45:22 bacon Exp $ * * {License} */ @@ -310,7 +310,7 @@ JNIEXPORT void JNICALL Java_ase_awk_Awk_open (JNIEnv* env, jobject obj) ase_awk_t* awk; ase_awk_prmfns_t prmfns; awk_data_t* awk_data; - int opt, errnum; + int opt; memset (&prmfns, 0, sizeof(prmfns)); @@ -352,13 +352,13 @@ JNIEXPORT void JNICALL Java_ase_awk_Awk_open (JNIEnv* env, jobject obj) memset (awk_data, 0, sizeof(awk_data_t)); - awk = ase_awk_open (&prmfns, awk_data, &errnum); + awk = ase_awk_open (&prmfns, awk_data); if (awk == NULL) { throw_exception ( env, - ase_awk_geterrstr(ASE_NULL, errnum), - errnum, + ase_awk_geterrstr(ASE_NULL, ASE_AWK_ENOMEM), + ASE_AWK_ENOMEM, 0); return; } @@ -464,7 +464,7 @@ JNIEXPORT void JNICALL Java_ase_awk_Awk_parse (JNIEnv* env, jobject obj) (*env)->DeleteLocalRef (env, run_data.object_class); \ } while (0) -static ase_char_t* java_strxdup (jchar* str, jint len) +static ase_char_t* java_strxdup (const jchar* str, jint len) { if (len > 0 && ASE_SIZEOF(jchar) != ASE_SIZEOF(ase_char_t)) { @@ -503,7 +503,7 @@ JNIEXPORT void JNICALL Java_ase_awk_Awk_run (JNIEnv* env, jobject obj, jstring m ase_char_t* mmm; ase_size_t len, i; - jchar* ptr; + const jchar* ptr; ase_awk_runarg_t* runarg = NULL; @@ -678,7 +678,7 @@ JNIEXPORT void JNICALL Java_ase_awk_Awk_run (JNIEnv* env, jobject obj, jstring m for (i = 0; i < len; i++) { - jchar* tmp; + const jchar* tmp; jstring obj = (jstring)(*env)->GetObjectArrayElement (env, args, i); runarg[i].len = (*env)->GetStringLength (env, obj); diff --git a/ase/test/awk/Awk.java b/ase/test/awk/Awk.java index 54d96be3..dcbf2699 100644 --- a/ase/test/awk/Awk.java +++ b/ase/test/awk/Awk.java @@ -1,5 +1,5 @@ /* - * $Id: Awk.java,v 1.27 2007-02-23 08:54:03 bacon Exp $ + * $Id: Awk.java,v 1.28 2007-03-23 07:45:22 bacon Exp $ */ package ase.test.awk; @@ -71,7 +71,7 @@ public class Awk extends ase.awk.StdAwk protected String[] sourceInputNames () { String[] sin = new String[1]; - sin[0] = "t.awk"; + sin[0] = "c:/projects/ase/test/awk/t.awk"; return sin; } diff --git a/ase/test/awk/AwkApplet.html b/ase/test/awk/AwkApplet.html index 81b457fa..1570297b 100644 --- a/ase/test/awk/AwkApplet.html +++ b/ase/test/awk/AwkApplet.html @@ -1,6 +1,11 @@ + + + + diff --git a/ase/test/awk/AwkApplet.java b/ase/test/awk/AwkApplet.java index 45e57df4..0cf10ef8 100644 --- a/ase/test/awk/AwkApplet.java +++ b/ase/test/awk/AwkApplet.java @@ -1,9 +1,9 @@ -package ase.test.awk; +//package ase.test.awk; import java.applet.*; import java.awt.*; import java.awt.event.*; - +import java.net.URL; public class AwkApplet extends Applet { @@ -27,11 +27,27 @@ public class AwkApplet extends Applet private void run_awk () { - Awk awk = null; + ase.test.awk.Awk awk = null; try { - awk = new Awk (); + /* + URL url = ase.awk.Awk.class.getResource ("aseawk_jni.dll"); + if (url == null) url = ase.awk.Awk.class.getResource ("aseawk_jni.so"); + + if (url != null) System.load (url.getFile()); */ + + try + { + System.load ("c:/projects/ase/test/awk/aseawk_jni.dll"); + } + catch (Exception e) + { + System.err.println ("fuck you"); + } + + + awk = new ase.test.awk.Awk (); awk.parse (); awk.run (); } diff --git a/ase/test/awk/makefile.msw.cl b/ase/test/awk/makefile.msw.cl index 5424a14e..c6b218cb 100644 --- a/ase/test/awk/makefile.msw.cl +++ b/ase/test/awk/makefile.msw.cl @@ -25,10 +25,15 @@ mini: mini.obj java: javac -classpath ../../.. Awk.java + javac -classpath ../../.. AwkApplet.java jrun: java -classpath ../../.. ase.test.awk.Awk +cert: + keytool -genkey -keystore ase.store -alias asecert + keytool -export -keystore ase.store -alias asecert -file ase.cer + clean: del $(OBJS) *.obj aseawk.exe mini.exe diff --git a/ase/test/awk/mkjar.bat b/ase/test/awk/mkjar.bat new file mode 100644 index 00000000..19ab553b --- /dev/null +++ b/ase/test/awk/mkjar.bat @@ -0,0 +1,8 @@ +cd ..\..\.. +move ase\test\awk\AwkApplet*.class . +jar cvf AwkApplet.jar *.class ase\test\awk\*.class ase\awk\*.class +move AwkApplet.jar ase\test\awk +cd ase\test\awk + +copy ..\..\awk\aseawk_jni.dll . +jarsigner -keystore ase.store AwkApplet.jar asecert