X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=java_strings.py;h=16f59b62dcbb940883d6cd6d388bd2a6aa9025c3;hb=36a5d30e562005ee6ddd8d69b7c3b10749f4448b;hp=2e9ae67052d7d06fe6873065da9004d0a72fc4a2;hpb=ba97d8dee5ef43b8b61c9a61e30789cdf8eb9c5e;p=ldk-java diff --git a/java_strings.py b/java_strings.py index 2e9ae670..16f59b62 100644 --- a/java_strings.py +++ b/java_strings.py @@ -7,7 +7,7 @@ class Consts: uint8_t = ['byte'], uint16_t = ['short'], uint32_t = ['int'], - long = ['long'], + uint64_t = ['long'], ) self.to_hu_conv_templates = dict( @@ -702,6 +702,12 @@ import java.util.Arrays; return (out_java, out_java_trait, out_c) + def trait_struct_inc_refcnt(self, ty_info): + base_conv = "\nif (" + ty_info.var_name + "_conv.free == " + ty_info.rust_obj + "_JCalls_free) {\n" + base_conv = base_conv + "\t// If this_arg is a JCalls struct, then we need to increment the refcnt in it.\n" + base_conv = base_conv + "\t" + ty_info.rust_obj + "_JCalls_clone(" + ty_info.var_name + "_conv.this_arg);\n}" + return base_conv + def map_complex_enum(self, struct_name, variant_list, camel_to_snake): java_hu_type = struct_name.replace("LDK", "") out_java_enum = ""