*** empty log message ***
This commit is contained in:
parent
e407a0b1fb
commit
ba462f755e
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* $Id: Awk.java,v 1.22 2007-01-25 14:10:02 bacon Exp $
|
* $Id: Awk.java,v 1.23 2007-01-26 15:27:00 bacon Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package ase.awk;
|
package ase.awk;
|
||||||
@ -44,8 +44,8 @@ public abstract class Awk
|
|||||||
System.getProperty("os.name")); os.arch / os.version;
|
System.getProperty("os.name")); os.arch / os.version;
|
||||||
*/
|
*/
|
||||||
//System.load ("c://projects//ase/awk/aseawk.dll");
|
//System.load ("c://projects//ase/awk/aseawk.dll");
|
||||||
URL url = ase.awk.Awk.class.getResource("aseawk.dll");
|
URL url = ase.awk.Awk.class.getResource("aseawk_jni.dll");
|
||||||
if (url == null) url = ase.awk.Awk.class.getResource("libaseawk_jni.so");
|
if (url == null) url = ase.awk.Awk.class.getResource("aseawk_jni.so");
|
||||||
if (url != null) System.load (url.getFile());
|
if (url != null) System.load (url.getFile());
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* $Id: jni.c,v 1.54 2007-01-25 14:10:03 bacon Exp $
|
* $Id: jni.c,v 1.55 2007-01-26 15:27:00 bacon Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@ -213,9 +213,7 @@ static void throw_exception (
|
|||||||
env, CLASS_OUTOFMEMORYERROR);
|
env, CLASS_OUTOFMEMORYERROR);
|
||||||
if (except_class == NULL) return;
|
if (except_class == NULL) return;
|
||||||
|
|
||||||
(*env)->ThrowNew (
|
(*env)->ThrowNew (env, except_class, "out of memory");
|
||||||
env, except_class,
|
|
||||||
ase_awk_geterrstr(ASE_AWK_ENOMEM));
|
|
||||||
(*env)->DeleteLocalRef (env, except_class);
|
(*env)->DeleteLocalRef (env, except_class);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -226,7 +224,8 @@ static void throw_exception (
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
except_msg = (*env)->NewString (env, msg, ase_awk_strlen(msg));
|
except_msg = (*env)->NewString (
|
||||||
|
env, (jchar*)msg, ase_awk_strlen(msg));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (except_msg == NULL)
|
if (except_msg == NULL)
|
||||||
@ -784,7 +783,8 @@ static ase_ssize_t __java_open_extio (
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
extio_name = (*env)->NewString (
|
extio_name = (*env)->NewString (
|
||||||
env, extio->name, ase_awk_strlen(extio->name));
|
env, (jchar*)extio->name,
|
||||||
|
ase_awk_strlen(extio->name));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (extio_name == NULL)
|
if (extio_name == NULL)
|
||||||
@ -1173,7 +1173,6 @@ static int __handle_bfn (
|
|||||||
{
|
{
|
||||||
jclass class;
|
jclass class;
|
||||||
jmethodID method;
|
jmethodID method;
|
||||||
jthrowable thrown;
|
|
||||||
jstring name;
|
jstring name;
|
||||||
const char* name_utf;
|
const char* name_utf;
|
||||||
run_data_t* run_data;
|
run_data_t* run_data;
|
||||||
@ -1213,7 +1212,7 @@ static int __handle_bfn (
|
|||||||
name = (*env)->NewString (env, tmp, fnl);
|
name = (*env)->NewString (env, tmp, fnl);
|
||||||
free (tmp);
|
free (tmp);
|
||||||
}
|
}
|
||||||
else name = (*env)->NewString (env, fnm, fnl);
|
else name = (*env)->NewString (env, (jchar*)fnm, fnl);
|
||||||
|
|
||||||
if (name == NULL)
|
if (name == NULL)
|
||||||
{
|
{
|
||||||
@ -1307,7 +1306,7 @@ static int __handle_bfn (
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
arg = (*env)->NewString (env,
|
arg = (*env)->NewString (env,
|
||||||
((ase_awk_val_str_t*)v)->buf,
|
(jchar*)((ase_awk_val_str_t*)v)->buf,
|
||||||
((ase_awk_val_str_t*)v)->len);
|
((ase_awk_val_str_t*)v)->len);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1920,12 +1919,15 @@ JNIEXPORT jobject JNICALL Java_ase_awk_Awk_strtonum (
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < len; i++) tmp[i] = (ase_char_t)ptr[i];
|
for (i = 0; i < len; i++) tmp[i] = (ase_char_t)ptr[i];
|
||||||
n = ase_awk_strtonum ((ase_awk_run_t*)runid, tmp, len, &lv, &rv);
|
n = ase_awk_strtonum (
|
||||||
|
(ase_awk_run_t*)runid, tmp, len, &lv, &rv);
|
||||||
free (tmp);
|
free (tmp);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
n = ase_awk_strtonum ((ase_awk_run_t*)runid, ptr, len, &lv, &rv);
|
n = ase_awk_strtonum (
|
||||||
|
(ase_awk_run_t*)runid,
|
||||||
|
(ase_char_t*)ptr, len, &lv, &rv);
|
||||||
}
|
}
|
||||||
(*env)->ReleaseStringChars (env, str, ptr);
|
(*env)->ReleaseStringChars (env, str, ptr);
|
||||||
|
|
||||||
|
@ -30,10 +30,10 @@ lib: $(C_OBJS)
|
|||||||
$(AR) cr lib$(OUT).a $(C_OBJS)
|
$(AR) cr lib$(OUT).a $(C_OBJS)
|
||||||
|
|
||||||
jni: lib $(JNI_OBJS) $(JAVA_OBJS)
|
jni: lib $(JNI_OBJS) $(JAVA_OBJS)
|
||||||
$(CC) -shared -o lib$(OUT)_jni.so $(JNI_OBJS) -lm -L. -l$(OUT)
|
$(CC) -shared -o $(OUT)_jni.so $(JNI_OBJS) -lm -L. -l$(OUT)
|
||||||
|
|
||||||
#$(CC) -fPIC -shared -static-libgcc -o lib$(OUT)_jni.so -L. -laseawk -lm libaseawk.a jni.o
|
#$(CC) -fPIC -shared -static-libgcc -o $(OUT)_jni.so -L. -laseawk -lm libaseawk.a jni.o
|
||||||
#$(LD) -fPIC -shared -soname lib$(OUT).so -o lib$(OUT).so -L . -l aseawk jni.o
|
#$(LD) -fPIC -shared -soname lib$(OUT).so -o $(OUT)_jni.so -L . -l aseawk jni.o
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -rf $(C_OBJS) $(JNI_OBJS) $(JAVA_OBJS) lib$(OUT).a lib$(OUT).so *.o
|
rm -rf $(C_OBJS) $(JNI_OBJS) $(JAVA_OBJS) lib$(OUT).a lib$(OUT).so *.o
|
||||||
|
@ -40,10 +40,10 @@ lib: $(C_OBJS)
|
|||||||
!
|
!
|
||||||
|
|
||||||
jni: lib $(JNI_OBJS) $(JAVA_OBJS)
|
jni: lib $(JNI_OBJS) $(JAVA_OBJS)
|
||||||
$(LD) $(LDFLAGS) $(STARTUP) $(JNI_OBJS),$(OUT).dll,,$(JNI_LIBS),jni.def,
|
$(LD) $(LDFLAGS) $(STARTUP) $(JNI_OBJS),$(OUT)_jni.dll,,$(JNI_LIBS),jni.def,
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
-del $(OBJS) $(OUT).lib $(OUT).dll *.obj *.class
|
-del $(OBJS) $(OUT).lib $(OUT)_jni.dll *.obj *.class
|
||||||
|
|
||||||
.SUFFIXES: .c .obj .java .class
|
.SUFFIXES: .c .obj .java .class
|
||||||
.c.obj:
|
.c.obj:
|
||||||
|
@ -30,12 +30,12 @@ lib: $(C_OBJS)
|
|||||||
|
|
||||||
jni: lib $(JNI_OBJS) $(JAVA_OBJS)
|
jni: lib $(JNI_OBJS) $(JAVA_OBJS)
|
||||||
$(LD) /dll /def:jni.def /subsystem:windows /version:0.1 /release @<<
|
$(LD) /dll /def:jni.def /subsystem:windows /version:0.1 /release @<<
|
||||||
/nologo /out:$(OUT).dll $(JNI_OBJS) /implib:tmp.lib user32.lib $(OUT).lib
|
/nologo /out:$(OUT)_jni.dll $(JNI_OBJS) /implib:tmp.lib user32.lib $(OUT).lib
|
||||||
<<
|
<<
|
||||||
del tmp.lib tmp.exp
|
del tmp.lib tmp.exp
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
del $(OBJS) $(OUT).lib $(OUT).dll *.obj *.class
|
del $(OBJS) $(OUT).lib $(OUT)_jni.dll *.obj *.class
|
||||||
|
|
||||||
.SUFFIXES: .c .obj .java .class
|
.SUFFIXES: .c .obj .java .class
|
||||||
.c.obj:
|
.c.obj:
|
||||||
|
Loading…
Reference in New Issue
Block a user