diff --git a/src/gen_cpp_Engine.ysl2 b/src/gen_cpp_Engine.ysl2 index 8a12367..1024f54 100644 --- a/src/gen_cpp_Engine.ysl2 +++ b/src/gen_cpp_Engine.ysl2 @@ -31,6 +31,8 @@ tstylesheet { const "returning", "count(parm/creates|parm/returns)"; const "CretType" choose { when "$returning = 0" > void + when "$returning = 1" + call "jni_type" with "type", "name(parm[returns|creates]/*[2])"; when "$returning > 0" > jobject } const "CretDefault" choose { @@ -124,13 +126,22 @@ tstylesheet { param "name", "name(*[3])"; choose { - when "$type = 'stringlist' or $type = 'stringpairlist' or $type = 'identity' or $type = 'identitylist'" - || - jobject «$name»_ = NULL; - if (_«$name») - «$name»_ = from_«$type»(env, _«$name»); + when "$type = 'stringlist' or $type = 'string' or $type = 'sstring' or $type = 'stringpairlist' or $type = 'identity' or $type = 'identitylist'" + { + const "jnitype" call "jni_type" with "type", "$type"; + const "from_type" choose { + when "$type = 'sstring'" + > from_string + otherwise + > from_«$type» + } + || + «$jnitype» «$name»_ = NULL; + if (_«$name») + «$name»_ = «$from_type»(env, _«$name»); - || + || + } when "ancestor::namespace/child::enum[@name=$type]" { const "ljtype" call "lcase" with "text","$jtype"; @@ -203,6 +214,10 @@ tstylesheet { choose { when "ancestor::namespace/child::enum[@name=$type]" | √$type _«$name»; + when "$type='sstring'"{ + | char * _«$name»; + | size_t _«$name»_size; + } otherwise | √$type *_«$name»; } @@ -210,6 +225,7 @@ tstylesheet { template "parm", mode=call { const "dir", "name(*[1])"; + const "type", "name(*[2])"; const "name", "name(*[3])"; > , @@ -217,12 +233,12 @@ tstylesheet { choose { when "$dir = 'Cconst'" value "*[3]"; - when "$dir = 'creates' or $dir = 'returns'" { + when "($dir = 'creates' or $dir = 'returns') and $type='sstring'" + > &_«$name», &_«$name»_size + when "$dir = 'creates' or $dir = 'returns'" > &_«$name» - } - otherwise { + otherwise > _«$name» - } } } diff --git a/src/gen_java_Engine.ysl2 b/src/gen_java_Engine.ysl2 index ded1be1..b921ff0 100644 --- a/src/gen_java_Engine.ysl2 +++ b/src/gen_java_Engine.ysl2 @@ -132,7 +132,7 @@ tstylesheet { // TODO factorize type conversion with multireturn and gen_java_message.java - when "count(parm[returns]/stringlist|parm[returns]/string) > 0" + when "count(parm[returns][stringlist|string|sstring]) > 0" |> return AbstractEngine.toUTF16(_«@name»(`apply "parm[in]", mode=call;`)); when "count(parm[returns]/stringpairlist) > 0" || diff --git a/src/pEp.yml2 b/src/pEp.yml2 index beab2e9..30d8b02 100644 --- a/src/pEp.yml2 +++ b/src/pEp.yml2 @@ -203,6 +203,14 @@ namespace pEp { returns identitylist identities ); + method get_trustwords( + in identity id1, + in identity id2, + in string lang, + returns sstring words, + in bool full + ); + basic string trustwords(identity ident); basic identity myself(identity ident); basic identity updateIdentity(identity ident); diff --git a/src/types_c.ysl2 b/src/types_c.ysl2 index 5f5ff29..6b16ed9 100644 --- a/src/types_c.ysl2 +++ b/src/types_c.ysl2 @@ -3,7 +3,7 @@ function "toC" { choose { when "$type='stringlist'" > stringlist_t - when "$type='string'" > char + when "$type='string' or $type='sstring'" > char when "$type='identity'" > pEp_identity when "$type='identitylist'" > identity_list when "$type='timestamp'" > timestamp @@ -25,7 +25,7 @@ function "jni_type" { choose { when "../enum[@name=$type]" > jint - when "$type = 'string'" > jbyteArray + when "$type = 'string' or $type = 'sstring'" > jbyteArray when "$type='bool'" > jboolean when "$type='int'" > jint otherwise > jobject diff --git a/src/types_java.ysl2 b/src/types_java.ysl2 index e5d0a96..de0029d 100644 --- a/src/types_java.ysl2 +++ b/src/types_java.ysl2 @@ -4,7 +4,7 @@ function "toJava" { choose { when "$type='bool'" > Boolean when "$type='int'" > Integer - when "$type='string'" > String + when "$type='string' or $type='sstring'" > String when "$type='timestamp'" > Date when "$type='void'" > void @@ -62,7 +62,7 @@ function "toIntermediate" { choose { when "$type='bool'" > boolean when "$type='int'" > int - when "$type='string'" > byte[] + when "$type='string' or $type='sstring'" > byte[] when "$type='bloblist'" > Vector<_Blob> when "$type='identity'" > _Identity