[TS] Update auto-generated bindings to LDK-C-Bindings 0.0.123.1
[ldk-java] / csharp_strings.py
index e1c2708e82e32ebcce0ea8dabe509c012675397a..3b0f9f1a411054fd0c910e046b4b8a87612a666b 100644 (file)
@@ -442,7 +442,8 @@ static inline LDKStr str_ref_to_owned_c(const jstring str) {
        return res;
 }
 
        return res;
 }
 
-typedef bool jboolean;
+// The C# Bool marshalling is defined as 4 bytes, but the size of bool is platform-dependent
+typedef int32_t jboolean;
 
 int64_t CS_LDK_allocate_buffer(int64_t len) {
        return (int64_t)MALLOC(len, "C#-requested buffer");
 
 int64_t CS_LDK_allocate_buffer(int64_t len) {
        return (int64_t)MALLOC(len, "C#-requested buffer");
@@ -576,12 +577,12 @@ int CS_LDK_register_{fn_suffix}_invoker(invoker_{fn_suffix} invoker) {{
         return "InternalUtils.getArrayLength(" + arr_name + ")"
 
     def get_java_arr_elem(self, elem_ty, arr_name, idx):
         return "InternalUtils.getArrayLength(" + arr_name + ")"
 
     def get_java_arr_elem(self, elem_ty, arr_name, idx):
-        if elem_ty.c_ty == "int64_t" or elem_ty.c_ty == "uint64_t" or elem_ty.c_ty.endswith("Array") or elem_ty.c_ty == "uintptr_t":
+        if elem_ty.c_ty == "int64_t" or elem_ty.c_ty == "uint64_t":
+            return "InternalUtils.getU64ArrayElem(" + arr_name + ", " + idx + ")"
+        elif elem_ty.c_ty.endswith("Array") or elem_ty.c_ty == "uintptr_t" or elem_ty.rust_obj == "LDKStr":
             return "InternalUtils.getU64ArrayElem(" + arr_name + ", " + idx + ")"
         elif elem_ty.rust_obj == "LDKU5":
             return "InternalUtils.getU8ArrayElem(" + arr_name + ", " + idx + ")"
             return "InternalUtils.getU64ArrayElem(" + arr_name + ", " + idx + ")"
         elif elem_ty.rust_obj == "LDKU5":
             return "InternalUtils.getU8ArrayElem(" + arr_name + ", " + idx + ")"
-        elif elem_ty.rust_obj == "LDKStr":
-            return "InternalUtils.getU64ArrayElem(" + arr_name + ", " + idx + ")"
         else:
             assert False
 
         else:
             assert False
 
@@ -1179,7 +1180,7 @@ public class {struct_name.replace("LDK","")} : CommonBase {{
         out_opaque_struct_human = ""
         out_opaque_struct_human += self.hu_struct_file_prefix
         out_opaque_struct_human += "\n/**\n * " + struct_doc_comment.replace("\n", "\n * ") + "\n */\n"
         out_opaque_struct_human = ""
         out_opaque_struct_human += self.hu_struct_file_prefix
         out_opaque_struct_human += "\n/**\n * " + struct_doc_comment.replace("\n", "\n * ") + "\n */\n"
-        hu_name = struct_name.replace("LDKC2Tuple", "TwoTuple").replace("LDKC3Tuple", "ThreeTuple").replace("LDK", "")
+        hu_name = struct_name.replace("LDKC2Tuple", "TwoTuple").replace("LDKC3Tuple", "ThreeTuple").replace("LDKC4Tuple", "FourTuple").replace("LDK", "")
         out_opaque_struct_human += ("public class " + hu_name + " : CommonBase")
         if struct_name.startswith("LDKLocked") or struct_name.startswith("LDKReadOnly"):
             out_opaque_struct_human += (", IDisposable")
         out_opaque_struct_human += ("public class " + hu_name + " : CommonBase")
         if struct_name.startswith("LDKLocked") or struct_name.startswith("LDKReadOnly"):
             out_opaque_struct_human += (", IDisposable")