Browse Source

Move from org.pEp.* to foundation.pEp.*

JNI-88
Hussein Kasem 3 years ago
parent
commit
596a095e70
24 changed files with 146 additions and 140 deletions
  1. +6
    -0
      .hgignore
  2. +43
    -43
      src/Makefile
  3. +15
    -15
      src/basic_api.cc
  4. +2
    -2
      src/foundation/pEp/jniadapter/AbstractEngine.java
  5. +1
    -1
      src/foundation/pEp/jniadapter/Blob.java
  6. +1
    -1
      src/foundation/pEp/jniadapter/CommType.java
  7. +1
    -1
      src/foundation/pEp/jniadapter/Engine.java.target
  8. +1
    -1
      src/foundation/pEp/jniadapter/Identity.java
  9. +1
    -1
      src/foundation/pEp/jniadapter/Message.java.target
  10. +1
    -1
      src/foundation/pEp/jniadapter/Pair.java
  11. +4
    -4
      src/foundation/pEp/jniadapter/Sync.java
  12. +1
    -1
      src/foundation/pEp/jniadapter/_Blob.java
  13. +1
    -1
      src/foundation/pEp/jniadapter/_Identity.java
  14. +20
    -20
      src/foundation_pEp_jniadapter_AbstractEngine.cc
  15. +10
    -10
      src/gen_cpp_Engine.ysl2
  16. +9
    -9
      src/gen_cpp_Message.ysl2
  17. +2
    -2
      src/gen_java_Engine.ysl2
  18. +4
    -4
      src/gen_java_Message.ysl2
  19. +3
    -3
      src/gen_java_exceptions.ysl2
  20. +1
    -1
      src/gen_throw_pEp_exception.ysl2
  21. +11
    -11
      src/jniutils.cc
  22. +6
    -6
      src/types_java.ysl2
  23. +1
    -1
      test/SyncCallbacks.java
  24. +1
    -1
      test/Testing.java

+ 6
- 0
.hgignore View File

@ -18,6 +18,10 @@ syntax: glob
org_pEp_*.h
org_pEp_*.cc
org/pEp/jniadapter/pEp*.java
foundation_pEp_*.h
foundation_pEp_*.cc
foundation/pEp/jniadapter/pEp*.java
throw_pEp_exception.*
Color.java
Engine.java
@ -28,6 +32,8 @@ Status.java
SyncHandshakeResult.java
IdentityFlags.java
SyncHandshakeSignal.java
CipherSuite.java
# ignore vim workspace


+ 43
- 43
src/Makefile View File

@ -40,67 +40,67 @@ else
$(error I don't know how to build for $(BUILD_FOR).)
endif
JAVA_SOURCES=org/pEp/jniadapter/AbstractEngine.java \
org/pEp/jniadapter/Blob.java \
org/pEp/jniadapter/CommType.java \
org/pEp/jniadapter/Identity.java \
org/pEp/jniadapter/Pair.java \
org/pEp/jniadapter/Sync.java \
org/pEp/jniadapter/_Blob.java \
org/pEp/jniadapter/_Identity.java \
org/pEp/jniadapter/pEpException.java \
org/pEp/jniadapter/Message.java \
org/pEp/jniadapter/Engine.java \
C_SOURCES=org_pEp_jniadapter_Engine.cc \
org_pEp_jniadapter_Engine.h \
org_pEp_jniadapter_Message.cc \
org_pEp_jniadapter_Message.h \
JAVA_SOURCES=foundation/pEp/jniadapter/AbstractEngine.java \
foundation/pEp/jniadapter/Blob.java \
foundation/pEp/jniadapter/CommType.java \
foundation/pEp/jniadapter/Identity.java \
foundation/pEp/jniadapter/Pair.java \
foundation/pEp/jniadapter/Sync.java \
foundation/pEp/jniadapter/_Blob.java \
foundation/pEp/jniadapter/_Identity.java \
foundation/pEp/jniadapter/pEpException.java \
foundation/pEp/jniadapter/Message.java \
foundation/pEp/jniadapter/Engine.java \
C_SOURCES=foundation_pEp_jniadapter_Engine.cc \
foundation_pEp_jniadapter_Engine.h \
foundation_pEp_jniadapter_Message.cc \
foundation_pEp_jniadapter_Message.h \
throw_pEp_exception.cc \
throw_pEp_exception.hh \
org_pEp_jniadapter_AbstractEngine.h
foundation_pEp_jniadapter_AbstractEngine.h
.PHONY: all
all: $(JAR) $(SHARED)
$(JAR): $(JAVA_SOURCES) $(C_SOURCES)
$(JP)/javac org/pEp/jniadapter/*.java
$(JP)/jar cf $@ org/pEp/jniadapter/*.class
$(JP)/javac foundation/pEp/jniadapter/*.java
$(JP)/jar cf $@ foundation/pEp/jniadapter/*.class
BLUBB=org_pEp_jniadapter_AbstractEngine.h org_pEp_jniadapter_Engine.h org_pEp_jniadapter_Message.h
$(BLUBB): org_pEp_jniadapter_%.h: org/pEp/jniadapter/%.java
BLUBB=foundation_pEp_jniadapter_AbstractEngine.h foundation_pEp_jniadapter_Engine.h foundation_pEp_jniadapter_Message.h
$(BLUBB): foundation_pEp_jniadapter_%.h: foundation/pEp/jniadapter/%.java
ifdef OLD_JAVA
$(JP)/javah $(subst /,.,$(subst .java,,$<))
else
$(JP)/javac -h . $<
endif
org_pEp_jniadapter_AbstractEngine.o: %.o: %.cc %.h throw_pEp_exception.hh jniutils.hh
foundation_pEp_jniadapter_AbstractEngine.o: %.o: %.cc %.h throw_pEp_exception.hh jniutils.hh
$(CXX) $(CXXFLAGS) -c $< -o $@
org_pEp_jniadapter_Engine.o org_pEp_jniadapter_Message.o: %.o: %.cc %.h
foundation_pEp_jniadapter_Engine.o foundation_pEp_jniadapter_Message.o: %.o: %.cc %.h
$(CXX) $(CXXFLAGS) -c $< -o $@
$(LIBRARY): org_pEp_jniadapter_AbstractEngine.o org_pEp_jniadapter_Engine.o org_pEp_jniadapter_Message.o throw_pEp_exception.o jniutils.o basic_api.o
$(LIBRARY): foundation_pEp_jniadapter_AbstractEngine.o foundation_pEp_jniadapter_Engine.o foundation_pEp_jniadapter_Message.o throw_pEp_exception.o jniutils.o basic_api.o
ar -r $@ *.o
$(SHARED): $(LIBRARY)
$(CXX) *.o $(LDFLAGS) $(LDLIBS) -o $@
org/pEp/jniadapter/pEpException.java: pEp.yml2 gen_java_exceptions.ysl2 pEp.yml2
foundation/pEp/jniadapter/pEpException.java: pEp.yml2 gen_java_exceptions.ysl2 pEp.yml2
$(YML2_PROC) -y gen_java_exceptions.ysl2 $< -o $@
org/pEp/jniadapter/Message.java: pEp.yml2 gen_java_Message.ysl2 types_java.ysl2
foundation/pEp/jniadapter/Message.java: pEp.yml2 gen_java_Message.ysl2 types_java.ysl2
$(YML2_PROC) -y gen_java_Message.ysl2 $<
org/pEp/jniadapter/Engine.java: pEp.yml2 gen_java_Engine.ysl2 types_java.ysl2
foundation/pEp/jniadapter/Engine.java: pEp.yml2 gen_java_Engine.ysl2 types_java.ysl2
$(YML2_PROC) -y gen_java_Engine.ysl2 $<
org_pEp_jniadapter_Message.cc: pEp.yml2 gen_cpp_Message.ysl2 types_c.ysl2
foundation_pEp_jniadapter_Message.cc: pEp.yml2 gen_cpp_Message.ysl2 types_c.ysl2
$(YML2_PROC) -y gen_cpp_Message.ysl2 $<
org_pEp_jniadapter_Engine.cc: pEp.yml2 gen_cpp_Engine.ysl2 types_c.ysl2
foundation_pEp_jniadapter_Engine.cc: pEp.yml2 gen_cpp_Engine.ysl2 types_c.ysl2
$(YML2_PROC) -y gen_cpp_Engine.ysl2 $<
throw_pEp_exception.cc throw_pEp_exception.hh: pEp.yml2 gen_throw_pEp_exception.ysl2 textutils.ysl2
@ -116,18 +116,18 @@ clean:
rm -f *.o
rm -f *.class
rm -f *.xml *.xsl
rm -f org_pEp_jniadapter_*.h
rm -f org/pEp/jniadapter/*.class
rm -f org/pEp/jniadapter/pEp*.java
rm -f org/pEp/jniadapter/Engine.java
rm -f org/pEp/jniadapter/Message.java
rm -f org/pEp/jniadapter/Color.java
rm -f org/pEp/jniadapter/DecryptFlags.java
rm -f org/pEp/jniadapter/IdentityFlags.java
rm -f org/pEp/jniadapter/Rating.java
rm -f org/pEp/jniadapter/Status.java
rm -f org/pEp/jniadapter/SyncHandshakeResult.java
rm -f org/pEp/jniadapter/SyncHandshakeSignal.java
rm -f org/pEp/jniadapter/CipherSuite.java
rm -f foundation_pEp_jniadapter_*.h
rm -f foundation/pEp/jniadapter/*.class
rm -f foundation/pEp/jniadapter/pEp*.java
rm -f foundation/pEp/jniadapter/Engine.java
rm -f foundation/pEp/jniadapter/Message.java
rm -f foundation/pEp/jniadapter/Color.java
rm -f foundation/pEp/jniadapter/DecryptFlags.java
rm -f foundation/pEp/jniadapter/IdentityFlags.java
rm -f foundation/pEp/jniadapter/Rating.java
rm -f foundation/pEp/jniadapter/Status.java
rm -f foundation/pEp/jniadapter/SyncHandshakeResult.java
rm -f foundation/pEp/jniadapter/SyncHandshakeSignal.java
rm -f foundation/pEp/jniadapter/CipherSuite.java
rm -f throw_pEp_exception.*
rm -f org_pEp_jniadapter_Message.cc org_pEp_jniadapter_Engine.cc
rm -f foundation_pEp_jniadapter_Message.cc foundation_pEp_jniadapter_Engine.cc

+ 15
- 15
src/basic_api.cc View File

@ -14,7 +14,7 @@ extern "C" {
using namespace pEp::JNIAdapter;
using namespace pEp::Adapter;
JNIEXPORT jobject JNICALL Java_org_pEp_jniadapter_Engine_trustwords(
JNIEXPORT jobject JNICALL Java_foundation_pEp_jniadapter_Engine_trustwords(
JNIEnv *env,
jobject obj,
jobject ident
@ -51,7 +51,7 @@ JNIEXPORT jobject JNICALL Java_org_pEp_jniadapter_Engine_trustwords(
return from_string(env, words);
}
JNIEXPORT jobject JNICALL Java_org_pEp_jniadapter_Engine_myself(
JNIEXPORT jobject JNICALL Java_foundation_pEp_jniadapter_Engine_myself(
JNIEnv *env,
jobject obj,
jobject ident
@ -69,7 +69,7 @@ JNIEXPORT jobject JNICALL Java_org_pEp_jniadapter_Engine_myself(
return from_identity(env, _ident);
}
JNIEXPORT jobject JNICALL Java_org_pEp_jniadapter_Engine_updateIdentity(
JNIEXPORT jobject JNICALL Java_foundation_pEp_jniadapter_Engine_updateIdentity(
JNIEnv *env,
jobject obj,
jobject ident
@ -82,7 +82,7 @@ JNIEXPORT jobject JNICALL Java_org_pEp_jniadapter_Engine_updateIdentity(
return from_identity(env, _ident);
}
JNIEXPORT jobject JNICALL Java_org_pEp_jniadapter_Engine_setOwnKey(
JNIEXPORT jobject JNICALL Java_foundation_pEp_jniadapter_Engine_setOwnKey(
JNIEnv *env,
jobject obj,
jobject ident,
@ -103,7 +103,7 @@ JNIEXPORT jobject JNICALL Java_org_pEp_jniadapter_Engine_setOwnKey(
return from_identity(env, _ident);
}
JNIEXPORT void JNICALL Java_org_pEp_jniadapter_Engine_keyMistrusted(
JNIEXPORT void JNICALL Java_foundation_pEp_jniadapter_Engine_keyMistrusted(
JNIEnv *env,
jobject obj,
jobject ident
@ -126,7 +126,7 @@ JNIEXPORT void JNICALL Java_org_pEp_jniadapter_Engine_keyMistrusted(
::key_mistrusted(session(), _ident);
}
JNIEXPORT void JNICALL Java_org_pEp_jniadapter_Engine_keyResetTrust(
JNIEXPORT void JNICALL Java_foundation_pEp_jniadapter_Engine_keyResetTrust(
JNIEnv *env,
jobject obj,
jobject ident
@ -149,7 +149,7 @@ JNIEXPORT void JNICALL Java_org_pEp_jniadapter_Engine_keyResetTrust(
::key_reset_trust(session(), _ident);
}
JNIEXPORT void JNICALL Java_org_pEp_jniadapter_Engine_trustPersonalKey(
JNIEXPORT void JNICALL Java_foundation_pEp_jniadapter_Engine_trustPersonalKey(
JNIEnv *env,
jobject obj,
jobject ident
@ -172,7 +172,7 @@ JNIEXPORT void JNICALL Java_org_pEp_jniadapter_Engine_trustPersonalKey(
::trust_personal_key(session(), _ident);
}
JNIEXPORT void JNICALL Java_org_pEp_jniadapter_Engine_trustOwnKey(
JNIEXPORT void JNICALL Java_foundation_pEp_jniadapter_Engine_trustOwnKey(
JNIEnv *env,
jobject obj,
jobject ident
@ -189,7 +189,7 @@ JNIEXPORT void JNICALL Java_org_pEp_jniadapter_Engine_trustOwnKey(
::trust_own_key(session, _ident);
}
JNIEXPORT void JNICALL Java_org_pEp_jniadapter_Engine_importKey(
JNIEXPORT void JNICALL Java_foundation_pEp_jniadapter_Engine_importKey(
JNIEnv *env,
jobject obj,
jbyteArray key
@ -212,7 +212,7 @@ JNIEXPORT void JNICALL Java_org_pEp_jniadapter_Engine_importKey(
env->ReleaseByteArrayElements(key, (jbyte *) _key, JNI_ABORT);
}
JNIEXPORT void JNICALL Java_org_pEp_jniadapter_Engine_config_1passive_1mode(
JNIEXPORT void JNICALL Java_foundation_pEp_jniadapter_Engine_config_1passive_1mode(
JNIEnv *env,
jobject obj,
jboolean enable
@ -222,7 +222,7 @@ JNIEXPORT void JNICALL Java_org_pEp_jniadapter_Engine_config_1passive_1mode(
}
JNIEXPORT void JNICALL Java_org_pEp_jniadapter_Engine_config_1unencrypted_1subject(
JNIEXPORT void JNICALL Java_foundation_pEp_jniadapter_Engine_config_1unencrypted_1subject(
JNIEnv *env,
jobject obj,
jboolean enable
@ -231,7 +231,7 @@ JNIEXPORT void JNICALL Java_org_pEp_jniadapter_Engine_config_1unencrypted_1subje
::config_unencrypted_subject(session(), (bool)enable);
}
JNIEXPORT void JNICALL Java_org_pEp_jniadapter_Engine_blacklist_1add(
JNIEXPORT void JNICALL Java_foundation_pEp_jniadapter_Engine_blacklist_1add(
JNIEnv *env,
jobject obj,
jbyteArray fpr
@ -252,7 +252,7 @@ JNIEXPORT void JNICALL Java_org_pEp_jniadapter_Engine_blacklist_1add(
}
JNIEXPORT void JNICALL Java_org_pEp_jniadapter_Engine_blacklist_1delete(
JNIEXPORT void JNICALL Java_foundation_pEp_jniadapter_Engine_blacklist_1delete(
JNIEnv *env,
jobject obj,
jbyteArray fpr
@ -273,7 +273,7 @@ JNIEXPORT void JNICALL Java_org_pEp_jniadapter_Engine_blacklist_1delete(
}
JNIEXPORT jboolean JNICALL Java_org_pEp_jniadapter_Engine_blacklist_1is_1listed(
JNIEXPORT jboolean JNICALL Java_foundation_pEp_jniadapter_Engine_blacklist_1is_1listed(
JNIEnv *env,
jobject obj,
jbyteArray fpr
@ -296,7 +296,7 @@ JNIEXPORT jboolean JNICALL Java_org_pEp_jniadapter_Engine_blacklist_1is_1listed(
return (jboolean)_listed;
}
JNIEXPORT jbyteArray JNICALL Java_org_pEp_jniadapter_Engine_getCrashdumpLog(
JNIEXPORT jbyteArray JNICALL Java_foundation_pEp_jniadapter_Engine_getCrashdumpLog(
JNIEnv *env,
jobject obj,
jint dummy,


src/org/pEp/jniadapter/AbstractEngine.java → src/foundation/pEp/jniadapter/AbstractEngine.java View File


src/org/pEp/jniadapter/Blob.java → src/foundation/pEp/jniadapter/Blob.java View File


src/org/pEp/jniadapter/CommType.java → src/foundation/pEp/jniadapter/CommType.java View File


src/org/pEp/jniadapter/Engine.java.target → src/foundation/pEp/jniadapter/Engine.java.target View File


src/org/pEp/jniadapter/Identity.java → src/foundation/pEp/jniadapter/Identity.java View File


src/org/pEp/jniadapter/Message.java.target → src/foundation/pEp/jniadapter/Message.java.target View File


src/org/pEp/jniadapter/Pair.java → src/foundation/pEp/jniadapter/Pair.java View File


src/org/pEp/jniadapter/Sync.java → src/foundation/pEp/jniadapter/Sync.java View File


src/org/pEp/jniadapter/_Blob.java → src/foundation/pEp/jniadapter/_Blob.java View File


src/org/pEp/jniadapter/_Identity.java → src/foundation/pEp/jniadapter/_Identity.java View File


src/org_pEp_jniadapter_AbstractEngine.cc → src/foundation_pEp_jniadapter_AbstractEngine.cc View File


+ 10
- 10
src/gen_cpp_Engine.ysl2 View File

@ -7,7 +7,7 @@ tstylesheet {
template "/namespace[@name='pEp']" apply "interface", 0;
template "interface" document("org_pEp_jniadapter_{@name}.cc", "text")
template "interface" document("foundation_pEp_jniadapter_{@name}.cc", "text")
||
#include <assert.h>
#include <pEp/message_api.h>
@ -15,7 +15,7 @@ tstylesheet {
#include <pEp/openpgp_compat.h>
#include <pEp/key_reset.h>
#include <pEp/Adapter.hh>
#include "org_pEp_jniadapter_«@name».h"
#include "foundation_pEp_jniadapter_«@name».h"
#include "throw_pEp_exception.hh"
#include "jniutils.hh"
@ -72,15 +72,15 @@ tstylesheet {
||
jobject result_ = NULL;
jclass clazz_result_ = findClass(env, "org/pEp/jniadapter/Engine$_«@name»_Return");
jclass clazz_result_ = findClass(env, "foundation/pEp/jniadapter/Engine$_«@name»_Return");
assert(clazz_result_);
jmethodID constructor_result_ = env->GetMethodID(clazz_result_, "<init>", "(Lorg/pEp/jniadapter/Engine;)V");
jmethodID constructor_result_ = env->GetMethodID(clazz_result_, "<init>", "(Lfoundation/pEp/jniadapter/Engine;)V");
assert(constructor_result_);
result_ = env->NewObject(clazz_result_, constructor_result_, obj);
||
apply "parm[returns|creates|inout[../int]]", mode=setresult
with "jtype" > org/pEp/jniadapter/Engine$_«@name»_Return
with "jtype" > foundation/pEp/jniadapter/Engine$_«@name»_Return
||
return result_;
@ -171,10 +171,10 @@ tstylesheet {
||
jobject «$name»_ = NULL;
{
jclass clazz_«$ljtype» = findClass(env, "org/pEp/jniadapter/«$jtype»");
jclass clazz_«$ljtype» = findClass(env, "foundation/pEp/jniadapter/«$jtype»");
assert(clazz_«$ljtype»);
jmethodID method_values = env->GetStaticMethodID(clazz_«$ljtype», "values",
"()[Lorg/pEp/jniadapter/«$jtype»;");
"()[Lfoundation/pEp/jniadapter/«$jtype»;");
assert(method_values);
jfieldID field_value = env->GetFieldID(clazz_«$ljtype», "value", "I");
assert(field_value);
@ -204,7 +204,7 @@ tstylesheet {
||
jobject «$name»_ = NULL;
if (_«$name») {
jclass clazz_«$name»_ = findClass(env, "org/pEp/jniadapter/«$jtype»");
jclass clazz_«$name»_ = findClass(env, "foundation/pEp/jniadapter/«$jtype»");
assert(clazz_«$name»_);
jmethodID constructor_«$name»_ = env->GetMethodID(clazz_«$name»_, "<init>", "(J)V");
assert(constructor_«$name»_);
@ -279,9 +279,9 @@ tstylesheet {
choose {
when "$convert"
> «concat('Java_org_pEp_jniadapter_', ../@name, '__1', str:replace(@name, '_', '_1'))»
> «concat('Java_foundation_pEp_jniadapter_', ../@name, '__1', str:replace(@name, '_', '_1'))»
otherwise
> «concat('Java_org_pEp_jniadapter_', ../@name, '_', str:replace(@name, '_', '_1'))»
> «concat('Java_foundation_pEp_jniadapter_', ../@name, '_', str:replace(@name, '_', '_1'))»
}
}


+ 9
- 9
src/gen_cpp_Message.ysl2 View File

@ -9,7 +9,7 @@ tstylesheet {
template "struct" {
const "jname" call "CamelCase" with "text", "@name";
document("org_pEp_jniadapter_{$jname}.cc", "text") {
document("foundation_pEp_jniadapter_{$jname}.cc", "text") {
||
#include <exception>
#include <new>
@ -21,7 +21,7 @@ tstylesheet {
#include "jniutils.hh"
#include "throw_pEp_exception.hh"
#include "org_pEp_jniadapter_«$jname».h"
#include "foundation_pEp_jniadapter_«$jname».h"
using namespace std;
@ -31,7 +31,7 @@ tstylesheet {
jfieldID handle;
try {
handle = getFieldID(env, "org/pEp/jniadapter/«$jname»", "handle", "J");
handle = getFieldID(env, "foundation/pEp/jniadapter/«$jname»", "handle", "J");
}
catch (std::exception& ex) {
assert(0);
@ -48,7 +48,7 @@ tstylesheet {
using namespace pEp::JNIAdapter;
JNIEXPORT jlong JNICALL
Java_org_pEp_jniadapter_«$jname»_init(JNIEnv *env, jobject obj) {
Java_foundation_pEp_jniadapter_«$jname»_init(JNIEnv *env, jobject obj) {
::«@name» * _obj = ::new_«@name»(PEP_dir_incoming);
if (!_obj) {
outOfMemory(env);
@ -58,14 +58,14 @@ tstylesheet {
}
JNIEXPORT void JNICALL
Java_org_pEp_jniadapter_«$jname»_release(JNIEnv *env, jobject obj, jlong value) {
Java_foundation_pEp_jniadapter_«$jname»_release(JNIEnv *env, jobject obj, jlong value) {
if (value) {
::«@name» *_obj = (::«@name» *) (intptr_t) (int64_t) value;
::free_«@name»(_obj);
}
}
JNIEXPORT jlong JNICALL Java_org_pEp_jniadapter_«$jname»__1«$jname»(
JNIEXPORT jlong JNICALL Java_foundation_pEp_jniadapter_«$jname»__1«$jname»(
JNIEnv *env, jobject msg, jbyteArray mime_text) {
char *_mime_text = to_string(env, mime_text);
@ -78,7 +78,7 @@ tstylesheet {
return (jlong) (int64_t) (intptr_t) _msg;
}
JNIEXPORT jbyteArray JNICALL Java_org_pEp_jniadapter_«$jname»__1encodeMIME(JNIEnv *env, jobject msg)
JNIEXPORT jbyteArray JNICALL Java_foundation_pEp_jniadapter_«$jname»__1encodeMIME(JNIEnv *env, jobject msg)
{
«@name» *_obj = «@name»_ptr(env, msg);
char *mime_text = nullptr;
@ -110,9 +110,9 @@ tstylesheet {
choose {
when "$convert"
> «concat('Java_org_pEp_jniadapter_', $classname, '__1', str:replace($name, '_', '_1'))»
> «concat('Java_foundation_pEp_jniadapter_', $classname, '__1', str:replace($name, '_', '_1'))»
otherwise
> «concat('Java_org_pEp_jniadapter_', $classname, '_', str:replace($name, '_', '_1'))»
> «concat('Java_foundation_pEp_jniadapter_', $classname, '_', str:replace($name, '_', '_1'))»
}
}


+ 2
- 2
src/gen_java_Engine.ysl2 View File

@ -8,9 +8,9 @@ tstylesheet {
template "interface" {
const "cname" call "toJava" with "type", "@name";
document("org/pEp/jniadapter/{$cname}.java", "text")
document("foundation/pEp/jniadapter/{$cname}.java", "text")
||
package org.pEp.jniadapter;
package foundation.pEp.jniadapter;
import java.util.ArrayList;
import java.util.Vector;


+ 4
- 4
src/gen_java_Message.ysl2 View File

@ -8,9 +8,9 @@ tstylesheet {
template "struct" {
const "cname" call "toJava" with "type", "@name";
document("org/pEp/jniadapter/{$cname}.java", "text")
document("foundation/pEp/jniadapter/{$cname}.java", "text")
||
package org.pEp.jniadapter;
package foundation.pEp.jniadapter;
import java.util.ArrayList;
import java.util.Vector;
@ -64,9 +64,9 @@ tstylesheet {
template "enum|exception" {
const "jname" call "toJava" with "type", "@name";
document("org/pEp/jniadapter/{$jname}.java", "text")
document("foundation/pEp/jniadapter/{$jname}.java", "text")
||
package org.pEp.jniadapter;
package foundation.pEp.jniadapter;
import java.util.HashMap;


+ 3
- 3
src/gen_java_exceptions.ysl2 View File

@ -4,7 +4,7 @@ tstylesheet {
include ./textutils.ysl2
template "/" {
| package org.pEp.jniadapter;
| package foundation.pEp.jniadapter;
|
| public class pEpException extends RuntimeException {
| public pEpException(String message) {
@ -18,8 +18,8 @@ tstylesheet {
function "exception" {
param "name";
document "org/pEp/jniadapter/{$name}.java", "text" {
| package org.pEp.jniadapter;
document "foundation/pEp/jniadapter/{$name}.java", "text" {
| package foundation.pEp.jniadapter;
|
| public class «$name» extends pEpException {
| public «$name»(String message) {


+ 1
- 1
src/gen_throw_pEp_exception.ysl2 View File

@ -57,7 +57,7 @@ tstylesheet {
template "*", mode=case {
| case `call "UCASE" with "text", "name(.)"`:
| ex_name = "org/pEp/jniadapter/`call "CamelCase" with "text", "name(.)"`";
| ex_name = "foundation/pEp/jniadapter/`call "CamelCase" with "text", "name(.)"`";
| break;
}
}


+ 11
- 11
src/jniutils.cc View File

@ -294,7 +294,7 @@ namespace pEp {
return (jobject) NULL;
jclass clazz = findClass(env, "java/util/ArrayList");
jclass clazz_pair = findClass(env, "org/pEp/jniadapter/Pair");
jclass clazz_pair = findClass(env, "foundation/pEp/jniadapter/Pair");
jmethodID constructor = env->GetMethodID(clazz, "<init>", "()V");
assert(constructor);
jmethodID constructor_pair = env->GetMethodID(clazz_pair, "<init>",
@ -337,9 +337,9 @@ namespace pEp {
if (size == 0)
return NULL;
jfieldID first_id = getFieldID(env, "org/pEp/jniadapter/Pair",
jfieldID first_id = getFieldID(env, "foundation/pEp/jniadapter/Pair",
"first", "Ljava/lang/Object;");
jfieldID second_id = getFieldID(env, "org/pEp/jniadapter/Pair",
jfieldID second_id = getFieldID(env, "foundation/pEp/jniadapter/Pair",
"second", "Ljava/lang/Object;");
stringpair_list_t *sl = new_stringpair_list(NULL);
@ -449,7 +449,7 @@ namespace pEp {
if (!ident)
return (jobject) NULL;
static const char *classname = "org/pEp/jniadapter/_Identity";
static const char *classname = "foundation/pEp/jniadapter/_Identity";
jclass clazz = findClass(env, classname);
jmethodID constructor = env->GetMethodID(clazz, "<init>", "()V");
assert(constructor);
@ -484,7 +484,7 @@ namespace pEp {
if (!ident)
return (jobject) NULL;
static const char *classname = "org/pEp/jniadapter/_Identity";
static const char *classname = "foundation/pEp/jniadapter/_Identity";
jmethodID constructor = env->GetMethodID(identityClass, "<init>", "()V");
assert(constructor);
jobject obj = env->NewObject(identityClass, constructor);
@ -527,7 +527,7 @@ namespace pEp {
if (!obj)
return NULL;
static const char *classname = "org/pEp/jniadapter/_Identity";
static const char *classname = "foundation/pEp/jniadapter/_Identity";
pEp_identity *ident = new_identity(NULL, NULL, NULL, NULL);
ident->address = _getStringField(env, classname, obj, "address");
@ -603,7 +603,7 @@ namespace pEp {
if (!b)
return (jobject) NULL;
static const char *classname = "org/pEp/jniadapter/_Blob";
static const char *classname = "foundation/pEp/jniadapter/_Blob";
jclass clazz = findClass(env, classname);
jmethodID constructor = env->GetMethodID(clazz, "<init>", "()V");
assert(constructor);
@ -653,7 +653,7 @@ namespace pEp {
if (size == 0)
return NULL;
static const char *classname = "org/pEp/jniadapter/_Blob";
static const char *classname = "foundation/pEp/jniadapter/_Blob";
jclass clazz = findClass(env, classname);
jfieldID data_id = getFieldID(env, classname, "data", "[B");
@ -689,7 +689,7 @@ namespace pEp {
PEP_enc_format to_EncFormat(JNIEnv *env, jobject obj)
{
static const char *classname = "org/pEp/jniadapter/Message$EncFormat";
static const char *classname = "foundation/pEp/jniadapter/Message$EncFormat";
jclass clazz_enc_format = findClass(env, classname);
jfieldID field_value = env->GetFieldID(clazz_enc_format, "value", "I");
assert(field_value);
@ -700,7 +700,7 @@ namespace pEp {
PEP_CIPHER_SUITE to_CipherSuite(JNIEnv *env, jobject obj)
{
static const char *classname = "org/pEp/jniadapter/Message$CipherSuite";
static const char *classname = "foundation/pEp/jniadapter/Message$CipherSuite";
jclass clazz_enc_format = findClass(env, classname);
jfieldID field_value = env->GetFieldID(clazz_enc_format, "value", "I");
assert(field_value);
@ -711,7 +711,7 @@ namespace pEp {
sync_handshake_result to_SyncHandshakeResult(JNIEnv *env, jobject obj)
{
static const char *classname = "org/pEp/jniadapter/SyncHandshakeResult";
static const char *classname = "foundation/pEp/jniadapter/SyncHandshakeResult";
jclass clazz_enc_format = findClass(env, classname);
jfieldID field_value = env->GetFieldID(clazz_enc_format, "value", "I");
assert(field_value);


+ 6
- 6
src/types_java.ysl2 View File

@ -39,18 +39,18 @@ function "toSig" {
when "$type='timestamp'" > java/util/Date
when "$type='int'" > java/lang/Integer
when "$type='identity'" > org/pEp/jniadapter/_Identity
when "$type='message'" > org/pEp/jniadapter/Message
when "$type='identity'" > foundation/pEp/jniadapter/_Identity
when "$type='message'" > foundation/pEp/jniadapter/Message
when "$type='bloblist'" > java/util/Vector
when "$type='identitylist'" > java/util/Vector
when "$type='stringlist'" > java/util/Vector
when "$type='stringpairlist'" > java/util/ArrayList
when "$type='Color'" > org/pEp/jniadapter/Color
when "$type='DecryptFlags'" > org/pEp/jniadapter/DecryptFlags
when "$type='EncFormat'" > org/pEp/jniadapter/Message/EncFormat
when "$type='Rating'" > org/pEp/jniadapter/Rating
when "$type='Color'" > foundation/pEp/jniadapter/Color
when "$type='DecryptFlags'" > foundation/pEp/jniadapter/DecryptFlags
when "$type='EncFormat'" > foundation/pEp/jniadapter/Message/EncFormat
when "$type='Rating'" > foundation/pEp/jniadapter/Rating
otherwise error | # cannot declare "«$type»"
}


+ 1
- 1
test/SyncCallbacks.java View File

@ -1,4 +1,4 @@
import org.pEp.jniadapter.*;
import foundation.pEp.jniadapter.*;
class SyncCallbacks implements Sync.MessageToSendCallback, Sync.NotifyHandshakeCallback {
public void messageToSend(Message message)


+ 1
- 1
test/Testing.java View File

@ -1,4 +1,4 @@
import org.pEp.jniadapter.*;
import foundation.pEp.jniadapter.*;
import java.util.Vector;
import java.net.URL;
import java.net.URLClassLoader;


Loading…
Cancel
Save