Added java/Makefile.in, java/xpcom/TODO; minor correctoiosn to java/xpcom/README.
Fix libxpjava.so JNI and linking problems. git-svn-id: svn://10.0.0.236/trunk@43324 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -43,18 +43,18 @@ EXPORTS = \
|
||||
|
||||
REQUIRES = xpcom
|
||||
|
||||
# XXX: fix this to substitute correct OS name
|
||||
|
||||
INCLUDES += -I$(JDKHOME)/include \
|
||||
-I$(JDKHOME)/include/solaris \
|
||||
-I$(JDKHOME)/include/linux \
|
||||
$(NULL)
|
||||
|
||||
EXTRA_DSO_LDOPTS += \
|
||||
-L$(topsrcdir)/dist/lib \
|
||||
-lxptinfo \
|
||||
-lxptcmd \
|
||||
-lxptcall \
|
||||
-lxpt \
|
||||
-lxpcom \
|
||||
-lxp \
|
||||
-lreg \
|
||||
-lplds3 \
|
||||
-lplc3 \
|
||||
-lnspr3 \
|
||||
-lplds3 \
|
||||
$(NULL)
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
#include <jni.h>
|
||||
#include "nscore.h"
|
||||
#include "nsID.h"
|
||||
#include "nsIFactory.h"
|
||||
@@ -31,6 +32,9 @@
|
||||
|
||||
/* ---------- CLASS METHODS ------------ */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_org_mozilla_xpcom_XPComUtilities_initialize(JNIEnv *env, jclass cls)
|
||||
@@ -214,5 +218,6 @@ JNIEXPORT void JNICALL
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
#include <jni.h>
|
||||
#include "nscore.h"
|
||||
#include "nsIFactory.h"
|
||||
#include "nsIComponentManager.h"
|
||||
@@ -40,6 +41,10 @@ jclass classXPCMethod = NULL;
|
||||
|
||||
#define USE_PARAM_TEMPLATE
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Class: XPCMethod
|
||||
* Method: init
|
||||
@@ -51,7 +56,7 @@ JNIEXPORT jint JNICALL
|
||||
int offset;
|
||||
const nsXPTMethodInfo *mi;
|
||||
nsID *iidPtr = ID_GetNative(env, iid);
|
||||
const jbyte *tmpstr;
|
||||
const char *tmpstr;
|
||||
nsresult res;
|
||||
|
||||
// Get method info
|
||||
@@ -153,7 +158,7 @@ JNIEXPORT void JNICALL
|
||||
* Class: XPCMethod
|
||||
* Method: getParameterType
|
||||
* Signature: (I)I
|
||||
XS */
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_org_mozilla_xpcom_XPCMethod_getParameterType
|
||||
(JNIEnv *env, jobject self, jint index) {
|
||||
|
||||
@@ -251,3 +256,7 @@ JNIEXPORT void JNICALL Java_org_mozilla_xpcom_XPCMethod_invoke
|
||||
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
#include <jni.h>
|
||||
#include "nscore.h"
|
||||
#include "nsID.h"
|
||||
#include "nsIAllocator.h"
|
||||
@@ -84,6 +85,10 @@ jboolean ID_IsEqual(JNIEnv *env, jobject self, jobject other) {
|
||||
return result;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Class: ID
|
||||
* Method: NewIDPtr
|
||||
@@ -121,7 +126,7 @@ JNIEXPORT void JNICALL Java_org_mozilla_xpcom_nsID_NewIDPtr__Ljava_lang_String_2
|
||||
nsID *idptr = (nsID *)nsAllocator::Alloc(sizeof(nsID));
|
||||
|
||||
jboolean isCopy;
|
||||
const jbyte *utf = env->GetStringUTFChars(string, &isCopy);
|
||||
const char *utf = env->GetStringUTFChars(string, &isCopy);
|
||||
char *aIDStr;
|
||||
|
||||
if (isCopy) {
|
||||
@@ -201,3 +206,7 @@ JNIEXPORT jint JNICALL Java_org_mozilla_xpcom_nsID_hashCode(JNIEnv *env, jobject
|
||||
return result;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -520,7 +520,7 @@ jboolean JObjectToVariant(JNIEnv *env,
|
||||
if (env->IsInstanceOf(elem, classString)) {
|
||||
jstring string = (jstring)elem;
|
||||
jsize jstrlen = env->GetStringUTFLength(string);
|
||||
const jbyte *utf = env->GetStringUTFChars(string, NULL);
|
||||
const char *utf = env->GetStringUTFChars(string, NULL);
|
||||
|
||||
// PENDING: copying every time is wasteful, but
|
||||
// we need to release `utf' before invocation loses it.
|
||||
|
||||
Reference in New Issue
Block a user