diff --git a/src/Makefile b/src/Makefile index e4f845d..a6c0cb6 100644 --- a/src/Makefile +++ b/src/Makefile @@ -36,7 +36,7 @@ org_pEp_jniadapter_AbstractEngine.o: %.o: %.cc %.h throw_pEp_exception.hh jniuti org_pEp_jniadapter_Engine.o org_pEp_jniadapter_Message.o: %.o: %.cc %.h -$(LIBRARY): org_pEp_jniadapter_AbstractEngine.o org_pEp_jniadapter_Engine.o org_pEp_jniadapter_Message.o throw_pEp_exception.o jniutils.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 ar -r $@ *.o org/pEp/jniadapter/pEpException.java: pEp.yml2 gen_java_exceptions.ysl2 @@ -59,6 +59,8 @@ throw_pEp_exception.cc throw_pEp_exception.hh: pEp.yml2 gen_throw_pEp_exception. throw_pEp_exception.o: throw_pEp_exception.cc throw_pEp_exception.hh +basic_api.o: basic_api.cc jniutils.hh throw_pEp_exception.hh + .PHONY: clean clean: diff --git a/src/gen_java_Engine.ysl2 b/src/gen_java_Engine.ysl2 index 6366b4c..0e2c86b 100644 --- a/src/gen_java_Engine.ysl2 +++ b/src/gen_java_Engine.ysl2 @@ -18,6 +18,12 @@ tstylesheet { public «$cname»() throws pEpException { } `` apply "method", mode=plain + private native byte[] trustwords(_Identity ident); + + public String trustwords(Identity ident) { + _Identity _ident = new _Identity(ident); + return AbstractEngine.toUTF16(trustwords(_ident)); + } } || @@ -47,6 +53,7 @@ tstylesheet { template "method", mode=plain { const "convert", "count(parm/stringlist|parm/string|parm/identity) > 0"; + const "convertreturn", "count(parm[returns]/stringlist|parm[returns]/string|parm[returns]/identity) > 0"; const "singlereturn", "count(parm/creates|parm/returns) = 1"; const "multireturn", "count(parm/creates|parm/returns) > 1"; @@ -85,7 +92,12 @@ tstylesheet { | { apply "parm", mode=convertIn; - if "$singlereturn" |> return _«@name»(`apply "parm[in]", mode=call;`); + if "$singlereturn" choose { + when "$convertreturn" + |> return AbstractEngine.toUTF16(_«@name»(`apply "parm[in]", mode=call;`)); + otherwise + |> return _«@name»(`apply "parm[in]", mode=call;`); + } if "$multireturn" || @@ -97,9 +109,11 @@ tstylesheet { || } - || } + || + + || } template "parm", mode=java {