*** empty log message ***
This commit is contained in:
parent
89e66ed7aa
commit
ccee9d5304
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* $Id: jni.c,v 1.68 2007-02-23 08:28:39 bacon Exp $
|
* $Id: jni.c,v 1.69 2007-02-23 08:53:35 bacon Exp $
|
||||||
*
|
*
|
||||||
* {License}
|
* {License}
|
||||||
*/
|
*/
|
||||||
@ -267,7 +267,6 @@ JNIEXPORT void JNICALL Java_ase_awk_Awk_open (JNIEnv* env, jobject obj)
|
|||||||
awk = ase_awk_open (&prmfns, awk_data, &errnum);
|
awk = ase_awk_open (&prmfns, awk_data, &errnum);
|
||||||
if (awk == NULL)
|
if (awk == NULL)
|
||||||
{
|
{
|
||||||
free (prmfns.custom_data);
|
|
||||||
throw_exception (
|
throw_exception (
|
||||||
env,
|
env,
|
||||||
ase_awk_geterrstr(errnum),
|
ase_awk_geterrstr(errnum),
|
||||||
@ -399,7 +398,7 @@ static ase_char_t* java_strxdup (jchar* str, jint len)
|
|||||||
tmp = (ase_char_t*) malloc ((len+1) * ASE_SIZEOF(ase_char_t));
|
tmp = (ase_char_t*) malloc ((len+1) * ASE_SIZEOF(ase_char_t));
|
||||||
if (tmp == ASE_NULL) return ASE_NULL;
|
if (tmp == ASE_NULL) return ASE_NULL;
|
||||||
|
|
||||||
ase_awk_strncpy (tmp, (ase_char_t*)str, (ase_size_t)len);
|
ase_strncpy (tmp, (ase_char_t*)str, (ase_size_t)len);
|
||||||
return tmp;
|
return tmp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -512,7 +511,7 @@ JNIEXPORT void JNICALL Java_ase_awk_Awk_run (JNIEnv* env, jobject obj, jstring m
|
|||||||
|
|
||||||
len = (*env)->GetStringLength (env, mfn);
|
len = (*env)->GetStringLength (env, mfn);
|
||||||
|
|
||||||
if (len > 0 && ASE_SIZEOF(jchar) != ASE_SIZEOF(ase_char_t))
|
if (len > 0)
|
||||||
{
|
{
|
||||||
ase_size_t i;
|
ase_size_t i;
|
||||||
|
|
||||||
@ -562,12 +561,11 @@ JNIEXPORT void JNICALL Java_ase_awk_Awk_run (JNIEnv* env, jobject obj, jstring m
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mmm = (ase_char_t*)mfn;
|
mmm = NULL;
|
||||||
ptr = NULL;
|
ptr = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (args != NULL)
|
if (args != NULL)
|
||||||
{
|
{
|
||||||
/* compose arguments */
|
/* compose arguments */
|
||||||
@ -577,7 +575,7 @@ JNIEXPORT void JNICALL Java_ase_awk_Awk_run (JNIEnv* env, jobject obj, jstring m
|
|||||||
runarg = malloc (sizeof(ase_awk_runarg_t) * (len+1));
|
runarg = malloc (sizeof(ase_awk_runarg_t) * (len+1));
|
||||||
if (runarg == NULL)
|
if (runarg == NULL)
|
||||||
{
|
{
|
||||||
if (mmm != NULL && mmm != mfn) free (mmm);
|
if (mmm != NULL) free (mmm);
|
||||||
if (ptr != NULL) (*env)->ReleaseStringChars (env, mfn, ptr);
|
if (ptr != NULL) (*env)->ReleaseStringChars (env, mfn, ptr);
|
||||||
DELETE_CLASS_REFS (env, run_data);
|
DELETE_CLASS_REFS (env, run_data);
|
||||||
|
|
||||||
@ -606,7 +604,7 @@ JNIEXPORT void JNICALL Java_ase_awk_Awk_run (JNIEnv* env, jobject obj, jstring m
|
|||||||
|
|
||||||
(*env)->DeleteLocalRef (env, obj);
|
(*env)->DeleteLocalRef (env, obj);
|
||||||
|
|
||||||
if (mmm != NULL && mmm != mfn) free (mmm);
|
if (mmm != NULL && mmm) free (mmm);
|
||||||
if (ptr != NULL) (*env)->ReleaseStringChars (env, mfn, ptr);
|
if (ptr != NULL) (*env)->ReleaseStringChars (env, mfn, ptr);
|
||||||
DELETE_CLASS_REFS (env, run_data);
|
DELETE_CLASS_REFS (env, run_data);
|
||||||
|
|
||||||
@ -630,7 +628,7 @@ JNIEXPORT void JNICALL Java_ase_awk_Awk_run (JNIEnv* env, jobject obj, jstring m
|
|||||||
(*env)->ReleaseStringChars (env, obj, tmp);
|
(*env)->ReleaseStringChars (env, obj, tmp);
|
||||||
(*env)->DeleteLocalRef (env, obj);
|
(*env)->DeleteLocalRef (env, obj);
|
||||||
|
|
||||||
if (mmm != NULL && mmm != mfn) free (mmm);
|
if (mmm != NULL) free (mmm);
|
||||||
if (ptr != NULL) (*env)->ReleaseStringChars (env, mfn, ptr);
|
if (ptr != NULL) (*env)->ReleaseStringChars (env, mfn, ptr);
|
||||||
DELETE_CLASS_REFS (env, run_data);
|
DELETE_CLASS_REFS (env, run_data);
|
||||||
|
|
||||||
@ -660,7 +658,7 @@ JNIEXPORT void JNICALL Java_ase_awk_Awk_run (JNIEnv* env, jobject obj, jstring m
|
|||||||
free (runarg);
|
free (runarg);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mmm != NULL && mmm != mfn) free (mmm);
|
if (mmm != NULL) free (mmm);
|
||||||
if (ptr != NULL) (*env)->ReleaseStringChars (env, mfn, ptr);
|
if (ptr != NULL) (*env)->ReleaseStringChars (env, mfn, ptr);
|
||||||
DELETE_CLASS_REFS (env, run_data);
|
DELETE_CLASS_REFS (env, run_data);
|
||||||
|
|
||||||
@ -678,7 +676,7 @@ JNIEXPORT void JNICALL Java_ase_awk_Awk_run (JNIEnv* env, jobject obj, jstring m
|
|||||||
free (runarg);
|
free (runarg);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mmm != NULL && mmm != mfn) free (mmm);
|
if (mmm != NULL) free (mmm);
|
||||||
if (ptr != NULL) (*env)->ReleaseStringChars (env, mfn, ptr);
|
if (ptr != NULL) (*env)->ReleaseStringChars (env, mfn, ptr);
|
||||||
DELETE_CLASS_REFS (env, run_data);
|
DELETE_CLASS_REFS (env, run_data);
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
OUT = aseawk
|
OUT = aseawk
|
||||||
|
|
||||||
C_SRCS = awk.c err.c tree.c str.c tab.c map.c parse.c \
|
C_SRCS = awk.c err.c tree.c tab.c map.c parse.c \
|
||||||
run.c rec.c val.c func.c misc.c extio.c rex.c
|
run.c rec.c val.c func.c misc.c extio.c rex.c
|
||||||
JNI_SRCS = jni.c
|
JNI_SRCS = jni.c
|
||||||
JAVA_SRCS = Exception.java Extio.java Awk.java StdAwk.java
|
JAVA_SRCS = Exception.java Extio.java Awk.java StdAwk.java
|
||||||
@ -28,7 +28,9 @@ JAVACFLAGS = -classpath ../..
|
|||||||
LDFLAGS = -Tpd -ap -Gn -c -q
|
LDFLAGS = -Tpd -ap -Gn -c -q
|
||||||
STARTUP = c0d32w.obj
|
STARTUP = c0d32w.obj
|
||||||
LIBS = import32.lib cw32mt.lib
|
LIBS = import32.lib cw32mt.lib
|
||||||
JNI_LIBS = $(LIBS) $(OUT).lib
|
|
||||||
|
JNI_LDFLAGS = $(LDFLAGS) -L..\cmn -L..\utl
|
||||||
|
JNI_LIBS = $(LIBS) $(OUT).lib asecmn.lib aseutl.lib
|
||||||
|
|
||||||
all: lib jni
|
all: lib jni
|
||||||
|
|
||||||
@ -39,7 +41,7 @@ lib: $(C_OBJS)
|
|||||||
!
|
!
|
||||||
|
|
||||||
jni: lib $(JNI_OBJS) $(JAVA_OBJS)
|
jni: lib $(JNI_OBJS) $(JAVA_OBJS)
|
||||||
$(LD) $(LDFLAGS) $(STARTUP) $(JNI_OBJS),$(OUT)_jni.dll,,$(JNI_LIBS),jni.def,
|
$(LD) $(JNI_LDFLAGS) $(STARTUP) $(JNI_OBJS),$(OUT)_jni.dll,,$(JNI_LIBS),jni.def,
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
-del $(OBJS) $(OUT).lib $(OUT)_jni.dll *.obj *.class
|
-del $(OBJS) $(OUT).lib $(OUT)_jni.dll *.obj *.class
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* $Id: Awk.java,v 1.26 2007-02-01 07:23:59 bacon Exp $
|
* $Id: Awk.java,v 1.27 2007-02-23 08:54:03 bacon Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package ase.test.awk;
|
package ase.test.awk;
|
||||||
@ -102,6 +102,7 @@ public class Awk extends ase.awk.StdAwk
|
|||||||
|
|
||||||
awk.parse ();
|
awk.parse ();
|
||||||
|
|
||||||
|
System.out.println ("about to run");
|
||||||
String[] aaa = new String[3];
|
String[] aaa = new String[3];
|
||||||
aaa[0] = "abcdefg";
|
aaa[0] = "abcdefg";
|
||||||
aaa[1] = "qwerty";
|
aaa[1] = "qwerty";
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* $Id: awk.c,v 1.176 2007-02-23 08:21:35 bacon Exp $
|
* $Id: awk.c,v 1.177 2007-02-23 08:54:03 bacon Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <ase/awk/awk.h>
|
#include <ase/awk/awk.h>
|
||||||
@ -612,16 +612,6 @@ static void awk_free (ase_mmgr_t* mmgr, void* ptr)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void* awk_memcpy (void* dst, const void* src, ase_size_t n)
|
|
||||||
{
|
|
||||||
return memcpy (dst, src, n);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void* awk_memset (void* dst, int val, ase_size_t n)
|
|
||||||
{
|
|
||||||
return memset (dst, val, n);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void print_usage (const ase_char_t* argv0)
|
static void print_usage (const ase_char_t* argv0)
|
||||||
{
|
{
|
||||||
ase_printf (ASE_T("Usage: %s [-m] [-d] [-a argument]* -f source-file [data-file]*\n"), argv0);
|
ase_printf (ASE_T("Usage: %s [-m] [-d] [-a argument]* -f source-file [data-file]*\n"), argv0);
|
||||||
|
@ -10,8 +10,8 @@
|
|||||||
CC = bcc32
|
CC = bcc32
|
||||||
LD = ilink32
|
LD = ilink32
|
||||||
CFLAGS = -O2 -WM -WU -RT- -w -I..\..\..
|
CFLAGS = -O2 -WM -WU -RT- -w -I..\..\..
|
||||||
LDFLAGS = -ap -Tpe -Gn -c -L..\..\awk -L..\..\utl
|
LDFLAGS = -ap -Tpe -Gn -c -L..\..\awk -L..\..\cmn -L..\..\utl
|
||||||
LIBS = import32.lib cw32mt.lib aseawk.lib aseutl.lib
|
LIBS = import32.lib cw32mt.lib aseawk.lib asecmn.lib aseutl.lib
|
||||||
STARTUP = c0x32w.obj
|
STARTUP = c0x32w.obj
|
||||||
|
|
||||||
all: aseawk
|
all: aseawk
|
||||||
|
Loading…
Reference in New Issue
Block a user