@@ -264,7 +264,7 @@ def java_c_types(fn_arg, ret_arr_len):
264264 fn_arg = fn_arg [4 :].strip ()
265265 is_primitive = True
266266 elif fn_arg .startswith ("bool" ):
267- java_ty = "boolean"
267+ java_ty = consts . c_type_map [ 'bool' ][ 0 ]
268268 c_ty = "jboolean"
269269 fn_ty_arg = "Z"
270270 arr_ty = "bool"
@@ -1059,6 +1059,7 @@ def map_tuple(struct_name, field_lines):
10591059 with open (f"{ sys .argv [3 ]} /structs/TxOut{ consts .file_ext } " , "w" ) as out_java_struct :
10601060 out_java_struct .write (consts .hu_struct_file_prefix )
10611061 out_java_struct .write (consts .txout_defn )
1062+ out_java_struct .write (consts .hu_struct_file_suffix )
10621063 fn_line = "struct LDKCVec_u8Z TxOut_get_script_pubkey (struct LDKTxOut* thing)"
10631064 write_c (fn_line + " {" )
10641065 write_c ("\t return CVec_u8Z_clone(&thing->script_pubkey);" )
@@ -1073,6 +1074,7 @@ def map_tuple(struct_name, field_lines):
10731074 with open (f"{ sys .argv [3 ]} /structs/BigEndianScalar{ consts .file_ext } " , "w" ) as out_java_struct :
10741075 out_java_struct .write (consts .hu_struct_file_prefix )
10751076 out_java_struct .write (consts .scalar_defn )
1077+ out_java_struct .write (consts .hu_struct_file_suffix )
10761078 fn_line = "struct LDKThirtyTwoBytes BigEndianScalar_get_bytes (struct LDKBigEndianScalar* thing)"
10771079 write_c (fn_line + " {\n " )
10781080 write_c ("\t LDKThirtyTwoBytes ret = { .data = *thing->big_endian_bytes };\n " )
@@ -1123,23 +1125,23 @@ def map_tuple(struct_name, field_lines):
11231125 else :
11241126 assert (line == "\n " )
11251127
1126- out_java .write (consts .bindings_footer )
1128+ out_java .write (consts .bindings_footer () )
11271129 for struct_name in opaque_structs :
11281130 with open (f"{ sys .argv [3 ]} /structs/{ struct_name .replace ('LDK' , '' )} { consts .file_ext } " , "a" ) as out_java_struct :
1129- out_java_struct .write ("}\n " )
1131+ out_java_struct .write ("}\n " + consts . hu_struct_file_suffix )
11301132 for struct_name in trait_structs :
11311133 with open (f"{ sys .argv [3 ]} /structs/{ struct_name .replace ('LDK' , '' )} { consts .file_ext } " , "a" ) as out_java_struct :
1132- out_java_struct .write ("}\n " )
1134+ out_java_struct .write ("}\n " + consts . hu_struct_file_suffix )
11331135 for struct_name in complex_enums :
11341136 with open (f"{ sys .argv [3 ]} /structs/{ struct_name .replace ('LDK' , '' ).replace ('COption' , 'Option' )} { consts .file_ext } " , "a" ) as out_java_struct :
1135- out_java_struct .write ("}\n " )
1137+ out_java_struct .write ("}\n " + consts . hu_struct_file_suffix )
11361138 for struct_name in result_types :
11371139 with open (f"{ sys .argv [3 ]} /structs/{ struct_name .replace ('LDKCResult' , 'Result' )} { consts .file_ext } " , "a" ) as out_java_struct :
1138- out_java_struct .write ("}\n " )
1140+ out_java_struct .write ("}\n " + consts . hu_struct_file_suffix )
11391141 for struct_name in tuple_types :
11401142 struct_hu_name = struct_name .replace ("LDKC2Tuple" , "TwoTuple" ).replace ("LDKC3Tuple" , "ThreeTuple" )
11411143 with open (f"{ sys .argv [3 ]} /structs/{ struct_hu_name } { consts .file_ext } " , "a" ) as out_java_struct :
1142- out_java_struct .write ("}\n " )
1144+ out_java_struct .write ("}\n " + consts . hu_struct_file_suffix )
11431145
11441146with open (f"{ sys .argv [4 ]} /bindings.c.body" , "w" ) as out_c :
11451147 out_c .write (consts .c_file_pfx )
0 commit comments