From 9dfac6ebdb362a04478736ca0e987508b7724039 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Tue, 30 Jan 2007 11:24:40 +0000 Subject: [PATCH] *** empty log message *** --- ase/awk/StdAwk.java | 6 ++++-- ase/awk/jni.c | 14 ++++++++------ ase/test/awk/Awk.java | 3 ++- ase/test/awk/makefile.mac.gcc | 25 +++++++++++++++++++++++++ 4 files changed, 39 insertions(+), 9 deletions(-) create mode 100644 ase/test/awk/makefile.mac.gcc diff --git a/ase/awk/StdAwk.java b/ase/awk/StdAwk.java index 23dbcc1a..4a5693ed 100644 --- a/ase/awk/StdAwk.java +++ b/ase/awk/StdAwk.java @@ -1,5 +1,5 @@ /* - * $Id: StdAwk.java,v 1.13 2007-01-25 14:10:03 bacon Exp $ + * $Id: StdAwk.java,v 1.14 2007-01-30 11:24:40 bacon Exp $ */ package ase.awk; @@ -180,7 +180,7 @@ public abstract class StdAwk extends Awk /* == console interface == */ protected int openConsole (Extio extio) { - //System.err.println ("[open_console called.... name: " + extio.getName() + " mode: " + extio.getMode()); + System.err.println ("[open_console called.... name: " + extio.getName() + " mode: " + extio.getMode()); int mode = extio.getMode (); @@ -210,11 +210,13 @@ public abstract class StdAwk extends Awk osw = get_stream_writer (cout[cout_no]); if (osw == null) return -1; +System.out.println ("setting console output name ...."); extio.setHandle (osw); try { setConsoleOutputName (extio, cout[cout_no]); } catch (Exception e) { return -1; } cout_no++; +System.out.println ("open ok...."); return 1; } diff --git a/ase/awk/jni.c b/ase/awk/jni.c index f16aaf5e..bd2ec8d6 100644 --- a/ase/awk/jni.c +++ b/ase/awk/jni.c @@ -1,5 +1,5 @@ /* - * $Id: jni.c,v 1.60 2007-01-30 10:55:27 bacon Exp $ + * $Id: jni.c,v 1.61 2007-01-30 11:24:40 bacon Exp $ */ #include @@ -1108,17 +1108,14 @@ static ase_ssize_t __process_extio ( ase_awk_extio_t* epa = (ase_awk_extio_t*)arg; runio_data_t* runio_data = (runio_data_t*)epa->custom_data; -printf ("__process_extio...\n"); if (cmd == ASE_AWK_IO_OPEN) { -printf ("__process_extio open...\n"); return __java_open_extio ( runio_data->env, runio_data->obj, "openExtio", epa); } else if (cmd == ASE_AWK_IO_CLOSE) { -printf ("__process_extio close...\n"); return __java_close_extio ( runio_data->env, runio_data->obj, "closeExtio", epa); @@ -1131,7 +1128,6 @@ printf ("__process_extio close...\n"); } else if (cmd == ASE_AWK_IO_WRITE) { -printf ("__process_extio write...\n"); return __java_write_extio ( runio_data->env, runio_data->obj, "writeExtio", epa, data, size); @@ -1811,6 +1807,7 @@ JNIEXPORT void JNICALL Java_ase_awk_Awk_setofilename ( jsize len; jint n; +printf ("setofilename....\n"); len = (*env)->GetStringLength (env, name); ptr = (*env)->GetStringChars (env, name, JNI_FALSE); if (ptr == NULL) @@ -1824,11 +1821,12 @@ JNIEXPORT void JNICALL Java_ase_awk_Awk_setofilename ( return; } +printf ("setofilename 11111....\n"); if (ASE_SIZEOF(jchar) != ASE_SIZEOF(ase_char_t)) { ase_size_t i; ase_char_t* tmp = (ase_char_t*) - malloc (ASE_SIZEOF(ase_char_t)*len); + malloc (ASE_SIZEOF(ase_char_t)*(len+1)); if (tmp == ASE_NULL) { (*env)->ReleaseStringChars (env, name, ptr); @@ -1841,8 +1839,12 @@ JNIEXPORT void JNICALL Java_ase_awk_Awk_setofilename ( return; } +printf ("setofilename 22222....%d\n", len); for (i = 0; i < len; i++) tmp[i] = (ase_char_t)ptr[i]; + tmp[len] = ASE_T('\0'); +printf ("setofilename 333333....[%ls], %d\n", tmp, len); n = ase_awk_setofilename (run, tmp, len); +printf ("setofilename 444444....\n"); free (tmp); } else diff --git a/ase/test/awk/Awk.java b/ase/test/awk/Awk.java index fa2897f4..3cef7c02 100644 --- a/ase/test/awk/Awk.java +++ b/ase/test/awk/Awk.java @@ -1,5 +1,5 @@ /* - * $Id: Awk.java,v 1.23 2007-01-29 04:39:22 bacon Exp $ + * $Id: Awk.java,v 1.24 2007-01-30 11:24:40 bacon Exp $ */ package ase.test.awk; @@ -95,6 +95,7 @@ public class Awk extends ase.awk.StdAwk System.out.println ("Option: [" + awk.getOption() + "]"); awk.parse (); + System.out.println ("about to run the program"); awk.run (); } catch (ase.awk.Exception e) diff --git a/ase/test/awk/makefile.mac.gcc b/ase/test/awk/makefile.mac.gcc new file mode 100644 index 00000000..6680493d --- /dev/null +++ b/ase/test/awk/makefile.mac.gcc @@ -0,0 +1,25 @@ +SRCS = awk.c +OBJS = $(SRCS:.c=.o) + +CC = gcc +CFLAGS = -O2 -Wall -D_REENTRANT -D_THREAD_SAFE -I../../.. +LDFLAGS = -L../../awk +LIBS = -laseawk -lm + +all: awk + +awk: $(OBJS) + $(CC) -o $@ awk.o $(LDFLAGS) $(LIBS) + +java: + javac -classpath ../../.. Awk.java AwkApplet.java + +jrun: + java -Xms1m -Xmx2m -classpath ../../.. ase.test.awk.Awk + +clean: + rm -rf *.o *.class awk + +.SUFFIXES: .c .o +.c.o: + $(CC) -c $(CFLAGS) $<