self.function_ptr_counter = 0
self.function_ptrs = {}
self.c_type_map = dict(
+ bool = ['boolean', 'boolean', 'XXX'],
uint8_t = ['number', 'number', 'Uint8Array'],
uint16_t = ['number', 'number', 'Uint16Array'],
uint32_t = ['number', 'number', 'Uint32Array'],
}
const fn_list = ["uuuuuu", "buuuuu", "bbuuuu", "bbbuuu", "bbbbuu",
- "bbbbbb", "ubuubu", "ubuuuu", "ubbuuu", "uubuuu", "uububu"];
+ "bbbbbb", "ubuubu", "ubuuuu", "ubbuuu", "uubuuu", "uububu", "ububuu"];
/* @internal */
export async function initializeWasmFromUint8Array(wasmBinary: Uint8Array) {
return "<git_version_ldk_garbagecollected>";
}"""
- self.bindings_footer = ""
-
self.common_base = """
function freer(f: () => void) { f() }
const finalizer = new FinalizationRegistry(freer);
import * as bindings from '../bindings.mjs'
"""
+ self.hu_struct_file_suffix = ""
self.util_fn_pfx = self.hu_struct_file_prefix + "\nexport class UtilMethods extends CommonBase {\n"
self.util_fn_sfx = "}"
self.c_fn_ty_pfx = ""
self.is_arr_some_check = ("", " != 0")
self.get_native_arr_len_call = ("", "->arr_len")
+ def bindings_footer(self):
+ return ""
+
def release_native_arr_ptr_call(self, ty_info, arr_var, arr_ptr_var):
return None
def create_native_arr_call(self, arr_len, ty_info):
if ty_info.c_ty == "ptrArray":
- assert ty_info.rust_obj == "LDKCVec_u5Z" or (ty_info.subty is not None and ty_info.subty.c_ty.endswith("Array"))
+ assert ty_info.rust_obj == "LDKCVec_U5Z" or (ty_info.subty is not None and ty_info.subty.c_ty.endswith("Array"))
return "init_" + ty_info.c_ty + "(" + arr_len + ", __LINE__)"
def set_native_arr_contents(self, arr_name, arr_len, ty_info):
if ty_info.c_ty == "int8_tArray":
return "FREE(" + arr_name + ")"
def map_hu_array_elems(self, arr_name, conv_name, arr_ty, elem_ty):
- if elem_ty.rust_obj == "LDKu5":
+ if elem_ty.rust_obj == "LDKU5":
return arr_name + " != null ? bindings.uint5ArrToBytes(" + arr_name + ") : null"
assert elem_ty.c_ty == "uint64_t" or elem_ty.c_ty.endswith("Array")
return arr_name + " != null ? " + arr_name + ".map(" + conv_name + " => " + elem_ty.from_hu_conv[0] + ") : null"
return "bindings.getU32ArrayElem(" + arr_name + ", " + idx + ")"
elif elem_ty.c_ty == "uint64_t":
return "bindings.getU64ArrayElem(" + arr_name + ", " + idx + ")"
- elif elem_ty.rust_obj == "LDKu5":
+ elif elem_ty.rust_obj == "LDKU5":
return "bindings.getU8ArrayElem(" + arr_name + ", " + idx + ")"
else:
assert False
out_c = out_c + arg_info.ret_conv[1].replace('\n', '\n\t') + "\n"
fn_suffix = ""
- assert len(fn_line.args_ty) < 6
+ assert len(fn_line.args_ty) < 7
for arg_info in fn_line.args_ty:
if arg_info.c_ty == "uint64_t" or arg_info.c_ty == "int64_t":
fn_suffix += "b"