*** empty log message ***

This commit is contained in:
hyung-hwan 2007-01-30 10:55:27 +00:00
parent e56edcd814
commit 87e972f36b
4 changed files with 53 additions and 6 deletions

View File

@ -1,5 +1,5 @@
/* /*
* $Id: jni.c,v 1.59 2007-01-28 11:28:26 bacon Exp $ * $Id: jni.c,v 1.60 2007-01-30 10:55:27 bacon Exp $
*/ */
#include <stdio.h> #include <stdio.h>
@ -1108,14 +1108,17 @@ static ase_ssize_t __process_extio (
ase_awk_extio_t* epa = (ase_awk_extio_t*)arg; ase_awk_extio_t* epa = (ase_awk_extio_t*)arg;
runio_data_t* runio_data = (runio_data_t*)epa->custom_data; runio_data_t* runio_data = (runio_data_t*)epa->custom_data;
printf ("__process_extio...\n");
if (cmd == ASE_AWK_IO_OPEN) if (cmd == ASE_AWK_IO_OPEN)
{ {
printf ("__process_extio open...\n");
return __java_open_extio ( return __java_open_extio (
runio_data->env, runio_data->obj, runio_data->env, runio_data->obj,
"openExtio", epa); "openExtio", epa);
} }
else if (cmd == ASE_AWK_IO_CLOSE) else if (cmd == ASE_AWK_IO_CLOSE)
{ {
printf ("__process_extio close...\n");
return __java_close_extio ( return __java_close_extio (
runio_data->env, runio_data->obj, runio_data->env, runio_data->obj,
"closeExtio", epa); "closeExtio", epa);
@ -1128,6 +1131,7 @@ static ase_ssize_t __process_extio (
} }
else if (cmd == ASE_AWK_IO_WRITE) else if (cmd == ASE_AWK_IO_WRITE)
{ {
printf ("__process_extio write...\n");
return __java_write_extio ( return __java_write_extio (
runio_data->env, runio_data->obj, runio_data->env, runio_data->obj,
"writeExtio", epa, data, size); "writeExtio", epa, data, size);
@ -2072,7 +2076,7 @@ JNIEXPORT jstring JNICALL Java_ase_awk_Awk_valtostr (
} }
else else
{ {
ret = (*env)->NewString (env, str, len); ret = (*env)->NewString (env, (jchar*)str, len);
} }
ase_awk_free (awk, str); ase_awk_free (awk, str);

View File

@ -1,11 +1,15 @@
/* /*
* $Id: jni.h,v 1.18 2007-01-28 11:12:30 bacon Exp $ * $Id: jni.h,v 1.19 2007-01-30 10:55:27 bacon Exp $
*/ */
#ifndef _ASE_AWK_JNI_H_ #ifndef _ASE_AWK_JNI_H_
#define _ASE_AWK_JNI_H_ #define _ASE_AWK_JNI_H_
#if defined(__APPLE__) && defined(__MACH__)
#include <JavaVM/jni.h>
#else
#include <jni.h> #include <jni.h>
#endif
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {

41
ase/awk/makefile.mac.gcc Normal file
View File

@ -0,0 +1,41 @@
OUT = aseawk
C_SRCS = awk.c err.c tree.c str.c tab.c map.c parse.c \
run.c rec.c val.c func.c misc.c extio.c rex.c
JNI_SRCS = jni.c
JAVA_SRCS = Exception.java Extio.java Awk.java StdAwk.java
C_OBJS = $(C_SRCS:.c=.o)
JNI_OBJS = $(JNI_SRCS:.c=.o)
JAVA_OBJS = $(JAVA_SRCS:.java=.class)
CC = gcc
AR = ar
LD = ld
RANLIB = ranlib
CFLAGS = -Wall -O2 -D_REENTRANT -D_THREAD_SAFE -I../..
LDFLAGS =
LIBS =
JAVAC = javac
JAVACFLAGS = -classpath ../..
all: lib jni
lib: $(C_OBJS)
$(AR) cr lib$(OUT).a $(C_OBJS)
ranlib lib$(OUT).a
jni: lib $(JNI_OBJS) $(JAVA_OBJS)
$(CC) -bundle -o $(OUT)_jni.so $(JNI_OBJS) -lm -L. -l$(OUT)
clean:
rm -rf $(C_OBJS) $(JNI_OBJS) $(JAVA_OBJS) lib$(OUT).a lib$(OUT).so *.o
.SUFFIXES: .c .o .java .class
.c.o:
$(CC) $(CFLAGS) -c $<
.java.class:
$(JAVAC) $(JAVACFLAGS) $<

View File

@ -1,5 +1,5 @@
/* /*
* $Id: run.c,v 1.321 2007-01-23 14:23:18 bacon Exp $ * $Id: run.c,v 1.322 2007-01-30 10:55:27 bacon Exp $
*/ */
#include <ase/awk/awk_i.h> #include <ase/awk/awk_i.h>
@ -1713,8 +1713,6 @@ static int __run_block0 (ase_awk_run_t* run, ase_awk_nde_blk_t* nde)
/* blockless pattern - execute print $0*/ /* blockless pattern - execute print $0*/
ase_awk_refupval (run, run->inrec.d0); ase_awk_refupval (run, run->inrec.d0);
/*n = ase_awk_writeextio_val (run,
ASE_AWK_OUT_CONSOLE, ASE_T(""), run->inrec.d0);*/
n = ase_awk_writeextio_str (run, n = ase_awk_writeextio_str (run,
ASE_AWK_OUT_CONSOLE, ASE_T(""), ASE_AWK_OUT_CONSOLE, ASE_T(""),
ASE_AWK_STR_BUF(&run->inrec.line), ASE_AWK_STR_BUF(&run->inrec.line),