public static native boolean LDKCResult_TxOutAccessErrorZ_result_ok(long arg);
public static native long LDKCResult_TxOutAccessErrorZ_get_ok(long arg);
public static native AccessError LDKCResult_TxOutAccessErrorZ_get_err(long arg);
- public static native long LDKC2Tuple_usizeTransactionZ_new(long a, byte[] b);
// uintptr_t C2Tuple_usizeTransactionZ_get_a(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR tuple);
public static native long C2Tuple_usizeTransactionZ_get_a(long tuple);
// struct LDKTransaction C2Tuple_usizeTransactionZ_get_b(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR tuple);
public static native boolean LDKCResult_NoneNoneZ_result_ok(long arg);
public static native void LDKCResult_NoneNoneZ_get_ok(long arg);
public static native void LDKCResult_NoneNoneZ_get_err(long arg);
- public static native long LDKC2Tuple_SignatureCVec_SignatureZZ_new(byte[] a, byte[][] b);
// struct LDKSignature C2Tuple_SignatureCVec_SignatureZZ_get_a(LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR tuple);
public static native byte[] C2Tuple_SignatureCVec_SignatureZZ_get_a(long tuple);
// struct LDKCVec_SignatureZ C2Tuple_SignatureCVec_SignatureZZ_get_b(LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR tuple);
public static native boolean LDKCResult_TransactionNoneZ_result_ok(long arg);
public static native byte[] LDKCResult_TransactionNoneZ_get_ok(long arg);
public static native void LDKCResult_TransactionNoneZ_get_err(long arg);
- public static native long LDKC2Tuple_BlockHashChannelMonitorZ_new(byte[] a, long b);
// struct LDKThirtyTwoBytes C2Tuple_BlockHashChannelMonitorZ_get_a(LDKC2Tuple_BlockHashChannelMonitorZ *NONNULL_PTR tuple);
public static native byte[] C2Tuple_BlockHashChannelMonitorZ_get_a(long tuple);
// struct LDKChannelMonitor C2Tuple_BlockHashChannelMonitorZ_get_b(LDKC2Tuple_BlockHashChannelMonitorZ *NONNULL_PTR tuple);
public static native boolean LDKCResult_NonePaymentSendFailureZ_result_ok(long arg);
public static native void LDKCResult_NonePaymentSendFailureZ_get_ok(long arg);
public static native long LDKCResult_NonePaymentSendFailureZ_get_err(long arg);
- public static native long LDKC2Tuple_PaymentHashPaymentIdZ_new(byte[] a, long b);
// struct LDKThirtyTwoBytes C2Tuple_PaymentHashPaymentIdZ_get_a(LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR tuple);
public static native byte[] C2Tuple_PaymentHashPaymentIdZ_get_a(long tuple);
// struct LDKPaymentId C2Tuple_PaymentHashPaymentIdZ_get_b(LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR tuple);
static { LDKNetAddress.init(); }
public static native LDKNetAddress LDKNetAddress_ref_from_ptr(long ptr);
public static native long LDKCVec_NetAddressZ_new(long[] elems);
- public static native long LDKC2Tuple_PaymentHashPaymentSecretZ_new(byte[] a, byte[] b);
// struct LDKThirtyTwoBytes C2Tuple_PaymentHashPaymentSecretZ_get_a(LDKC2Tuple_PaymentHashPaymentSecretZ *NONNULL_PTR tuple);
public static native byte[] C2Tuple_PaymentHashPaymentSecretZ_get_a(long tuple);
// struct LDKThirtyTwoBytes C2Tuple_PaymentHashPaymentSecretZ_get_b(LDKC2Tuple_PaymentHashPaymentSecretZ *NONNULL_PTR tuple);
void log(String record);
}
public static native long LDKLogger_new(LDKLogger impl);
- public static native long LDKC2Tuple_BlockHashChannelManagerZ_new(byte[] a, long b);
// struct LDKThirtyTwoBytes C2Tuple_BlockHashChannelManagerZ_get_a(LDKC2Tuple_BlockHashChannelManagerZ *NONNULL_PTR tuple);
public static native byte[] C2Tuple_BlockHashChannelManagerZ_get_a(long tuple);
// struct LDKChannelManager *C2Tuple_BlockHashChannelManagerZ_get_b(LDKC2Tuple_BlockHashChannelManagerZ *NONNULL_PTR tuple);
public static native boolean LDKCResult_SignedRawInvoiceNoneZ_result_ok(long arg);
public static native long LDKCResult_SignedRawInvoiceNoneZ_get_ok(long arg);
public static native void LDKCResult_SignedRawInvoiceNoneZ_get_err(long arg);
- public static native long LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ_new(long a, byte[] b, long c);
// struct LDKRawInvoice C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_a(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR tuple);
public static native long C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_a(long tuple);
// struct LDKThirtyTwoBytes C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_b(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR tuple);
public static native boolean LDKCResult_NoneMonitorUpdateErrorZ_result_ok(long arg);
public static native void LDKCResult_NoneMonitorUpdateErrorZ_get_ok(long arg);
public static native long LDKCResult_NoneMonitorUpdateErrorZ_get_err(long arg);
- public static native long LDKC2Tuple_OutPointScriptZ_new(long a, byte[] b);
// struct LDKOutPoint C2Tuple_OutPointScriptZ_get_a(LDKC2Tuple_OutPointScriptZ *NONNULL_PTR tuple);
public static native long C2Tuple_OutPointScriptZ_get_a(long tuple);
// struct LDKCVec_u8Z C2Tuple_OutPointScriptZ_get_b(LDKC2Tuple_OutPointScriptZ *NONNULL_PTR tuple);
public static native byte[] C2Tuple_OutPointScriptZ_get_b(long tuple);
- public static native long LDKC2Tuple_u32ScriptZ_new(int a, byte[] b);
// uint32_t C2Tuple_u32ScriptZ_get_a(LDKC2Tuple_u32ScriptZ *NONNULL_PTR tuple);
public static native int C2Tuple_u32ScriptZ_get_a(long tuple);
// struct LDKCVec_u8Z C2Tuple_u32ScriptZ_get_b(LDKC2Tuple_u32ScriptZ *NONNULL_PTR tuple);
public static native byte[] C2Tuple_u32ScriptZ_get_b(long tuple);
public static native long LDKCVec_C2Tuple_u32ScriptZZ_new(long[] elems);
- public static native long LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new(byte[] a, long[] b);
// struct LDKThirtyTwoBytes C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_a(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *NONNULL_PTR tuple);
public static native byte[] C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_a(long tuple);
// struct LDKCVec_C2Tuple_u32ScriptZZ C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_b(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *NONNULL_PTR tuple);
static { LDKEvent.init(); }
public static native LDKEvent LDKEvent_ref_from_ptr(long ptr);
public static native long LDKCVec_EventZ_new(long[] elems);
- public static native long LDKC2Tuple_u32TxOutZ_new(int a, long b);
// uint32_t C2Tuple_u32TxOutZ_get_a(LDKC2Tuple_u32TxOutZ *NONNULL_PTR tuple);
public static native int C2Tuple_u32TxOutZ_get_a(long tuple);
// struct LDKTxOut C2Tuple_u32TxOutZ_get_b(LDKC2Tuple_u32TxOutZ *NONNULL_PTR tuple);
public static native long C2Tuple_u32TxOutZ_get_b(long tuple);
public static native long LDKCVec_C2Tuple_u32TxOutZZ_new(long[] elems);
- public static native long LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(byte[] a, long[] b);
// struct LDKThirtyTwoBytes C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_a(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR tuple);
public static native byte[] C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_a(long tuple);
// struct LDKCVec_C2Tuple_u32TxOutZZ C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_b(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR tuple);
public static native boolean LDKCResult_NoneLightningErrorZ_result_ok(long arg);
public static native void LDKCResult_NoneLightningErrorZ_get_ok(long arg);
public static native long LDKCResult_NoneLightningErrorZ_get_err(long arg);
- public static native long LDKC2Tuple_PublicKeyTypeZ_new(byte[] a, long b);
// struct LDKPublicKey C2Tuple_PublicKeyTypeZ_get_a(LDKC2Tuple_PublicKeyTypeZ *NONNULL_PTR tuple);
public static native byte[] C2Tuple_PublicKeyTypeZ_get_a(long tuple);
// struct LDKType C2Tuple_PublicKeyTypeZ_get_b(LDKC2Tuple_PublicKeyTypeZ *NONNULL_PTR tuple);
public static native boolean LDKCResult_boolLightningErrorZ_result_ok(long arg);
public static native boolean LDKCResult_boolLightningErrorZ_get_ok(long arg);
public static native long LDKCResult_boolLightningErrorZ_get_err(long arg);
- public static native long LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(long a, long b, long c);
// struct LDKChannelAnnouncement C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR tuple);
public static native long C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a(long tuple);
// struct LDKChannelUpdate C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR tuple);
public static native long CResult_ShutdownScriptInvalidShutdownScriptZ_err(long e);
// void CResult_ShutdownScriptInvalidShutdownScriptZ_free(struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ _res);
public static native void CResult_ShutdownScriptInvalidShutdownScriptZ_free(long _res);
+ // struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_clone(const struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR orig);
+ public static native long CResult_ShutdownScriptInvalidShutdownScriptZ_clone(long orig);
// struct LDKCResult_NoneErrorZ CResult_NoneErrorZ_ok(void);
public static native long CResult_NoneErrorZ_ok();
// struct LDKCResult_NoneErrorZ CResult_NoneErrorZ_err(enum LDKIOError e);
public static native byte[] BuiltCommitmentTransaction_sign(long this_arg, byte[] funding_key, byte[] funding_redeemscript, long channel_value_satoshis);
// void ClosingTransaction_free(struct LDKClosingTransaction this_obj);
public static native void ClosingTransaction_free(long this_obj);
+ // struct LDKClosingTransaction ClosingTransaction_clone(const struct LDKClosingTransaction *NONNULL_PTR orig);
+ public static native long ClosingTransaction_clone(long orig);
+ // uint64_t ClosingTransaction_hash(const struct LDKClosingTransaction *NONNULL_PTR o);
+ public static native long ClosingTransaction_hash(long o);
// MUST_USE_RES struct LDKClosingTransaction ClosingTransaction_new(uint64_t to_holder_value_sat, uint64_t to_counterparty_value_sat, struct LDKCVec_u8Z to_holder_script, struct LDKCVec_u8Z to_counterparty_script, struct LDKOutPoint funding_outpoint);
public static native long ClosingTransaction_new(long to_holder_value_sat, long to_counterparty_value_sat, byte[] to_holder_script, byte[] to_counterparty_script, long funding_outpoint);
// MUST_USE_RES struct LDKTrustedClosingTransaction ClosingTransaction_trust(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
public static native void InvalidShutdownScript_set_script(long this_ptr, byte[] val);
// MUST_USE_RES struct LDKInvalidShutdownScript InvalidShutdownScript_new(struct LDKCVec_u8Z script_arg);
public static native long InvalidShutdownScript_new(byte[] script_arg);
+ // struct LDKInvalidShutdownScript InvalidShutdownScript_clone(const struct LDKInvalidShutdownScript *NONNULL_PTR orig);
+ public static native long InvalidShutdownScript_clone(long orig);
// struct LDKCVec_u8Z ShutdownScript_write(const struct LDKShutdownScript *NONNULL_PTR obj);
public static native byte[] ShutdownScript_write(long obj);
// struct LDKCResult_ShutdownScriptDecodeErrorZ ShutdownScript_read(struct LDKu8slice ser);
if (ptr != 0) { bindings.ClosingTransaction_free(ptr); }
}
+ /**
+ * Creates a copy of the ClosingTransaction
+ */
+ public ClosingTransaction clone() {
+ long ret = bindings.ClosingTransaction_clone(this.ptr);
+ if (ret >= 0 && ret < 1024) { return null; }
+ ClosingTransaction ret_hu_conv = new ClosingTransaction(null, ret);
+ ret_hu_conv.ptrs_to.add(this);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Checks if two ClosingTransactions contain equal inner contents.
+ */
+ public long hash() {
+ long ret = bindings.ClosingTransaction_hash(this.ptr);
+ return ret;
+ }
+
/**
* Construct an object of the class
*/
return ret_hu_conv;
}
+ /**
+ * Creates a copy of the InvalidShutdownScript
+ */
+ public InvalidShutdownScript clone() {
+ long ret = bindings.InvalidShutdownScript_clone(this.ptr);
+ if (ret >= 0 && ret < 1024) { return null; }
+ InvalidShutdownScript ret_hu_conv = new InvalidShutdownScript(null, ret);
+ ret_hu_conv.ptrs_to.add(this);
+ return ret_hu_conv;
+ }
+
}
/**
* Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ in the error state.
*/
- public static Result_ShutdownScriptInvalidShutdownScriptZ err(byte[] e_script_arg) {
- long ret = bindings.CResult_ShutdownScriptInvalidShutdownScriptZ_err(bindings.InvalidShutdownScript_new(e_script_arg));
+ public static Result_ShutdownScriptInvalidShutdownScriptZ err(InvalidShutdownScript e) {
+ long ret = bindings.CResult_ShutdownScriptInvalidShutdownScriptZ_err(e == null ? 0 : e.ptr & ~1);
+ if (ret >= 0 && ret < 1024) { return null; }
+ Result_ShutdownScriptInvalidShutdownScriptZ ret_hu_conv = Result_ShutdownScriptInvalidShutdownScriptZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+ public Result_ShutdownScriptInvalidShutdownScriptZ clone() {
+ long ret = bindings.CResult_ShutdownScriptInvalidShutdownScriptZ_clone(this.ptr);
if (ret >= 0 && ret < 1024) { return null; }
Result_ShutdownScriptInvalidShutdownScriptZ ret_hu_conv = Result_ShutdownScriptInvalidShutdownScriptZ.constr_from_ptr(ret);
return ret_hu_conv;
#define DEBUG_PRINT(...) fprintf(stderr, __VA_ARGS__)
#define MALLOC(a, _) malloc(a)
#define FREE(p) if ((uint64_t)(p) > 1024) { free(p); }
+#define CHECK_ACCESS(p)
#define DO_ASSERT(a) (void)(a)
#define CHECK(a)
jclass err_conv = LDKAccessError_to_java(env, (*val->contents.err));
return err_conv;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1usizeTransactionZ_1new(JNIEnv *env, jclass clz, int64_t a, int8_tArray b) {
- LDKC2Tuple_usizeTransactionZ* ret = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ");
- ret->a = a;
- LDKTransaction b_ref;
- b_ref.datalen = (*env)->GetArrayLength(env, b);
- b_ref.data = MALLOC(b_ref.datalen, "LDKTransaction Bytes");
- (*env)->GetByteArrayRegion(env, b, 0, b_ref.datalen, b_ref.data);
- b_ref.data_is_owned = false;
- ret->b = b_ref;
- return (uint64_t)ret;
-}
static inline uintptr_t C2Tuple_usizeTransactionZ_get_a(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR tuple){
return tuple->a;
}
int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
for (size_t i = 0; i < ret->datalen; i++) {
int64_t arr_elem = java_elems[i];
- LDKC2Tuple_usizeTransactionZ arr_elem_conv = *(LDKC2Tuple_usizeTransactionZ*)(((uint64_t)arr_elem) & ~1);
+ void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1);
+ CHECK_ACCESS(arr_elem_ptr);
+ LDKC2Tuple_usizeTransactionZ arr_elem_conv = *(LDKC2Tuple_usizeTransactionZ*)(arr_elem_ptr);
arr_elem_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)(((uint64_t)arr_elem) & ~1));
ret->data[i] = arr_elem_conv;
}
int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
for (size_t i = 0; i < ret->datalen; i++) {
int64_t arr_elem = java_elems[i];
- LDKMonitorEvent arr_elem_conv = *(LDKMonitorEvent*)(((uint64_t)arr_elem) & ~1);
+ void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1);
+ CHECK_ACCESS(arr_elem_ptr);
+ LDKMonitorEvent arr_elem_conv = *(LDKMonitorEvent*)(arr_elem_ptr);
arr_elem_conv = MonitorEvent_clone((LDKMonitorEvent*)(((uint64_t)arr_elem) & ~1));
ret->data[i] = arr_elem_conv;
}
int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
for (size_t i = 0; i < ret->datalen; i++) {
int64_t arr_elem = java_elems[i];
- LDKSpendableOutputDescriptor arr_elem_conv = *(LDKSpendableOutputDescriptor*)(((uint64_t)arr_elem) & ~1);
+ void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1);
+ CHECK_ACCESS(arr_elem_ptr);
+ LDKSpendableOutputDescriptor arr_elem_conv = *(LDKSpendableOutputDescriptor*)(arr_elem_ptr);
arr_elem_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)(((uint64_t)arr_elem) & ~1));
ret->data[i] = arr_elem_conv;
}
int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
for (size_t i = 0; i < ret->datalen; i++) {
int64_t arr_elem = java_elems[i];
- LDKMessageSendEvent arr_elem_conv = *(LDKMessageSendEvent*)(((uint64_t)arr_elem) & ~1);
+ void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1);
+ CHECK_ACCESS(arr_elem_ptr);
+ LDKMessageSendEvent arr_elem_conv = *(LDKMessageSendEvent*)(arr_elem_ptr);
arr_elem_conv = MessageSendEvent_clone((LDKMessageSendEvent*)(((uint64_t)arr_elem) & ~1));
ret->data[i] = arr_elem_conv;
}
CHECK(!val->result_ok);
return *val->contents.err;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1SignatureCVec_1SignatureZZ_1new(JNIEnv *env, jclass clz, int8_tArray a, jobjectArray b) {
- LDKC2Tuple_SignatureCVec_SignatureZZ* ret = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ");
- LDKSignature a_ref;
- CHECK((*env)->GetArrayLength(env, a) == 64);
- (*env)->GetByteArrayRegion(env, a, 0, 64, a_ref.compact_form);
- ret->a = a_ref;
- LDKCVec_SignatureZ b_constr;
- b_constr.datalen = (*env)->GetArrayLength(env, b);
- if (b_constr.datalen > 0)
- b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements");
- else
- b_constr.data = NULL;
- for (size_t i = 0; i < b_constr.datalen; i++) {
- int8_tArray b_conv_8 = (*env)->GetObjectArrayElement(env, b, i);
- LDKSignature b_conv_8_ref;
- CHECK((*env)->GetArrayLength(env, b_conv_8) == 64);
- (*env)->GetByteArrayRegion(env, b_conv_8, 0, 64, b_conv_8_ref.compact_form);
- b_constr.data[i] = b_conv_8_ref;
- }
- ret->b = b_constr;
- return (uint64_t)ret;
-}
static inline struct LDKSignature C2Tuple_SignatureCVec_SignatureZZ_get_a(LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR tuple){
return tuple->a;
}
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to validate_holder_commitment in LDKBaseSign from rust threw an exception.");
}
- LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(ret_ptr);
ret_conv = CResult_NoneNoneZ_clone((LDKCResult_NoneNoneZ*)(((uint64_t)ret) & ~1));
if (get_jenv_res == JNI_EDETACHED) {
DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to sign_counterparty_commitment in LDKBaseSign from rust threw an exception.");
}
- LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(ret_ptr);
ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone((LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(((uint64_t)ret) & ~1));
if (get_jenv_res == JNI_EDETACHED) {
DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to validate_counterparty_revocation in LDKBaseSign from rust threw an exception.");
}
- LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(ret_ptr);
ret_conv = CResult_NoneNoneZ_clone((LDKCResult_NoneNoneZ*)(((uint64_t)ret) & ~1));
if (get_jenv_res == JNI_EDETACHED) {
DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to sign_holder_commitment_and_htlcs in LDKBaseSign from rust threw an exception.");
}
- LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(ret_ptr);
ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone((LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(((uint64_t)ret) & ~1));
if (get_jenv_res == JNI_EDETACHED) {
DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to sign_justice_revoked_output in LDKBaseSign from rust threw an exception.");
}
- LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr);
ret_conv = CResult_SignatureNoneZ_clone((LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1));
if (get_jenv_res == JNI_EDETACHED) {
DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to sign_justice_revoked_htlc in LDKBaseSign from rust threw an exception.");
}
- LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr);
ret_conv = CResult_SignatureNoneZ_clone((LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1));
if (get_jenv_res == JNI_EDETACHED) {
DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to sign_counterparty_htlc_transaction in LDKBaseSign from rust threw an exception.");
}
- LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr);
ret_conv = CResult_SignatureNoneZ_clone((LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1));
if (get_jenv_res == JNI_EDETACHED) {
DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
DO_ASSERT(get_jenv_res == JNI_OK);
}
LDKClosingTransaction closing_tx_var = *closing_tx;
- // Warning: we may need a move here but no clone is available for LDKClosingTransaction
+ closing_tx_var = ClosingTransaction_clone(closing_tx);
CHECK((((uint64_t)closing_tx_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&closing_tx_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
uint64_t closing_tx_ref = (uint64_t)closing_tx_var.inner;
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to sign_closing_transaction in LDKBaseSign from rust threw an exception.");
}
- LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr);
ret_conv = CResult_SignatureNoneZ_clone((LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1));
if (get_jenv_res == JNI_EDETACHED) {
DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to sign_channel_announcement in LDKBaseSign from rust threw an exception.");
}
- LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr);
ret_conv = CResult_SignatureNoneZ_clone((LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1));
if (get_jenv_res == JNI_EDETACHED) {
DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
return (uint64_t)res_ptr;
}
JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BaseSign_1get_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_arg, int64_t idx) {
- LDKBaseSign* this_arg_conv = (LDKBaseSign*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
(*env)->SetByteArrayRegion(env, ret_arr, 0, 33, (this_arg_conv->get_per_commitment_point)(this_arg_conv->this_arg, idx).compressed_form);
return ret_arr;
}
JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BaseSign_1release_1commitment_1secret(JNIEnv *env, jclass clz, int64_t this_arg, int64_t idx) {
- LDKBaseSign* this_arg_conv = (LDKBaseSign*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
(*env)->SetByteArrayRegion(env, ret_arr, 0, 32, (this_arg_conv->release_commitment_secret)(this_arg_conv->this_arg, idx).data);
return ret_arr;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BaseSign_1validate_1holder_1commitment(JNIEnv *env, jclass clz, int64_t this_arg, int64_t holder_tx) {
- LDKBaseSign* this_arg_conv = (LDKBaseSign*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
LDKHolderCommitmentTransaction holder_tx_conv;
holder_tx_conv.inner = (void*)(holder_tx & (~1));
holder_tx_conv.is_owned = false;
}
JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BaseSign_1channel_1keys_1id(JNIEnv *env, jclass clz, int64_t this_arg) {
- LDKBaseSign* this_arg_conv = (LDKBaseSign*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
(*env)->SetByteArrayRegion(env, ret_arr, 0, 32, (this_arg_conv->channel_keys_id)(this_arg_conv->this_arg).data);
return ret_arr;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BaseSign_1sign_1counterparty_1commitment(JNIEnv *env, jclass clz, int64_t this_arg, int64_t commitment_tx) {
- LDKBaseSign* this_arg_conv = (LDKBaseSign*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
LDKCommitmentTransaction commitment_tx_conv;
commitment_tx_conv.inner = (void*)(commitment_tx & (~1));
commitment_tx_conv.is_owned = false;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BaseSign_1validate_1counterparty_1revocation(JNIEnv *env, jclass clz, int64_t this_arg, int64_t idx, int8_tArray secret) {
- LDKBaseSign* this_arg_conv = (LDKBaseSign*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
unsigned char secret_arr[32];
CHECK((*env)->GetArrayLength(env, secret) == 32);
(*env)->GetByteArrayRegion(env, secret, 0, 32, secret_arr);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BaseSign_1sign_1holder_1commitment_1and_1htlcs(JNIEnv *env, jclass clz, int64_t this_arg, int64_t commitment_tx) {
- LDKBaseSign* this_arg_conv = (LDKBaseSign*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
LDKHolderCommitmentTransaction commitment_tx_conv;
commitment_tx_conv.inner = (void*)(commitment_tx & (~1));
commitment_tx_conv.is_owned = false;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BaseSign_1sign_1justice_1revoked_1output(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray justice_tx, int64_t input, int64_t amount, int8_tArray per_commitment_key) {
- LDKBaseSign* this_arg_conv = (LDKBaseSign*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
LDKTransaction justice_tx_ref;
justice_tx_ref.datalen = (*env)->GetArrayLength(env, justice_tx);
justice_tx_ref.data = MALLOC(justice_tx_ref.datalen, "LDKTransaction Bytes");
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BaseSign_1sign_1justice_1revoked_1htlc(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray justice_tx, int64_t input, int64_t amount, int8_tArray per_commitment_key, int64_t htlc) {
- LDKBaseSign* this_arg_conv = (LDKBaseSign*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
LDKTransaction justice_tx_ref;
justice_tx_ref.datalen = (*env)->GetArrayLength(env, justice_tx);
justice_tx_ref.data = MALLOC(justice_tx_ref.datalen, "LDKTransaction Bytes");
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BaseSign_1sign_1counterparty_1htlc_1transaction(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray htlc_tx, int64_t input, int64_t amount, int8_tArray per_commitment_point, int64_t htlc) {
- LDKBaseSign* this_arg_conv = (LDKBaseSign*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
LDKTransaction htlc_tx_ref;
htlc_tx_ref.datalen = (*env)->GetArrayLength(env, htlc_tx);
htlc_tx_ref.data = MALLOC(htlc_tx_ref.datalen, "LDKTransaction Bytes");
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BaseSign_1sign_1closing_1transaction(JNIEnv *env, jclass clz, int64_t this_arg, int64_t closing_tx) {
- LDKBaseSign* this_arg_conv = (LDKBaseSign*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
LDKClosingTransaction closing_tx_conv;
closing_tx_conv.inner = (void*)(closing_tx & (~1));
closing_tx_conv.is_owned = false;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BaseSign_1sign_1channel_1announcement(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg) {
- LDKBaseSign* this_arg_conv = (LDKBaseSign*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
LDKUnsignedChannelAnnouncement msg_conv;
msg_conv.inner = (void*)(msg & (~1));
msg_conv.is_owned = false;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BaseSign_1ready_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int64_t channel_parameters) {
- LDKBaseSign* this_arg_conv = (LDKBaseSign*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
LDKChannelTransactionParameters channel_parameters_conv;
channel_parameters_conv.inner = (void*)(channel_parameters & (~1));
channel_parameters_conv.is_owned = false;
return this_arg->pubkeys;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BaseSign_1get_1pubkeys(JNIEnv *env, jclass clz, int64_t this_arg) {
- LDKBaseSign* this_arg_conv = (LDKBaseSign*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
LDKChannelPublicKeys ret_var = LDKBaseSign_set_get_pubkeys(this_arg_conv);
CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
return (int64_t)(res_ptr | 1);
}
JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Sign_1write(JNIEnv *env, jclass clz, int64_t this_arg) {
- LDKSign* this_arg_conv = (LDKSign*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKSign* this_arg_conv = (LDKSign*)this_arg_ptr;
LDKCVec_u8Z ret_var = (this_arg_conv->write)(this_arg_conv->this_arg);
int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
(*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
for (size_t i = 0; i < ret->datalen; i++) {
int64_t arr_elem = java_elems[i];
- LDKTxOut arr_elem_conv = *(LDKTxOut*)(((uint64_t)arr_elem) & ~1);
+ void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1);
+ CHECK_ACCESS(arr_elem_ptr);
+ LDKTxOut arr_elem_conv = *(LDKTxOut*)(arr_elem_ptr);
arr_elem_conv = TxOut_clone((LDKTxOut*)(((uint64_t)arr_elem) & ~1));
ret->data[i] = arr_elem_conv;
}
CHECK(!val->result_ok);
return *val->contents.err;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1BlockHashChannelMonitorZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int64_t b) {
- LDKC2Tuple_BlockHashChannelMonitorZ* ret = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKC2Tuple_BlockHashChannelMonitorZ");
- LDKThirtyTwoBytes a_ref;
- CHECK((*env)->GetArrayLength(env, a) == 32);
- (*env)->GetByteArrayRegion(env, a, 0, 32, a_ref.data);
- ret->a = a_ref;
- LDKChannelMonitor b_conv;
- b_conv.inner = (void*)(b & (~1));
- b_conv.is_owned = (b & 1) || (b == 0);
- b_conv = ChannelMonitor_clone(&b_conv);
- ret->b = b_conv;
- return (uint64_t)ret;
-}
static inline struct LDKThirtyTwoBytes C2Tuple_BlockHashChannelMonitorZ_get_a(LDKC2Tuple_BlockHashChannelMonitorZ *NONNULL_PTR tuple){
return ThirtyTwoBytes_clone(&tuple->a);
}
int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
for (size_t i = 0; i < ret->datalen; i++) {
int64_t arr_elem = java_elems[i];
- LDKC2Tuple_BlockHashChannelMonitorZ arr_elem_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(((uint64_t)arr_elem) & ~1);
+ void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1);
+ CHECK_ACCESS(arr_elem_ptr);
+ LDKC2Tuple_BlockHashChannelMonitorZ arr_elem_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(arr_elem_ptr);
arr_elem_conv = C2Tuple_BlockHashChannelMonitorZ_clone((LDKC2Tuple_BlockHashChannelMonitorZ*)(((uint64_t)arr_elem) & ~1));
ret->data[i] = arr_elem_conv;
}
int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
for (size_t i = 0; i < ret->datalen; i++) {
int64_t arr_elem = java_elems[i];
- LDKCResult_NoneAPIErrorZ arr_elem_conv = *(LDKCResult_NoneAPIErrorZ*)(((uint64_t)arr_elem) & ~1);
+ void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1);
+ CHECK_ACCESS(arr_elem_ptr);
+ LDKCResult_NoneAPIErrorZ arr_elem_conv = *(LDKCResult_NoneAPIErrorZ*)(arr_elem_ptr);
arr_elem_conv = CResult_NoneAPIErrorZ_clone((LDKCResult_NoneAPIErrorZ*)(((uint64_t)arr_elem) & ~1));
ret->data[i] = arr_elem_conv;
}
int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
for (size_t i = 0; i < ret->datalen; i++) {
int64_t arr_elem = java_elems[i];
- LDKAPIError arr_elem_conv = *(LDKAPIError*)(((uint64_t)arr_elem) & ~1);
+ void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1);
+ CHECK_ACCESS(arr_elem_ptr);
+ LDKAPIError arr_elem_conv = *(LDKAPIError*)(arr_elem_ptr);
arr_elem_conv = APIError_clone((LDKAPIError*)(((uint64_t)arr_elem) & ~1));
ret->data[i] = arr_elem_conv;
}
uint64_t err_ref = ((uint64_t)&(*val->contents.err)) | 1;
return err_ref;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1PaymentHashPaymentIdZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int64_t b) {
- LDKC2Tuple_PaymentHashPaymentIdZ* ret = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentIdZ), "LDKC2Tuple_PaymentHashPaymentIdZ");
- LDKThirtyTwoBytes a_ref;
- CHECK((*env)->GetArrayLength(env, a) == 32);
- (*env)->GetByteArrayRegion(env, a, 0, 32, a_ref.data);
- ret->a = a_ref;
- LDKPaymentId b_conv;
- b_conv.inner = (void*)(b & (~1));
- b_conv.is_owned = (b & 1) || (b == 0);
- b_conv = PaymentId_clone(&b_conv);
- ret->b = b_conv;
- return (uint64_t)ret;
-}
static inline struct LDKThirtyTwoBytes C2Tuple_PaymentHashPaymentIdZ_get_a(LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR tuple){
return ThirtyTwoBytes_clone(&tuple->a);
}
int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
for (size_t i = 0; i < ret->datalen; i++) {
int64_t arr_elem = java_elems[i];
- LDKNetAddress arr_elem_conv = *(LDKNetAddress*)(((uint64_t)arr_elem) & ~1);
+ void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1);
+ CHECK_ACCESS(arr_elem_ptr);
+ LDKNetAddress arr_elem_conv = *(LDKNetAddress*)(arr_elem_ptr);
arr_elem_conv = NetAddress_clone((LDKNetAddress*)(((uint64_t)arr_elem) & ~1));
ret->data[i] = arr_elem_conv;
}
}
return ret;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1PaymentHashPaymentSecretZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int8_tArray b) {
- LDKC2Tuple_PaymentHashPaymentSecretZ* ret = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ");
- LDKThirtyTwoBytes a_ref;
- CHECK((*env)->GetArrayLength(env, a) == 32);
- (*env)->GetByteArrayRegion(env, a, 0, 32, a_ref.data);
- ret->a = a_ref;
- LDKThirtyTwoBytes b_ref;
- CHECK((*env)->GetArrayLength(env, b) == 32);
- (*env)->GetByteArrayRegion(env, b, 0, 32, b_ref.data);
- ret->b = b_ref;
- return (uint64_t)ret;
-}
static inline struct LDKThirtyTwoBytes C2Tuple_PaymentHashPaymentSecretZ_get_a(LDKC2Tuple_PaymentHashPaymentSecretZ *NONNULL_PTR tuple){
return ThirtyTwoBytes_clone(&tuple->a);
}
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to watch_channel in LDKWatch from rust threw an exception.");
}
- LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr);
ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone((LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)ret) & ~1));
if (get_jenv_res == JNI_EDETACHED) {
DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to update_channel in LDKWatch from rust threw an exception.");
}
- LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr);
ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone((LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)ret) & ~1));
if (get_jenv_res == JNI_EDETACHED) {
DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
int64_t* ret_vals = (*env)->GetLongArrayElements (env, ret, NULL);
for (size_t o = 0; o < ret_constr.datalen; o++) {
int64_t ret_conv_14 = ret_vals[o];
- LDKMonitorEvent ret_conv_14_conv = *(LDKMonitorEvent*)(((uint64_t)ret_conv_14) & ~1);
+ void* ret_conv_14_ptr = (void*)(((uint64_t)ret_conv_14) & ~1);
+ CHECK_ACCESS(ret_conv_14_ptr);
+ LDKMonitorEvent ret_conv_14_conv = *(LDKMonitorEvent*)(ret_conv_14_ptr);
ret_conv_14_conv = MonitorEvent_clone((LDKMonitorEvent*)(((uint64_t)ret_conv_14) & ~1));
ret_constr.data[o] = ret_conv_14_conv;
}
return (uint64_t)res_ptr;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Watch_1watch_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int64_t funding_txo, int64_t monitor) {
- LDKWatch* this_arg_conv = (LDKWatch*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKWatch* this_arg_conv = (LDKWatch*)this_arg_ptr;
LDKOutPoint funding_txo_conv;
funding_txo_conv.inner = (void*)(funding_txo & (~1));
funding_txo_conv.is_owned = (funding_txo & 1) || (funding_txo == 0);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Watch_1update_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int64_t funding_txo, int64_t update) {
- LDKWatch* this_arg_conv = (LDKWatch*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKWatch* this_arg_conv = (LDKWatch*)this_arg_ptr;
LDKOutPoint funding_txo_conv;
funding_txo_conv.inner = (void*)(funding_txo & (~1));
funding_txo_conv.is_owned = (funding_txo & 1) || (funding_txo == 0);
}
JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Watch_1release_1pending_1monitor_1events(JNIEnv *env, jclass clz, int64_t this_arg) {
- LDKWatch* this_arg_conv = (LDKWatch*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKWatch* this_arg_conv = (LDKWatch*)this_arg_ptr;
LDKCVec_MonitorEventZ ret_var = (this_arg_conv->release_pending_monitor_events)(this_arg_conv->this_arg);
int64_tArray ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
for (size_t o = 0; o < ret_var.datalen; o++) {
LDKMonitorEvent *ret_conv_14_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
- *ret_conv_14_copy = MonitorEvent_clone(&ret_var.data[o]);
+ *ret_conv_14_copy = ret_var.data[o];
uint64_t ret_conv_14_ref = (uint64_t)ret_conv_14_copy;
ret_arr_ptr[o] = ret_conv_14_ref;
}
return (uint64_t)res_ptr;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BroadcasterInterface_1broadcast_1transaction(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray tx) {
- LDKBroadcasterInterface* this_arg_conv = (LDKBroadcasterInterface*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKBroadcasterInterface* this_arg_conv = (LDKBroadcasterInterface*)this_arg_ptr;
LDKTransaction tx_ref;
tx_ref.datalen = (*env)->GetArrayLength(env, tx);
tx_ref.data = MALLOC(tx_ref.datalen, "LDKTransaction Bytes");
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to get_channel_signer in LDKKeysInterface from rust threw an exception.");
}
- LDKSign ret_conv = *(LDKSign*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKSign ret_conv = *(LDKSign*)(ret_ptr);
ret_conv = Sign_clone(&ret_conv);
if (get_jenv_res == JNI_EDETACHED) {
DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to read_chan_signer in LDKKeysInterface from rust threw an exception.");
}
- LDKCResult_SignDecodeErrorZ ret_conv = *(LDKCResult_SignDecodeErrorZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_SignDecodeErrorZ ret_conv = *(LDKCResult_SignDecodeErrorZ*)(ret_ptr);
ret_conv = CResult_SignDecodeErrorZ_clone((LDKCResult_SignDecodeErrorZ*)(((uint64_t)ret) & ~1));
if (get_jenv_res == JNI_EDETACHED) {
DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to sign_invoice in LDKKeysInterface from rust threw an exception.");
}
- LDKCResult_RecoverableSignatureNoneZ ret_conv = *(LDKCResult_RecoverableSignatureNoneZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_RecoverableSignatureNoneZ ret_conv = *(LDKCResult_RecoverableSignatureNoneZ*)(ret_ptr);
ret_conv = CResult_RecoverableSignatureNoneZ_clone((LDKCResult_RecoverableSignatureNoneZ*)(((uint64_t)ret) & ~1));
if (get_jenv_res == JNI_EDETACHED) {
DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
return (uint64_t)res_ptr;
}
JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_KeysInterface_1get_1node_1secret(JNIEnv *env, jclass clz, int64_t this_arg) {
- LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
(*env)->SetByteArrayRegion(env, ret_arr, 0, 32, (this_arg_conv->get_node_secret)(this_arg_conv->this_arg).bytes);
return ret_arr;
}
JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_KeysInterface_1get_1destination_1script(JNIEnv *env, jclass clz, int64_t this_arg) {
- LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
LDKCVec_u8Z ret_var = (this_arg_conv->get_destination_script)(this_arg_conv->this_arg);
int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
(*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysInterface_1get_1shutdown_1scriptpubkey(JNIEnv *env, jclass clz, int64_t this_arg) {
- LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
LDKShutdownScript ret_var = (this_arg_conv->get_shutdown_scriptpubkey)(this_arg_conv->this_arg);
CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysInterface_1get_1channel_1signer(JNIEnv *env, jclass clz, int64_t this_arg, jboolean inbound, int64_t channel_value_satoshis) {
- LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
LDKSign* ret_ret =MALLOC(sizeof(LDKSign), "LDKSign");
*ret_ret = (this_arg_conv->get_channel_signer)(this_arg_conv->this_arg, inbound, channel_value_satoshis);
return (uint64_t)ret_ret;
}
JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_KeysInterface_1get_1secure_1random_1bytes(JNIEnv *env, jclass clz, int64_t this_arg) {
- LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
(*env)->SetByteArrayRegion(env, ret_arr, 0, 32, (this_arg_conv->get_secure_random_bytes)(this_arg_conv->this_arg).data);
return ret_arr;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysInterface_1read_1chan_1signer(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray reader) {
- LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
LDKu8slice reader_ref;
reader_ref.datalen = (*env)->GetArrayLength(env, reader);
reader_ref.data = (*env)->GetByteArrayElements (env, reader, NULL);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysInterface_1sign_1invoice(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray invoice_preimage) {
- LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
LDKCVec_u8Z invoice_preimage_ref;
invoice_preimage_ref.datalen = (*env)->GetArrayLength(env, invoice_preimage);
invoice_preimage_ref.data = MALLOC(invoice_preimage_ref.datalen, "LDKCVec_u8Z Bytes");
return (uint64_t)res_ptr;
}
JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_FeeEstimator_1get_1est_1sat_1per_11000_1weight(JNIEnv *env, jclass clz, int64_t this_arg, jclass confirmation_target) {
- LDKFeeEstimator* this_arg_conv = (LDKFeeEstimator*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKFeeEstimator* this_arg_conv = (LDKFeeEstimator*)this_arg_ptr;
LDKConfirmationTarget confirmation_target_conv = LDKConfirmationTarget_from_java(env, confirmation_target);
int32_t ret_val = (this_arg_conv->get_est_sat_per_1000_weight)(this_arg_conv->this_arg, confirmation_target_conv);
return ret_val;
*res_ptr = LDKLogger_init(env, clz, o);
return (uint64_t)res_ptr;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1BlockHashChannelManagerZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int64_t b) {
- LDKC2Tuple_BlockHashChannelManagerZ* ret = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelManagerZ), "LDKC2Tuple_BlockHashChannelManagerZ");
- LDKThirtyTwoBytes a_ref;
- CHECK((*env)->GetArrayLength(env, a) == 32);
- (*env)->GetByteArrayRegion(env, a, 0, 32, a_ref.data);
- ret->a = a_ref;
- LDKChannelManager b_conv;
- b_conv.inner = (void*)(b & (~1));
- b_conv.is_owned = (b & 1) || (b == 0);
- // Warning: we need a move here but no clone is available for LDKChannelManager
- ret->b = b_conv;
- return (uint64_t)ret;
-}
static inline struct LDKThirtyTwoBytes C2Tuple_BlockHashChannelManagerZ_get_a(LDKC2Tuple_BlockHashChannelManagerZ *NONNULL_PTR tuple){
return ThirtyTwoBytes_clone(&tuple->a);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1BlockHashChannelManagerZDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ *val = (LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
- LDKC2Tuple_BlockHashChannelManagerZ* res_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelManagerZ), "LDKC2Tuple_BlockHashChannelManagerZ");
- *res_conv = (*val->contents.result);
+ LDKC2Tuple_BlockHashChannelManagerZ* res_conv = &(*val->contents.result);
// Warning: we really need to clone here, but no clone is available for LDKC2Tuple_BlockHashChannelManagerZ
return ((uint64_t)res_conv) | 1;
}
return (uint64_t)res_ptr;
}
JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_Type_1type_1id(JNIEnv *env, jclass clz, int64_t this_arg) {
- LDKType* this_arg_conv = (LDKType*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKType* this_arg_conv = (LDKType*)this_arg_ptr;
int16_t ret_val = (this_arg_conv->type_id)(this_arg_conv->this_arg);
return ret_val;
}
JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Type_1debug_1str(JNIEnv *env, jclass clz, int64_t this_arg) {
- LDKType* this_arg_conv = (LDKType*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKType* this_arg_conv = (LDKType*)this_arg_ptr;
LDKStr ret_str = (this_arg_conv->debug_str)(this_arg_conv->this_arg);
jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
Str_free(ret_str);
}
JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Type_1write(JNIEnv *env, jclass clz, int64_t this_arg) {
- LDKType* this_arg_conv = (LDKType*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKType* this_arg_conv = (LDKType*)this_arg_ptr;
LDKCVec_u8Z ret_var = (this_arg_conv->write)(this_arg_conv->this_arg);
int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
(*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
CHECK(!val->result_ok);
return *val->contents.err;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKC3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1new(JNIEnv *env, jclass clz, int64_t a, int8_tArray b, int64_t c) {
- LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* ret = MALLOC(sizeof(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ), "LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ");
- LDKRawInvoice a_conv;
- a_conv.inner = (void*)(a & (~1));
- a_conv.is_owned = (a & 1) || (a == 0);
- a_conv = RawInvoice_clone(&a_conv);
- ret->a = a_conv;
- LDKThirtyTwoBytes b_ref;
- CHECK((*env)->GetArrayLength(env, b) == 32);
- (*env)->GetByteArrayRegion(env, b, 0, 32, b_ref.data);
- ret->b = b_ref;
- LDKInvoiceSignature c_conv;
- c_conv.inner = (void*)(c & (~1));
- c_conv.is_owned = (c & 1) || (c == 0);
- c_conv = InvoiceSignature_clone(&c_conv);
- ret->c = c_conv;
- return (uint64_t)ret;
-}
static inline struct LDKRawInvoice C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_a(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR tuple){
return RawInvoice_clone(&tuple->a);
}
uint64_t err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1OutPointScriptZ_1new(JNIEnv *env, jclass clz, int64_t a, int8_tArray b) {
- LDKC2Tuple_OutPointScriptZ* ret = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ");
- LDKOutPoint a_conv;
- a_conv.inner = (void*)(a & (~1));
- a_conv.is_owned = (a & 1) || (a == 0);
- a_conv = OutPoint_clone(&a_conv);
- ret->a = a_conv;
- LDKCVec_u8Z b_ref;
- b_ref.datalen = (*env)->GetArrayLength(env, b);
- b_ref.data = MALLOC(b_ref.datalen, "LDKCVec_u8Z Bytes");
- (*env)->GetByteArrayRegion(env, b, 0, b_ref.datalen, b_ref.data);
- ret->b = b_ref;
- return (uint64_t)ret;
-}
static inline struct LDKOutPoint C2Tuple_OutPointScriptZ_get_a(LDKC2Tuple_OutPointScriptZ *NONNULL_PTR tuple){
return OutPoint_clone(&tuple->a);
}
return ret_arr;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1u32ScriptZ_1new(JNIEnv *env, jclass clz, int32_t a, int8_tArray b) {
- LDKC2Tuple_u32ScriptZ* ret = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ), "LDKC2Tuple_u32ScriptZ");
- ret->a = a;
- LDKCVec_u8Z b_ref;
- b_ref.datalen = (*env)->GetArrayLength(env, b);
- b_ref.data = MALLOC(b_ref.datalen, "LDKCVec_u8Z Bytes");
- (*env)->GetByteArrayRegion(env, b, 0, b_ref.datalen, b_ref.data);
- ret->b = b_ref;
- return (uint64_t)ret;
-}
static inline uint32_t C2Tuple_u32ScriptZ_get_a(LDKC2Tuple_u32ScriptZ *NONNULL_PTR tuple){
return tuple->a;
}
int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
for (size_t i = 0; i < ret->datalen; i++) {
int64_t arr_elem = java_elems[i];
- LDKC2Tuple_u32ScriptZ arr_elem_conv = *(LDKC2Tuple_u32ScriptZ*)(((uint64_t)arr_elem) & ~1);
+ void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1);
+ CHECK_ACCESS(arr_elem_ptr);
+ LDKC2Tuple_u32ScriptZ arr_elem_conv = *(LDKC2Tuple_u32ScriptZ*)(arr_elem_ptr);
arr_elem_conv = C2Tuple_u32ScriptZ_clone((LDKC2Tuple_u32ScriptZ*)(((uint64_t)arr_elem) & ~1));
ret->data[i] = arr_elem_conv;
}
}
return ret;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int64_tArray b) {
- LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* ret = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ");
- LDKThirtyTwoBytes a_ref;
- CHECK((*env)->GetArrayLength(env, a) == 32);
- (*env)->GetByteArrayRegion(env, a, 0, 32, a_ref.data);
- ret->a = a_ref;
- LDKCVec_C2Tuple_u32ScriptZZ b_constr;
- b_constr.datalen = (*env)->GetArrayLength(env, b);
- if (b_constr.datalen > 0)
- b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKC2Tuple_u32ScriptZ), "LDKCVec_C2Tuple_u32ScriptZZ Elements");
- else
- b_constr.data = NULL;
- int64_t* b_vals = (*env)->GetLongArrayElements (env, b, NULL);
- for (size_t v = 0; v < b_constr.datalen; v++) {
- int64_t b_conv_21 = b_vals[v];
- LDKC2Tuple_u32ScriptZ b_conv_21_conv = *(LDKC2Tuple_u32ScriptZ*)(((uint64_t)b_conv_21) & ~1);
- b_conv_21_conv = C2Tuple_u32ScriptZ_clone((LDKC2Tuple_u32ScriptZ*)(((uint64_t)b_conv_21) & ~1));
- b_constr.data[v] = b_conv_21_conv;
- }
- (*env)->ReleaseLongArrayElements(env, b, b_vals, 0);
- ret->b = b_constr;
- return (uint64_t)ret;
-}
static inline struct LDKThirtyTwoBytes C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_a(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *NONNULL_PTR tuple){
return ThirtyTwoBytes_clone(&tuple->a);
}
int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
for (size_t i = 0; i < ret->datalen; i++) {
int64_t arr_elem = java_elems[i];
- LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ arr_elem_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(((uint64_t)arr_elem) & ~1);
+ void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1);
+ CHECK_ACCESS(arr_elem_ptr);
+ LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ arr_elem_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(arr_elem_ptr);
arr_elem_conv = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone((LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(((uint64_t)arr_elem) & ~1));
ret->data[i] = arr_elem_conv;
}
int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
for (size_t i = 0; i < ret->datalen; i++) {
int64_t arr_elem = java_elems[i];
- LDKEvent arr_elem_conv = *(LDKEvent*)(((uint64_t)arr_elem) & ~1);
+ void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1);
+ CHECK_ACCESS(arr_elem_ptr);
+ LDKEvent arr_elem_conv = *(LDKEvent*)(arr_elem_ptr);
arr_elem_conv = Event_clone((LDKEvent*)(((uint64_t)arr_elem) & ~1));
ret->data[i] = arr_elem_conv;
}
}
return ret;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1u32TxOutZ_1new(JNIEnv *env, jclass clz, int32_t a, int64_t b) {
- LDKC2Tuple_u32TxOutZ* ret = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ), "LDKC2Tuple_u32TxOutZ");
- ret->a = a;
- LDKTxOut b_conv = *(LDKTxOut*)(((uint64_t)b) & ~1);
- b_conv = TxOut_clone((LDKTxOut*)(((uint64_t)b) & ~1));
- ret->b = b_conv;
- return (uint64_t)ret;
-}
static inline uint32_t C2Tuple_u32TxOutZ_get_a(LDKC2Tuple_u32TxOutZ *NONNULL_PTR tuple){
return tuple->a;
}
int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
for (size_t i = 0; i < ret->datalen; i++) {
int64_t arr_elem = java_elems[i];
- LDKC2Tuple_u32TxOutZ arr_elem_conv = *(LDKC2Tuple_u32TxOutZ*)(((uint64_t)arr_elem) & ~1);
+ void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1);
+ CHECK_ACCESS(arr_elem_ptr);
+ LDKC2Tuple_u32TxOutZ arr_elem_conv = *(LDKC2Tuple_u32TxOutZ*)(arr_elem_ptr);
arr_elem_conv = C2Tuple_u32TxOutZ_clone((LDKC2Tuple_u32TxOutZ*)(((uint64_t)arr_elem) & ~1));
ret->data[i] = arr_elem_conv;
}
}
return ret;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int64_tArray b) {
- LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ");
- LDKThirtyTwoBytes a_ref;
- CHECK((*env)->GetArrayLength(env, a) == 32);
- (*env)->GetByteArrayRegion(env, a, 0, 32, a_ref.data);
- ret->a = a_ref;
- LDKCVec_C2Tuple_u32TxOutZZ b_constr;
- b_constr.datalen = (*env)->GetArrayLength(env, b);
- if (b_constr.datalen > 0)
- b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKC2Tuple_u32TxOutZ), "LDKCVec_C2Tuple_u32TxOutZZ Elements");
- else
- b_constr.data = NULL;
- int64_t* b_vals = (*env)->GetLongArrayElements (env, b, NULL);
- for (size_t u = 0; u < b_constr.datalen; u++) {
- int64_t b_conv_20 = b_vals[u];
- LDKC2Tuple_u32TxOutZ b_conv_20_conv = *(LDKC2Tuple_u32TxOutZ*)(((uint64_t)b_conv_20) & ~1);
- b_conv_20_conv = C2Tuple_u32TxOutZ_clone((LDKC2Tuple_u32TxOutZ*)(((uint64_t)b_conv_20) & ~1));
- b_constr.data[u] = b_conv_20_conv;
- }
- (*env)->ReleaseLongArrayElements(env, b, b_vals, 0);
- ret->b = b_constr;
- return (uint64_t)ret;
-}
static inline struct LDKThirtyTwoBytes C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_a(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR tuple){
return ThirtyTwoBytes_clone(&tuple->a);
}
int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
for (size_t i = 0; i < ret->datalen; i++) {
int64_t arr_elem = java_elems[i];
- LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ arr_elem_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(((uint64_t)arr_elem) & ~1);
+ void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1);
+ CHECK_ACCESS(arr_elem_ptr);
+ LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ arr_elem_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(arr_elem_ptr);
arr_elem_conv = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone((LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(((uint64_t)arr_elem) & ~1));
ret->data[i] = arr_elem_conv;
}
int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
for (size_t i = 0; i < ret->datalen; i++) {
int64_t arr_elem = java_elems[i];
- LDKBalance arr_elem_conv = *(LDKBalance*)(((uint64_t)arr_elem) & ~1);
+ void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1);
+ CHECK_ACCESS(arr_elem_ptr);
+ LDKBalance arr_elem_conv = *(LDKBalance*)(arr_elem_ptr);
arr_elem_conv = Balance_clone((LDKBalance*)(((uint64_t)arr_elem) & ~1));
ret->data[i] = arr_elem_conv;
}
uint64_t err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1PublicKeyTypeZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int64_t b) {
- LDKC2Tuple_PublicKeyTypeZ* ret = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKC2Tuple_PublicKeyTypeZ");
- LDKPublicKey a_ref;
- CHECK((*env)->GetArrayLength(env, a) == 33);
- (*env)->GetByteArrayRegion(env, a, 0, 33, a_ref.compressed_form);
- ret->a = a_ref;
- LDKType b_conv = *(LDKType*)(((uint64_t)b) & ~1);
- b_conv = Type_clone(&b_conv);
- ret->b = b_conv;
- return (uint64_t)ret;
-}
static inline struct LDKPublicKey C2Tuple_PublicKeyTypeZ_get_a(LDKC2Tuple_PublicKeyTypeZ *NONNULL_PTR tuple){
return tuple->a;
}
int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
for (size_t i = 0; i < ret->datalen; i++) {
int64_t arr_elem = java_elems[i];
- LDKC2Tuple_PublicKeyTypeZ arr_elem_conv = *(LDKC2Tuple_PublicKeyTypeZ*)(((uint64_t)arr_elem) & ~1);
+ void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1);
+ CHECK_ACCESS(arr_elem_ptr);
+ LDKC2Tuple_PublicKeyTypeZ arr_elem_conv = *(LDKC2Tuple_PublicKeyTypeZ*)(arr_elem_ptr);
arr_elem_conv = C2Tuple_PublicKeyTypeZ_clone((LDKC2Tuple_PublicKeyTypeZ*)(((uint64_t)arr_elem) & ~1));
ret->data[i] = arr_elem_conv;
}
uint64_t err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKC3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1new(JNIEnv *env, jclass clz, int64_t a, int64_t b, int64_t c) {
- LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ");
- LDKChannelAnnouncement a_conv;
- a_conv.inner = (void*)(a & (~1));
- a_conv.is_owned = (a & 1) || (a == 0);
- a_conv = ChannelAnnouncement_clone(&a_conv);
- ret->a = a_conv;
- LDKChannelUpdate b_conv;
- b_conv.inner = (void*)(b & (~1));
- b_conv.is_owned = (b & 1) || (b == 0);
- b_conv = ChannelUpdate_clone(&b_conv);
- ret->b = b_conv;
- LDKChannelUpdate c_conv;
- c_conv.inner = (void*)(c & (~1));
- c_conv.is_owned = (c & 1) || (c == 0);
- c_conv = ChannelUpdate_clone(&c_conv);
- ret->c = c_conv;
- return (uint64_t)ret;
-}
static inline struct LDKChannelAnnouncement C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR tuple){
return ChannelAnnouncement_clone(&tuple->a);
}
int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
for (size_t i = 0; i < ret->datalen; i++) {
int64_t arr_elem = java_elems[i];
- LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ arr_elem_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(((uint64_t)arr_elem) & ~1);
+ void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1);
+ CHECK_ACCESS(arr_elem_ptr);
+ LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ arr_elem_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(arr_elem_ptr);
arr_elem_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone((LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(((uint64_t)arr_elem) & ~1));
ret->data[i] = arr_elem_conv;
}
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to get_utxo in LDKAccess from rust threw an exception.");
}
- LDKCResult_TxOutAccessErrorZ ret_conv = *(LDKCResult_TxOutAccessErrorZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_TxOutAccessErrorZ ret_conv = *(LDKCResult_TxOutAccessErrorZ*)(ret_ptr);
ret_conv = CResult_TxOutAccessErrorZ_clone((LDKCResult_TxOutAccessErrorZ*)(((uint64_t)ret) & ~1));
if (get_jenv_res == JNI_EDETACHED) {
DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
return (uint64_t)res_ptr;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Access_1get_1utxo(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray genesis_hash, int64_t short_channel_id) {
- LDKAccess* this_arg_conv = (LDKAccess*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKAccess* this_arg_conv = (LDKAccess*)this_arg_ptr;
unsigned char genesis_hash_arr[32];
CHECK((*env)->GetArrayLength(env, genesis_hash) == 32);
(*env)->GetByteArrayRegion(env, genesis_hash, 0, 32, genesis_hash_arr);
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to register_output in LDKFilter from rust threw an exception.");
}
- LDKCOption_C2Tuple_usizeTransactionZZ ret_conv = *(LDKCOption_C2Tuple_usizeTransactionZZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCOption_C2Tuple_usizeTransactionZZ ret_conv = *(LDKCOption_C2Tuple_usizeTransactionZZ*)(ret_ptr);
ret_conv = COption_C2Tuple_usizeTransactionZZ_clone((LDKCOption_C2Tuple_usizeTransactionZZ*)(((uint64_t)ret) & ~1));
if (get_jenv_res == JNI_EDETACHED) {
DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
return (uint64_t)res_ptr;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Filter_1register_1tx(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray txid, int8_tArray script_pubkey) {
- LDKFilter* this_arg_conv = (LDKFilter*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKFilter* this_arg_conv = (LDKFilter*)this_arg_ptr;
unsigned char txid_arr[32];
CHECK((*env)->GetArrayLength(env, txid) == 32);
(*env)->GetByteArrayRegion(env, txid, 0, 32, txid_arr);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Filter_1register_1output(JNIEnv *env, jclass clz, int64_t this_arg, int64_t output) {
- LDKFilter* this_arg_conv = (LDKFilter*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKFilter* this_arg_conv = (LDKFilter*)this_arg_ptr;
LDKWatchedOutput output_conv;
output_conv.inner = (void*)(output & (~1));
output_conv.is_owned = (output & 1) || (output == 0);
int64_t* ret_vals = (*env)->GetLongArrayElements (env, ret, NULL);
for (size_t s = 0; s < ret_constr.datalen; s++) {
int64_t ret_conv_18 = ret_vals[s];
- LDKMessageSendEvent ret_conv_18_conv = *(LDKMessageSendEvent*)(((uint64_t)ret_conv_18) & ~1);
+ void* ret_conv_18_ptr = (void*)(((uint64_t)ret_conv_18) & ~1);
+ CHECK_ACCESS(ret_conv_18_ptr);
+ LDKMessageSendEvent ret_conv_18_conv = *(LDKMessageSendEvent*)(ret_conv_18_ptr);
ret_conv_18_conv = MessageSendEvent_clone((LDKMessageSendEvent*)(((uint64_t)ret_conv_18) & ~1));
ret_constr.data[s] = ret_conv_18_conv;
}
return (uint64_t)res_ptr;
}
JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_MessageSendEventsProvider_1get_1and_1clear_1pending_1msg_1events(JNIEnv *env, jclass clz, int64_t this_arg) {
- LDKMessageSendEventsProvider* this_arg_conv = (LDKMessageSendEventsProvider*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKMessageSendEventsProvider* this_arg_conv = (LDKMessageSendEventsProvider*)this_arg_ptr;
LDKCVec_MessageSendEventZ ret_var = (this_arg_conv->get_and_clear_pending_msg_events)(this_arg_conv->this_arg);
int64_tArray ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
for (size_t s = 0; s < ret_var.datalen; s++) {
LDKMessageSendEvent *ret_conv_18_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
- *ret_conv_18_copy = MessageSendEvent_clone(&ret_var.data[s]);
+ *ret_conv_18_copy = ret_var.data[s];
uint64_t ret_conv_18_ref = (uint64_t)ret_conv_18_copy;
ret_arr_ptr[s] = ret_conv_18_ref;
}
return (uint64_t)res_ptr;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EventHandler_1handle_1event(JNIEnv *env, jclass clz, int64_t this_arg, int64_t event) {
- LDKEventHandler* this_arg_conv = (LDKEventHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKEventHandler* this_arg_conv = (LDKEventHandler*)this_arg_ptr;
LDKEvent* event_conv = (LDKEvent*)event;
(this_arg_conv->handle_event)(this_arg_conv->this_arg, event_conv);
}
return (uint64_t)res_ptr;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EventsProvider_1process_1pending_1events(JNIEnv *env, jclass clz, int64_t this_arg, int64_t handler) {
- LDKEventsProvider* this_arg_conv = (LDKEventsProvider*)(((uint64_t)this_arg) & ~1);
- LDKEventHandler handler_conv = *(LDKEventHandler*)(((uint64_t)handler) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKEventsProvider* this_arg_conv = (LDKEventsProvider*)this_arg_ptr;
+ void* handler_ptr = (void*)(((uint64_t)handler) & ~1);
+ CHECK_ACCESS(handler_ptr);
+ LDKEventHandler handler_conv = *(LDKEventHandler*)(handler_ptr);
if (handler_conv.free == LDKEventHandler_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKEventHandler_JCalls_cloned(&handler_conv);
return (uint64_t)res_ptr;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Listen_1block_1connected(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray block, int32_t height) {
- LDKListen* this_arg_conv = (LDKListen*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKListen* this_arg_conv = (LDKListen*)this_arg_ptr;
LDKu8slice block_ref;
block_ref.datalen = (*env)->GetArrayLength(env, block);
block_ref.data = (*env)->GetByteArrayElements (env, block, NULL);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Listen_1block_1disconnected(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray header, int32_t height) {
- LDKListen* this_arg_conv = (LDKListen*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKListen* this_arg_conv = (LDKListen*)this_arg_ptr;
unsigned char header_arr[80];
CHECK((*env)->GetArrayLength(env, header) == 80);
(*env)->GetByteArrayRegion(env, header, 0, 80, header_arr);
return (uint64_t)res_ptr;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Confirm_1transactions_1confirmed(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray header, int64_tArray txdata, int32_t height) {
- LDKConfirm* this_arg_conv = (LDKConfirm*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKConfirm* this_arg_conv = (LDKConfirm*)this_arg_ptr;
unsigned char header_arr[80];
CHECK((*env)->GetArrayLength(env, header) == 80);
(*env)->GetByteArrayRegion(env, header, 0, 80, header_arr);
int64_t* txdata_vals = (*env)->GetLongArrayElements (env, txdata, NULL);
for (size_t c = 0; c < txdata_constr.datalen; c++) {
int64_t txdata_conv_28 = txdata_vals[c];
- LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(((uint64_t)txdata_conv_28) & ~1);
+ void* txdata_conv_28_ptr = (void*)(((uint64_t)txdata_conv_28) & ~1);
+ CHECK_ACCESS(txdata_conv_28_ptr);
+ LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(txdata_conv_28_ptr);
txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)(((uint64_t)txdata_conv_28) & ~1));
txdata_constr.data[c] = txdata_conv_28_conv;
}
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Confirm_1transaction_1unconfirmed(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray txid) {
- LDKConfirm* this_arg_conv = (LDKConfirm*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKConfirm* this_arg_conv = (LDKConfirm*)this_arg_ptr;
unsigned char txid_arr[32];
CHECK((*env)->GetArrayLength(env, txid) == 32);
(*env)->GetByteArrayRegion(env, txid, 0, 32, txid_arr);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Confirm_1best_1block_1updated(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray header, int32_t height) {
- LDKConfirm* this_arg_conv = (LDKConfirm*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKConfirm* this_arg_conv = (LDKConfirm*)this_arg_ptr;
unsigned char header_arr[80];
CHECK((*env)->GetArrayLength(env, header) == 80);
(*env)->GetByteArrayRegion(env, header, 0, 80, header_arr);
}
JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_Confirm_1get_1relevant_1txids(JNIEnv *env, jclass clz, int64_t this_arg) {
- LDKConfirm* this_arg_conv = (LDKConfirm*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKConfirm* this_arg_conv = (LDKConfirm*)this_arg_ptr;
LDKCVec_TxidZ ret_var = (this_arg_conv->get_relevant_txids)(this_arg_conv->this_arg);
jobjectArray ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL);
;
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to persist_new_channel in LDKPersist from rust threw an exception.");
}
- LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr);
ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone((LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)ret) & ~1));
if (get_jenv_res == JNI_EDETACHED) {
DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to update_persisted_channel in LDKPersist from rust threw an exception.");
}
- LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr);
ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone((LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)ret) & ~1));
if (get_jenv_res == JNI_EDETACHED) {
DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
return (uint64_t)res_ptr;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Persist_1persist_1new_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int64_t id, int64_t data) {
- LDKPersist* this_arg_conv = (LDKPersist*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKPersist* this_arg_conv = (LDKPersist*)this_arg_ptr;
LDKOutPoint id_conv;
id_conv.inner = (void*)(id & (~1));
id_conv.is_owned = (id & 1) || (id == 0);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Persist_1update_1persisted_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int64_t id, int64_t update, int64_t data) {
- LDKPersist* this_arg_conv = (LDKPersist*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKPersist* this_arg_conv = (LDKPersist*)this_arg_ptr;
LDKOutPoint id_conv;
id_conv.inner = (void*)(id & (~1));
id_conv.is_owned = (id & 1) || (id == 0);
return (int64_t)(res_ptr | 1);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1open_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t their_features, int64_t msg) {
- LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
(*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1accept_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t their_features, int64_t msg) {
- LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
(*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1funding_1created(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) {
- LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
(*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1funding_1signed(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) {
- LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
(*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1funding_1locked(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) {
- LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
(*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1shutdown(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t their_features, int64_t msg) {
- LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
(*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1closing_1signed(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) {
- LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
(*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1update_1add_1htlc(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) {
- LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
(*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1update_1fulfill_1htlc(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) {
- LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
(*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1update_1fail_1htlc(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) {
- LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
(*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1update_1fail_1malformed_1htlc(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) {
- LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
(*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1commitment_1signed(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) {
- LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
(*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1revoke_1and_1ack(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) {
- LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
(*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1update_1fee(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) {
- LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
(*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1announcement_1signatures(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) {
- LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
(*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1peer_1disconnected(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, jboolean no_connection_possible) {
- LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
(*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1peer_1connected(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) {
- LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
(*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1channel_1reestablish(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) {
- LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
(*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1channel_1update(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) {
- LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
(*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1error(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) {
- LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
(*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to handle_node_announcement in LDKRoutingMessageHandler from rust threw an exception.");
}
- LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(ret_ptr);
ret_conv = CResult_boolLightningErrorZ_clone((LDKCResult_boolLightningErrorZ*)(((uint64_t)ret) & ~1));
if (get_jenv_res == JNI_EDETACHED) {
DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to handle_channel_announcement in LDKRoutingMessageHandler from rust threw an exception.");
}
- LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(ret_ptr);
ret_conv = CResult_boolLightningErrorZ_clone((LDKCResult_boolLightningErrorZ*)(((uint64_t)ret) & ~1));
if (get_jenv_res == JNI_EDETACHED) {
DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to handle_channel_update in LDKRoutingMessageHandler from rust threw an exception.");
}
- LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(ret_ptr);
ret_conv = CResult_boolLightningErrorZ_clone((LDKCResult_boolLightningErrorZ*)(((uint64_t)ret) & ~1));
if (get_jenv_res == JNI_EDETACHED) {
DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
int64_t* ret_vals = (*env)->GetLongArrayElements (env, ret, NULL);
for (size_t h = 0; h < ret_constr.datalen; h++) {
int64_t ret_conv_59 = ret_vals[h];
- LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ ret_conv_59_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(((uint64_t)ret_conv_59) & ~1);
+ void* ret_conv_59_ptr = (void*)(((uint64_t)ret_conv_59) & ~1);
+ CHECK_ACCESS(ret_conv_59_ptr);
+ LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ ret_conv_59_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(ret_conv_59_ptr);
ret_conv_59_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone((LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(((uint64_t)ret_conv_59) & ~1));
ret_constr.data[h] = ret_conv_59_conv;
}
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to handle_reply_channel_range in LDKRoutingMessageHandler from rust threw an exception.");
}
- LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr);
ret_conv = CResult_NoneLightningErrorZ_clone((LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1));
if (get_jenv_res == JNI_EDETACHED) {
DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to handle_reply_short_channel_ids_end in LDKRoutingMessageHandler from rust threw an exception.");
}
- LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr);
ret_conv = CResult_NoneLightningErrorZ_clone((LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1));
if (get_jenv_res == JNI_EDETACHED) {
DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to handle_query_channel_range in LDKRoutingMessageHandler from rust threw an exception.");
}
- LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr);
ret_conv = CResult_NoneLightningErrorZ_clone((LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1));
if (get_jenv_res == JNI_EDETACHED) {
DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to handle_query_short_channel_ids in LDKRoutingMessageHandler from rust threw an exception.");
}
- LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr);
ret_conv = CResult_NoneLightningErrorZ_clone((LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1));
if (get_jenv_res == JNI_EDETACHED) {
DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
return (int64_t)(res_ptr | 1);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1handle_1node_1announcement(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg) {
- LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
LDKNodeAnnouncement msg_conv;
msg_conv.inner = (void*)(msg & (~1));
msg_conv.is_owned = false;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1handle_1channel_1announcement(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg) {
- LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
LDKChannelAnnouncement msg_conv;
msg_conv.inner = (void*)(msg & (~1));
msg_conv.is_owned = false;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1handle_1channel_1update(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg) {
- LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
LDKChannelUpdate msg_conv;
msg_conv.inner = (void*)(msg & (~1));
msg_conv.is_owned = false;
}
JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1get_1next_1channel_1announcements(JNIEnv *env, jclass clz, int64_t this_arg, int64_t starting_point, int8_t batch_amount) {
- LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ ret_var = (this_arg_conv->get_next_channel_announcements)(this_arg_conv->this_arg, starting_point, batch_amount);
int64_tArray ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
}
JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1get_1next_1node_1announcements(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray starting_point, int8_t batch_amount) {
- LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
LDKPublicKey starting_point_ref;
CHECK((*env)->GetArrayLength(env, starting_point) == 33);
(*env)->GetByteArrayRegion(env, starting_point, 0, 33, starting_point_ref.compressed_form);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1sync_1routing_1table(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t init) {
- LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
(*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1handle_1reply_1channel_1range(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) {
- LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
(*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1handle_1reply_1short_1channel_1ids_1end(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) {
- LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
(*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1handle_1query_1channel_1range(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) {
- LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
(*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1handle_1query_1short_1channel_1ids(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) {
- LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
(*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to read in LDKCustomMessageReader from rust threw an exception.");
}
- LDKCResult_COption_TypeZDecodeErrorZ ret_conv = *(LDKCResult_COption_TypeZDecodeErrorZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_COption_TypeZDecodeErrorZ ret_conv = *(LDKCResult_COption_TypeZDecodeErrorZ*)(ret_ptr);
ret_conv = CResult_COption_TypeZDecodeErrorZ_clone((LDKCResult_COption_TypeZDecodeErrorZ*)(((uint64_t)ret) & ~1));
if (get_jenv_res == JNI_EDETACHED) {
DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
return (uint64_t)res_ptr;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CustomMessageReader_1read(JNIEnv *env, jclass clz, int64_t this_arg, int16_t message_type, int8_tArray buffer) {
- LDKCustomMessageReader* this_arg_conv = (LDKCustomMessageReader*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKCustomMessageReader* this_arg_conv = (LDKCustomMessageReader*)this_arg_ptr;
LDKu8slice buffer_ref;
buffer_ref.datalen = (*env)->GetArrayLength(env, buffer);
buffer_ref.data = (*env)->GetByteArrayElements (env, buffer, NULL);
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to handle_custom_message in LDKCustomMessageHandler from rust threw an exception.");
}
- LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr);
ret_conv = CResult_NoneLightningErrorZ_clone((LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1));
if (get_jenv_res == JNI_EDETACHED) {
DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
int64_t* ret_vals = (*env)->GetLongArrayElements (env, ret, NULL);
for (size_t z = 0; z < ret_constr.datalen; z++) {
int64_t ret_conv_25 = ret_vals[z];
- LDKC2Tuple_PublicKeyTypeZ ret_conv_25_conv = *(LDKC2Tuple_PublicKeyTypeZ*)(((uint64_t)ret_conv_25) & ~1);
+ void* ret_conv_25_ptr = (void*)(((uint64_t)ret_conv_25) & ~1);
+ CHECK_ACCESS(ret_conv_25_ptr);
+ LDKC2Tuple_PublicKeyTypeZ ret_conv_25_conv = *(LDKC2Tuple_PublicKeyTypeZ*)(ret_conv_25_ptr);
ret_conv_25_conv = C2Tuple_PublicKeyTypeZ_clone((LDKC2Tuple_PublicKeyTypeZ*)(((uint64_t)ret_conv_25) & ~1));
ret_constr.data[z] = ret_conv_25_conv;
}
return (int64_t)(res_ptr | 1);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CustomMessageHandler_1handle_1custom_1message(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg, int8_tArray sender_node_id) {
- LDKCustomMessageHandler* this_arg_conv = (LDKCustomMessageHandler*)(((uint64_t)this_arg) & ~1);
- LDKType msg_conv = *(LDKType*)(((uint64_t)msg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKCustomMessageHandler* this_arg_conv = (LDKCustomMessageHandler*)this_arg_ptr;
+ void* msg_ptr = (void*)(((uint64_t)msg) & ~1);
+ CHECK_ACCESS(msg_ptr);
+ LDKType msg_conv = *(LDKType*)(msg_ptr);
if (msg_conv.free == LDKType_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKType_JCalls_cloned(&msg_conv);
}
JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CustomMessageHandler_1get_1and_1clear_1pending_1msg(JNIEnv *env, jclass clz, int64_t this_arg) {
- LDKCustomMessageHandler* this_arg_conv = (LDKCustomMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKCustomMessageHandler* this_arg_conv = (LDKCustomMessageHandler*)this_arg_ptr;
LDKCVec_C2Tuple_PublicKeyTypeZZ ret_var = (this_arg_conv->get_and_clear_pending_msg)(this_arg_conv->this_arg);
int64_tArray ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
return (uint64_t)res_ptr;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1send_1data(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray data, jboolean resume_read) {
- LDKSocketDescriptor* this_arg_conv = (LDKSocketDescriptor*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKSocketDescriptor* this_arg_conv = (LDKSocketDescriptor*)this_arg_ptr;
LDKu8slice data_ref;
data_ref.datalen = (*env)->GetArrayLength(env, data);
data_ref.data = (*env)->GetByteArrayElements (env, data, NULL);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1disconnect_1socket(JNIEnv *env, jclass clz, int64_t this_arg) {
- LDKSocketDescriptor* this_arg_conv = (LDKSocketDescriptor*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKSocketDescriptor* this_arg_conv = (LDKSocketDescriptor*)this_arg_ptr;
(this_arg_conv->disconnect_socket)(this_arg_conv->this_arg);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1hash(JNIEnv *env, jclass clz, int64_t this_arg) {
- LDKSocketDescriptor* this_arg_conv = (LDKSocketDescriptor*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKSocketDescriptor* this_arg_conv = (LDKSocketDescriptor*)this_arg_ptr;
int64_t ret_val = (this_arg_conv->hash)(this_arg_conv->this_arg);
return ret_val;
}
return (uint64_t)res_ptr;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Score_1channel_1penalty_1msat(JNIEnv *env, jclass clz, int64_t this_arg, int64_t short_channel_id) {
- LDKScore* this_arg_conv = (LDKScore*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr;
int64_t ret_val = (this_arg_conv->channel_penalty_msat)(this_arg_conv->this_arg, short_channel_id);
return ret_val;
}
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to persist_manager in LDKChannelManagerPersister from rust threw an exception.");
}
- LDKCResult_NoneErrorZ ret_conv = *(LDKCResult_NoneErrorZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_NoneErrorZ ret_conv = *(LDKCResult_NoneErrorZ*)(ret_ptr);
ret_conv = CResult_NoneErrorZ_clone((LDKCResult_NoneErrorZ*)(((uint64_t)ret) & ~1));
if (get_jenv_res == JNI_EDETACHED) {
DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
return (uint64_t)res_ptr;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerPersister_1persist_1manager(JNIEnv *env, jclass clz, int64_t this_arg, int64_t channel_manager) {
- LDKChannelManagerPersister* this_arg_conv = (LDKChannelManagerPersister*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelManagerPersister* this_arg_conv = (LDKChannelManagerPersister*)this_arg_ptr;
LDKChannelManager channel_manager_conv;
channel_manager_conv.inner = (void*)(channel_manager & (~1));
channel_manager_conv.is_owned = false;
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxOut_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKTxOut _res_conv = *(LDKTxOut*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKTxOut _res_conv = *(LDKTxOut*)(_res_ptr);
FREE((void*)_res);
TxOut_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_SecretKeyErrorZ _res_conv = *(LDKCResult_SecretKeyErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_SecretKeyErrorZ _res_conv = *(LDKCResult_SecretKeyErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_SecretKeyErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_PublicKeyErrorZ _res_conv = *(LDKCResult_PublicKeyErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_PublicKeyErrorZ _res_conv = *(LDKCResult_PublicKeyErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_PublicKeyErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_TxCreationKeysDecodeErrorZ _res_conv = *(LDKCResult_TxCreationKeysDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_TxCreationKeysDecodeErrorZ _res_conv = *(LDKCResult_TxCreationKeysDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_TxCreationKeysDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelPublicKeysDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_ChannelPublicKeysDecodeErrorZ _res_conv = *(LDKCResult_ChannelPublicKeysDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_ChannelPublicKeysDecodeErrorZ _res_conv = *(LDKCResult_ChannelPublicKeysDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_ChannelPublicKeysDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_TxCreationKeysErrorZ _res_conv = *(LDKCResult_TxCreationKeysErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_TxCreationKeysErrorZ _res_conv = *(LDKCResult_TxCreationKeysErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_TxCreationKeysErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1u32Z_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCOption_u32Z _res_conv = *(LDKCOption_u32Z*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCOption_u32Z _res_conv = *(LDKCOption_u32Z*)(_res_ptr);
FREE((void*)_res);
COption_u32Z_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCOutputInCommitmentDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_HTLCOutputInCommitmentDecodeErrorZ _res_conv = *(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_HTLCOutputInCommitmentDecodeErrorZ _res_conv = *(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_HTLCOutputInCommitmentDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyChannelTransactionParametersDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ _res_conv = *(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ _res_conv = *(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTransactionParametersDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_ChannelTransactionParametersDecodeErrorZ _res_conv = *(LDKCResult_ChannelTransactionParametersDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_ChannelTransactionParametersDecodeErrorZ _res_conv = *(LDKCResult_ChannelTransactionParametersDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_ChannelTransactionParametersDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1HolderCommitmentTransactionDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_HolderCommitmentTransactionDecodeErrorZ _res_conv = *(LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_HolderCommitmentTransactionDecodeErrorZ _res_conv = *(LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_HolderCommitmentTransactionDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BuiltCommitmentTransactionDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_BuiltCommitmentTransactionDecodeErrorZ _res_conv = *(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_BuiltCommitmentTransactionDecodeErrorZ _res_conv = *(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_BuiltCommitmentTransactionDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedClosingTransactionNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_TrustedClosingTransactionNoneZ _res_conv = *(LDKCResult_TrustedClosingTransactionNoneZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_TrustedClosingTransactionNoneZ _res_conv = *(LDKCResult_TrustedClosingTransactionNoneZ*)(_res_ptr);
FREE((void*)_res);
CResult_TrustedClosingTransactionNoneZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentTransactionDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_CommitmentTransactionDecodeErrorZ _res_conv = *(LDKCResult_CommitmentTransactionDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_CommitmentTransactionDecodeErrorZ _res_conv = *(LDKCResult_CommitmentTransactionDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_CommitmentTransactionDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedCommitmentTransactionNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_TrustedCommitmentTransactionNoneZ _res_conv = *(LDKCResult_TrustedCommitmentTransactionNoneZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_TrustedCommitmentTransactionNoneZ _res_conv = *(LDKCResult_TrustedCommitmentTransactionNoneZ*)(_res_ptr);
FREE((void*)_res);
CResult_TrustedCommitmentTransactionNoneZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_CVec_SignatureZNoneZ _res_conv = *(LDKCResult_CVec_SignatureZNoneZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_CVec_SignatureZNoneZ _res_conv = *(LDKCResult_CVec_SignatureZNoneZ*)(_res_ptr);
FREE((void*)_res);
CResult_CVec_SignatureZNoneZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_ShutdownScriptDecodeErrorZ _res_conv = *(LDKCResult_ShutdownScriptDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_ShutdownScriptDecodeErrorZ _res_conv = *(LDKCResult_ShutdownScriptDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_ShutdownScriptDecodeErrorZ_free(_res_conv);
}
LDKInvalidShutdownScript e_conv;
e_conv.inner = (void*)(e & (~1));
e_conv.is_owned = (e & 1) || (e == 0);
- // Warning: we need a move here but no clone is available for LDKInvalidShutdownScript
+ e_conv = InvalidShutdownScript_clone(&e_conv);
LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ");
*ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_err(e_conv);
return (uint64_t)ret_conv;
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptInvalidShutdownScriptZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_ShutdownScriptInvalidShutdownScriptZ _res_conv = *(LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_ShutdownScriptInvalidShutdownScriptZ _res_conv = *(LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)(_res_ptr);
FREE((void*)_res);
CResult_ShutdownScriptInvalidShutdownScriptZ_free(_res_conv);
}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptInvalidShutdownScriptZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
+ LDKCResult_ShutdownScriptInvalidShutdownScriptZ* orig_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)(orig & ~1);
+ LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ");
+ *ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_clone(orig_conv);
+ return (uint64_t)ret_conv;
+}
+
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneErrorZ_1ok(JNIEnv *env, jclass clz) {
LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ");
*ret_conv = CResult_NoneErrorZ_ok();
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_NoneErrorZ _res_conv = *(LDKCResult_NoneErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_NoneErrorZ _res_conv = *(LDKCResult_NoneErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_NoneErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_RouteHopDecodeErrorZ _res_conv = *(LDKCResult_RouteHopDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_RouteHopDecodeErrorZ _res_conv = *(LDKCResult_RouteHopDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_RouteHopDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_RouteDecodeErrorZ _res_conv = *(LDKCResult_RouteDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_RouteDecodeErrorZ _res_conv = *(LDKCResult_RouteDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_RouteDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1u64Z_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCOption_u64Z _res_conv = *(LDKCOption_u64Z*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCOption_u64Z _res_conv = *(LDKCOption_u64Z*)(_res_ptr);
FREE((void*)_res);
COption_u64Z_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_RouteLightningErrorZ _res_conv = *(LDKCResult_RouteLightningErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_RouteLightningErrorZ _res_conv = *(LDKCResult_RouteLightningErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_RouteLightningErrorZ_free(_res_conv);
}
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
- LDKTxOut o_conv = *(LDKTxOut*)(((uint64_t)o) & ~1);
+ void* o_ptr = (void*)(((uint64_t)o) & ~1);
+ CHECK_ACCESS(o_ptr);
+ LDKTxOut o_conv = *(LDKTxOut*)(o_ptr);
o_conv = TxOut_clone((LDKTxOut*)(((uint64_t)o) & ~1));
LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ");
*ret_conv = CResult_TxOutAccessErrorZ_ok(o_conv);
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_TxOutAccessErrorZ _res_conv = *(LDKCResult_TxOutAccessErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_TxOutAccessErrorZ _res_conv = *(LDKCResult_TxOutAccessErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_TxOutAccessErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKC2Tuple_usizeTransactionZ _res_conv = *(LDKC2Tuple_usizeTransactionZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKC2Tuple_usizeTransactionZ _res_conv = *(LDKC2Tuple_usizeTransactionZ*)(_res_ptr);
FREE((void*)_res);
C2Tuple_usizeTransactionZ_free(_res_conv);
}
int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
for (size_t c = 0; c < _res_constr.datalen; c++) {
int64_t _res_conv_28 = _res_vals[c];
- LDKC2Tuple_usizeTransactionZ _res_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(((uint64_t)_res_conv_28) & ~1);
+ void* _res_conv_28_ptr = (void*)(((uint64_t)_res_conv_28) & ~1);
+ CHECK_ACCESS(_res_conv_28_ptr);
+ LDKC2Tuple_usizeTransactionZ _res_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(_res_conv_28_ptr);
FREE((void*)_res_conv_28);
_res_constr.data[c] = _res_conv_28_conv;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_NoneChannelMonitorUpdateErrZ _res_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_NoneChannelMonitorUpdateErrZ _res_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(_res_ptr);
FREE((void*)_res);
CResult_NoneChannelMonitorUpdateErrZ_free(_res_conv);
}
int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
for (size_t o = 0; o < _res_constr.datalen; o++) {
int64_t _res_conv_14 = _res_vals[o];
- LDKMonitorEvent _res_conv_14_conv = *(LDKMonitorEvent*)(((uint64_t)_res_conv_14) & ~1);
+ void* _res_conv_14_ptr = (void*)(((uint64_t)_res_conv_14) & ~1);
+ CHECK_ACCESS(_res_conv_14_ptr);
+ LDKMonitorEvent _res_conv_14_conv = *(LDKMonitorEvent*)(_res_conv_14_ptr);
FREE((void*)_res_conv_14);
_res_constr.data[o] = _res_conv_14_conv;
}
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1usizeTransactionZZ_1some(JNIEnv *env, jclass clz, int64_t o) {
- LDKC2Tuple_usizeTransactionZ o_conv = *(LDKC2Tuple_usizeTransactionZ*)(((uint64_t)o) & ~1);
+ void* o_ptr = (void*)(((uint64_t)o) & ~1);
+ CHECK_ACCESS(o_ptr);
+ LDKC2Tuple_usizeTransactionZ o_conv = *(LDKC2Tuple_usizeTransactionZ*)(o_ptr);
o_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)(((uint64_t)o) & ~1));
LDKCOption_C2Tuple_usizeTransactionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_usizeTransactionZZ), "LDKCOption_C2Tuple_usizeTransactionZZ");
*ret_copy = COption_C2Tuple_usizeTransactionZZ_some(o_conv);
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1usizeTransactionZZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCOption_C2Tuple_usizeTransactionZZ _res_conv = *(LDKCOption_C2Tuple_usizeTransactionZZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCOption_C2Tuple_usizeTransactionZZ _res_conv = *(LDKCOption_C2Tuple_usizeTransactionZZ*)(_res_ptr);
FREE((void*)_res);
COption_C2Tuple_usizeTransactionZZ_free(_res_conv);
}
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1NetworkUpdateZ_1some(JNIEnv *env, jclass clz, int64_t o) {
- LDKNetworkUpdate o_conv = *(LDKNetworkUpdate*)(((uint64_t)o) & ~1);
+ void* o_ptr = (void*)(((uint64_t)o) & ~1);
+ CHECK_ACCESS(o_ptr);
+ LDKNetworkUpdate o_conv = *(LDKNetworkUpdate*)(o_ptr);
o_conv = NetworkUpdate_clone((LDKNetworkUpdate*)(((uint64_t)o) & ~1));
LDKCOption_NetworkUpdateZ *ret_copy = MALLOC(sizeof(LDKCOption_NetworkUpdateZ), "LDKCOption_NetworkUpdateZ");
*ret_copy = COption_NetworkUpdateZ_some(o_conv);
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1NetworkUpdateZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCOption_NetworkUpdateZ _res_conv = *(LDKCOption_NetworkUpdateZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCOption_NetworkUpdateZ _res_conv = *(LDKCOption_NetworkUpdateZ*)(_res_ptr);
FREE((void*)_res);
COption_NetworkUpdateZ_free(_res_conv);
}
int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
for (size_t b = 0; b < _res_constr.datalen; b++) {
int64_t _res_conv_27 = _res_vals[b];
- LDKSpendableOutputDescriptor _res_conv_27_conv = *(LDKSpendableOutputDescriptor*)(((uint64_t)_res_conv_27) & ~1);
+ void* _res_conv_27_ptr = (void*)(((uint64_t)_res_conv_27) & ~1);
+ CHECK_ACCESS(_res_conv_27_ptr);
+ LDKSpendableOutputDescriptor _res_conv_27_conv = *(LDKSpendableOutputDescriptor*)(_res_conv_27_ptr);
FREE((void*)_res_conv_27);
_res_constr.data[b] = _res_conv_27_conv;
}
int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
for (size_t s = 0; s < _res_constr.datalen; s++) {
int64_t _res_conv_18 = _res_vals[s];
- LDKMessageSendEvent _res_conv_18_conv = *(LDKMessageSendEvent*)(((uint64_t)_res_conv_18) & ~1);
+ void* _res_conv_18_ptr = (void*)(((uint64_t)_res_conv_18) & ~1);
+ CHECK_ACCESS(_res_conv_18_ptr);
+ LDKMessageSendEvent _res_conv_18_conv = *(LDKMessageSendEvent*)(_res_conv_18_ptr);
FREE((void*)_res_conv_18);
_res_constr.data[s] = _res_conv_18_conv;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_InitFeaturesDecodeErrorZ _res_conv = *(LDKCResult_InitFeaturesDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_InitFeaturesDecodeErrorZ _res_conv = *(LDKCResult_InitFeaturesDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_InitFeaturesDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_NodeFeaturesDecodeErrorZ _res_conv = *(LDKCResult_NodeFeaturesDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_NodeFeaturesDecodeErrorZ _res_conv = *(LDKCResult_NodeFeaturesDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_NodeFeaturesDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_ChannelFeaturesDecodeErrorZ _res_conv = *(LDKCResult_ChannelFeaturesDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_ChannelFeaturesDecodeErrorZ _res_conv = *(LDKCResult_ChannelFeaturesDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_ChannelFeaturesDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_InvoiceFeaturesDecodeErrorZ _res_conv = *(LDKCResult_InvoiceFeaturesDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_InvoiceFeaturesDecodeErrorZ _res_conv = *(LDKCResult_InvoiceFeaturesDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_InvoiceFeaturesDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ _res_conv = *(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ _res_conv = *(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ _res_conv = *(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ _res_conv = *(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free(_res_conv);
}
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
- LDKSpendableOutputDescriptor o_conv = *(LDKSpendableOutputDescriptor*)(((uint64_t)o) & ~1);
+ void* o_ptr = (void*)(((uint64_t)o) & ~1);
+ CHECK_ACCESS(o_ptr);
+ LDKSpendableOutputDescriptor o_conv = *(LDKSpendableOutputDescriptor*)(o_ptr);
o_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)(((uint64_t)o) & ~1));
LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ");
*ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_ok(o_conv);
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_SpendableOutputDescriptorDecodeErrorZ _res_conv = *(LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_SpendableOutputDescriptorDecodeErrorZ _res_conv = *(LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_SpendableOutputDescriptorDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_NoneNoneZ _res_conv = *(LDKCResult_NoneNoneZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_NoneNoneZ _res_conv = *(LDKCResult_NoneNoneZ*)(_res_ptr);
FREE((void*)_res);
CResult_NoneNoneZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKC2Tuple_SignatureCVec_SignatureZZ _res_conv = *(LDKC2Tuple_SignatureCVec_SignatureZZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKC2Tuple_SignatureCVec_SignatureZZ _res_conv = *(LDKC2Tuple_SignatureCVec_SignatureZZ*)(_res_ptr);
FREE((void*)_res);
C2Tuple_SignatureCVec_SignatureZZ_free(_res_conv);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
- LDKC2Tuple_SignatureCVec_SignatureZZ o_conv = *(LDKC2Tuple_SignatureCVec_SignatureZZ*)(((uint64_t)o) & ~1);
+ void* o_ptr = (void*)(((uint64_t)o) & ~1);
+ CHECK_ACCESS(o_ptr);
+ LDKC2Tuple_SignatureCVec_SignatureZZ o_conv = *(LDKC2Tuple_SignatureCVec_SignatureZZ*)(o_ptr);
o_conv = C2Tuple_SignatureCVec_SignatureZZ_clone((LDKC2Tuple_SignatureCVec_SignatureZZ*)(((uint64_t)o) & ~1));
LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ");
*ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(o_conv);
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ _res_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ _res_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(_res_ptr);
FREE((void*)_res);
CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_SignatureNoneZ _res_conv = *(LDKCResult_SignatureNoneZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_SignatureNoneZ _res_conv = *(LDKCResult_SignatureNoneZ*)(_res_ptr);
FREE((void*)_res);
CResult_SignatureNoneZ_free(_res_conv);
}
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
- LDKSign o_conv = *(LDKSign*)(((uint64_t)o) & ~1);
+ void* o_ptr = (void*)(((uint64_t)o) & ~1);
+ CHECK_ACCESS(o_ptr);
+ LDKSign o_conv = *(LDKSign*)(o_ptr);
if (o_conv.free == LDKSign_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKSign_JCalls_cloned(&o_conv);
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_SignDecodeErrorZ _res_conv = *(LDKCResult_SignDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_SignDecodeErrorZ _res_conv = *(LDKCResult_SignDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_SignDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_RecoverableSignatureNoneZ _res_conv = *(LDKCResult_RecoverableSignatureNoneZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_RecoverableSignatureNoneZ _res_conv = *(LDKCResult_RecoverableSignatureNoneZ*)(_res_ptr);
FREE((void*)_res);
CResult_RecoverableSignatureNoneZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_CVec_CVec_u8ZZNoneZ _res_conv = *(LDKCResult_CVec_CVec_u8ZZNoneZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_CVec_CVec_u8ZZNoneZ _res_conv = *(LDKCResult_CVec_CVec_u8ZZNoneZ*)(_res_ptr);
FREE((void*)_res);
CResult_CVec_CVec_u8ZZNoneZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_InMemorySignerDecodeErrorZ _res_conv = *(LDKCResult_InMemorySignerDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_InMemorySignerDecodeErrorZ _res_conv = *(LDKCResult_InMemorySignerDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_InMemorySignerDecodeErrorZ_free(_res_conv);
}
int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
for (size_t h = 0; h < _res_constr.datalen; h++) {
int64_t _res_conv_7 = _res_vals[h];
- LDKTxOut _res_conv_7_conv = *(LDKTxOut*)(((uint64_t)_res_conv_7) & ~1);
+ void* _res_conv_7_ptr = (void*)(((uint64_t)_res_conv_7) & ~1);
+ CHECK_ACCESS(_res_conv_7_ptr);
+ LDKTxOut _res_conv_7_conv = *(LDKTxOut*)(_res_conv_7_ptr);
FREE((void*)_res_conv_7);
_res_constr.data[h] = _res_conv_7_conv;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_TransactionNoneZ _res_conv = *(LDKCResult_TransactionNoneZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_TransactionNoneZ _res_conv = *(LDKCResult_TransactionNoneZ*)(_res_ptr);
FREE((void*)_res);
CResult_TransactionNoneZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMonitorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKC2Tuple_BlockHashChannelMonitorZ _res_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKC2Tuple_BlockHashChannelMonitorZ _res_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(_res_ptr);
FREE((void*)_res);
C2Tuple_BlockHashChannelMonitorZ_free(_res_conv);
}
int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
for (size_t j = 0; j < _res_constr.datalen; j++) {
int64_t _res_conv_35 = _res_vals[j];
- LDKC2Tuple_BlockHashChannelMonitorZ _res_conv_35_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(((uint64_t)_res_conv_35) & ~1);
+ void* _res_conv_35_ptr = (void*)(((uint64_t)_res_conv_35) & ~1);
+ CHECK_ACCESS(_res_conv_35_ptr);
+ LDKC2Tuple_BlockHashChannelMonitorZ _res_conv_35_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(_res_conv_35_ptr);
FREE((void*)_res_conv_35);
_res_constr.data[j] = _res_conv_35_conv;
}
int64_t* o_vals = (*env)->GetLongArrayElements (env, o, NULL);
for (size_t j = 0; j < o_constr.datalen; j++) {
int64_t o_conv_35 = o_vals[j];
- LDKC2Tuple_BlockHashChannelMonitorZ o_conv_35_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(((uint64_t)o_conv_35) & ~1);
+ void* o_conv_35_ptr = (void*)(((uint64_t)o_conv_35) & ~1);
+ CHECK_ACCESS(o_conv_35_ptr);
+ LDKC2Tuple_BlockHashChannelMonitorZ o_conv_35_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(o_conv_35_ptr);
o_conv_35_conv = C2Tuple_BlockHashChannelMonitorZ_clone((LDKC2Tuple_BlockHashChannelMonitorZ*)(((uint64_t)o_conv_35) & ~1));
o_constr.data[j] = o_conv_35_conv;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ _res_conv = *(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ _res_conv = *(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_PaymentIdDecodeErrorZ _res_conv = *(LDKCResult_PaymentIdDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_PaymentIdDecodeErrorZ _res_conv = *(LDKCResult_PaymentIdDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_PaymentIdDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1u16Z_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCOption_u16Z _res_conv = *(LDKCOption_u16Z*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCOption_u16Z _res_conv = *(LDKCOption_u16Z*)(_res_ptr);
FREE((void*)_res);
COption_u16Z_free(_res_conv);
}
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKAPIError e_conv = *(LDKAPIError*)(((uint64_t)e) & ~1);
+ void* e_ptr = (void*)(((uint64_t)e) & ~1);
+ CHECK_ACCESS(e_ptr);
+ LDKAPIError e_conv = *(LDKAPIError*)(e_ptr);
e_conv = APIError_clone((LDKAPIError*)(((uint64_t)e) & ~1));
LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
*ret_conv = CResult_NoneAPIErrorZ_err(e_conv);
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_NoneAPIErrorZ _res_conv = *(LDKCResult_NoneAPIErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_NoneAPIErrorZ _res_conv = *(LDKCResult_NoneAPIErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_NoneAPIErrorZ_free(_res_conv);
}
int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
for (size_t w = 0; w < _res_constr.datalen; w++) {
int64_t _res_conv_22 = _res_vals[w];
- LDKCResult_NoneAPIErrorZ _res_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(((uint64_t)_res_conv_22) & ~1);
+ void* _res_conv_22_ptr = (void*)(((uint64_t)_res_conv_22) & ~1);
+ CHECK_ACCESS(_res_conv_22_ptr);
+ LDKCResult_NoneAPIErrorZ _res_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(_res_conv_22_ptr);
FREE((void*)_res_conv_22);
_res_constr.data[w] = _res_conv_22_conv;
}
int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
for (size_t k = 0; k < _res_constr.datalen; k++) {
int64_t _res_conv_10 = _res_vals[k];
- LDKAPIError _res_conv_10_conv = *(LDKAPIError*)(((uint64_t)_res_conv_10) & ~1);
+ void* _res_conv_10_ptr = (void*)(((uint64_t)_res_conv_10) & ~1);
+ CHECK_ACCESS(_res_conv_10_ptr);
+ LDKAPIError _res_conv_10_conv = *(LDKAPIError*)(_res_conv_10_ptr);
FREE((void*)_res_conv_10);
_res_constr.data[k] = _res_conv_10_conv;
}
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKAPIError e_conv = *(LDKAPIError*)(((uint64_t)e) & ~1);
+ void* e_ptr = (void*)(((uint64_t)e) & ~1);
+ CHECK_ACCESS(e_ptr);
+ LDKAPIError e_conv = *(LDKAPIError*)(e_ptr);
e_conv = APIError_clone((LDKAPIError*)(((uint64_t)e) & ~1));
LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ");
*ret_conv = CResult__u832APIErrorZ_err(e_conv);
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult__u832APIErrorZ _res_conv = *(LDKCResult__u832APIErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult__u832APIErrorZ _res_conv = *(LDKCResult__u832APIErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult__u832APIErrorZ_free(_res_conv);
}
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKPaymentSendFailure e_conv = *(LDKPaymentSendFailure*)(((uint64_t)e) & ~1);
+ void* e_ptr = (void*)(((uint64_t)e) & ~1);
+ CHECK_ACCESS(e_ptr);
+ LDKPaymentSendFailure e_conv = *(LDKPaymentSendFailure*)(e_ptr);
e_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)(((uint64_t)e) & ~1));
LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ");
*ret_conv = CResult_PaymentIdPaymentSendFailureZ_err(e_conv);
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_PaymentIdPaymentSendFailureZ _res_conv = *(LDKCResult_PaymentIdPaymentSendFailureZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_PaymentIdPaymentSendFailureZ _res_conv = *(LDKCResult_PaymentIdPaymentSendFailureZ*)(_res_ptr);
FREE((void*)_res);
CResult_PaymentIdPaymentSendFailureZ_free(_res_conv);
}
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKPaymentSendFailure e_conv = *(LDKPaymentSendFailure*)(((uint64_t)e) & ~1);
+ void* e_ptr = (void*)(((uint64_t)e) & ~1);
+ CHECK_ACCESS(e_ptr);
+ LDKPaymentSendFailure e_conv = *(LDKPaymentSendFailure*)(e_ptr);
e_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)(((uint64_t)e) & ~1));
LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
*ret_conv = CResult_NonePaymentSendFailureZ_err(e_conv);
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_NonePaymentSendFailureZ _res_conv = *(LDKCResult_NonePaymentSendFailureZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_NonePaymentSendFailureZ _res_conv = *(LDKCResult_NonePaymentSendFailureZ*)(_res_ptr);
FREE((void*)_res);
CResult_NonePaymentSendFailureZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentIdZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKC2Tuple_PaymentHashPaymentIdZ _res_conv = *(LDKC2Tuple_PaymentHashPaymentIdZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKC2Tuple_PaymentHashPaymentIdZ _res_conv = *(LDKC2Tuple_PaymentHashPaymentIdZ*)(_res_ptr);
FREE((void*)_res);
C2Tuple_PaymentHashPaymentIdZ_free(_res_conv);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
- LDKC2Tuple_PaymentHashPaymentIdZ o_conv = *(LDKC2Tuple_PaymentHashPaymentIdZ*)(((uint64_t)o) & ~1);
+ void* o_ptr = (void*)(((uint64_t)o) & ~1);
+ CHECK_ACCESS(o_ptr);
+ LDKC2Tuple_PaymentHashPaymentIdZ o_conv = *(LDKC2Tuple_PaymentHashPaymentIdZ*)(o_ptr);
o_conv = C2Tuple_PaymentHashPaymentIdZ_clone((LDKC2Tuple_PaymentHashPaymentIdZ*)(((uint64_t)o) & ~1));
LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ");
*ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_ok(o_conv);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKPaymentSendFailure e_conv = *(LDKPaymentSendFailure*)(((uint64_t)e) & ~1);
+ void* e_ptr = (void*)(((uint64_t)e) & ~1);
+ CHECK_ACCESS(e_ptr);
+ LDKPaymentSendFailure e_conv = *(LDKPaymentSendFailure*)(e_ptr);
e_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)(((uint64_t)e) & ~1));
LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ");
*ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_err(e_conv);
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ _res_conv = *(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ _res_conv = *(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)(_res_ptr);
FREE((void*)_res);
CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_free(_res_conv);
}
int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
for (size_t m = 0; m < _res_constr.datalen; m++) {
int64_t _res_conv_12 = _res_vals[m];
- LDKNetAddress _res_conv_12_conv = *(LDKNetAddress*)(((uint64_t)_res_conv_12) & ~1);
+ void* _res_conv_12_ptr = (void*)(((uint64_t)_res_conv_12) & ~1);
+ CHECK_ACCESS(_res_conv_12_ptr);
+ LDKNetAddress _res_conv_12_conv = *(LDKNetAddress*)(_res_conv_12_ptr);
FREE((void*)_res_conv_12);
_res_constr.data[m] = _res_conv_12_conv;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentSecretZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKC2Tuple_PaymentHashPaymentSecretZ _res_conv = *(LDKC2Tuple_PaymentHashPaymentSecretZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKC2Tuple_PaymentHashPaymentSecretZ _res_conv = *(LDKC2Tuple_PaymentHashPaymentSecretZ*)(_res_ptr);
FREE((void*)_res);
C2Tuple_PaymentHashPaymentSecretZ_free(_res_conv);
}
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKAPIError e_conv = *(LDKAPIError*)(((uint64_t)e) & ~1);
+ void* e_ptr = (void*)(((uint64_t)e) & ~1);
+ CHECK_ACCESS(e_ptr);
+ LDKAPIError e_conv = *(LDKAPIError*)(e_ptr);
e_conv = APIError_clone((LDKAPIError*)(((uint64_t)e) & ~1));
LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ");
*ret_conv = CResult_PaymentSecretAPIErrorZ_err(e_conv);
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_PaymentSecretAPIErrorZ _res_conv = *(LDKCResult_PaymentSecretAPIErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_PaymentSecretAPIErrorZ _res_conv = *(LDKCResult_PaymentSecretAPIErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_PaymentSecretAPIErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelManagerZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKC2Tuple_BlockHashChannelManagerZ _res_conv = *(LDKC2Tuple_BlockHashChannelManagerZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKC2Tuple_BlockHashChannelManagerZ _res_conv = *(LDKC2Tuple_BlockHashChannelManagerZ*)(_res_ptr);
FREE((void*)_res);
C2Tuple_BlockHashChannelManagerZ_free(_res_conv);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelManagerZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
- LDKC2Tuple_BlockHashChannelManagerZ o_conv = *(LDKC2Tuple_BlockHashChannelManagerZ*)(((uint64_t)o) & ~1);
+ void* o_ptr = (void*)(((uint64_t)o) & ~1);
+ CHECK_ACCESS(o_ptr);
+ LDKC2Tuple_BlockHashChannelManagerZ o_conv = *(LDKC2Tuple_BlockHashChannelManagerZ*)(o_ptr);
// Warning: we may need a move here but no clone is available for LDKC2Tuple_BlockHashChannelManagerZ
LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ");
*ret_conv = CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(o_conv);
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelManagerZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ _res_conv = *(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ _res_conv = *(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_ChannelConfigDecodeErrorZ _res_conv = *(LDKCResult_ChannelConfigDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_ChannelConfigDecodeErrorZ _res_conv = *(LDKCResult_ChannelConfigDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_ChannelConfigDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_OutPointDecodeErrorZ _res_conv = *(LDKCResult_OutPointDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_OutPointDecodeErrorZ _res_conv = *(LDKCResult_OutPointDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_OutPointDecodeErrorZ_free(_res_conv);
}
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1TypeZ_1some(JNIEnv *env, jclass clz, int64_t o) {
- LDKType o_conv = *(LDKType*)(((uint64_t)o) & ~1);
+ void* o_ptr = (void*)(((uint64_t)o) & ~1);
+ CHECK_ACCESS(o_ptr);
+ LDKType o_conv = *(LDKType*)(o_ptr);
if (o_conv.free == LDKType_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKType_JCalls_cloned(&o_conv);
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1TypeZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCOption_TypeZ _res_conv = *(LDKCOption_TypeZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCOption_TypeZ _res_conv = *(LDKCOption_TypeZ*)(_res_ptr);
FREE((void*)_res);
COption_TypeZ_free(_res_conv);
}
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
- LDKCOption_TypeZ o_conv = *(LDKCOption_TypeZ*)(((uint64_t)o) & ~1);
+ void* o_ptr = (void*)(((uint64_t)o) & ~1);
+ CHECK_ACCESS(o_ptr);
+ LDKCOption_TypeZ o_conv = *(LDKCOption_TypeZ*)(o_ptr);
o_conv = COption_TypeZ_clone((LDKCOption_TypeZ*)(((uint64_t)o) & ~1));
LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ");
*ret_conv = CResult_COption_TypeZDecodeErrorZ_ok(o_conv);
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_COption_TypeZDecodeErrorZ _res_conv = *(LDKCResult_COption_TypeZDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_COption_TypeZDecodeErrorZ _res_conv = *(LDKCResult_COption_TypeZDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_COption_TypeZDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_SiPrefixNoneZ _res_conv = *(LDKCResult_SiPrefixNoneZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_SiPrefixNoneZ _res_conv = *(LDKCResult_SiPrefixNoneZ*)(_res_ptr);
FREE((void*)_res);
CResult_SiPrefixNoneZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_InvoiceNoneZ _res_conv = *(LDKCResult_InvoiceNoneZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_InvoiceNoneZ _res_conv = *(LDKCResult_InvoiceNoneZ*)(_res_ptr);
FREE((void*)_res);
CResult_InvoiceNoneZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_SignedRawInvoiceNoneZ _res_conv = *(LDKCResult_SignedRawInvoiceNoneZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_SignedRawInvoiceNoneZ _res_conv = *(LDKCResult_SignedRawInvoiceNoneZ*)(_res_ptr);
FREE((void*)_res);
CResult_SignedRawInvoiceNoneZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ _res_conv = *(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ _res_conv = *(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)(_res_ptr);
FREE((void*)_res);
C3Tuple_RawInvoice_u832InvoiceSignatureZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_PayeePubKeyErrorZ _res_conv = *(LDKCResult_PayeePubKeyErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_PayeePubKeyErrorZ _res_conv = *(LDKCResult_PayeePubKeyErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_PayeePubKeyErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_PositiveTimestampCreationErrorZ _res_conv = *(LDKCResult_PositiveTimestampCreationErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_PositiveTimestampCreationErrorZ _res_conv = *(LDKCResult_PositiveTimestampCreationErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_PositiveTimestampCreationErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_NoneSemanticErrorZ _res_conv = *(LDKCResult_NoneSemanticErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_NoneSemanticErrorZ _res_conv = *(LDKCResult_NoneSemanticErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_NoneSemanticErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_InvoiceSemanticErrorZ _res_conv = *(LDKCResult_InvoiceSemanticErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_InvoiceSemanticErrorZ _res_conv = *(LDKCResult_InvoiceSemanticErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_InvoiceSemanticErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_DescriptionCreationErrorZ _res_conv = *(LDKCResult_DescriptionCreationErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_DescriptionCreationErrorZ _res_conv = *(LDKCResult_DescriptionCreationErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_DescriptionCreationErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ExpiryTimeCreationErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_ExpiryTimeCreationErrorZ _res_conv = *(LDKCResult_ExpiryTimeCreationErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_ExpiryTimeCreationErrorZ _res_conv = *(LDKCResult_ExpiryTimeCreationErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_ExpiryTimeCreationErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_PrivateRouteCreationErrorZ _res_conv = *(LDKCResult_PrivateRouteCreationErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_PrivateRouteCreationErrorZ _res_conv = *(LDKCResult_PrivateRouteCreationErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_PrivateRouteCreationErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_StringErrorZ _res_conv = *(LDKCResult_StringErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_StringErrorZ _res_conv = *(LDKCResult_StringErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_StringErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_ChannelMonitorUpdateDecodeErrorZ _res_conv = *(LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_ChannelMonitorUpdateDecodeErrorZ _res_conv = *(LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_ChannelMonitorUpdateDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_HTLCUpdateDecodeErrorZ _res_conv = *(LDKCResult_HTLCUpdateDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_HTLCUpdateDecodeErrorZ _res_conv = *(LDKCResult_HTLCUpdateDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_HTLCUpdateDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_NoneMonitorUpdateErrorZ _res_conv = *(LDKCResult_NoneMonitorUpdateErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_NoneMonitorUpdateErrorZ _res_conv = *(LDKCResult_NoneMonitorUpdateErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_NoneMonitorUpdateErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKC2Tuple_OutPointScriptZ _res_conv = *(LDKC2Tuple_OutPointScriptZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKC2Tuple_OutPointScriptZ _res_conv = *(LDKC2Tuple_OutPointScriptZ*)(_res_ptr);
FREE((void*)_res);
C2Tuple_OutPointScriptZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32ScriptZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKC2Tuple_u32ScriptZ _res_conv = *(LDKC2Tuple_u32ScriptZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKC2Tuple_u32ScriptZ _res_conv = *(LDKC2Tuple_u32ScriptZ*)(_res_ptr);
FREE((void*)_res);
C2Tuple_u32ScriptZ_free(_res_conv);
}
int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
for (size_t v = 0; v < _res_constr.datalen; v++) {
int64_t _res_conv_21 = _res_vals[v];
- LDKC2Tuple_u32ScriptZ _res_conv_21_conv = *(LDKC2Tuple_u32ScriptZ*)(((uint64_t)_res_conv_21) & ~1);
+ void* _res_conv_21_ptr = (void*)(((uint64_t)_res_conv_21) & ~1);
+ CHECK_ACCESS(_res_conv_21_ptr);
+ LDKC2Tuple_u32ScriptZ _res_conv_21_conv = *(LDKC2Tuple_u32ScriptZ*)(_res_conv_21_ptr);
FREE((void*)_res_conv_21);
_res_constr.data[v] = _res_conv_21_conv;
}
int64_t* b_vals = (*env)->GetLongArrayElements (env, b, NULL);
for (size_t v = 0; v < b_constr.datalen; v++) {
int64_t b_conv_21 = b_vals[v];
- LDKC2Tuple_u32ScriptZ b_conv_21_conv = *(LDKC2Tuple_u32ScriptZ*)(((uint64_t)b_conv_21) & ~1);
+ void* b_conv_21_ptr = (void*)(((uint64_t)b_conv_21) & ~1);
+ CHECK_ACCESS(b_conv_21_ptr);
+ LDKC2Tuple_u32ScriptZ b_conv_21_conv = *(LDKC2Tuple_u32ScriptZ*)(b_conv_21_ptr);
b_conv_21_conv = C2Tuple_u32ScriptZ_clone((LDKC2Tuple_u32ScriptZ*)(((uint64_t)b_conv_21) & ~1));
b_constr.data[v] = b_conv_21_conv;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ _res_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ _res_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(_res_ptr);
FREE((void*)_res);
C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_free(_res_conv);
}
int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
for (size_t o = 0; o < _res_constr.datalen; o++) {
int64_t _res_conv_40 = _res_vals[o];
- LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ _res_conv_40_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(((uint64_t)_res_conv_40) & ~1);
+ void* _res_conv_40_ptr = (void*)(((uint64_t)_res_conv_40) & ~1);
+ CHECK_ACCESS(_res_conv_40_ptr);
+ LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ _res_conv_40_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(_res_conv_40_ptr);
FREE((void*)_res_conv_40);
_res_constr.data[o] = _res_conv_40_conv;
}
int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
for (size_t h = 0; h < _res_constr.datalen; h++) {
int64_t _res_conv_7 = _res_vals[h];
- LDKEvent _res_conv_7_conv = *(LDKEvent*)(((uint64_t)_res_conv_7) & ~1);
+ void* _res_conv_7_ptr = (void*)(((uint64_t)_res_conv_7) & ~1);
+ CHECK_ACCESS(_res_conv_7_ptr);
+ LDKEvent _res_conv_7_conv = *(LDKEvent*)(_res_conv_7_ptr);
FREE((void*)_res_conv_7);
_res_constr.data[h] = _res_conv_7_conv;
}
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32TxOutZ_1new(JNIEnv *env, jclass clz, int32_t a, int64_t b) {
- LDKTxOut b_conv = *(LDKTxOut*)(((uint64_t)b) & ~1);
+ void* b_ptr = (void*)(((uint64_t)b) & ~1);
+ CHECK_ACCESS(b_ptr);
+ LDKTxOut b_conv = *(LDKTxOut*)(b_ptr);
b_conv = TxOut_clone((LDKTxOut*)(((uint64_t)b) & ~1));
LDKC2Tuple_u32TxOutZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ), "LDKC2Tuple_u32TxOutZ");
*ret_conv = C2Tuple_u32TxOutZ_new(a, b_conv);
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32TxOutZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKC2Tuple_u32TxOutZ _res_conv = *(LDKC2Tuple_u32TxOutZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKC2Tuple_u32TxOutZ _res_conv = *(LDKC2Tuple_u32TxOutZ*)(_res_ptr);
FREE((void*)_res);
C2Tuple_u32TxOutZ_free(_res_conv);
}
int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
for (size_t u = 0; u < _res_constr.datalen; u++) {
int64_t _res_conv_20 = _res_vals[u];
- LDKC2Tuple_u32TxOutZ _res_conv_20_conv = *(LDKC2Tuple_u32TxOutZ*)(((uint64_t)_res_conv_20) & ~1);
+ void* _res_conv_20_ptr = (void*)(((uint64_t)_res_conv_20) & ~1);
+ CHECK_ACCESS(_res_conv_20_ptr);
+ LDKC2Tuple_u32TxOutZ _res_conv_20_conv = *(LDKC2Tuple_u32TxOutZ*)(_res_conv_20_ptr);
FREE((void*)_res_conv_20);
_res_constr.data[u] = _res_conv_20_conv;
}
int64_t* b_vals = (*env)->GetLongArrayElements (env, b, NULL);
for (size_t u = 0; u < b_constr.datalen; u++) {
int64_t b_conv_20 = b_vals[u];
- LDKC2Tuple_u32TxOutZ b_conv_20_conv = *(LDKC2Tuple_u32TxOutZ*)(((uint64_t)b_conv_20) & ~1);
+ void* b_conv_20_ptr = (void*)(((uint64_t)b_conv_20) & ~1);
+ CHECK_ACCESS(b_conv_20_ptr);
+ LDKC2Tuple_u32TxOutZ b_conv_20_conv = *(LDKC2Tuple_u32TxOutZ*)(b_conv_20_ptr);
b_conv_20_conv = C2Tuple_u32TxOutZ_clone((LDKC2Tuple_u32TxOutZ*)(((uint64_t)b_conv_20) & ~1));
b_constr.data[u] = b_conv_20_conv;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ _res_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ _res_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(_res_ptr);
FREE((void*)_res);
C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free(_res_conv);
}
int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
for (size_t n = 0; n < _res_constr.datalen; n++) {
int64_t _res_conv_39 = _res_vals[n];
- LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ _res_conv_39_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(((uint64_t)_res_conv_39) & ~1);
+ void* _res_conv_39_ptr = (void*)(((uint64_t)_res_conv_39) & ~1);
+ CHECK_ACCESS(_res_conv_39_ptr);
+ LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ _res_conv_39_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(_res_conv_39_ptr);
FREE((void*)_res_conv_39);
_res_constr.data[n] = _res_conv_39_conv;
}
int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
for (size_t j = 0; j < _res_constr.datalen; j++) {
int64_t _res_conv_9 = _res_vals[j];
- LDKBalance _res_conv_9_conv = *(LDKBalance*)(((uint64_t)_res_conv_9) & ~1);
+ void* _res_conv_9_ptr = (void*)(((uint64_t)_res_conv_9) & ~1);
+ CHECK_ACCESS(_res_conv_9_ptr);
+ LDKBalance _res_conv_9_conv = *(LDKBalance*)(_res_conv_9_ptr);
FREE((void*)_res_conv_9);
_res_constr.data[j] = _res_conv_9_conv;
}
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
- LDKC2Tuple_BlockHashChannelMonitorZ o_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(((uint64_t)o) & ~1);
+ void* o_ptr = (void*)(((uint64_t)o) & ~1);
+ CHECK_ACCESS(o_ptr);
+ LDKC2Tuple_BlockHashChannelMonitorZ o_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(o_ptr);
o_conv = C2Tuple_BlockHashChannelMonitorZ_clone((LDKC2Tuple_BlockHashChannelMonitorZ*)(((uint64_t)o) & ~1));
LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ");
*ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(o_conv);
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ _res_conv = *(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ _res_conv = *(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_NoneLightningErrorZ _res_conv = *(LDKCResult_NoneLightningErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_NoneLightningErrorZ _res_conv = *(LDKCResult_NoneLightningErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_NoneLightningErrorZ_free(_res_conv);
}
LDKPublicKey a_ref;
CHECK((*env)->GetArrayLength(env, a) == 33);
(*env)->GetByteArrayRegion(env, a, 0, 33, a_ref.compressed_form);
- LDKType b_conv = *(LDKType*)(((uint64_t)b) & ~1);
+ void* b_ptr = (void*)(((uint64_t)b) & ~1);
+ CHECK_ACCESS(b_ptr);
+ LDKType b_conv = *(LDKType*)(b_ptr);
if (b_conv.free == LDKType_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKType_JCalls_cloned(&b_conv);
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyTypeZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKC2Tuple_PublicKeyTypeZ _res_conv = *(LDKC2Tuple_PublicKeyTypeZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKC2Tuple_PublicKeyTypeZ _res_conv = *(LDKC2Tuple_PublicKeyTypeZ*)(_res_ptr);
FREE((void*)_res);
C2Tuple_PublicKeyTypeZ_free(_res_conv);
}
int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
for (size_t z = 0; z < _res_constr.datalen; z++) {
int64_t _res_conv_25 = _res_vals[z];
- LDKC2Tuple_PublicKeyTypeZ _res_conv_25_conv = *(LDKC2Tuple_PublicKeyTypeZ*)(((uint64_t)_res_conv_25) & ~1);
+ void* _res_conv_25_ptr = (void*)(((uint64_t)_res_conv_25) & ~1);
+ CHECK_ACCESS(_res_conv_25_ptr);
+ LDKC2Tuple_PublicKeyTypeZ _res_conv_25_conv = *(LDKC2Tuple_PublicKeyTypeZ*)(_res_conv_25_ptr);
FREE((void*)_res_conv_25);
_res_constr.data[z] = _res_conv_25_conv;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_boolLightningErrorZ _res_conv = *(LDKCResult_boolLightningErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_boolLightningErrorZ _res_conv = *(LDKCResult_boolLightningErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_boolLightningErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(_res_ptr);
FREE((void*)_res);
C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(_res_conv);
}
int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
for (size_t h = 0; h < _res_constr.datalen; h++) {
int64_t _res_conv_59 = _res_vals[h];
- LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res_conv_59_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(((uint64_t)_res_conv_59) & ~1);
+ void* _res_conv_59_ptr = (void*)(((uint64_t)_res_conv_59) & ~1);
+ CHECK_ACCESS(_res_conv_59_ptr);
+ LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res_conv_59_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(_res_conv_59_ptr);
FREE((void*)_res_conv_59);
_res_constr.data[h] = _res_conv_59_conv;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_CVec_u8ZPeerHandleErrorZ _res_conv = *(LDKCResult_CVec_u8ZPeerHandleErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_CVec_u8ZPeerHandleErrorZ _res_conv = *(LDKCResult_CVec_u8ZPeerHandleErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_CVec_u8ZPeerHandleErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_NonePeerHandleErrorZ _res_conv = *(LDKCResult_NonePeerHandleErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_NonePeerHandleErrorZ _res_conv = *(LDKCResult_NonePeerHandleErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_NonePeerHandleErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_boolPeerHandleErrorZ _res_conv = *(LDKCResult_boolPeerHandleErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_boolPeerHandleErrorZ _res_conv = *(LDKCResult_boolPeerHandleErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_boolPeerHandleErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_NodeIdDecodeErrorZ _res_conv = *(LDKCResult_NodeIdDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_NodeIdDecodeErrorZ _res_conv = *(LDKCResult_NodeIdDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_NodeIdDecodeErrorZ_free(_res_conv);
}
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1AccessZ_1some(JNIEnv *env, jclass clz, int64_t o) {
- LDKAccess o_conv = *(LDKAccess*)(((uint64_t)o) & ~1);
+ void* o_ptr = (void*)(((uint64_t)o) & ~1);
+ CHECK_ACCESS(o_ptr);
+ LDKAccess o_conv = *(LDKAccess*)(o_ptr);
if (o_conv.free == LDKAccess_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKAccess_JCalls_cloned(&o_conv);
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1AccessZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCOption_AccessZ _res_conv = *(LDKCOption_AccessZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCOption_AccessZ _res_conv = *(LDKCOption_AccessZ*)(_res_ptr);
FREE((void*)_res);
COption_AccessZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1DirectionalChannelInfoDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_DirectionalChannelInfoDecodeErrorZ _res_conv = *(LDKCResult_DirectionalChannelInfoDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_DirectionalChannelInfoDecodeErrorZ _res_conv = *(LDKCResult_DirectionalChannelInfoDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_DirectionalChannelInfoDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_ChannelInfoDecodeErrorZ _res_conv = *(LDKCResult_ChannelInfoDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_ChannelInfoDecodeErrorZ _res_conv = *(LDKCResult_ChannelInfoDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_ChannelInfoDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_RoutingFeesDecodeErrorZ _res_conv = *(LDKCResult_RoutingFeesDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_RoutingFeesDecodeErrorZ _res_conv = *(LDKCResult_RoutingFeesDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_RoutingFeesDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_NodeAnnouncementInfoDecodeErrorZ _res_conv = *(LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_NodeAnnouncementInfoDecodeErrorZ _res_conv = *(LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_NodeAnnouncementInfoDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_NodeInfoDecodeErrorZ _res_conv = *(LDKCResult_NodeInfoDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_NodeInfoDecodeErrorZ _res_conv = *(LDKCResult_NodeInfoDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_NodeInfoDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_NetworkGraphDecodeErrorZ _res_conv = *(LDKCResult_NetworkGraphDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_NetworkGraphDecodeErrorZ _res_conv = *(LDKCResult_NetworkGraphDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_NetworkGraphDecodeErrorZ_free(_res_conv);
}
int64_t* o_vals = (*env)->GetLongArrayElements (env, o, NULL);
for (size_t m = 0; m < o_constr.datalen; m++) {
int64_t o_conv_12 = o_vals[m];
- LDKNetAddress o_conv_12_conv = *(LDKNetAddress*)(((uint64_t)o_conv_12) & ~1);
+ void* o_conv_12_ptr = (void*)(((uint64_t)o_conv_12) & ~1);
+ CHECK_ACCESS(o_conv_12_ptr);
+ LDKNetAddress o_conv_12_conv = *(LDKNetAddress*)(o_conv_12_ptr);
o_conv_12_conv = NetAddress_clone((LDKNetAddress*)(((uint64_t)o_conv_12) & ~1));
o_constr.data[m] = o_conv_12_conv;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1CVec_1NetAddressZZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCOption_CVec_NetAddressZZ _res_conv = *(LDKCOption_CVec_NetAddressZZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCOption_CVec_NetAddressZZ _res_conv = *(LDKCOption_CVec_NetAddressZZ*)(_res_ptr);
FREE((void*)_res);
COption_CVec_NetAddressZZ_free(_res_conv);
}
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressu8Z_1ok(JNIEnv *env, jclass clz, int64_t o) {
- LDKNetAddress o_conv = *(LDKNetAddress*)(((uint64_t)o) & ~1);
+ void* o_ptr = (void*)(((uint64_t)o) & ~1);
+ CHECK_ACCESS(o_ptr);
+ LDKNetAddress o_conv = *(LDKNetAddress*)(o_ptr);
o_conv = NetAddress_clone((LDKNetAddress*)(((uint64_t)o) & ~1));
LDKCResult_NetAddressu8Z* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressu8Z), "LDKCResult_NetAddressu8Z");
*ret_conv = CResult_NetAddressu8Z_ok(o_conv);
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressu8Z_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_NetAddressu8Z _res_conv = *(LDKCResult_NetAddressu8Z*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_NetAddressu8Z _res_conv = *(LDKCResult_NetAddressu8Z*)(_res_ptr);
FREE((void*)_res);
CResult_NetAddressu8Z_free(_res_conv);
}
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CResult_1NetAddressu8ZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
- LDKCResult_NetAddressu8Z o_conv = *(LDKCResult_NetAddressu8Z*)(((uint64_t)o) & ~1);
+ void* o_ptr = (void*)(((uint64_t)o) & ~1);
+ CHECK_ACCESS(o_ptr);
+ LDKCResult_NetAddressu8Z o_conv = *(LDKCResult_NetAddressu8Z*)(o_ptr);
o_conv = CResult_NetAddressu8Z_clone((LDKCResult_NetAddressu8Z*)(((uint64_t)o) & ~1));
LDKCResult_CResult_NetAddressu8ZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CResult_NetAddressu8ZDecodeErrorZ), "LDKCResult_CResult_NetAddressu8ZDecodeErrorZ");
*ret_conv = CResult_CResult_NetAddressu8ZDecodeErrorZ_ok(o_conv);
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CResult_1NetAddressu8ZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_CResult_NetAddressu8ZDecodeErrorZ _res_conv = *(LDKCResult_CResult_NetAddressu8ZDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_CResult_NetAddressu8ZDecodeErrorZ _res_conv = *(LDKCResult_CResult_NetAddressu8ZDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_CResult_NetAddressu8ZDecodeErrorZ_free(_res_conv);
}
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
- LDKNetAddress o_conv = *(LDKNetAddress*)(((uint64_t)o) & ~1);
+ void* o_ptr = (void*)(((uint64_t)o) & ~1);
+ CHECK_ACCESS(o_ptr);
+ LDKNetAddress o_conv = *(LDKNetAddress*)(o_ptr);
o_conv = NetAddress_clone((LDKNetAddress*)(((uint64_t)o) & ~1));
LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ");
*ret_conv = CResult_NetAddressDecodeErrorZ_ok(o_conv);
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_NetAddressDecodeErrorZ _res_conv = *(LDKCResult_NetAddressDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_NetAddressDecodeErrorZ _res_conv = *(LDKCResult_NetAddressDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_NetAddressDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1AcceptChannelDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_AcceptChannelDecodeErrorZ _res_conv = *(LDKCResult_AcceptChannelDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_AcceptChannelDecodeErrorZ _res_conv = *(LDKCResult_AcceptChannelDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_AcceptChannelDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1AnnouncementSignaturesDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_AnnouncementSignaturesDecodeErrorZ _res_conv = *(LDKCResult_AnnouncementSignaturesDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_AnnouncementSignaturesDecodeErrorZ _res_conv = *(LDKCResult_AnnouncementSignaturesDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_AnnouncementSignaturesDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReestablishDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_ChannelReestablishDecodeErrorZ _res_conv = *(LDKCResult_ChannelReestablishDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_ChannelReestablishDecodeErrorZ _res_conv = *(LDKCResult_ChannelReestablishDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_ChannelReestablishDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_ClosingSignedDecodeErrorZ _res_conv = *(LDKCResult_ClosingSignedDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_ClosingSignedDecodeErrorZ _res_conv = *(LDKCResult_ClosingSignedDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_ClosingSignedDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedFeeRangeDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_ClosingSignedFeeRangeDecodeErrorZ _res_conv = *(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_ClosingSignedFeeRangeDecodeErrorZ _res_conv = *(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_ClosingSignedFeeRangeDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_CommitmentSignedDecodeErrorZ _res_conv = *(LDKCResult_CommitmentSignedDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_CommitmentSignedDecodeErrorZ _res_conv = *(LDKCResult_CommitmentSignedDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_CommitmentSignedDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1FundingCreatedDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_FundingCreatedDecodeErrorZ _res_conv = *(LDKCResult_FundingCreatedDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_FundingCreatedDecodeErrorZ _res_conv = *(LDKCResult_FundingCreatedDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_FundingCreatedDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1FundingSignedDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_FundingSignedDecodeErrorZ _res_conv = *(LDKCResult_FundingSignedDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_FundingSignedDecodeErrorZ _res_conv = *(LDKCResult_FundingSignedDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_FundingSignedDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1FundingLockedDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_FundingLockedDecodeErrorZ _res_conv = *(LDKCResult_FundingLockedDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_FundingLockedDecodeErrorZ _res_conv = *(LDKCResult_FundingLockedDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_FundingLockedDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InitDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_InitDecodeErrorZ _res_conv = *(LDKCResult_InitDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_InitDecodeErrorZ _res_conv = *(LDKCResult_InitDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_InitDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1OpenChannelDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_OpenChannelDecodeErrorZ _res_conv = *(LDKCResult_OpenChannelDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_OpenChannelDecodeErrorZ _res_conv = *(LDKCResult_OpenChannelDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_OpenChannelDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RevokeAndACKDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_RevokeAndACKDecodeErrorZ _res_conv = *(LDKCResult_RevokeAndACKDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_RevokeAndACKDecodeErrorZ _res_conv = *(LDKCResult_RevokeAndACKDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_RevokeAndACKDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_ShutdownDecodeErrorZ _res_conv = *(LDKCResult_ShutdownDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_ShutdownDecodeErrorZ _res_conv = *(LDKCResult_ShutdownDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_ShutdownDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailHTLCDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_UpdateFailHTLCDecodeErrorZ _res_conv = *(LDKCResult_UpdateFailHTLCDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_UpdateFailHTLCDecodeErrorZ _res_conv = *(LDKCResult_UpdateFailHTLCDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_UpdateFailHTLCDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailMalformedHTLCDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ _res_conv = *(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ _res_conv = *(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFeeDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_UpdateFeeDecodeErrorZ _res_conv = *(LDKCResult_UpdateFeeDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_UpdateFeeDecodeErrorZ _res_conv = *(LDKCResult_UpdateFeeDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_UpdateFeeDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFulfillHTLCDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_UpdateFulfillHTLCDecodeErrorZ _res_conv = *(LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_UpdateFulfillHTLCDecodeErrorZ _res_conv = *(LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_UpdateFulfillHTLCDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateAddHTLCDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_UpdateAddHTLCDecodeErrorZ _res_conv = *(LDKCResult_UpdateAddHTLCDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_UpdateAddHTLCDecodeErrorZ _res_conv = *(LDKCResult_UpdateAddHTLCDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_UpdateAddHTLCDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PingDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_PingDecodeErrorZ _res_conv = *(LDKCResult_PingDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_PingDecodeErrorZ _res_conv = *(LDKCResult_PingDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_PingDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PongDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_PongDecodeErrorZ _res_conv = *(LDKCResult_PongDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_PongDecodeErrorZ _res_conv = *(LDKCResult_PongDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_PongDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelAnnouncementDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ _res_conv = *(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ _res_conv = *(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelAnnouncementDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_ChannelAnnouncementDecodeErrorZ _res_conv = *(LDKCResult_ChannelAnnouncementDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_ChannelAnnouncementDecodeErrorZ _res_conv = *(LDKCResult_ChannelAnnouncementDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_ChannelAnnouncementDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelUpdateDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_UnsignedChannelUpdateDecodeErrorZ _res_conv = *(LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_UnsignedChannelUpdateDecodeErrorZ _res_conv = *(LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_UnsignedChannelUpdateDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_ChannelUpdateDecodeErrorZ _res_conv = *(LDKCResult_ChannelUpdateDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_ChannelUpdateDecodeErrorZ _res_conv = *(LDKCResult_ChannelUpdateDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_ChannelUpdateDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ErrorMessageDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_ErrorMessageDecodeErrorZ _res_conv = *(LDKCResult_ErrorMessageDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_ErrorMessageDecodeErrorZ _res_conv = *(LDKCResult_ErrorMessageDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_ErrorMessageDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedNodeAnnouncementDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ _res_conv = *(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ _res_conv = *(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_NodeAnnouncementDecodeErrorZ _res_conv = *(LDKCResult_NodeAnnouncementDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_NodeAnnouncementDecodeErrorZ _res_conv = *(LDKCResult_NodeAnnouncementDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_NodeAnnouncementDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1QueryShortChannelIdsDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_QueryShortChannelIdsDecodeErrorZ _res_conv = *(LDKCResult_QueryShortChannelIdsDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_QueryShortChannelIdsDecodeErrorZ _res_conv = *(LDKCResult_QueryShortChannelIdsDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_QueryShortChannelIdsDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyShortChannelIdsEndDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ _res_conv = *(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ _res_conv = *(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1QueryChannelRangeDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_QueryChannelRangeDecodeErrorZ _res_conv = *(LDKCResult_QueryChannelRangeDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_QueryChannelRangeDecodeErrorZ _res_conv = *(LDKCResult_QueryChannelRangeDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_QueryChannelRangeDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyChannelRangeDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_ReplyChannelRangeDecodeErrorZ _res_conv = *(LDKCResult_ReplyChannelRangeDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_ReplyChannelRangeDecodeErrorZ _res_conv = *(LDKCResult_ReplyChannelRangeDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_ReplyChannelRangeDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1GossipTimestampFilterDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_GossipTimestampFilterDecodeErrorZ _res_conv = *(LDKCResult_GossipTimestampFilterDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_GossipTimestampFilterDecodeErrorZ _res_conv = *(LDKCResult_GossipTimestampFilterDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_GossipTimestampFilterDecodeErrorZ_free(_res_conv);
}
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSignOrCreationErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKSignOrCreationError e_conv = *(LDKSignOrCreationError*)(((uint64_t)e) & ~1);
+ void* e_ptr = (void*)(((uint64_t)e) & ~1);
+ CHECK_ACCESS(e_ptr);
+ LDKSignOrCreationError e_conv = *(LDKSignOrCreationError*)(e_ptr);
e_conv = SignOrCreationError_clone((LDKSignOrCreationError*)(((uint64_t)e) & ~1));
LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
*ret_conv = CResult_InvoiceSignOrCreationErrorZ_err(e_conv);
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSignOrCreationErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_InvoiceSignOrCreationErrorZ _res_conv = *(LDKCResult_InvoiceSignOrCreationErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_InvoiceSignOrCreationErrorZ _res_conv = *(LDKCResult_InvoiceSignOrCreationErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_InvoiceSignOrCreationErrorZ_free(_res_conv);
}
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1FilterZ_1some(JNIEnv *env, jclass clz, int64_t o) {
- LDKFilter o_conv = *(LDKFilter*)(((uint64_t)o) & ~1);
+ void* o_ptr = (void*)(((uint64_t)o) & ~1);
+ CHECK_ACCESS(o_ptr);
+ LDKFilter o_conv = *(LDKFilter*)(o_ptr);
if (o_conv.free == LDKFilter_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKFilter_JCalls_cloned(&o_conv);
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1FilterZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCOption_FilterZ _res_conv = *(LDKCOption_FilterZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCOption_FilterZ _res_conv = *(LDKCOption_FilterZ*)(_res_ptr);
FREE((void*)_res);
COption_FilterZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1LockedChannelMonitorNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_LockedChannelMonitorNoneZ _res_conv = *(LDKCResult_LockedChannelMonitorNoneZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_LockedChannelMonitorNoneZ _res_conv = *(LDKCResult_LockedChannelMonitorNoneZ*)(_res_ptr);
FREE((void*)_res);
CResult_LockedChannelMonitorNoneZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKPaymentPurpose this_ptr_conv = *(LDKPaymentPurpose*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKPaymentPurpose this_ptr_conv = *(LDKPaymentPurpose*)(this_ptr_ptr);
FREE((void*)this_ptr);
PaymentPurpose_free(this_ptr_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosureReason_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKClosureReason this_ptr_conv = *(LDKClosureReason*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKClosureReason this_ptr_conv = *(LDKClosureReason*)(this_ptr_ptr);
FREE((void*)this_ptr);
ClosureReason_free(this_ptr_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Event_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKEvent this_ptr_conv = *(LDKEvent*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKEvent this_ptr_conv = *(LDKEvent*)(this_ptr_ptr);
FREE((void*)this_ptr);
Event_free(this_ptr_conv);
}
LDKThirtyTwoBytes payment_hash_ref;
CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
(*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
- LDKPaymentPurpose purpose_conv = *(LDKPaymentPurpose*)(((uint64_t)purpose) & ~1);
+ void* purpose_ptr = (void*)(((uint64_t)purpose) & ~1);
+ CHECK_ACCESS(purpose_ptr);
+ LDKPaymentPurpose purpose_conv = *(LDKPaymentPurpose*)(purpose_ptr);
purpose_conv = PaymentPurpose_clone((LDKPaymentPurpose*)(((uint64_t)purpose) & ~1));
LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
*ret_copy = Event_payment_received(payment_hash_ref, amt, purpose_conv);
LDKThirtyTwoBytes payment_hash_ref;
CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
(*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
- LDKCOption_NetworkUpdateZ network_update_conv = *(LDKCOption_NetworkUpdateZ*)(((uint64_t)network_update) & ~1);
+ void* network_update_ptr = (void*)(((uint64_t)network_update) & ~1);
+ CHECK_ACCESS(network_update_ptr);
+ LDKCOption_NetworkUpdateZ network_update_conv = *(LDKCOption_NetworkUpdateZ*)(network_update_ptr);
network_update_conv = COption_NetworkUpdateZ_clone((LDKCOption_NetworkUpdateZ*)(((uint64_t)network_update) & ~1));
LDKCVec_RouteHopZ path_constr;
path_constr.datalen = (*env)->GetArrayLength(env, path);
path_constr.data[k] = path_conv_10_conv;
}
(*env)->ReleaseLongArrayElements(env, path, path_vals, 0);
- LDKCOption_u64Z short_channel_id_conv = *(LDKCOption_u64Z*)(((uint64_t)short_channel_id) & ~1);
+ void* short_channel_id_ptr = (void*)(((uint64_t)short_channel_id) & ~1);
+ CHECK_ACCESS(short_channel_id_ptr);
+ LDKCOption_u64Z short_channel_id_conv = *(LDKCOption_u64Z*)(short_channel_id_ptr);
short_channel_id_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)short_channel_id) & ~1));
LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
*ret_copy = Event_payment_path_failed(payment_hash_ref, rejected_by_dest, network_update_conv, all_paths_failed, path_constr, short_channel_id_conv);
int64_t* outputs_vals = (*env)->GetLongArrayElements (env, outputs, NULL);
for (size_t b = 0; b < outputs_constr.datalen; b++) {
int64_t outputs_conv_27 = outputs_vals[b];
- LDKSpendableOutputDescriptor outputs_conv_27_conv = *(LDKSpendableOutputDescriptor*)(((uint64_t)outputs_conv_27) & ~1);
+ void* outputs_conv_27_ptr = (void*)(((uint64_t)outputs_conv_27) & ~1);
+ CHECK_ACCESS(outputs_conv_27_ptr);
+ LDKSpendableOutputDescriptor outputs_conv_27_conv = *(LDKSpendableOutputDescriptor*)(outputs_conv_27_ptr);
outputs_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)(((uint64_t)outputs_conv_27) & ~1));
outputs_constr.data[b] = outputs_conv_27_conv;
}
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1forwarded(JNIEnv *env, jclass clz, int64_t fee_earned_msat, jboolean claim_from_onchain_tx) {
- LDKCOption_u64Z fee_earned_msat_conv = *(LDKCOption_u64Z*)(((uint64_t)fee_earned_msat) & ~1);
+ void* fee_earned_msat_ptr = (void*)(((uint64_t)fee_earned_msat) & ~1);
+ CHECK_ACCESS(fee_earned_msat_ptr);
+ LDKCOption_u64Z fee_earned_msat_conv = *(LDKCOption_u64Z*)(fee_earned_msat_ptr);
fee_earned_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)fee_earned_msat) & ~1));
LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
*ret_copy = Event_payment_forwarded(fee_earned_msat_conv, claim_from_onchain_tx);
LDKThirtyTwoBytes channel_id_ref;
CHECK((*env)->GetArrayLength(env, channel_id) == 32);
(*env)->GetByteArrayRegion(env, channel_id, 0, 32, channel_id_ref.data);
- LDKClosureReason reason_conv = *(LDKClosureReason*)(((uint64_t)reason) & ~1);
+ void* reason_ptr = (void*)(((uint64_t)reason) & ~1);
+ CHECK_ACCESS(reason_ptr);
+ LDKClosureReason reason_conv = *(LDKClosureReason*)(reason_ptr);
reason_conv = ClosureReason_clone((LDKClosureReason*)(((uint64_t)reason) & ~1));
LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
*ret_copy = Event_channel_closed(channel_id_ref, user_channel_id, reason_conv);
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKMessageSendEvent this_ptr_conv = *(LDKMessageSendEvent*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKMessageSendEvent this_ptr_conv = *(LDKMessageSendEvent*)(this_ptr_ptr);
FREE((void*)this_ptr);
MessageSendEvent_free(this_ptr_conv);
}
LDKPublicKey node_id_ref;
CHECK((*env)->GetArrayLength(env, node_id) == 33);
(*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
- LDKErrorAction action_conv = *(LDKErrorAction*)(((uint64_t)action) & ~1);
+ void* action_ptr = (void*)(((uint64_t)action) & ~1);
+ CHECK_ACCESS(action_ptr);
+ LDKErrorAction action_conv = *(LDKErrorAction*)(action_ptr);
action_conv = ErrorAction_clone((LDKErrorAction*)(((uint64_t)action) & ~1));
LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
*ret_copy = MessageSendEvent_handle_error(node_id_ref, action_conv);
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageSendEventsProvider_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKMessageSendEventsProvider this_ptr_conv = *(LDKMessageSendEventsProvider*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKMessageSendEventsProvider this_ptr_conv = *(LDKMessageSendEventsProvider*)(this_ptr_ptr);
FREE((void*)this_ptr);
MessageSendEventsProvider_free(this_ptr_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EventsProvider_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKEventsProvider this_ptr_conv = *(LDKEventsProvider*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKEventsProvider this_ptr_conv = *(LDKEventsProvider*)(this_ptr_ptr);
FREE((void*)this_ptr);
EventsProvider_free(this_ptr_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EventHandler_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKEventHandler this_ptr_conv = *(LDKEventHandler*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKEventHandler this_ptr_conv = *(LDKEventHandler*)(this_ptr_ptr);
FREE((void*)this_ptr);
EventHandler_free(this_ptr_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_APIError_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKAPIError this_ptr_conv = *(LDKAPIError*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKAPIError this_ptr_conv = *(LDKAPIError*)(this_ptr_ptr);
FREE((void*)this_ptr);
APIError_free(this_ptr_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Logger_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKLogger this_ptr_conv = *(LDKLogger*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKLogger this_ptr_conv = *(LDKLogger*)(this_ptr_ptr);
FREE((void*)this_ptr);
Logger_free(this_ptr_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Access_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKAccess this_ptr_conv = *(LDKAccess*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKAccess this_ptr_conv = *(LDKAccess*)(this_ptr_ptr);
FREE((void*)this_ptr);
Access_free(this_ptr_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Listen_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKListen this_ptr_conv = *(LDKListen*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKListen this_ptr_conv = *(LDKListen*)(this_ptr_ptr);
FREE((void*)this_ptr);
Listen_free(this_ptr_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Confirm_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKConfirm this_ptr_conv = *(LDKConfirm*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKConfirm this_ptr_conv = *(LDKConfirm*)(this_ptr_ptr);
FREE((void*)this_ptr);
Confirm_free(this_ptr_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Watch_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKWatch this_ptr_conv = *(LDKWatch*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKWatch this_ptr_conv = *(LDKWatch*)(this_ptr_ptr);
FREE((void*)this_ptr);
Watch_free(this_ptr_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Filter_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKFilter this_ptr_conv = *(LDKFilter*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKFilter this_ptr_conv = *(LDKFilter*)(this_ptr_ptr);
FREE((void*)this_ptr);
Filter_free(this_ptr_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BroadcasterInterface_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKBroadcasterInterface this_ptr_conv = *(LDKBroadcasterInterface*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKBroadcasterInterface this_ptr_conv = *(LDKBroadcasterInterface*)(this_ptr_ptr);
FREE((void*)this_ptr);
BroadcasterInterface_free(this_ptr_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FeeEstimator_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKFeeEstimator this_ptr_conv = *(LDKFeeEstimator*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKFeeEstimator this_ptr_conv = *(LDKFeeEstimator*)(this_ptr_ptr);
FREE((void*)this_ptr);
FeeEstimator_free(this_ptr_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Persist_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKPersist this_ptr_conv = *(LDKPersist*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKPersist this_ptr_conv = *(LDKPersist*)(this_ptr_ptr);
FREE((void*)this_ptr);
Persist_free(this_ptr_conv);
}
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1new(JNIEnv *env, jclass clz, int64_t chain_source, int64_t broadcaster, int64_t logger, int64_t feeest, int64_t persister) {
- LDKCOption_FilterZ chain_source_conv = *(LDKCOption_FilterZ*)(((uint64_t)chain_source) & ~1);
+ void* chain_source_ptr = (void*)(((uint64_t)chain_source) & ~1);
+ CHECK_ACCESS(chain_source_ptr);
+ LDKCOption_FilterZ chain_source_conv = *(LDKCOption_FilterZ*)(chain_source_ptr);
// Warning: we may need a move here but no clone is available for LDKCOption_FilterZ
if (chain_source_conv.tag == LDKCOption_FilterZ_Some) {
// Manually implement clone for Java trait instances
LDKFilter_JCalls_cloned(&chain_source_conv.some);
}
}
- LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(((uint64_t)broadcaster) & ~1);
+ void* broadcaster_ptr = (void*)(((uint64_t)broadcaster) & ~1);
+ CHECK_ACCESS(broadcaster_ptr);
+ LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr);
if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv);
}
- LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1);
+ void* logger_ptr = (void*)(((uint64_t)logger) & ~1);
+ CHECK_ACCESS(logger_ptr);
+ LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
if (logger_conv.free == LDKLogger_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKLogger_JCalls_cloned(&logger_conv);
}
- LDKFeeEstimator feeest_conv = *(LDKFeeEstimator*)(((uint64_t)feeest) & ~1);
+ void* feeest_ptr = (void*)(((uint64_t)feeest) & ~1);
+ CHECK_ACCESS(feeest_ptr);
+ LDKFeeEstimator feeest_conv = *(LDKFeeEstimator*)(feeest_ptr);
if (feeest_conv.free == LDKFeeEstimator_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKFeeEstimator_JCalls_cloned(&feeest_conv);
}
- LDKPersist persister_conv = *(LDKPersist*)(((uint64_t)persister) & ~1);
+ void* persister_ptr = (void*)(((uint64_t)persister) & ~1);
+ CHECK_ACCESS(persister_ptr);
+ LDKPersist persister_conv = *(LDKPersist*)(persister_ptr);
if (persister_conv.free == LDKPersist_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKPersist_JCalls_cloned(&persister_conv);
int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
for (size_t j = 0; j < ret_var.datalen; j++) {
LDKBalance *ret_conv_9_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
- *ret_conv_9_copy = Balance_clone(&ret_var.data[j]);
+ *ret_conv_9_copy = ret_var.data[j];
uint64_t ret_conv_9_ref = (uint64_t)ret_conv_9_copy;
ret_arr_ptr[j] = ret_conv_9_ref;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKMonitorEvent this_ptr_conv = *(LDKMonitorEvent*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKMonitorEvent this_ptr_conv = *(LDKMonitorEvent*)(this_ptr_ptr);
FREE((void*)this_ptr);
MonitorEvent_free(this_ptr_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Balance_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKBalance this_ptr_conv = *(LDKBalance*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKBalance this_ptr_conv = *(LDKBalance*)(this_ptr_ptr);
FREE((void*)this_ptr);
Balance_free(this_ptr_conv);
}
LDKChannelMonitorUpdate updates_conv;
updates_conv.inner = (void*)(updates & (~1));
updates_conv.is_owned = false;
- LDKBroadcasterInterface* broadcaster_conv = (LDKBroadcasterInterface*)(((uint64_t)broadcaster) & ~1);
- LDKFeeEstimator* fee_estimator_conv = (LDKFeeEstimator*)(((uint64_t)fee_estimator) & ~1);
- LDKLogger* logger_conv = (LDKLogger*)(((uint64_t)logger) & ~1);
+ void* broadcaster_ptr = (void*)(((uint64_t)broadcaster) & ~1);
+ if (!(broadcaster & 1)) { CHECK_ACCESS(broadcaster_ptr); }
+ LDKBroadcasterInterface* broadcaster_conv = (LDKBroadcasterInterface*)broadcaster_ptr;
+ void* fee_estimator_ptr = (void*)(((uint64_t)fee_estimator) & ~1);
+ if (!(fee_estimator & 1)) { CHECK_ACCESS(fee_estimator_ptr); }
+ LDKFeeEstimator* fee_estimator_conv = (LDKFeeEstimator*)fee_estimator_ptr;
+ void* logger_ptr = (void*)(((uint64_t)logger) & ~1);
+ if (!(logger & 1)) { CHECK_ACCESS(logger_ptr); }
+ LDKLogger* logger_conv = (LDKLogger*)logger_ptr;
LDKCResult_NoneMonitorUpdateErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneMonitorUpdateErrorZ), "LDKCResult_NoneMonitorUpdateErrorZ");
*ret_conv = ChannelMonitor_update_monitor(&this_arg_conv, &updates_conv, broadcaster_conv, fee_estimator_conv, logger_conv);
return (uint64_t)ret_conv;
LDKChannelMonitor this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKFilter* filter_conv = (LDKFilter*)(((uint64_t)filter) & ~1);
+ void* filter_ptr = (void*)(((uint64_t)filter) & ~1);
+ if (!(filter & 1)) { CHECK_ACCESS(filter_ptr); }
+ LDKFilter* filter_conv = (LDKFilter*)filter_ptr;
ChannelMonitor_load_outputs_to_watch(&this_arg_conv, filter_conv);
}
int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
for (size_t o = 0; o < ret_var.datalen; o++) {
LDKMonitorEvent *ret_conv_14_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
- *ret_conv_14_copy = MonitorEvent_clone(&ret_var.data[o]);
+ *ret_conv_14_copy = ret_var.data[o];
uint64_t ret_conv_14_ref = (uint64_t)ret_conv_14_copy;
ret_arr_ptr[o] = ret_conv_14_ref;
}
int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
for (size_t h = 0; h < ret_var.datalen; h++) {
LDKEvent *ret_conv_7_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
- *ret_conv_7_copy = Event_clone(&ret_var.data[h]);
+ *ret_conv_7_copy = ret_var.data[h];
uint64_t ret_conv_7_ref = (uint64_t)ret_conv_7_copy;
ret_arr_ptr[h] = ret_conv_7_ref;
}
LDKChannelMonitor this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKLogger* logger_conv = (LDKLogger*)(((uint64_t)logger) & ~1);
+ void* logger_ptr = (void*)(((uint64_t)logger) & ~1);
+ if (!(logger & 1)) { CHECK_ACCESS(logger_ptr); }
+ LDKLogger* logger_conv = (LDKLogger*)logger_ptr;
LDKCVec_TransactionZ ret_var = ChannelMonitor_get_latest_holder_commitment_txn(&this_arg_conv, logger_conv);
jobjectArray ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL);
;
int64_t* txdata_vals = (*env)->GetLongArrayElements (env, txdata, NULL);
for (size_t c = 0; c < txdata_constr.datalen; c++) {
int64_t txdata_conv_28 = txdata_vals[c];
- LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(((uint64_t)txdata_conv_28) & ~1);
+ void* txdata_conv_28_ptr = (void*)(((uint64_t)txdata_conv_28) & ~1);
+ CHECK_ACCESS(txdata_conv_28_ptr);
+ LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(txdata_conv_28_ptr);
txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)(((uint64_t)txdata_conv_28) & ~1));
txdata_constr.data[c] = txdata_conv_28_conv;
}
(*env)->ReleaseLongArrayElements(env, txdata, txdata_vals, 0);
- LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(((uint64_t)broadcaster) & ~1);
+ void* broadcaster_ptr = (void*)(((uint64_t)broadcaster) & ~1);
+ CHECK_ACCESS(broadcaster_ptr);
+ LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr);
if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv);
}
- LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(((uint64_t)fee_estimator) & ~1);
+ void* fee_estimator_ptr = (void*)(((uint64_t)fee_estimator) & ~1);
+ CHECK_ACCESS(fee_estimator_ptr);
+ LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr);
if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv);
}
- LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1);
+ void* logger_ptr = (void*)(((uint64_t)logger) & ~1);
+ CHECK_ACCESS(logger_ptr);
+ LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
if (logger_conv.free == LDKLogger_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKLogger_JCalls_cloned(&logger_conv);
CHECK((*env)->GetArrayLength(env, header) == 80);
(*env)->GetByteArrayRegion(env, header, 0, 80, header_arr);
unsigned char (*header_ref)[80] = &header_arr;
- LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(((uint64_t)broadcaster) & ~1);
+ void* broadcaster_ptr = (void*)(((uint64_t)broadcaster) & ~1);
+ CHECK_ACCESS(broadcaster_ptr);
+ LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr);
if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv);
}
- LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(((uint64_t)fee_estimator) & ~1);
+ void* fee_estimator_ptr = (void*)(((uint64_t)fee_estimator) & ~1);
+ CHECK_ACCESS(fee_estimator_ptr);
+ LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr);
if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv);
}
- LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1);
+ void* logger_ptr = (void*)(((uint64_t)logger) & ~1);
+ CHECK_ACCESS(logger_ptr);
+ LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
if (logger_conv.free == LDKLogger_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKLogger_JCalls_cloned(&logger_conv);
int64_t* txdata_vals = (*env)->GetLongArrayElements (env, txdata, NULL);
for (size_t c = 0; c < txdata_constr.datalen; c++) {
int64_t txdata_conv_28 = txdata_vals[c];
- LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(((uint64_t)txdata_conv_28) & ~1);
+ void* txdata_conv_28_ptr = (void*)(((uint64_t)txdata_conv_28) & ~1);
+ CHECK_ACCESS(txdata_conv_28_ptr);
+ LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(txdata_conv_28_ptr);
txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)(((uint64_t)txdata_conv_28) & ~1));
txdata_constr.data[c] = txdata_conv_28_conv;
}
(*env)->ReleaseLongArrayElements(env, txdata, txdata_vals, 0);
- LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(((uint64_t)broadcaster) & ~1);
+ void* broadcaster_ptr = (void*)(((uint64_t)broadcaster) & ~1);
+ CHECK_ACCESS(broadcaster_ptr);
+ LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr);
if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv);
}
- LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(((uint64_t)fee_estimator) & ~1);
+ void* fee_estimator_ptr = (void*)(((uint64_t)fee_estimator) & ~1);
+ CHECK_ACCESS(fee_estimator_ptr);
+ LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr);
if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv);
}
- LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1);
+ void* logger_ptr = (void*)(((uint64_t)logger) & ~1);
+ CHECK_ACCESS(logger_ptr);
+ LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
if (logger_conv.free == LDKLogger_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKLogger_JCalls_cloned(&logger_conv);
CHECK((*env)->GetArrayLength(env, txid) == 32);
(*env)->GetByteArrayRegion(env, txid, 0, 32, txid_arr);
unsigned char (*txid_ref)[32] = &txid_arr;
- LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(((uint64_t)broadcaster) & ~1);
+ void* broadcaster_ptr = (void*)(((uint64_t)broadcaster) & ~1);
+ CHECK_ACCESS(broadcaster_ptr);
+ LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr);
if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv);
}
- LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(((uint64_t)fee_estimator) & ~1);
+ void* fee_estimator_ptr = (void*)(((uint64_t)fee_estimator) & ~1);
+ CHECK_ACCESS(fee_estimator_ptr);
+ LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr);
if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv);
}
- LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1);
+ void* logger_ptr = (void*)(((uint64_t)logger) & ~1);
+ CHECK_ACCESS(logger_ptr);
+ LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
if (logger_conv.free == LDKLogger_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKLogger_JCalls_cloned(&logger_conv);
CHECK((*env)->GetArrayLength(env, header) == 80);
(*env)->GetByteArrayRegion(env, header, 0, 80, header_arr);
unsigned char (*header_ref)[80] = &header_arr;
- LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(((uint64_t)broadcaster) & ~1);
+ void* broadcaster_ptr = (void*)(((uint64_t)broadcaster) & ~1);
+ CHECK_ACCESS(broadcaster_ptr);
+ LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr);
if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv);
}
- LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(((uint64_t)fee_estimator) & ~1);
+ void* fee_estimator_ptr = (void*)(((uint64_t)fee_estimator) & ~1);
+ CHECK_ACCESS(fee_estimator_ptr);
+ LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr);
if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv);
}
- LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1);
+ void* logger_ptr = (void*)(((uint64_t)logger) & ~1);
+ CHECK_ACCESS(logger_ptr);
+ LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
if (logger_conv.free == LDKLogger_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKLogger_JCalls_cloned(&logger_conv);
int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
for (size_t j = 0; j < ret_var.datalen; j++) {
LDKBalance *ret_conv_9_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
- *ret_conv_9_copy = Balance_clone(&ret_var.data[j]);
+ *ret_conv_9_copy = ret_var.data[j];
uint64_t ret_conv_9_ref = (uint64_t)ret_conv_9_copy;
ret_arr_ptr[j] = ret_conv_9_ref;
}
LDKu8slice ser_ref;
ser_ref.datalen = (*env)->GetArrayLength(env, ser);
ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
- LDKKeysInterface* arg_conv = (LDKKeysInterface*)(((uint64_t)arg) & ~1);
+ void* arg_ptr = (void*)(((uint64_t)arg) & ~1);
+ if (!(arg & 1)) { CHECK_ACCESS(arg_ptr); }
+ LDKKeysInterface* arg_conv = (LDKKeysInterface*)arg_ptr;
LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ");
*ret_conv = C2Tuple_BlockHashChannelMonitorZ_read(ser_ref, arg_conv);
(*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
LDKDelayedPaymentOutputDescriptor this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- LDKTxOut val_conv = *(LDKTxOut*)(((uint64_t)val) & ~1);
+ void* val_ptr = (void*)(((uint64_t)val) & ~1);
+ CHECK_ACCESS(val_ptr);
+ LDKTxOut val_conv = *(LDKTxOut*)(val_ptr);
val_conv = TxOut_clone((LDKTxOut*)(((uint64_t)val) & ~1));
DelayedPaymentOutputDescriptor_set_output(&this_ptr_conv, val_conv);
}
LDKPublicKey per_commitment_point_arg_ref;
CHECK((*env)->GetArrayLength(env, per_commitment_point_arg) == 33);
(*env)->GetByteArrayRegion(env, per_commitment_point_arg, 0, 33, per_commitment_point_arg_ref.compressed_form);
- LDKTxOut output_arg_conv = *(LDKTxOut*)(((uint64_t)output_arg) & ~1);
+ void* output_arg_ptr = (void*)(((uint64_t)output_arg) & ~1);
+ CHECK_ACCESS(output_arg_ptr);
+ LDKTxOut output_arg_conv = *(LDKTxOut*)(output_arg_ptr);
output_arg_conv = TxOut_clone((LDKTxOut*)(((uint64_t)output_arg) & ~1));
LDKPublicKey revocation_pubkey_arg_ref;
CHECK((*env)->GetArrayLength(env, revocation_pubkey_arg) == 33);
LDKStaticPaymentOutputDescriptor this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- LDKTxOut val_conv = *(LDKTxOut*)(((uint64_t)val) & ~1);
+ void* val_ptr = (void*)(((uint64_t)val) & ~1);
+ CHECK_ACCESS(val_ptr);
+ LDKTxOut val_conv = *(LDKTxOut*)(val_ptr);
val_conv = TxOut_clone((LDKTxOut*)(((uint64_t)val) & ~1));
StaticPaymentOutputDescriptor_set_output(&this_ptr_conv, val_conv);
}
outpoint_arg_conv.inner = (void*)(outpoint_arg & (~1));
outpoint_arg_conv.is_owned = (outpoint_arg & 1) || (outpoint_arg == 0);
outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv);
- LDKTxOut output_arg_conv = *(LDKTxOut*)(((uint64_t)output_arg) & ~1);
+ void* output_arg_ptr = (void*)(((uint64_t)output_arg) & ~1);
+ CHECK_ACCESS(output_arg_ptr);
+ LDKTxOut output_arg_conv = *(LDKTxOut*)(output_arg_ptr);
output_arg_conv = TxOut_clone((LDKTxOut*)(((uint64_t)output_arg) & ~1));
LDKThirtyTwoBytes channel_keys_id_arg_ref;
CHECK((*env)->GetArrayLength(env, channel_keys_id_arg) == 32);
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKSpendableOutputDescriptor this_ptr_conv = *(LDKSpendableOutputDescriptor*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKSpendableOutputDescriptor this_ptr_conv = *(LDKSpendableOutputDescriptor*)(this_ptr_ptr);
FREE((void*)this_ptr);
SpendableOutputDescriptor_free(this_ptr_conv);
}
outpoint_conv.inner = (void*)(outpoint & (~1));
outpoint_conv.is_owned = (outpoint & 1) || (outpoint == 0);
outpoint_conv = OutPoint_clone(&outpoint_conv);
- LDKTxOut output_conv = *(LDKTxOut*)(((uint64_t)output) & ~1);
+ void* output_ptr = (void*)(((uint64_t)output) & ~1);
+ CHECK_ACCESS(output_ptr);
+ LDKTxOut output_conv = *(LDKTxOut*)(output_ptr);
output_conv = TxOut_clone((LDKTxOut*)(((uint64_t)output) & ~1));
LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor");
*ret_copy = SpendableOutputDescriptor_static_output(outpoint_conv, output_conv);
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BaseSign_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKBaseSign this_ptr_conv = *(LDKBaseSign*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKBaseSign this_ptr_conv = *(LDKBaseSign*)(this_ptr_ptr);
FREE((void*)this_ptr);
BaseSign_free(this_ptr_conv);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Sign_1clone(JNIEnv *env, jclass clz, int64_t orig) {
- LDKSign* orig_conv = (LDKSign*)(((uint64_t)orig) & ~1);
+ void* orig_ptr = (void*)(((uint64_t)orig) & ~1);
+ if (!(orig & 1)) { CHECK_ACCESS(orig_ptr); }
+ LDKSign* orig_conv = (LDKSign*)orig_ptr;
LDKSign* ret_ret =MALLOC(sizeof(LDKSign), "LDKSign");
*ret_ret = Sign_clone(orig_conv);
return (uint64_t)ret_ret;
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Sign_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKSign this_ptr_conv = *(LDKSign*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKSign this_ptr_conv = *(LDKSign*)(this_ptr_ptr);
FREE((void*)this_ptr);
Sign_free(this_ptr_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_KeysInterface_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKKeysInterface this_ptr_conv = *(LDKKeysInterface*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKKeysInterface this_ptr_conv = *(LDKKeysInterface*)(this_ptr_ptr);
FREE((void*)this_ptr);
KeysInterface_free(this_ptr_conv);
}
int64_t* descriptors_vals = (*env)->GetLongArrayElements (env, descriptors, NULL);
for (size_t b = 0; b < descriptors_constr.datalen; b++) {
int64_t descriptors_conv_27 = descriptors_vals[b];
- LDKSpendableOutputDescriptor descriptors_conv_27_conv = *(LDKSpendableOutputDescriptor*)(((uint64_t)descriptors_conv_27) & ~1);
+ void* descriptors_conv_27_ptr = (void*)(((uint64_t)descriptors_conv_27) & ~1);
+ CHECK_ACCESS(descriptors_conv_27_ptr);
+ LDKSpendableOutputDescriptor descriptors_conv_27_conv = *(LDKSpendableOutputDescriptor*)(descriptors_conv_27_ptr);
descriptors_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)(((uint64_t)descriptors_conv_27) & ~1));
descriptors_constr.data[b] = descriptors_conv_27_conv;
}
int64_t* outputs_vals = (*env)->GetLongArrayElements (env, outputs, NULL);
for (size_t h = 0; h < outputs_constr.datalen; h++) {
int64_t outputs_conv_7 = outputs_vals[h];
- LDKTxOut outputs_conv_7_conv = *(LDKTxOut*)(((uint64_t)outputs_conv_7) & ~1);
+ void* outputs_conv_7_ptr = (void*)(((uint64_t)outputs_conv_7) & ~1);
+ CHECK_ACCESS(outputs_conv_7_ptr);
+ LDKTxOut outputs_conv_7_conv = *(LDKTxOut*)(outputs_conv_7_ptr);
outputs_conv_7_conv = TxOut_clone((LDKTxOut*)(((uint64_t)outputs_conv_7) & ~1));
outputs_constr.data[h] = outputs_conv_7_conv;
}
LDKChannelDetails this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(((uint64_t)val) & ~1);
+ void* val_ptr = (void*)(((uint64_t)val) & ~1);
+ CHECK_ACCESS(val_ptr);
+ LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
val_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)val) & ~1));
ChannelDetails_set_short_channel_id(&this_ptr_conv, val_conv);
}
LDKChannelDetails this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(((uint64_t)val) & ~1);
+ void* val_ptr = (void*)(((uint64_t)val) & ~1);
+ CHECK_ACCESS(val_ptr);
+ LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
val_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)val) & ~1));
ChannelDetails_set_unspendable_punishment_reserve(&this_ptr_conv, val_conv);
}
LDKChannelDetails this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(((uint64_t)val) & ~1);
+ void* val_ptr = (void*)(((uint64_t)val) & ~1);
+ CHECK_ACCESS(val_ptr);
+ LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(val_ptr);
val_conv = COption_u32Z_clone((LDKCOption_u32Z*)(((uint64_t)val) & ~1));
ChannelDetails_set_confirmations_required(&this_ptr_conv, val_conv);
}
LDKChannelDetails this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- LDKCOption_u16Z val_conv = *(LDKCOption_u16Z*)(((uint64_t)val) & ~1);
+ void* val_ptr = (void*)(((uint64_t)val) & ~1);
+ CHECK_ACCESS(val_ptr);
+ LDKCOption_u16Z val_conv = *(LDKCOption_u16Z*)(val_ptr);
val_conv = COption_u16Z_clone((LDKCOption_u16Z*)(((uint64_t)val) & ~1));
ChannelDetails_set_force_close_spend_delay(&this_ptr_conv, val_conv);
}
funding_txo_arg_conv.inner = (void*)(funding_txo_arg & (~1));
funding_txo_arg_conv.is_owned = (funding_txo_arg & 1) || (funding_txo_arg == 0);
funding_txo_arg_conv = OutPoint_clone(&funding_txo_arg_conv);
- LDKCOption_u64Z short_channel_id_arg_conv = *(LDKCOption_u64Z*)(((uint64_t)short_channel_id_arg) & ~1);
+ void* short_channel_id_arg_ptr = (void*)(((uint64_t)short_channel_id_arg) & ~1);
+ CHECK_ACCESS(short_channel_id_arg_ptr);
+ LDKCOption_u64Z short_channel_id_arg_conv = *(LDKCOption_u64Z*)(short_channel_id_arg_ptr);
short_channel_id_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)short_channel_id_arg) & ~1));
- LDKCOption_u64Z unspendable_punishment_reserve_arg_conv = *(LDKCOption_u64Z*)(((uint64_t)unspendable_punishment_reserve_arg) & ~1);
- LDKCOption_u32Z confirmations_required_arg_conv = *(LDKCOption_u32Z*)(((uint64_t)confirmations_required_arg) & ~1);
+ void* unspendable_punishment_reserve_arg_ptr = (void*)(((uint64_t)unspendable_punishment_reserve_arg) & ~1);
+ CHECK_ACCESS(unspendable_punishment_reserve_arg_ptr);
+ LDKCOption_u64Z unspendable_punishment_reserve_arg_conv = *(LDKCOption_u64Z*)(unspendable_punishment_reserve_arg_ptr);
+ void* confirmations_required_arg_ptr = (void*)(((uint64_t)confirmations_required_arg) & ~1);
+ CHECK_ACCESS(confirmations_required_arg_ptr);
+ LDKCOption_u32Z confirmations_required_arg_conv = *(LDKCOption_u32Z*)(confirmations_required_arg_ptr);
confirmations_required_arg_conv = COption_u32Z_clone((LDKCOption_u32Z*)(((uint64_t)confirmations_required_arg) & ~1));
- LDKCOption_u16Z force_close_spend_delay_arg_conv = *(LDKCOption_u16Z*)(((uint64_t)force_close_spend_delay_arg) & ~1);
+ void* force_close_spend_delay_arg_ptr = (void*)(((uint64_t)force_close_spend_delay_arg) & ~1);
+ CHECK_ACCESS(force_close_spend_delay_arg_ptr);
+ LDKCOption_u16Z force_close_spend_delay_arg_conv = *(LDKCOption_u16Z*)(force_close_spend_delay_arg_ptr);
force_close_spend_delay_arg_conv = COption_u16Z_clone((LDKCOption_u16Z*)(((uint64_t)force_close_spend_delay_arg) & ~1));
LDKChannelDetails ret_var = ChannelDetails_new(channel_id_arg_ref, counterparty_arg_conv, funding_txo_arg_conv, short_channel_id_arg_conv, channel_value_satoshis_arg, unspendable_punishment_reserve_arg_conv, user_channel_id_arg, outbound_capacity_msat_arg, inbound_capacity_msat_arg, confirmations_required_arg_conv, force_close_spend_delay_arg_conv, is_outbound_arg, is_funding_locked_arg, is_usable_arg, is_public_arg);
CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKPaymentSendFailure this_ptr_conv = *(LDKPaymentSendFailure*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKPaymentSendFailure this_ptr_conv = *(LDKPaymentSendFailure*)(this_ptr_ptr);
FREE((void*)this_ptr);
PaymentSendFailure_free(this_ptr_conv);
}
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1parameter_1error(JNIEnv *env, jclass clz, int64_t a) {
- LDKAPIError a_conv = *(LDKAPIError*)(((uint64_t)a) & ~1);
+ void* a_ptr = (void*)(((uint64_t)a) & ~1);
+ CHECK_ACCESS(a_ptr);
+ LDKAPIError a_conv = *(LDKAPIError*)(a_ptr);
a_conv = APIError_clone((LDKAPIError*)(((uint64_t)a) & ~1));
LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
*ret_copy = PaymentSendFailure_parameter_error(a_conv);
int64_t* a_vals = (*env)->GetLongArrayElements (env, a, NULL);
for (size_t w = 0; w < a_constr.datalen; w++) {
int64_t a_conv_22 = a_vals[w];
- LDKCResult_NoneAPIErrorZ a_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(((uint64_t)a_conv_22) & ~1);
+ void* a_conv_22_ptr = (void*)(((uint64_t)a_conv_22) & ~1);
+ CHECK_ACCESS(a_conv_22_ptr);
+ LDKCResult_NoneAPIErrorZ a_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(a_conv_22_ptr);
a_conv_22_conv = CResult_NoneAPIErrorZ_clone((LDKCResult_NoneAPIErrorZ*)(((uint64_t)a_conv_22) & ~1));
a_constr.data[w] = a_conv_22_conv;
}
int64_t* a_vals = (*env)->GetLongArrayElements (env, a, NULL);
for (size_t k = 0; k < a_constr.datalen; k++) {
int64_t a_conv_10 = a_vals[k];
- LDKAPIError a_conv_10_conv = *(LDKAPIError*)(((uint64_t)a_conv_10) & ~1);
+ void* a_conv_10_ptr = (void*)(((uint64_t)a_conv_10) & ~1);
+ CHECK_ACCESS(a_conv_10_ptr);
+ LDKAPIError a_conv_10_conv = *(LDKAPIError*)(a_conv_10_ptr);
a_conv_10_conv = APIError_clone((LDKAPIError*)(((uint64_t)a_conv_10) & ~1));
a_constr.data[k] = a_conv_10_conv;
}
int64_t* a_vals = (*env)->GetLongArrayElements (env, a, NULL);
for (size_t w = 0; w < a_constr.datalen; w++) {
int64_t a_conv_22 = a_vals[w];
- LDKCResult_NoneAPIErrorZ a_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(((uint64_t)a_conv_22) & ~1);
+ void* a_conv_22_ptr = (void*)(((uint64_t)a_conv_22) & ~1);
+ CHECK_ACCESS(a_conv_22_ptr);
+ LDKCResult_NoneAPIErrorZ a_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(a_conv_22_ptr);
a_conv_22_conv = CResult_NoneAPIErrorZ_clone((LDKCResult_NoneAPIErrorZ*)(((uint64_t)a_conv_22) & ~1));
a_constr.data[w] = a_conv_22_conv;
}
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1new(JNIEnv *env, jclass clz, int64_t fee_est, int64_t chain_monitor, int64_t tx_broadcaster, int64_t logger, int64_t keys_manager, int64_t config, int64_t params) {
- LDKFeeEstimator fee_est_conv = *(LDKFeeEstimator*)(((uint64_t)fee_est) & ~1);
+ void* fee_est_ptr = (void*)(((uint64_t)fee_est) & ~1);
+ CHECK_ACCESS(fee_est_ptr);
+ LDKFeeEstimator fee_est_conv = *(LDKFeeEstimator*)(fee_est_ptr);
if (fee_est_conv.free == LDKFeeEstimator_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKFeeEstimator_JCalls_cloned(&fee_est_conv);
}
- LDKWatch chain_monitor_conv = *(LDKWatch*)(((uint64_t)chain_monitor) & ~1);
+ void* chain_monitor_ptr = (void*)(((uint64_t)chain_monitor) & ~1);
+ CHECK_ACCESS(chain_monitor_ptr);
+ LDKWatch chain_monitor_conv = *(LDKWatch*)(chain_monitor_ptr);
if (chain_monitor_conv.free == LDKWatch_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKWatch_JCalls_cloned(&chain_monitor_conv);
}
- LDKBroadcasterInterface tx_broadcaster_conv = *(LDKBroadcasterInterface*)(((uint64_t)tx_broadcaster) & ~1);
+ void* tx_broadcaster_ptr = (void*)(((uint64_t)tx_broadcaster) & ~1);
+ CHECK_ACCESS(tx_broadcaster_ptr);
+ LDKBroadcasterInterface tx_broadcaster_conv = *(LDKBroadcasterInterface*)(tx_broadcaster_ptr);
if (tx_broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKBroadcasterInterface_JCalls_cloned(&tx_broadcaster_conv);
}
- LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1);
+ void* logger_ptr = (void*)(((uint64_t)logger) & ~1);
+ CHECK_ACCESS(logger_ptr);
+ LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
if (logger_conv.free == LDKLogger_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKLogger_JCalls_cloned(&logger_conv);
}
- LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(((uint64_t)keys_manager) & ~1);
+ void* keys_manager_ptr = (void*)(((uint64_t)keys_manager) & ~1);
+ CHECK_ACCESS(keys_manager_ptr);
+ LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(keys_manager_ptr);
if (keys_manager_conv.free == LDKKeysInterface_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKKeysInterface_JCalls_cloned(&keys_manager_conv);
int64_t* addresses_vals = (*env)->GetLongArrayElements (env, addresses, NULL);
for (size_t m = 0; m < addresses_constr.datalen; m++) {
int64_t addresses_conv_12 = addresses_vals[m];
- LDKNetAddress addresses_conv_12_conv = *(LDKNetAddress*)(((uint64_t)addresses_conv_12) & ~1);
+ void* addresses_conv_12_ptr = (void*)(((uint64_t)addresses_conv_12) & ~1);
+ CHECK_ACCESS(addresses_conv_12_ptr);
+ LDKNetAddress addresses_conv_12_conv = *(LDKNetAddress*)(addresses_conv_12_ptr);
addresses_constr.data[m] = addresses_conv_12_conv;
}
(*env)->ReleaseLongArrayElements(env, addresses, addresses_vals, 0);
LDKChannelManager this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(((uint64_t)min_value_msat) & ~1);
+ void* min_value_msat_ptr = (void*)(((uint64_t)min_value_msat) & ~1);
+ CHECK_ACCESS(min_value_msat_ptr);
+ LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr);
min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)min_value_msat) & ~1));
LDKC2Tuple_PaymentHashPaymentSecretZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ");
*ret_conv = ChannelManager_create_inbound_payment(&this_arg_conv, min_value_msat_conv, invoice_expiry_delta_secs, user_payment_id);
LDKThirtyTwoBytes payment_hash_ref;
CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
(*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
- LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(((uint64_t)min_value_msat) & ~1);
+ void* min_value_msat_ptr = (void*)(((uint64_t)min_value_msat) & ~1);
+ CHECK_ACCESS(min_value_msat_ptr);
+ LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr);
min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)min_value_msat) & ~1));
LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ");
*ret_conv = ChannelManager_create_inbound_payment_for_hash(&this_arg_conv, payment_hash_ref, min_value_msat_conv, invoice_expiry_delta_secs, user_payment_id);
LDKChannelManagerReadArgs this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- LDKKeysInterface val_conv = *(LDKKeysInterface*)(((uint64_t)val) & ~1);
+ void* val_ptr = (void*)(((uint64_t)val) & ~1);
+ CHECK_ACCESS(val_ptr);
+ LDKKeysInterface val_conv = *(LDKKeysInterface*)(val_ptr);
if (val_conv.free == LDKKeysInterface_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKKeysInterface_JCalls_cloned(&val_conv);
LDKChannelManagerReadArgs this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- LDKFeeEstimator val_conv = *(LDKFeeEstimator*)(((uint64_t)val) & ~1);
+ void* val_ptr = (void*)(((uint64_t)val) & ~1);
+ CHECK_ACCESS(val_ptr);
+ LDKFeeEstimator val_conv = *(LDKFeeEstimator*)(val_ptr);
if (val_conv.free == LDKFeeEstimator_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKFeeEstimator_JCalls_cloned(&val_conv);
LDKChannelManagerReadArgs this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- LDKWatch val_conv = *(LDKWatch*)(((uint64_t)val) & ~1);
+ void* val_ptr = (void*)(((uint64_t)val) & ~1);
+ CHECK_ACCESS(val_ptr);
+ LDKWatch val_conv = *(LDKWatch*)(val_ptr);
if (val_conv.free == LDKWatch_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKWatch_JCalls_cloned(&val_conv);
LDKChannelManagerReadArgs this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- LDKBroadcasterInterface val_conv = *(LDKBroadcasterInterface*)(((uint64_t)val) & ~1);
+ void* val_ptr = (void*)(((uint64_t)val) & ~1);
+ CHECK_ACCESS(val_ptr);
+ LDKBroadcasterInterface val_conv = *(LDKBroadcasterInterface*)(val_ptr);
if (val_conv.free == LDKBroadcasterInterface_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKBroadcasterInterface_JCalls_cloned(&val_conv);
LDKChannelManagerReadArgs this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- LDKLogger val_conv = *(LDKLogger*)(((uint64_t)val) & ~1);
+ void* val_ptr = (void*)(((uint64_t)val) & ~1);
+ CHECK_ACCESS(val_ptr);
+ LDKLogger val_conv = *(LDKLogger*)(val_ptr);
if (val_conv.free == LDKLogger_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKLogger_JCalls_cloned(&val_conv);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1new(JNIEnv *env, jclass clz, int64_t keys_manager, int64_t fee_estimator, int64_t chain_monitor, int64_t tx_broadcaster, int64_t logger, int64_t default_config, int64_tArray channel_monitors) {
- LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(((uint64_t)keys_manager) & ~1);
+ void* keys_manager_ptr = (void*)(((uint64_t)keys_manager) & ~1);
+ CHECK_ACCESS(keys_manager_ptr);
+ LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(keys_manager_ptr);
if (keys_manager_conv.free == LDKKeysInterface_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKKeysInterface_JCalls_cloned(&keys_manager_conv);
}
- LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(((uint64_t)fee_estimator) & ~1);
+ void* fee_estimator_ptr = (void*)(((uint64_t)fee_estimator) & ~1);
+ CHECK_ACCESS(fee_estimator_ptr);
+ LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr);
if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv);
}
- LDKWatch chain_monitor_conv = *(LDKWatch*)(((uint64_t)chain_monitor) & ~1);
+ void* chain_monitor_ptr = (void*)(((uint64_t)chain_monitor) & ~1);
+ CHECK_ACCESS(chain_monitor_ptr);
+ LDKWatch chain_monitor_conv = *(LDKWatch*)(chain_monitor_ptr);
if (chain_monitor_conv.free == LDKWatch_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKWatch_JCalls_cloned(&chain_monitor_conv);
}
- LDKBroadcasterInterface tx_broadcaster_conv = *(LDKBroadcasterInterface*)(((uint64_t)tx_broadcaster) & ~1);
+ void* tx_broadcaster_ptr = (void*)(((uint64_t)tx_broadcaster) & ~1);
+ CHECK_ACCESS(tx_broadcaster_ptr);
+ LDKBroadcasterInterface tx_broadcaster_conv = *(LDKBroadcasterInterface*)(tx_broadcaster_ptr);
if (tx_broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKBroadcasterInterface_JCalls_cloned(&tx_broadcaster_conv);
}
- LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1);
+ void* logger_ptr = (void*)(((uint64_t)logger) & ~1);
+ CHECK_ACCESS(logger_ptr);
+ LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
if (logger_conv.free == LDKLogger_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKLogger_JCalls_cloned(&logger_conv);
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetAddress_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKNetAddress this_ptr_conv = *(LDKNetAddress*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKNetAddress this_ptr_conv = *(LDKNetAddress*)(this_ptr_ptr);
FREE((void*)this_ptr);
NetAddress_free(this_ptr_conv);
}
int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL);
for (size_t m = 0; m < val_constr.datalen; m++) {
int64_t val_conv_12 = val_vals[m];
- LDKNetAddress val_conv_12_conv = *(LDKNetAddress*)(((uint64_t)val_conv_12) & ~1);
+ void* val_conv_12_ptr = (void*)(((uint64_t)val_conv_12) & ~1);
+ CHECK_ACCESS(val_conv_12_ptr);
+ LDKNetAddress val_conv_12_conv = *(LDKNetAddress*)(val_conv_12_ptr);
val_conv_12_conv = NetAddress_clone((LDKNetAddress*)(((uint64_t)val_conv_12) & ~1));
val_constr.data[m] = val_conv_12_conv;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorAction_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKErrorAction this_ptr_conv = *(LDKErrorAction*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKErrorAction this_ptr_conv = *(LDKErrorAction*)(this_ptr_ptr);
FREE((void*)this_ptr);
ErrorAction_free(this_ptr_conv);
}
LDKLightningError this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- LDKErrorAction val_conv = *(LDKErrorAction*)(((uint64_t)val) & ~1);
+ void* val_ptr = (void*)(((uint64_t)val) & ~1);
+ CHECK_ACCESS(val_ptr);
+ LDKErrorAction val_conv = *(LDKErrorAction*)(val_ptr);
val_conv = ErrorAction_clone((LDKErrorAction*)(((uint64_t)val) & ~1));
LightningError_set_action(&this_ptr_conv, val_conv);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LightningError_1new(JNIEnv *env, jclass clz, jstring err_arg, int64_t action_arg) {
LDKStr err_arg_conv = java_to_owned_str(env, err_arg);
- LDKErrorAction action_arg_conv = *(LDKErrorAction*)(((uint64_t)action_arg) & ~1);
+ void* action_arg_ptr = (void*)(((uint64_t)action_arg) & ~1);
+ CHECK_ACCESS(action_arg_ptr);
+ LDKErrorAction action_arg_conv = *(LDKErrorAction*)(action_arg_ptr);
action_arg_conv = ErrorAction_clone((LDKErrorAction*)(((uint64_t)action_arg) & ~1));
LDKLightningError ret_var = LightningError_new(err_arg_conv, action_arg_conv);
CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKChannelMessageHandler this_ptr_conv = *(LDKChannelMessageHandler*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKChannelMessageHandler this_ptr_conv = *(LDKChannelMessageHandler*)(this_ptr_ptr);
FREE((void*)this_ptr);
ChannelMessageHandler_free(this_ptr_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKRoutingMessageHandler this_ptr_conv = *(LDKRoutingMessageHandler*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKRoutingMessageHandler this_ptr_conv = *(LDKRoutingMessageHandler*)(this_ptr_ptr);
FREE((void*)this_ptr);
RoutingMessageHandler_free(this_ptr_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CustomMessageHandler_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKCustomMessageHandler this_ptr_conv = *(LDKCustomMessageHandler*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKCustomMessageHandler this_ptr_conv = *(LDKCustomMessageHandler*)(this_ptr_ptr);
FREE((void*)this_ptr);
CustomMessageHandler_free(this_ptr_conv);
}
LDKMessageHandler this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- LDKChannelMessageHandler val_conv = *(LDKChannelMessageHandler*)(((uint64_t)val) & ~1);
+ void* val_ptr = (void*)(((uint64_t)val) & ~1);
+ CHECK_ACCESS(val_ptr);
+ LDKChannelMessageHandler val_conv = *(LDKChannelMessageHandler*)(val_ptr);
if (val_conv.free == LDKChannelMessageHandler_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKChannelMessageHandler_JCalls_cloned(&val_conv);
LDKMessageHandler this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- LDKRoutingMessageHandler val_conv = *(LDKRoutingMessageHandler*)(((uint64_t)val) & ~1);
+ void* val_ptr = (void*)(((uint64_t)val) & ~1);
+ CHECK_ACCESS(val_ptr);
+ LDKRoutingMessageHandler val_conv = *(LDKRoutingMessageHandler*)(val_ptr);
if (val_conv.free == LDKRoutingMessageHandler_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKRoutingMessageHandler_JCalls_cloned(&val_conv);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageHandler_1new(JNIEnv *env, jclass clz, int64_t chan_handler_arg, int64_t route_handler_arg) {
- LDKChannelMessageHandler chan_handler_arg_conv = *(LDKChannelMessageHandler*)(((uint64_t)chan_handler_arg) & ~1);
+ void* chan_handler_arg_ptr = (void*)(((uint64_t)chan_handler_arg) & ~1);
+ CHECK_ACCESS(chan_handler_arg_ptr);
+ LDKChannelMessageHandler chan_handler_arg_conv = *(LDKChannelMessageHandler*)(chan_handler_arg_ptr);
if (chan_handler_arg_conv.free == LDKChannelMessageHandler_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKChannelMessageHandler_JCalls_cloned(&chan_handler_arg_conv);
}
- LDKRoutingMessageHandler route_handler_arg_conv = *(LDKRoutingMessageHandler*)(((uint64_t)route_handler_arg) & ~1);
+ void* route_handler_arg_ptr = (void*)(((uint64_t)route_handler_arg) & ~1);
+ CHECK_ACCESS(route_handler_arg_ptr);
+ LDKRoutingMessageHandler route_handler_arg_conv = *(LDKRoutingMessageHandler*)(route_handler_arg_ptr);
if (route_handler_arg_conv.free == LDKRoutingMessageHandler_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKRoutingMessageHandler_JCalls_cloned(&route_handler_arg_conv);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1clone(JNIEnv *env, jclass clz, int64_t orig) {
- LDKSocketDescriptor* orig_conv = (LDKSocketDescriptor*)(((uint64_t)orig) & ~1);
+ void* orig_ptr = (void*)(((uint64_t)orig) & ~1);
+ if (!(orig & 1)) { CHECK_ACCESS(orig_ptr); }
+ LDKSocketDescriptor* orig_conv = (LDKSocketDescriptor*)orig_ptr;
LDKSocketDescriptor* ret_ret =MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor");
*ret_ret = SocketDescriptor_clone(orig_conv);
return (uint64_t)ret_ret;
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKSocketDescriptor this_ptr_conv = *(LDKSocketDescriptor*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKSocketDescriptor this_ptr_conv = *(LDKSocketDescriptor*)(this_ptr_ptr);
FREE((void*)this_ptr);
SocketDescriptor_free(this_ptr_conv);
}
CHECK((*env)->GetArrayLength(env, ephemeral_random_data) == 32);
(*env)->GetByteArrayRegion(env, ephemeral_random_data, 0, 32, ephemeral_random_data_arr);
unsigned char (*ephemeral_random_data_ref)[32] = &ephemeral_random_data_arr;
- LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1);
+ void* logger_ptr = (void*)(((uint64_t)logger) & ~1);
+ CHECK_ACCESS(logger_ptr);
+ LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
if (logger_conv.free == LDKLogger_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKLogger_JCalls_cloned(&logger_conv);
}
- LDKCustomMessageHandler custom_message_handler_conv = *(LDKCustomMessageHandler*)(((uint64_t)custom_message_handler) & ~1);
+ void* custom_message_handler_ptr = (void*)(((uint64_t)custom_message_handler) & ~1);
+ CHECK_ACCESS(custom_message_handler_ptr);
+ LDKCustomMessageHandler custom_message_handler_conv = *(LDKCustomMessageHandler*)(custom_message_handler_ptr);
if (custom_message_handler_conv.free == LDKCustomMessageHandler_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKCustomMessageHandler_JCalls_cloned(&custom_message_handler_conv);
LDKPublicKey their_node_id_ref;
CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
(*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
- LDKSocketDescriptor descriptor_conv = *(LDKSocketDescriptor*)(((uint64_t)descriptor) & ~1);
+ void* descriptor_ptr = (void*)(((uint64_t)descriptor) & ~1);
+ CHECK_ACCESS(descriptor_ptr);
+ LDKSocketDescriptor descriptor_conv = *(LDKSocketDescriptor*)(descriptor_ptr);
if (descriptor_conv.free == LDKSocketDescriptor_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKSocketDescriptor_JCalls_cloned(&descriptor_conv);
LDKPeerManager this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKSocketDescriptor descriptor_conv = *(LDKSocketDescriptor*)(((uint64_t)descriptor) & ~1);
+ void* descriptor_ptr = (void*)(((uint64_t)descriptor) & ~1);
+ CHECK_ACCESS(descriptor_ptr);
+ LDKSocketDescriptor descriptor_conv = *(LDKSocketDescriptor*)(descriptor_ptr);
if (descriptor_conv.free == LDKSocketDescriptor_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKSocketDescriptor_JCalls_cloned(&descriptor_conv);
LDKPeerManager this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)(((uint64_t)descriptor) & ~1);
+ void* descriptor_ptr = (void*)(((uint64_t)descriptor) & ~1);
+ if (!(descriptor & 1)) { CHECK_ACCESS(descriptor_ptr); }
+ LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)descriptor_ptr;
LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
*ret_conv = PeerManager_write_buffer_space_avail(&this_arg_conv, descriptor_conv);
return (uint64_t)ret_conv;
LDKPeerManager this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKSocketDescriptor* peer_descriptor_conv = (LDKSocketDescriptor*)(((uint64_t)peer_descriptor) & ~1);
+ void* peer_descriptor_ptr = (void*)(((uint64_t)peer_descriptor) & ~1);
+ if (!(peer_descriptor & 1)) { CHECK_ACCESS(peer_descriptor_ptr); }
+ LDKSocketDescriptor* peer_descriptor_conv = (LDKSocketDescriptor*)peer_descriptor_ptr;
LDKu8slice data_ref;
data_ref.datalen = (*env)->GetArrayLength(env, data);
data_ref.data = (*env)->GetByteArrayElements (env, data, NULL);
LDKPeerManager this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)(((uint64_t)descriptor) & ~1);
+ void* descriptor_ptr = (void*)(((uint64_t)descriptor) & ~1);
+ if (!(descriptor & 1)) { CHECK_ACCESS(descriptor_ptr); }
+ LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)descriptor_ptr;
PeerManager_socket_disconnected(&this_arg_conv, descriptor_conv);
}
LDKHTLCOutputInCommitment this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(((uint64_t)val) & ~1);
+ void* val_ptr = (void*)(((uint64_t)val) & ~1);
+ CHECK_ACCESS(val_ptr);
+ LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(val_ptr);
val_conv = COption_u32Z_clone((LDKCOption_u32Z*)(((uint64_t)val) & ~1));
HTLCOutputInCommitment_set_transaction_output_index(&this_ptr_conv, val_conv);
}
LDKThirtyTwoBytes payment_hash_arg_ref;
CHECK((*env)->GetArrayLength(env, payment_hash_arg) == 32);
(*env)->GetByteArrayRegion(env, payment_hash_arg, 0, 32, payment_hash_arg_ref.data);
- LDKCOption_u32Z transaction_output_index_arg_conv = *(LDKCOption_u32Z*)(((uint64_t)transaction_output_index_arg) & ~1);
+ void* transaction_output_index_arg_ptr = (void*)(((uint64_t)transaction_output_index_arg) & ~1);
+ CHECK_ACCESS(transaction_output_index_arg_ptr);
+ LDKCOption_u32Z transaction_output_index_arg_conv = *(LDKCOption_u32Z*)(transaction_output_index_arg_ptr);
transaction_output_index_arg_conv = COption_u32Z_clone((LDKCOption_u32Z*)(((uint64_t)transaction_output_index_arg) & ~1));
LDKHTLCOutputInCommitment ret_var = HTLCOutputInCommitment_new(offered_arg, amount_msat_arg, cltv_expiry_arg, payment_hash_arg_ref, transaction_output_index_arg_conv);
CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
ClosingTransaction_free(this_obj_conv);
}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1clone(JNIEnv *env, jclass clz, int64_t orig) {
+ LDKClosingTransaction orig_conv;
+ orig_conv.inner = (void*)(orig & (~1));
+ orig_conv.is_owned = false;
+ LDKClosingTransaction ret_var = ClosingTransaction_clone(&orig_conv);
+ CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ uint64_t ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1hash(JNIEnv *env, jclass clz, int64_t o) {
+ LDKClosingTransaction o_conv;
+ o_conv.inner = (void*)(o & (~1));
+ o_conv.is_owned = false;
+ int64_t ret_val = ClosingTransaction_hash(&o_conv);
+ return ret_val;
+}
+
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1new(JNIEnv *env, jclass clz, int64_t to_holder_value_sat, int64_t to_counterparty_value_sat, int8_tArray to_holder_script, int8_tArray to_counterparty_script, int64_t funding_outpoint) {
LDKCVec_u8Z to_holder_script_ref;
to_holder_script_ref.datalen = (*env)->GetArrayLength(env, to_holder_script);
return ret_ref;
}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1clone(JNIEnv *env, jclass clz, int64_t orig) {
+ LDKInvalidShutdownScript orig_conv;
+ orig_conv.inner = (void*)(orig & (~1));
+ orig_conv.is_owned = false;
+ LDKInvalidShutdownScript ret_var = InvalidShutdownScript_clone(&orig_conv);
+ CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ uint64_t ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ return ret_ref;
+}
+
JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1write(JNIEnv *env, jclass clz, int64_t obj) {
LDKShutdownScript obj_conv;
obj_conv.inner = (void*)(obj & (~1));
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CustomMessageReader_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKCustomMessageReader this_ptr_conv = *(LDKCustomMessageReader*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKCustomMessageReader this_ptr_conv = *(LDKCustomMessageReader*)(this_ptr_ptr);
FREE((void*)this_ptr);
CustomMessageReader_free(this_ptr_conv);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Type_1clone(JNIEnv *env, jclass clz, int64_t orig) {
- LDKType* orig_conv = (LDKType*)(((uint64_t)orig) & ~1);
+ void* orig_ptr = (void*)(((uint64_t)orig) & ~1);
+ if (!(orig & 1)) { CHECK_ACCESS(orig_ptr); }
+ LDKType* orig_conv = (LDKType*)orig_ptr;
LDKType* ret_ret =MALLOC(sizeof(LDKType), "LDKType");
*ret_ret = Type_clone(orig_conv);
return (uint64_t)ret_ret;
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Type_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKType this_ptr_conv = *(LDKType*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKType this_ptr_conv = *(LDKType*)(this_ptr_ptr);
FREE((void*)this_ptr);
Type_free(this_ptr_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Score_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKScore this_ptr_conv = *(LDKScore*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKScore this_ptr_conv = *(LDKScore*)(this_ptr_ptr);
FREE((void*)this_ptr);
Score_free(this_ptr_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKNetworkUpdate this_ptr_conv = *(LDKNetworkUpdate*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKNetworkUpdate this_ptr_conv = *(LDKNetworkUpdate*)(this_ptr_ptr);
FREE((void*)this_ptr);
NetworkUpdate_free(this_ptr_conv);
}
network_graph_conv.inner = (void*)(network_graph & (~1));
network_graph_conv.is_owned = (network_graph & 1) || (network_graph == 0);
network_graph_conv = NetworkGraph_clone(&network_graph_conv);
- LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(((uint64_t)chain_access) & ~1);
+ void* chain_access_ptr = (void*)(((uint64_t)chain_access) & ~1);
+ CHECK_ACCESS(chain_access_ptr);
+ LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(chain_access_ptr);
// Warning: we may need a move here but no clone is available for LDKCOption_AccessZ
if (chain_access_conv.tag == LDKCOption_AccessZ_Some) {
// Manually implement clone for Java trait instances
LDKAccess_JCalls_cloned(&chain_access_conv.some);
}
}
- LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1);
+ void* logger_ptr = (void*)(((uint64_t)logger) & ~1);
+ CHECK_ACCESS(logger_ptr);
+ LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
if (logger_conv.free == LDKLogger_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKLogger_JCalls_cloned(&logger_conv);
LDKNetGraphMsgHandler this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(((uint64_t)chain_access) & ~1);
+ void* chain_access_ptr = (void*)(((uint64_t)chain_access) & ~1);
+ CHECK_ACCESS(chain_access_ptr);
+ LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(chain_access_ptr);
// Warning: we may need a move here but no clone is available for LDKCOption_AccessZ
if (chain_access_conv.tag == LDKCOption_AccessZ_Some) {
// Manually implement clone for Java trait instances
LDKDirectionalChannelInfo this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(((uint64_t)val) & ~1);
+ void* val_ptr = (void*)(((uint64_t)val) & ~1);
+ CHECK_ACCESS(val_ptr);
+ LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
val_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)val) & ~1));
DirectionalChannelInfo_set_htlc_maximum_msat(&this_ptr_conv, val_conv);
}
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1new(JNIEnv *env, jclass clz, int32_t last_update_arg, jboolean enabled_arg, int16_t cltv_expiry_delta_arg, int64_t htlc_minimum_msat_arg, int64_t htlc_maximum_msat_arg, int64_t fees_arg, int64_t last_update_message_arg) {
- LDKCOption_u64Z htlc_maximum_msat_arg_conv = *(LDKCOption_u64Z*)(((uint64_t)htlc_maximum_msat_arg) & ~1);
+ void* htlc_maximum_msat_arg_ptr = (void*)(((uint64_t)htlc_maximum_msat_arg) & ~1);
+ CHECK_ACCESS(htlc_maximum_msat_arg_ptr);
+ LDKCOption_u64Z htlc_maximum_msat_arg_conv = *(LDKCOption_u64Z*)(htlc_maximum_msat_arg_ptr);
htlc_maximum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)htlc_maximum_msat_arg) & ~1));
LDKRoutingFees fees_arg_conv;
fees_arg_conv.inner = (void*)(fees_arg & (~1));
LDKChannelInfo this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(((uint64_t)val) & ~1);
+ void* val_ptr = (void*)(((uint64_t)val) & ~1);
+ CHECK_ACCESS(val_ptr);
+ LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
val_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)val) & ~1));
ChannelInfo_set_capacity_sats(&this_ptr_conv, val_conv);
}
two_to_one_arg_conv.inner = (void*)(two_to_one_arg & (~1));
two_to_one_arg_conv.is_owned = (two_to_one_arg & 1) || (two_to_one_arg == 0);
two_to_one_arg_conv = DirectionalChannelInfo_clone(&two_to_one_arg_conv);
- LDKCOption_u64Z capacity_sats_arg_conv = *(LDKCOption_u64Z*)(((uint64_t)capacity_sats_arg) & ~1);
+ void* capacity_sats_arg_ptr = (void*)(((uint64_t)capacity_sats_arg) & ~1);
+ CHECK_ACCESS(capacity_sats_arg_ptr);
+ LDKCOption_u64Z capacity_sats_arg_conv = *(LDKCOption_u64Z*)(capacity_sats_arg_ptr);
capacity_sats_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)capacity_sats_arg) & ~1));
LDKChannelAnnouncement announcement_message_arg_conv;
announcement_message_arg_conv.inner = (void*)(announcement_message_arg & (~1));
int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL);
for (size_t m = 0; m < val_constr.datalen; m++) {
int64_t val_conv_12 = val_vals[m];
- LDKNetAddress val_conv_12_conv = *(LDKNetAddress*)(((uint64_t)val_conv_12) & ~1);
+ void* val_conv_12_ptr = (void*)(((uint64_t)val_conv_12) & ~1);
+ CHECK_ACCESS(val_conv_12_ptr);
+ LDKNetAddress val_conv_12_conv = *(LDKNetAddress*)(val_conv_12_ptr);
val_conv_12_conv = NetAddress_clone((LDKNetAddress*)(((uint64_t)val_conv_12) & ~1));
val_constr.data[m] = val_conv_12_conv;
}
int64_t* addresses_arg_vals = (*env)->GetLongArrayElements (env, addresses_arg, NULL);
for (size_t m = 0; m < addresses_arg_constr.datalen; m++) {
int64_t addresses_arg_conv_12 = addresses_arg_vals[m];
- LDKNetAddress addresses_arg_conv_12_conv = *(LDKNetAddress*)(((uint64_t)addresses_arg_conv_12) & ~1);
+ void* addresses_arg_conv_12_ptr = (void*)(((uint64_t)addresses_arg_conv_12) & ~1);
+ CHECK_ACCESS(addresses_arg_conv_12_ptr);
+ LDKNetAddress addresses_arg_conv_12_conv = *(LDKNetAddress*)(addresses_arg_conv_12_ptr);
addresses_arg_constr.data[m] = addresses_arg_conv_12_conv;
}
(*env)->ReleaseLongArrayElements(env, addresses_arg, addresses_arg_vals, 0);
LDKChannelAnnouncement msg_conv;
msg_conv.inner = (void*)(msg & (~1));
msg_conv.is_owned = false;
- LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(((uint64_t)chain_access) & ~1);
+ void* chain_access_ptr = (void*)(((uint64_t)chain_access) & ~1);
+ CHECK_ACCESS(chain_access_ptr);
+ LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(chain_access_ptr);
// Warning: we may need a move here but no clone is available for LDKCOption_AccessZ
if (chain_access_conv.tag == LDKCOption_AccessZ_Some) {
// Manually implement clone for Java trait instances
LDKUnsignedChannelAnnouncement msg_conv;
msg_conv.inner = (void*)(msg & (~1));
msg_conv.is_owned = false;
- LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(((uint64_t)chain_access) & ~1);
+ void* chain_access_ptr = (void*)(((uint64_t)chain_access) & ~1);
+ CHECK_ACCESS(chain_access_ptr);
+ LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(chain_access_ptr);
// Warning: we may need a move here but no clone is available for LDKCOption_AccessZ
if (chain_access_conv.tag == LDKCOption_AccessZ_Some) {
// Manually implement clone for Java trait instances
LDKRouteHintHop this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(((uint64_t)val) & ~1);
+ void* val_ptr = (void*)(((uint64_t)val) & ~1);
+ CHECK_ACCESS(val_ptr);
+ LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
val_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)val) & ~1));
RouteHintHop_set_htlc_minimum_msat(&this_ptr_conv, val_conv);
}
LDKRouteHintHop this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(((uint64_t)val) & ~1);
+ void* val_ptr = (void*)(((uint64_t)val) & ~1);
+ CHECK_ACCESS(val_ptr);
+ LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
val_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)val) & ~1));
RouteHintHop_set_htlc_maximum_msat(&this_ptr_conv, val_conv);
}
fees_arg_conv.inner = (void*)(fees_arg & (~1));
fees_arg_conv.is_owned = (fees_arg & 1) || (fees_arg == 0);
fees_arg_conv = RoutingFees_clone(&fees_arg_conv);
- LDKCOption_u64Z htlc_minimum_msat_arg_conv = *(LDKCOption_u64Z*)(((uint64_t)htlc_minimum_msat_arg) & ~1);
+ void* htlc_minimum_msat_arg_ptr = (void*)(((uint64_t)htlc_minimum_msat_arg) & ~1);
+ CHECK_ACCESS(htlc_minimum_msat_arg_ptr);
+ LDKCOption_u64Z htlc_minimum_msat_arg_conv = *(LDKCOption_u64Z*)(htlc_minimum_msat_arg_ptr);
htlc_minimum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)htlc_minimum_msat_arg) & ~1));
- LDKCOption_u64Z htlc_maximum_msat_arg_conv = *(LDKCOption_u64Z*)(((uint64_t)htlc_maximum_msat_arg) & ~1);
+ void* htlc_maximum_msat_arg_ptr = (void*)(((uint64_t)htlc_maximum_msat_arg) & ~1);
+ CHECK_ACCESS(htlc_maximum_msat_arg_ptr);
+ LDKCOption_u64Z htlc_maximum_msat_arg_conv = *(LDKCOption_u64Z*)(htlc_maximum_msat_arg_ptr);
htlc_maximum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)htlc_maximum_msat_arg) & ~1));
LDKRouteHintHop ret_var = RouteHintHop_new(src_node_id_arg_ref, short_channel_id_arg, fees_arg_conv, cltv_expiry_delta_arg, htlc_minimum_msat_arg_conv, htlc_maximum_msat_arg_conv);
CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
last_hops_constr.data[l] = last_hops_conv_11_conv;
}
(*env)->ReleaseLongArrayElements(env, last_hops, last_hops_vals, 0);
- LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1);
+ void* logger_ptr = (void*)(((uint64_t)logger) & ~1);
+ CHECK_ACCESS(logger_ptr);
+ LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
if (logger_conv.free == LDKLogger_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKLogger_JCalls_cloned(&logger_conv);
}
- LDKScore* scorer_conv = (LDKScore*)(((uint64_t)scorer) & ~1);
+ void* scorer_ptr = (void*)(((uint64_t)scorer) & ~1);
+ if (!(scorer & 1)) { CHECK_ACCESS(scorer_ptr); }
+ LDKScore* scorer_conv = (LDKScore*)scorer_ptr;
LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
*ret_conv = get_keysend_route(our_node_pubkey_ref, &network_conv, payee_ref, first_hops_ptr, last_hops_constr, final_value_msat, final_cltv, logger_conv, scorer_conv);
if (first_hops_ptr != NULL) { FREE(first_hops_constr.data); }
last_hops_constr.data[l] = last_hops_conv_11_conv;
}
(*env)->ReleaseLongArrayElements(env, last_hops, last_hops_vals, 0);
- LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1);
+ void* logger_ptr = (void*)(((uint64_t)logger) & ~1);
+ CHECK_ACCESS(logger_ptr);
+ LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
if (logger_conv.free == LDKLogger_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKLogger_JCalls_cloned(&logger_conv);
}
- LDKScore* scorer_conv = (LDKScore*)(((uint64_t)scorer) & ~1);
+ void* scorer_ptr = (void*)(((uint64_t)scorer) & ~1);
+ if (!(scorer & 1)) { CHECK_ACCESS(scorer_ptr); }
+ LDKScore* scorer_conv = (LDKScore*)scorer_ptr;
LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
*ret_conv = get_route(our_node_pubkey_ref, &network_conv, payee_ref, payee_features_conv, first_hops_ptr, last_hops_constr, final_value_msat, final_cltv, logger_conv, scorer_conv);
if (first_hops_ptr != NULL) { FREE(first_hops_constr.data); }
LDKFilesystemPersister this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(((uint64_t)keys_manager) & ~1);
+ void* keys_manager_ptr = (void*)(((uint64_t)keys_manager) & ~1);
+ CHECK_ACCESS(keys_manager_ptr);
+ LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(keys_manager_ptr);
if (keys_manager_conv.free == LDKKeysInterface_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKKeysInterface_JCalls_cloned(&keys_manager_conv);
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerPersister_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKChannelManagerPersister this_ptr_conv = *(LDKChannelManagerPersister*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKChannelManagerPersister this_ptr_conv = *(LDKChannelManagerPersister*)(this_ptr_ptr);
FREE((void*)this_ptr);
ChannelManagerPersister_free(this_ptr_conv);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BackgroundProcessor_1start(JNIEnv *env, jclass clz, int64_t persister, int64_t event_handler, int64_t chain_monitor, int64_t channel_manager, int64_t net_graph_msg_handler, int64_t peer_manager, int64_t logger) {
- LDKChannelManagerPersister persister_conv = *(LDKChannelManagerPersister*)(((uint64_t)persister) & ~1);
+ void* persister_ptr = (void*)(((uint64_t)persister) & ~1);
+ CHECK_ACCESS(persister_ptr);
+ LDKChannelManagerPersister persister_conv = *(LDKChannelManagerPersister*)(persister_ptr);
if (persister_conv.free == LDKChannelManagerPersister_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKChannelManagerPersister_JCalls_cloned(&persister_conv);
}
- LDKEventHandler event_handler_conv = *(LDKEventHandler*)(((uint64_t)event_handler) & ~1);
+ void* event_handler_ptr = (void*)(((uint64_t)event_handler) & ~1);
+ CHECK_ACCESS(event_handler_ptr);
+ LDKEventHandler event_handler_conv = *(LDKEventHandler*)(event_handler_ptr);
if (event_handler_conv.free == LDKEventHandler_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKEventHandler_JCalls_cloned(&event_handler_conv);
LDKPeerManager peer_manager_conv;
peer_manager_conv.inner = (void*)(peer_manager & (~1));
peer_manager_conv.is_owned = false;
- LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1);
+ void* logger_ptr = (void*)(((uint64_t)logger) & ~1);
+ CHECK_ACCESS(logger_ptr);
+ LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
if (logger_conv.free == LDKLogger_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKLogger_JCalls_cloned(&logger_conv);
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Fallback_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKFallback this_ptr_conv = *(LDKFallback*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKFallback this_ptr_conv = *(LDKFallback*)(this_ptr_ptr);
FREE((void*)this_ptr);
Fallback_free(this_ptr_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SignOrCreationError_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKSignOrCreationError this_ptr_conv = *(LDKSignOrCreationError*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKSignOrCreationError this_ptr_conv = *(LDKSignOrCreationError*)(this_ptr_ptr);
FREE((void*)this_ptr);
SignOrCreationError_free(this_ptr_conv);
}
LDKChannelManager channelmanager_conv;
channelmanager_conv.inner = (void*)(channelmanager & (~1));
channelmanager_conv.is_owned = false;
- LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(((uint64_t)keys_manager) & ~1);
+ void* keys_manager_ptr = (void*)(((uint64_t)keys_manager) & ~1);
+ CHECK_ACCESS(keys_manager_ptr);
+ LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(keys_manager_ptr);
if (keys_manager_conv.free == LDKKeysInterface_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKKeysInterface_JCalls_cloned(&keys_manager_conv);
}
LDKCurrency network_conv = LDKCurrency_from_java(env, network);
- LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(((uint64_t)amt_msat) & ~1);
+ void* amt_msat_ptr = (void*)(((uint64_t)amt_msat) & ~1);
+ CHECK_ACCESS(amt_msat_ptr);
+ LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr);
amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)amt_msat) & ~1));
LDKStr description_conv = java_to_owned_str(env, description);
LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
#define DEBUG_PRINT(...) fprintf(stderr, __VA_ARGS__)
#define MALLOC(a, _) malloc(a)
#define FREE(p) if ((uint64_t)(p) > 1024) { free(p); }
+#define CHECK_ACCESS(p)
#define DO_ASSERT(a) (void)(a)
#define CHECK(a)
jclass err_conv = LDKAccessError_to_java(env, (*val->contents.err));
return err_conv;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1usizeTransactionZ_1new(JNIEnv *env, jclass clz, int64_t a, int8_tArray b) {
- LDKC2Tuple_usizeTransactionZ* ret = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ");
- ret->a = a;
- LDKTransaction b_ref;
- b_ref.datalen = (*env)->GetArrayLength(env, b);
- b_ref.data = MALLOC(b_ref.datalen, "LDKTransaction Bytes");
- (*env)->GetByteArrayRegion(env, b, 0, b_ref.datalen, b_ref.data);
- b_ref.data_is_owned = false;
- ret->b = b_ref;
- return (uint64_t)ret;
-}
static inline uintptr_t C2Tuple_usizeTransactionZ_get_a(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR tuple){
return tuple->a;
}
int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
for (size_t i = 0; i < ret->datalen; i++) {
int64_t arr_elem = java_elems[i];
- LDKC2Tuple_usizeTransactionZ arr_elem_conv = *(LDKC2Tuple_usizeTransactionZ*)(((uint64_t)arr_elem) & ~1);
+ void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1);
+ CHECK_ACCESS(arr_elem_ptr);
+ LDKC2Tuple_usizeTransactionZ arr_elem_conv = *(LDKC2Tuple_usizeTransactionZ*)(arr_elem_ptr);
arr_elem_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)(((uint64_t)arr_elem) & ~1));
ret->data[i] = arr_elem_conv;
}
int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
for (size_t i = 0; i < ret->datalen; i++) {
int64_t arr_elem = java_elems[i];
- LDKMonitorEvent arr_elem_conv = *(LDKMonitorEvent*)(((uint64_t)arr_elem) & ~1);
+ void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1);
+ CHECK_ACCESS(arr_elem_ptr);
+ LDKMonitorEvent arr_elem_conv = *(LDKMonitorEvent*)(arr_elem_ptr);
arr_elem_conv = MonitorEvent_clone((LDKMonitorEvent*)(((uint64_t)arr_elem) & ~1));
ret->data[i] = arr_elem_conv;
}
int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
for (size_t i = 0; i < ret->datalen; i++) {
int64_t arr_elem = java_elems[i];
- LDKSpendableOutputDescriptor arr_elem_conv = *(LDKSpendableOutputDescriptor*)(((uint64_t)arr_elem) & ~1);
+ void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1);
+ CHECK_ACCESS(arr_elem_ptr);
+ LDKSpendableOutputDescriptor arr_elem_conv = *(LDKSpendableOutputDescriptor*)(arr_elem_ptr);
arr_elem_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)(((uint64_t)arr_elem) & ~1));
ret->data[i] = arr_elem_conv;
}
int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
for (size_t i = 0; i < ret->datalen; i++) {
int64_t arr_elem = java_elems[i];
- LDKMessageSendEvent arr_elem_conv = *(LDKMessageSendEvent*)(((uint64_t)arr_elem) & ~1);
+ void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1);
+ CHECK_ACCESS(arr_elem_ptr);
+ LDKMessageSendEvent arr_elem_conv = *(LDKMessageSendEvent*)(arr_elem_ptr);
arr_elem_conv = MessageSendEvent_clone((LDKMessageSendEvent*)(((uint64_t)arr_elem) & ~1));
ret->data[i] = arr_elem_conv;
}
CHECK(!val->result_ok);
return *val->contents.err;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1SignatureCVec_1SignatureZZ_1new(JNIEnv *env, jclass clz, int8_tArray a, jobjectArray b) {
- LDKC2Tuple_SignatureCVec_SignatureZZ* ret = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ");
- LDKSignature a_ref;
- CHECK((*env)->GetArrayLength(env, a) == 64);
- (*env)->GetByteArrayRegion(env, a, 0, 64, a_ref.compact_form);
- ret->a = a_ref;
- LDKCVec_SignatureZ b_constr;
- b_constr.datalen = (*env)->GetArrayLength(env, b);
- if (b_constr.datalen > 0)
- b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements");
- else
- b_constr.data = NULL;
- for (size_t i = 0; i < b_constr.datalen; i++) {
- int8_tArray b_conv_8 = (*env)->GetObjectArrayElement(env, b, i);
- LDKSignature b_conv_8_ref;
- CHECK((*env)->GetArrayLength(env, b_conv_8) == 64);
- (*env)->GetByteArrayRegion(env, b_conv_8, 0, 64, b_conv_8_ref.compact_form);
- b_constr.data[i] = b_conv_8_ref;
- }
- ret->b = b_constr;
- return (uint64_t)ret;
-}
static inline struct LDKSignature C2Tuple_SignatureCVec_SignatureZZ_get_a(LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR tuple){
return tuple->a;
}
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to validate_holder_commitment in LDKBaseSign from rust threw an exception.");
}
- LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(ret_ptr);
ret_conv = CResult_NoneNoneZ_clone((LDKCResult_NoneNoneZ*)(((uint64_t)ret) & ~1));
if (get_jenv_res == JNI_EDETACHED) {
DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to sign_counterparty_commitment in LDKBaseSign from rust threw an exception.");
}
- LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(ret_ptr);
ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone((LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(((uint64_t)ret) & ~1));
if (get_jenv_res == JNI_EDETACHED) {
DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to validate_counterparty_revocation in LDKBaseSign from rust threw an exception.");
}
- LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(ret_ptr);
ret_conv = CResult_NoneNoneZ_clone((LDKCResult_NoneNoneZ*)(((uint64_t)ret) & ~1));
if (get_jenv_res == JNI_EDETACHED) {
DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to sign_holder_commitment_and_htlcs in LDKBaseSign from rust threw an exception.");
}
- LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(ret_ptr);
ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone((LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(((uint64_t)ret) & ~1));
if (get_jenv_res == JNI_EDETACHED) {
DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to sign_justice_revoked_output in LDKBaseSign from rust threw an exception.");
}
- LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr);
ret_conv = CResult_SignatureNoneZ_clone((LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1));
if (get_jenv_res == JNI_EDETACHED) {
DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to sign_justice_revoked_htlc in LDKBaseSign from rust threw an exception.");
}
- LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr);
ret_conv = CResult_SignatureNoneZ_clone((LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1));
if (get_jenv_res == JNI_EDETACHED) {
DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to sign_counterparty_htlc_transaction in LDKBaseSign from rust threw an exception.");
}
- LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr);
ret_conv = CResult_SignatureNoneZ_clone((LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1));
if (get_jenv_res == JNI_EDETACHED) {
DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
DO_ASSERT(get_jenv_res == JNI_OK);
}
LDKClosingTransaction closing_tx_var = *closing_tx;
- // Warning: we may need a move here but no clone is available for LDKClosingTransaction
+ closing_tx_var = ClosingTransaction_clone(closing_tx);
CHECK((((uint64_t)closing_tx_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&closing_tx_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
uint64_t closing_tx_ref = (uint64_t)closing_tx_var.inner;
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to sign_closing_transaction in LDKBaseSign from rust threw an exception.");
}
- LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr);
ret_conv = CResult_SignatureNoneZ_clone((LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1));
if (get_jenv_res == JNI_EDETACHED) {
DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to sign_channel_announcement in LDKBaseSign from rust threw an exception.");
}
- LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr);
ret_conv = CResult_SignatureNoneZ_clone((LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1));
if (get_jenv_res == JNI_EDETACHED) {
DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
return (uint64_t)res_ptr;
}
JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BaseSign_1get_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_arg, int64_t idx) {
- LDKBaseSign* this_arg_conv = (LDKBaseSign*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
(*env)->SetByteArrayRegion(env, ret_arr, 0, 33, (this_arg_conv->get_per_commitment_point)(this_arg_conv->this_arg, idx).compressed_form);
return ret_arr;
}
JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BaseSign_1release_1commitment_1secret(JNIEnv *env, jclass clz, int64_t this_arg, int64_t idx) {
- LDKBaseSign* this_arg_conv = (LDKBaseSign*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
(*env)->SetByteArrayRegion(env, ret_arr, 0, 32, (this_arg_conv->release_commitment_secret)(this_arg_conv->this_arg, idx).data);
return ret_arr;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BaseSign_1validate_1holder_1commitment(JNIEnv *env, jclass clz, int64_t this_arg, int64_t holder_tx) {
- LDKBaseSign* this_arg_conv = (LDKBaseSign*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
LDKHolderCommitmentTransaction holder_tx_conv;
holder_tx_conv.inner = (void*)(holder_tx & (~1));
holder_tx_conv.is_owned = false;
}
JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BaseSign_1channel_1keys_1id(JNIEnv *env, jclass clz, int64_t this_arg) {
- LDKBaseSign* this_arg_conv = (LDKBaseSign*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
(*env)->SetByteArrayRegion(env, ret_arr, 0, 32, (this_arg_conv->channel_keys_id)(this_arg_conv->this_arg).data);
return ret_arr;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BaseSign_1sign_1counterparty_1commitment(JNIEnv *env, jclass clz, int64_t this_arg, int64_t commitment_tx) {
- LDKBaseSign* this_arg_conv = (LDKBaseSign*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
LDKCommitmentTransaction commitment_tx_conv;
commitment_tx_conv.inner = (void*)(commitment_tx & (~1));
commitment_tx_conv.is_owned = false;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BaseSign_1validate_1counterparty_1revocation(JNIEnv *env, jclass clz, int64_t this_arg, int64_t idx, int8_tArray secret) {
- LDKBaseSign* this_arg_conv = (LDKBaseSign*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
unsigned char secret_arr[32];
CHECK((*env)->GetArrayLength(env, secret) == 32);
(*env)->GetByteArrayRegion(env, secret, 0, 32, secret_arr);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BaseSign_1sign_1holder_1commitment_1and_1htlcs(JNIEnv *env, jclass clz, int64_t this_arg, int64_t commitment_tx) {
- LDKBaseSign* this_arg_conv = (LDKBaseSign*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
LDKHolderCommitmentTransaction commitment_tx_conv;
commitment_tx_conv.inner = (void*)(commitment_tx & (~1));
commitment_tx_conv.is_owned = false;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BaseSign_1sign_1justice_1revoked_1output(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray justice_tx, int64_t input, int64_t amount, int8_tArray per_commitment_key) {
- LDKBaseSign* this_arg_conv = (LDKBaseSign*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
LDKTransaction justice_tx_ref;
justice_tx_ref.datalen = (*env)->GetArrayLength(env, justice_tx);
justice_tx_ref.data = MALLOC(justice_tx_ref.datalen, "LDKTransaction Bytes");
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BaseSign_1sign_1justice_1revoked_1htlc(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray justice_tx, int64_t input, int64_t amount, int8_tArray per_commitment_key, int64_t htlc) {
- LDKBaseSign* this_arg_conv = (LDKBaseSign*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
LDKTransaction justice_tx_ref;
justice_tx_ref.datalen = (*env)->GetArrayLength(env, justice_tx);
justice_tx_ref.data = MALLOC(justice_tx_ref.datalen, "LDKTransaction Bytes");
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BaseSign_1sign_1counterparty_1htlc_1transaction(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray htlc_tx, int64_t input, int64_t amount, int8_tArray per_commitment_point, int64_t htlc) {
- LDKBaseSign* this_arg_conv = (LDKBaseSign*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
LDKTransaction htlc_tx_ref;
htlc_tx_ref.datalen = (*env)->GetArrayLength(env, htlc_tx);
htlc_tx_ref.data = MALLOC(htlc_tx_ref.datalen, "LDKTransaction Bytes");
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BaseSign_1sign_1closing_1transaction(JNIEnv *env, jclass clz, int64_t this_arg, int64_t closing_tx) {
- LDKBaseSign* this_arg_conv = (LDKBaseSign*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
LDKClosingTransaction closing_tx_conv;
closing_tx_conv.inner = (void*)(closing_tx & (~1));
closing_tx_conv.is_owned = false;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BaseSign_1sign_1channel_1announcement(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg) {
- LDKBaseSign* this_arg_conv = (LDKBaseSign*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
LDKUnsignedChannelAnnouncement msg_conv;
msg_conv.inner = (void*)(msg & (~1));
msg_conv.is_owned = false;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BaseSign_1ready_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int64_t channel_parameters) {
- LDKBaseSign* this_arg_conv = (LDKBaseSign*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
LDKChannelTransactionParameters channel_parameters_conv;
channel_parameters_conv.inner = (void*)(channel_parameters & (~1));
channel_parameters_conv.is_owned = false;
return this_arg->pubkeys;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BaseSign_1get_1pubkeys(JNIEnv *env, jclass clz, int64_t this_arg) {
- LDKBaseSign* this_arg_conv = (LDKBaseSign*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
LDKChannelPublicKeys ret_var = LDKBaseSign_set_get_pubkeys(this_arg_conv);
CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
return (int64_t)(res_ptr | 1);
}
JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Sign_1write(JNIEnv *env, jclass clz, int64_t this_arg) {
- LDKSign* this_arg_conv = (LDKSign*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKSign* this_arg_conv = (LDKSign*)this_arg_ptr;
LDKCVec_u8Z ret_var = (this_arg_conv->write)(this_arg_conv->this_arg);
int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
(*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
for (size_t i = 0; i < ret->datalen; i++) {
int64_t arr_elem = java_elems[i];
- LDKTxOut arr_elem_conv = *(LDKTxOut*)(((uint64_t)arr_elem) & ~1);
+ void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1);
+ CHECK_ACCESS(arr_elem_ptr);
+ LDKTxOut arr_elem_conv = *(LDKTxOut*)(arr_elem_ptr);
arr_elem_conv = TxOut_clone((LDKTxOut*)(((uint64_t)arr_elem) & ~1));
ret->data[i] = arr_elem_conv;
}
CHECK(!val->result_ok);
return *val->contents.err;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1BlockHashChannelMonitorZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int64_t b) {
- LDKC2Tuple_BlockHashChannelMonitorZ* ret = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKC2Tuple_BlockHashChannelMonitorZ");
- LDKThirtyTwoBytes a_ref;
- CHECK((*env)->GetArrayLength(env, a) == 32);
- (*env)->GetByteArrayRegion(env, a, 0, 32, a_ref.data);
- ret->a = a_ref;
- LDKChannelMonitor b_conv;
- b_conv.inner = (void*)(b & (~1));
- b_conv.is_owned = (b & 1) || (b == 0);
- b_conv = ChannelMonitor_clone(&b_conv);
- ret->b = b_conv;
- return (uint64_t)ret;
-}
static inline struct LDKThirtyTwoBytes C2Tuple_BlockHashChannelMonitorZ_get_a(LDKC2Tuple_BlockHashChannelMonitorZ *NONNULL_PTR tuple){
return ThirtyTwoBytes_clone(&tuple->a);
}
int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
for (size_t i = 0; i < ret->datalen; i++) {
int64_t arr_elem = java_elems[i];
- LDKC2Tuple_BlockHashChannelMonitorZ arr_elem_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(((uint64_t)arr_elem) & ~1);
+ void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1);
+ CHECK_ACCESS(arr_elem_ptr);
+ LDKC2Tuple_BlockHashChannelMonitorZ arr_elem_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(arr_elem_ptr);
arr_elem_conv = C2Tuple_BlockHashChannelMonitorZ_clone((LDKC2Tuple_BlockHashChannelMonitorZ*)(((uint64_t)arr_elem) & ~1));
ret->data[i] = arr_elem_conv;
}
int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
for (size_t i = 0; i < ret->datalen; i++) {
int64_t arr_elem = java_elems[i];
- LDKCResult_NoneAPIErrorZ arr_elem_conv = *(LDKCResult_NoneAPIErrorZ*)(((uint64_t)arr_elem) & ~1);
+ void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1);
+ CHECK_ACCESS(arr_elem_ptr);
+ LDKCResult_NoneAPIErrorZ arr_elem_conv = *(LDKCResult_NoneAPIErrorZ*)(arr_elem_ptr);
arr_elem_conv = CResult_NoneAPIErrorZ_clone((LDKCResult_NoneAPIErrorZ*)(((uint64_t)arr_elem) & ~1));
ret->data[i] = arr_elem_conv;
}
int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
for (size_t i = 0; i < ret->datalen; i++) {
int64_t arr_elem = java_elems[i];
- LDKAPIError arr_elem_conv = *(LDKAPIError*)(((uint64_t)arr_elem) & ~1);
+ void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1);
+ CHECK_ACCESS(arr_elem_ptr);
+ LDKAPIError arr_elem_conv = *(LDKAPIError*)(arr_elem_ptr);
arr_elem_conv = APIError_clone((LDKAPIError*)(((uint64_t)arr_elem) & ~1));
ret->data[i] = arr_elem_conv;
}
uint64_t err_ref = ((uint64_t)&(*val->contents.err)) | 1;
return err_ref;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1PaymentHashPaymentIdZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int64_t b) {
- LDKC2Tuple_PaymentHashPaymentIdZ* ret = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentIdZ), "LDKC2Tuple_PaymentHashPaymentIdZ");
- LDKThirtyTwoBytes a_ref;
- CHECK((*env)->GetArrayLength(env, a) == 32);
- (*env)->GetByteArrayRegion(env, a, 0, 32, a_ref.data);
- ret->a = a_ref;
- LDKPaymentId b_conv;
- b_conv.inner = (void*)(b & (~1));
- b_conv.is_owned = (b & 1) || (b == 0);
- b_conv = PaymentId_clone(&b_conv);
- ret->b = b_conv;
- return (uint64_t)ret;
-}
static inline struct LDKThirtyTwoBytes C2Tuple_PaymentHashPaymentIdZ_get_a(LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR tuple){
return ThirtyTwoBytes_clone(&tuple->a);
}
int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
for (size_t i = 0; i < ret->datalen; i++) {
int64_t arr_elem = java_elems[i];
- LDKNetAddress arr_elem_conv = *(LDKNetAddress*)(((uint64_t)arr_elem) & ~1);
+ void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1);
+ CHECK_ACCESS(arr_elem_ptr);
+ LDKNetAddress arr_elem_conv = *(LDKNetAddress*)(arr_elem_ptr);
arr_elem_conv = NetAddress_clone((LDKNetAddress*)(((uint64_t)arr_elem) & ~1));
ret->data[i] = arr_elem_conv;
}
}
return ret;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1PaymentHashPaymentSecretZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int8_tArray b) {
- LDKC2Tuple_PaymentHashPaymentSecretZ* ret = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ");
- LDKThirtyTwoBytes a_ref;
- CHECK((*env)->GetArrayLength(env, a) == 32);
- (*env)->GetByteArrayRegion(env, a, 0, 32, a_ref.data);
- ret->a = a_ref;
- LDKThirtyTwoBytes b_ref;
- CHECK((*env)->GetArrayLength(env, b) == 32);
- (*env)->GetByteArrayRegion(env, b, 0, 32, b_ref.data);
- ret->b = b_ref;
- return (uint64_t)ret;
-}
static inline struct LDKThirtyTwoBytes C2Tuple_PaymentHashPaymentSecretZ_get_a(LDKC2Tuple_PaymentHashPaymentSecretZ *NONNULL_PTR tuple){
return ThirtyTwoBytes_clone(&tuple->a);
}
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to watch_channel in LDKWatch from rust threw an exception.");
}
- LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr);
ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone((LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)ret) & ~1));
if (get_jenv_res == JNI_EDETACHED) {
DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to update_channel in LDKWatch from rust threw an exception.");
}
- LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr);
ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone((LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)ret) & ~1));
if (get_jenv_res == JNI_EDETACHED) {
DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
int64_t* ret_vals = (*env)->GetLongArrayElements (env, ret, NULL);
for (size_t o = 0; o < ret_constr.datalen; o++) {
int64_t ret_conv_14 = ret_vals[o];
- LDKMonitorEvent ret_conv_14_conv = *(LDKMonitorEvent*)(((uint64_t)ret_conv_14) & ~1);
+ void* ret_conv_14_ptr = (void*)(((uint64_t)ret_conv_14) & ~1);
+ CHECK_ACCESS(ret_conv_14_ptr);
+ LDKMonitorEvent ret_conv_14_conv = *(LDKMonitorEvent*)(ret_conv_14_ptr);
ret_conv_14_conv = MonitorEvent_clone((LDKMonitorEvent*)(((uint64_t)ret_conv_14) & ~1));
ret_constr.data[o] = ret_conv_14_conv;
}
return (uint64_t)res_ptr;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Watch_1watch_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int64_t funding_txo, int64_t monitor) {
- LDKWatch* this_arg_conv = (LDKWatch*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKWatch* this_arg_conv = (LDKWatch*)this_arg_ptr;
LDKOutPoint funding_txo_conv;
funding_txo_conv.inner = (void*)(funding_txo & (~1));
funding_txo_conv.is_owned = (funding_txo & 1) || (funding_txo == 0);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Watch_1update_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int64_t funding_txo, int64_t update) {
- LDKWatch* this_arg_conv = (LDKWatch*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKWatch* this_arg_conv = (LDKWatch*)this_arg_ptr;
LDKOutPoint funding_txo_conv;
funding_txo_conv.inner = (void*)(funding_txo & (~1));
funding_txo_conv.is_owned = (funding_txo & 1) || (funding_txo == 0);
}
JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Watch_1release_1pending_1monitor_1events(JNIEnv *env, jclass clz, int64_t this_arg) {
- LDKWatch* this_arg_conv = (LDKWatch*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKWatch* this_arg_conv = (LDKWatch*)this_arg_ptr;
LDKCVec_MonitorEventZ ret_var = (this_arg_conv->release_pending_monitor_events)(this_arg_conv->this_arg);
int64_tArray ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
for (size_t o = 0; o < ret_var.datalen; o++) {
LDKMonitorEvent *ret_conv_14_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
- *ret_conv_14_copy = MonitorEvent_clone(&ret_var.data[o]);
+ *ret_conv_14_copy = ret_var.data[o];
uint64_t ret_conv_14_ref = (uint64_t)ret_conv_14_copy;
ret_arr_ptr[o] = ret_conv_14_ref;
}
return (uint64_t)res_ptr;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BroadcasterInterface_1broadcast_1transaction(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray tx) {
- LDKBroadcasterInterface* this_arg_conv = (LDKBroadcasterInterface*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKBroadcasterInterface* this_arg_conv = (LDKBroadcasterInterface*)this_arg_ptr;
LDKTransaction tx_ref;
tx_ref.datalen = (*env)->GetArrayLength(env, tx);
tx_ref.data = MALLOC(tx_ref.datalen, "LDKTransaction Bytes");
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to get_channel_signer in LDKKeysInterface from rust threw an exception.");
}
- LDKSign ret_conv = *(LDKSign*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKSign ret_conv = *(LDKSign*)(ret_ptr);
ret_conv = Sign_clone(&ret_conv);
if (get_jenv_res == JNI_EDETACHED) {
DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to read_chan_signer in LDKKeysInterface from rust threw an exception.");
}
- LDKCResult_SignDecodeErrorZ ret_conv = *(LDKCResult_SignDecodeErrorZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_SignDecodeErrorZ ret_conv = *(LDKCResult_SignDecodeErrorZ*)(ret_ptr);
ret_conv = CResult_SignDecodeErrorZ_clone((LDKCResult_SignDecodeErrorZ*)(((uint64_t)ret) & ~1));
if (get_jenv_res == JNI_EDETACHED) {
DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to sign_invoice in LDKKeysInterface from rust threw an exception.");
}
- LDKCResult_RecoverableSignatureNoneZ ret_conv = *(LDKCResult_RecoverableSignatureNoneZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_RecoverableSignatureNoneZ ret_conv = *(LDKCResult_RecoverableSignatureNoneZ*)(ret_ptr);
ret_conv = CResult_RecoverableSignatureNoneZ_clone((LDKCResult_RecoverableSignatureNoneZ*)(((uint64_t)ret) & ~1));
if (get_jenv_res == JNI_EDETACHED) {
DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
return (uint64_t)res_ptr;
}
JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_KeysInterface_1get_1node_1secret(JNIEnv *env, jclass clz, int64_t this_arg) {
- LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
(*env)->SetByteArrayRegion(env, ret_arr, 0, 32, (this_arg_conv->get_node_secret)(this_arg_conv->this_arg).bytes);
return ret_arr;
}
JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_KeysInterface_1get_1destination_1script(JNIEnv *env, jclass clz, int64_t this_arg) {
- LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
LDKCVec_u8Z ret_var = (this_arg_conv->get_destination_script)(this_arg_conv->this_arg);
int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
(*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysInterface_1get_1shutdown_1scriptpubkey(JNIEnv *env, jclass clz, int64_t this_arg) {
- LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
LDKShutdownScript ret_var = (this_arg_conv->get_shutdown_scriptpubkey)(this_arg_conv->this_arg);
CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysInterface_1get_1channel_1signer(JNIEnv *env, jclass clz, int64_t this_arg, jboolean inbound, int64_t channel_value_satoshis) {
- LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
LDKSign* ret_ret =MALLOC(sizeof(LDKSign), "LDKSign");
*ret_ret = (this_arg_conv->get_channel_signer)(this_arg_conv->this_arg, inbound, channel_value_satoshis);
return (uint64_t)ret_ret;
}
JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_KeysInterface_1get_1secure_1random_1bytes(JNIEnv *env, jclass clz, int64_t this_arg) {
- LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
(*env)->SetByteArrayRegion(env, ret_arr, 0, 32, (this_arg_conv->get_secure_random_bytes)(this_arg_conv->this_arg).data);
return ret_arr;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysInterface_1read_1chan_1signer(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray reader) {
- LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
LDKu8slice reader_ref;
reader_ref.datalen = (*env)->GetArrayLength(env, reader);
reader_ref.data = (*env)->GetByteArrayElements (env, reader, NULL);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysInterface_1sign_1invoice(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray invoice_preimage) {
- LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
LDKCVec_u8Z invoice_preimage_ref;
invoice_preimage_ref.datalen = (*env)->GetArrayLength(env, invoice_preimage);
invoice_preimage_ref.data = MALLOC(invoice_preimage_ref.datalen, "LDKCVec_u8Z Bytes");
return (uint64_t)res_ptr;
}
JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_FeeEstimator_1get_1est_1sat_1per_11000_1weight(JNIEnv *env, jclass clz, int64_t this_arg, jclass confirmation_target) {
- LDKFeeEstimator* this_arg_conv = (LDKFeeEstimator*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKFeeEstimator* this_arg_conv = (LDKFeeEstimator*)this_arg_ptr;
LDKConfirmationTarget confirmation_target_conv = LDKConfirmationTarget_from_java(env, confirmation_target);
int32_t ret_val = (this_arg_conv->get_est_sat_per_1000_weight)(this_arg_conv->this_arg, confirmation_target_conv);
return ret_val;
*res_ptr = LDKLogger_init(env, clz, o);
return (uint64_t)res_ptr;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1BlockHashChannelManagerZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int64_t b) {
- LDKC2Tuple_BlockHashChannelManagerZ* ret = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelManagerZ), "LDKC2Tuple_BlockHashChannelManagerZ");
- LDKThirtyTwoBytes a_ref;
- CHECK((*env)->GetArrayLength(env, a) == 32);
- (*env)->GetByteArrayRegion(env, a, 0, 32, a_ref.data);
- ret->a = a_ref;
- LDKChannelManager b_conv;
- b_conv.inner = (void*)(b & (~1));
- b_conv.is_owned = (b & 1) || (b == 0);
- // Warning: we need a move here but no clone is available for LDKChannelManager
- ret->b = b_conv;
- return (uint64_t)ret;
-}
static inline struct LDKThirtyTwoBytes C2Tuple_BlockHashChannelManagerZ_get_a(LDKC2Tuple_BlockHashChannelManagerZ *NONNULL_PTR tuple){
return ThirtyTwoBytes_clone(&tuple->a);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1BlockHashChannelManagerZDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ *val = (LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
- LDKC2Tuple_BlockHashChannelManagerZ* res_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelManagerZ), "LDKC2Tuple_BlockHashChannelManagerZ");
- *res_conv = (*val->contents.result);
+ LDKC2Tuple_BlockHashChannelManagerZ* res_conv = &(*val->contents.result);
// Warning: we really need to clone here, but no clone is available for LDKC2Tuple_BlockHashChannelManagerZ
return ((uint64_t)res_conv) | 1;
}
return (uint64_t)res_ptr;
}
JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_Type_1type_1id(JNIEnv *env, jclass clz, int64_t this_arg) {
- LDKType* this_arg_conv = (LDKType*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKType* this_arg_conv = (LDKType*)this_arg_ptr;
int16_t ret_val = (this_arg_conv->type_id)(this_arg_conv->this_arg);
return ret_val;
}
JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Type_1debug_1str(JNIEnv *env, jclass clz, int64_t this_arg) {
- LDKType* this_arg_conv = (LDKType*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKType* this_arg_conv = (LDKType*)this_arg_ptr;
LDKStr ret_str = (this_arg_conv->debug_str)(this_arg_conv->this_arg);
jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
Str_free(ret_str);
}
JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Type_1write(JNIEnv *env, jclass clz, int64_t this_arg) {
- LDKType* this_arg_conv = (LDKType*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKType* this_arg_conv = (LDKType*)this_arg_ptr;
LDKCVec_u8Z ret_var = (this_arg_conv->write)(this_arg_conv->this_arg);
int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
(*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
CHECK(!val->result_ok);
return *val->contents.err;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKC3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1new(JNIEnv *env, jclass clz, int64_t a, int8_tArray b, int64_t c) {
- LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* ret = MALLOC(sizeof(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ), "LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ");
- LDKRawInvoice a_conv;
- a_conv.inner = (void*)(a & (~1));
- a_conv.is_owned = (a & 1) || (a == 0);
- a_conv = RawInvoice_clone(&a_conv);
- ret->a = a_conv;
- LDKThirtyTwoBytes b_ref;
- CHECK((*env)->GetArrayLength(env, b) == 32);
- (*env)->GetByteArrayRegion(env, b, 0, 32, b_ref.data);
- ret->b = b_ref;
- LDKInvoiceSignature c_conv;
- c_conv.inner = (void*)(c & (~1));
- c_conv.is_owned = (c & 1) || (c == 0);
- c_conv = InvoiceSignature_clone(&c_conv);
- ret->c = c_conv;
- return (uint64_t)ret;
-}
static inline struct LDKRawInvoice C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_a(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR tuple){
return RawInvoice_clone(&tuple->a);
}
uint64_t err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1OutPointScriptZ_1new(JNIEnv *env, jclass clz, int64_t a, int8_tArray b) {
- LDKC2Tuple_OutPointScriptZ* ret = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ");
- LDKOutPoint a_conv;
- a_conv.inner = (void*)(a & (~1));
- a_conv.is_owned = (a & 1) || (a == 0);
- a_conv = OutPoint_clone(&a_conv);
- ret->a = a_conv;
- LDKCVec_u8Z b_ref;
- b_ref.datalen = (*env)->GetArrayLength(env, b);
- b_ref.data = MALLOC(b_ref.datalen, "LDKCVec_u8Z Bytes");
- (*env)->GetByteArrayRegion(env, b, 0, b_ref.datalen, b_ref.data);
- ret->b = b_ref;
- return (uint64_t)ret;
-}
static inline struct LDKOutPoint C2Tuple_OutPointScriptZ_get_a(LDKC2Tuple_OutPointScriptZ *NONNULL_PTR tuple){
return OutPoint_clone(&tuple->a);
}
return ret_arr;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1u32ScriptZ_1new(JNIEnv *env, jclass clz, int32_t a, int8_tArray b) {
- LDKC2Tuple_u32ScriptZ* ret = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ), "LDKC2Tuple_u32ScriptZ");
- ret->a = a;
- LDKCVec_u8Z b_ref;
- b_ref.datalen = (*env)->GetArrayLength(env, b);
- b_ref.data = MALLOC(b_ref.datalen, "LDKCVec_u8Z Bytes");
- (*env)->GetByteArrayRegion(env, b, 0, b_ref.datalen, b_ref.data);
- ret->b = b_ref;
- return (uint64_t)ret;
-}
static inline uint32_t C2Tuple_u32ScriptZ_get_a(LDKC2Tuple_u32ScriptZ *NONNULL_PTR tuple){
return tuple->a;
}
int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
for (size_t i = 0; i < ret->datalen; i++) {
int64_t arr_elem = java_elems[i];
- LDKC2Tuple_u32ScriptZ arr_elem_conv = *(LDKC2Tuple_u32ScriptZ*)(((uint64_t)arr_elem) & ~1);
+ void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1);
+ CHECK_ACCESS(arr_elem_ptr);
+ LDKC2Tuple_u32ScriptZ arr_elem_conv = *(LDKC2Tuple_u32ScriptZ*)(arr_elem_ptr);
arr_elem_conv = C2Tuple_u32ScriptZ_clone((LDKC2Tuple_u32ScriptZ*)(((uint64_t)arr_elem) & ~1));
ret->data[i] = arr_elem_conv;
}
}
return ret;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int64_tArray b) {
- LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* ret = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ");
- LDKThirtyTwoBytes a_ref;
- CHECK((*env)->GetArrayLength(env, a) == 32);
- (*env)->GetByteArrayRegion(env, a, 0, 32, a_ref.data);
- ret->a = a_ref;
- LDKCVec_C2Tuple_u32ScriptZZ b_constr;
- b_constr.datalen = (*env)->GetArrayLength(env, b);
- if (b_constr.datalen > 0)
- b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKC2Tuple_u32ScriptZ), "LDKCVec_C2Tuple_u32ScriptZZ Elements");
- else
- b_constr.data = NULL;
- int64_t* b_vals = (*env)->GetLongArrayElements (env, b, NULL);
- for (size_t v = 0; v < b_constr.datalen; v++) {
- int64_t b_conv_21 = b_vals[v];
- LDKC2Tuple_u32ScriptZ b_conv_21_conv = *(LDKC2Tuple_u32ScriptZ*)(((uint64_t)b_conv_21) & ~1);
- b_conv_21_conv = C2Tuple_u32ScriptZ_clone((LDKC2Tuple_u32ScriptZ*)(((uint64_t)b_conv_21) & ~1));
- b_constr.data[v] = b_conv_21_conv;
- }
- (*env)->ReleaseLongArrayElements(env, b, b_vals, 0);
- ret->b = b_constr;
- return (uint64_t)ret;
-}
static inline struct LDKThirtyTwoBytes C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_a(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *NONNULL_PTR tuple){
return ThirtyTwoBytes_clone(&tuple->a);
}
int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
for (size_t i = 0; i < ret->datalen; i++) {
int64_t arr_elem = java_elems[i];
- LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ arr_elem_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(((uint64_t)arr_elem) & ~1);
+ void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1);
+ CHECK_ACCESS(arr_elem_ptr);
+ LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ arr_elem_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(arr_elem_ptr);
arr_elem_conv = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone((LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(((uint64_t)arr_elem) & ~1));
ret->data[i] = arr_elem_conv;
}
int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
for (size_t i = 0; i < ret->datalen; i++) {
int64_t arr_elem = java_elems[i];
- LDKEvent arr_elem_conv = *(LDKEvent*)(((uint64_t)arr_elem) & ~1);
+ void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1);
+ CHECK_ACCESS(arr_elem_ptr);
+ LDKEvent arr_elem_conv = *(LDKEvent*)(arr_elem_ptr);
arr_elem_conv = Event_clone((LDKEvent*)(((uint64_t)arr_elem) & ~1));
ret->data[i] = arr_elem_conv;
}
}
return ret;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1u32TxOutZ_1new(JNIEnv *env, jclass clz, int32_t a, int64_t b) {
- LDKC2Tuple_u32TxOutZ* ret = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ), "LDKC2Tuple_u32TxOutZ");
- ret->a = a;
- LDKTxOut b_conv = *(LDKTxOut*)(((uint64_t)b) & ~1);
- b_conv = TxOut_clone((LDKTxOut*)(((uint64_t)b) & ~1));
- ret->b = b_conv;
- return (uint64_t)ret;
-}
static inline uint32_t C2Tuple_u32TxOutZ_get_a(LDKC2Tuple_u32TxOutZ *NONNULL_PTR tuple){
return tuple->a;
}
int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
for (size_t i = 0; i < ret->datalen; i++) {
int64_t arr_elem = java_elems[i];
- LDKC2Tuple_u32TxOutZ arr_elem_conv = *(LDKC2Tuple_u32TxOutZ*)(((uint64_t)arr_elem) & ~1);
+ void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1);
+ CHECK_ACCESS(arr_elem_ptr);
+ LDKC2Tuple_u32TxOutZ arr_elem_conv = *(LDKC2Tuple_u32TxOutZ*)(arr_elem_ptr);
arr_elem_conv = C2Tuple_u32TxOutZ_clone((LDKC2Tuple_u32TxOutZ*)(((uint64_t)arr_elem) & ~1));
ret->data[i] = arr_elem_conv;
}
}
return ret;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int64_tArray b) {
- LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ");
- LDKThirtyTwoBytes a_ref;
- CHECK((*env)->GetArrayLength(env, a) == 32);
- (*env)->GetByteArrayRegion(env, a, 0, 32, a_ref.data);
- ret->a = a_ref;
- LDKCVec_C2Tuple_u32TxOutZZ b_constr;
- b_constr.datalen = (*env)->GetArrayLength(env, b);
- if (b_constr.datalen > 0)
- b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKC2Tuple_u32TxOutZ), "LDKCVec_C2Tuple_u32TxOutZZ Elements");
- else
- b_constr.data = NULL;
- int64_t* b_vals = (*env)->GetLongArrayElements (env, b, NULL);
- for (size_t u = 0; u < b_constr.datalen; u++) {
- int64_t b_conv_20 = b_vals[u];
- LDKC2Tuple_u32TxOutZ b_conv_20_conv = *(LDKC2Tuple_u32TxOutZ*)(((uint64_t)b_conv_20) & ~1);
- b_conv_20_conv = C2Tuple_u32TxOutZ_clone((LDKC2Tuple_u32TxOutZ*)(((uint64_t)b_conv_20) & ~1));
- b_constr.data[u] = b_conv_20_conv;
- }
- (*env)->ReleaseLongArrayElements(env, b, b_vals, 0);
- ret->b = b_constr;
- return (uint64_t)ret;
-}
static inline struct LDKThirtyTwoBytes C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_a(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR tuple){
return ThirtyTwoBytes_clone(&tuple->a);
}
int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
for (size_t i = 0; i < ret->datalen; i++) {
int64_t arr_elem = java_elems[i];
- LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ arr_elem_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(((uint64_t)arr_elem) & ~1);
+ void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1);
+ CHECK_ACCESS(arr_elem_ptr);
+ LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ arr_elem_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(arr_elem_ptr);
arr_elem_conv = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone((LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(((uint64_t)arr_elem) & ~1));
ret->data[i] = arr_elem_conv;
}
int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
for (size_t i = 0; i < ret->datalen; i++) {
int64_t arr_elem = java_elems[i];
- LDKBalance arr_elem_conv = *(LDKBalance*)(((uint64_t)arr_elem) & ~1);
+ void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1);
+ CHECK_ACCESS(arr_elem_ptr);
+ LDKBalance arr_elem_conv = *(LDKBalance*)(arr_elem_ptr);
arr_elem_conv = Balance_clone((LDKBalance*)(((uint64_t)arr_elem) & ~1));
ret->data[i] = arr_elem_conv;
}
uint64_t err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1PublicKeyTypeZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int64_t b) {
- LDKC2Tuple_PublicKeyTypeZ* ret = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKC2Tuple_PublicKeyTypeZ");
- LDKPublicKey a_ref;
- CHECK((*env)->GetArrayLength(env, a) == 33);
- (*env)->GetByteArrayRegion(env, a, 0, 33, a_ref.compressed_form);
- ret->a = a_ref;
- LDKType b_conv = *(LDKType*)(((uint64_t)b) & ~1);
- b_conv = Type_clone(&b_conv);
- ret->b = b_conv;
- return (uint64_t)ret;
-}
static inline struct LDKPublicKey C2Tuple_PublicKeyTypeZ_get_a(LDKC2Tuple_PublicKeyTypeZ *NONNULL_PTR tuple){
return tuple->a;
}
int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
for (size_t i = 0; i < ret->datalen; i++) {
int64_t arr_elem = java_elems[i];
- LDKC2Tuple_PublicKeyTypeZ arr_elem_conv = *(LDKC2Tuple_PublicKeyTypeZ*)(((uint64_t)arr_elem) & ~1);
+ void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1);
+ CHECK_ACCESS(arr_elem_ptr);
+ LDKC2Tuple_PublicKeyTypeZ arr_elem_conv = *(LDKC2Tuple_PublicKeyTypeZ*)(arr_elem_ptr);
arr_elem_conv = C2Tuple_PublicKeyTypeZ_clone((LDKC2Tuple_PublicKeyTypeZ*)(((uint64_t)arr_elem) & ~1));
ret->data[i] = arr_elem_conv;
}
uint64_t err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKC3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1new(JNIEnv *env, jclass clz, int64_t a, int64_t b, int64_t c) {
- LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ");
- LDKChannelAnnouncement a_conv;
- a_conv.inner = (void*)(a & (~1));
- a_conv.is_owned = (a & 1) || (a == 0);
- a_conv = ChannelAnnouncement_clone(&a_conv);
- ret->a = a_conv;
- LDKChannelUpdate b_conv;
- b_conv.inner = (void*)(b & (~1));
- b_conv.is_owned = (b & 1) || (b == 0);
- b_conv = ChannelUpdate_clone(&b_conv);
- ret->b = b_conv;
- LDKChannelUpdate c_conv;
- c_conv.inner = (void*)(c & (~1));
- c_conv.is_owned = (c & 1) || (c == 0);
- c_conv = ChannelUpdate_clone(&c_conv);
- ret->c = c_conv;
- return (uint64_t)ret;
-}
static inline struct LDKChannelAnnouncement C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR tuple){
return ChannelAnnouncement_clone(&tuple->a);
}
int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
for (size_t i = 0; i < ret->datalen; i++) {
int64_t arr_elem = java_elems[i];
- LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ arr_elem_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(((uint64_t)arr_elem) & ~1);
+ void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1);
+ CHECK_ACCESS(arr_elem_ptr);
+ LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ arr_elem_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(arr_elem_ptr);
arr_elem_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone((LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(((uint64_t)arr_elem) & ~1));
ret->data[i] = arr_elem_conv;
}
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to get_utxo in LDKAccess from rust threw an exception.");
}
- LDKCResult_TxOutAccessErrorZ ret_conv = *(LDKCResult_TxOutAccessErrorZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_TxOutAccessErrorZ ret_conv = *(LDKCResult_TxOutAccessErrorZ*)(ret_ptr);
ret_conv = CResult_TxOutAccessErrorZ_clone((LDKCResult_TxOutAccessErrorZ*)(((uint64_t)ret) & ~1));
if (get_jenv_res == JNI_EDETACHED) {
DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
return (uint64_t)res_ptr;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Access_1get_1utxo(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray genesis_hash, int64_t short_channel_id) {
- LDKAccess* this_arg_conv = (LDKAccess*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKAccess* this_arg_conv = (LDKAccess*)this_arg_ptr;
unsigned char genesis_hash_arr[32];
CHECK((*env)->GetArrayLength(env, genesis_hash) == 32);
(*env)->GetByteArrayRegion(env, genesis_hash, 0, 32, genesis_hash_arr);
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to register_output in LDKFilter from rust threw an exception.");
}
- LDKCOption_C2Tuple_usizeTransactionZZ ret_conv = *(LDKCOption_C2Tuple_usizeTransactionZZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCOption_C2Tuple_usizeTransactionZZ ret_conv = *(LDKCOption_C2Tuple_usizeTransactionZZ*)(ret_ptr);
ret_conv = COption_C2Tuple_usizeTransactionZZ_clone((LDKCOption_C2Tuple_usizeTransactionZZ*)(((uint64_t)ret) & ~1));
if (get_jenv_res == JNI_EDETACHED) {
DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
return (uint64_t)res_ptr;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Filter_1register_1tx(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray txid, int8_tArray script_pubkey) {
- LDKFilter* this_arg_conv = (LDKFilter*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKFilter* this_arg_conv = (LDKFilter*)this_arg_ptr;
unsigned char txid_arr[32];
CHECK((*env)->GetArrayLength(env, txid) == 32);
(*env)->GetByteArrayRegion(env, txid, 0, 32, txid_arr);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Filter_1register_1output(JNIEnv *env, jclass clz, int64_t this_arg, int64_t output) {
- LDKFilter* this_arg_conv = (LDKFilter*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKFilter* this_arg_conv = (LDKFilter*)this_arg_ptr;
LDKWatchedOutput output_conv;
output_conv.inner = (void*)(output & (~1));
output_conv.is_owned = (output & 1) || (output == 0);
int64_t* ret_vals = (*env)->GetLongArrayElements (env, ret, NULL);
for (size_t s = 0; s < ret_constr.datalen; s++) {
int64_t ret_conv_18 = ret_vals[s];
- LDKMessageSendEvent ret_conv_18_conv = *(LDKMessageSendEvent*)(((uint64_t)ret_conv_18) & ~1);
+ void* ret_conv_18_ptr = (void*)(((uint64_t)ret_conv_18) & ~1);
+ CHECK_ACCESS(ret_conv_18_ptr);
+ LDKMessageSendEvent ret_conv_18_conv = *(LDKMessageSendEvent*)(ret_conv_18_ptr);
ret_conv_18_conv = MessageSendEvent_clone((LDKMessageSendEvent*)(((uint64_t)ret_conv_18) & ~1));
ret_constr.data[s] = ret_conv_18_conv;
}
return (uint64_t)res_ptr;
}
JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_MessageSendEventsProvider_1get_1and_1clear_1pending_1msg_1events(JNIEnv *env, jclass clz, int64_t this_arg) {
- LDKMessageSendEventsProvider* this_arg_conv = (LDKMessageSendEventsProvider*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKMessageSendEventsProvider* this_arg_conv = (LDKMessageSendEventsProvider*)this_arg_ptr;
LDKCVec_MessageSendEventZ ret_var = (this_arg_conv->get_and_clear_pending_msg_events)(this_arg_conv->this_arg);
int64_tArray ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
for (size_t s = 0; s < ret_var.datalen; s++) {
LDKMessageSendEvent *ret_conv_18_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
- *ret_conv_18_copy = MessageSendEvent_clone(&ret_var.data[s]);
+ *ret_conv_18_copy = ret_var.data[s];
uint64_t ret_conv_18_ref = (uint64_t)ret_conv_18_copy;
ret_arr_ptr[s] = ret_conv_18_ref;
}
return (uint64_t)res_ptr;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EventHandler_1handle_1event(JNIEnv *env, jclass clz, int64_t this_arg, int64_t event) {
- LDKEventHandler* this_arg_conv = (LDKEventHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKEventHandler* this_arg_conv = (LDKEventHandler*)this_arg_ptr;
LDKEvent* event_conv = (LDKEvent*)event;
(this_arg_conv->handle_event)(this_arg_conv->this_arg, event_conv);
}
return (uint64_t)res_ptr;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EventsProvider_1process_1pending_1events(JNIEnv *env, jclass clz, int64_t this_arg, int64_t handler) {
- LDKEventsProvider* this_arg_conv = (LDKEventsProvider*)(((uint64_t)this_arg) & ~1);
- LDKEventHandler handler_conv = *(LDKEventHandler*)(((uint64_t)handler) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKEventsProvider* this_arg_conv = (LDKEventsProvider*)this_arg_ptr;
+ void* handler_ptr = (void*)(((uint64_t)handler) & ~1);
+ CHECK_ACCESS(handler_ptr);
+ LDKEventHandler handler_conv = *(LDKEventHandler*)(handler_ptr);
if (handler_conv.free == LDKEventHandler_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKEventHandler_JCalls_cloned(&handler_conv);
return (uint64_t)res_ptr;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Listen_1block_1connected(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray block, int32_t height) {
- LDKListen* this_arg_conv = (LDKListen*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKListen* this_arg_conv = (LDKListen*)this_arg_ptr;
LDKu8slice block_ref;
block_ref.datalen = (*env)->GetArrayLength(env, block);
block_ref.data = (*env)->GetByteArrayElements (env, block, NULL);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Listen_1block_1disconnected(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray header, int32_t height) {
- LDKListen* this_arg_conv = (LDKListen*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKListen* this_arg_conv = (LDKListen*)this_arg_ptr;
unsigned char header_arr[80];
CHECK((*env)->GetArrayLength(env, header) == 80);
(*env)->GetByteArrayRegion(env, header, 0, 80, header_arr);
return (uint64_t)res_ptr;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Confirm_1transactions_1confirmed(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray header, int64_tArray txdata, int32_t height) {
- LDKConfirm* this_arg_conv = (LDKConfirm*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKConfirm* this_arg_conv = (LDKConfirm*)this_arg_ptr;
unsigned char header_arr[80];
CHECK((*env)->GetArrayLength(env, header) == 80);
(*env)->GetByteArrayRegion(env, header, 0, 80, header_arr);
int64_t* txdata_vals = (*env)->GetLongArrayElements (env, txdata, NULL);
for (size_t c = 0; c < txdata_constr.datalen; c++) {
int64_t txdata_conv_28 = txdata_vals[c];
- LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(((uint64_t)txdata_conv_28) & ~1);
+ void* txdata_conv_28_ptr = (void*)(((uint64_t)txdata_conv_28) & ~1);
+ CHECK_ACCESS(txdata_conv_28_ptr);
+ LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(txdata_conv_28_ptr);
txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)(((uint64_t)txdata_conv_28) & ~1));
txdata_constr.data[c] = txdata_conv_28_conv;
}
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Confirm_1transaction_1unconfirmed(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray txid) {
- LDKConfirm* this_arg_conv = (LDKConfirm*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKConfirm* this_arg_conv = (LDKConfirm*)this_arg_ptr;
unsigned char txid_arr[32];
CHECK((*env)->GetArrayLength(env, txid) == 32);
(*env)->GetByteArrayRegion(env, txid, 0, 32, txid_arr);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Confirm_1best_1block_1updated(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray header, int32_t height) {
- LDKConfirm* this_arg_conv = (LDKConfirm*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKConfirm* this_arg_conv = (LDKConfirm*)this_arg_ptr;
unsigned char header_arr[80];
CHECK((*env)->GetArrayLength(env, header) == 80);
(*env)->GetByteArrayRegion(env, header, 0, 80, header_arr);
}
JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_Confirm_1get_1relevant_1txids(JNIEnv *env, jclass clz, int64_t this_arg) {
- LDKConfirm* this_arg_conv = (LDKConfirm*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKConfirm* this_arg_conv = (LDKConfirm*)this_arg_ptr;
LDKCVec_TxidZ ret_var = (this_arg_conv->get_relevant_txids)(this_arg_conv->this_arg);
jobjectArray ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL);
;
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to persist_new_channel in LDKPersist from rust threw an exception.");
}
- LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr);
ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone((LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)ret) & ~1));
if (get_jenv_res == JNI_EDETACHED) {
DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to update_persisted_channel in LDKPersist from rust threw an exception.");
}
- LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr);
ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone((LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)ret) & ~1));
if (get_jenv_res == JNI_EDETACHED) {
DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
return (uint64_t)res_ptr;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Persist_1persist_1new_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int64_t id, int64_t data) {
- LDKPersist* this_arg_conv = (LDKPersist*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKPersist* this_arg_conv = (LDKPersist*)this_arg_ptr;
LDKOutPoint id_conv;
id_conv.inner = (void*)(id & (~1));
id_conv.is_owned = (id & 1) || (id == 0);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Persist_1update_1persisted_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int64_t id, int64_t update, int64_t data) {
- LDKPersist* this_arg_conv = (LDKPersist*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKPersist* this_arg_conv = (LDKPersist*)this_arg_ptr;
LDKOutPoint id_conv;
id_conv.inner = (void*)(id & (~1));
id_conv.is_owned = (id & 1) || (id == 0);
return (int64_t)(res_ptr | 1);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1open_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t their_features, int64_t msg) {
- LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
(*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1accept_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t their_features, int64_t msg) {
- LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
(*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1funding_1created(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) {
- LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
(*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1funding_1signed(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) {
- LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
(*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1funding_1locked(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) {
- LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
(*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1shutdown(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t their_features, int64_t msg) {
- LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
(*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1closing_1signed(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) {
- LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
(*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1update_1add_1htlc(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) {
- LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
(*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1update_1fulfill_1htlc(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) {
- LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
(*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1update_1fail_1htlc(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) {
- LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
(*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1update_1fail_1malformed_1htlc(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) {
- LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
(*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1commitment_1signed(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) {
- LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
(*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1revoke_1and_1ack(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) {
- LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
(*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1update_1fee(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) {
- LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
(*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1announcement_1signatures(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) {
- LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
(*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1peer_1disconnected(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, jboolean no_connection_possible) {
- LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
(*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1peer_1connected(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) {
- LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
(*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1channel_1reestablish(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) {
- LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
(*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1channel_1update(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) {
- LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
(*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1error(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) {
- LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
(*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to handle_node_announcement in LDKRoutingMessageHandler from rust threw an exception.");
}
- LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(ret_ptr);
ret_conv = CResult_boolLightningErrorZ_clone((LDKCResult_boolLightningErrorZ*)(((uint64_t)ret) & ~1));
if (get_jenv_res == JNI_EDETACHED) {
DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to handle_channel_announcement in LDKRoutingMessageHandler from rust threw an exception.");
}
- LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(ret_ptr);
ret_conv = CResult_boolLightningErrorZ_clone((LDKCResult_boolLightningErrorZ*)(((uint64_t)ret) & ~1));
if (get_jenv_res == JNI_EDETACHED) {
DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to handle_channel_update in LDKRoutingMessageHandler from rust threw an exception.");
}
- LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(ret_ptr);
ret_conv = CResult_boolLightningErrorZ_clone((LDKCResult_boolLightningErrorZ*)(((uint64_t)ret) & ~1));
if (get_jenv_res == JNI_EDETACHED) {
DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
int64_t* ret_vals = (*env)->GetLongArrayElements (env, ret, NULL);
for (size_t h = 0; h < ret_constr.datalen; h++) {
int64_t ret_conv_59 = ret_vals[h];
- LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ ret_conv_59_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(((uint64_t)ret_conv_59) & ~1);
+ void* ret_conv_59_ptr = (void*)(((uint64_t)ret_conv_59) & ~1);
+ CHECK_ACCESS(ret_conv_59_ptr);
+ LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ ret_conv_59_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(ret_conv_59_ptr);
ret_conv_59_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone((LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(((uint64_t)ret_conv_59) & ~1));
ret_constr.data[h] = ret_conv_59_conv;
}
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to handle_reply_channel_range in LDKRoutingMessageHandler from rust threw an exception.");
}
- LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr);
ret_conv = CResult_NoneLightningErrorZ_clone((LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1));
if (get_jenv_res == JNI_EDETACHED) {
DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to handle_reply_short_channel_ids_end in LDKRoutingMessageHandler from rust threw an exception.");
}
- LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr);
ret_conv = CResult_NoneLightningErrorZ_clone((LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1));
if (get_jenv_res == JNI_EDETACHED) {
DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to handle_query_channel_range in LDKRoutingMessageHandler from rust threw an exception.");
}
- LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr);
ret_conv = CResult_NoneLightningErrorZ_clone((LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1));
if (get_jenv_res == JNI_EDETACHED) {
DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to handle_query_short_channel_ids in LDKRoutingMessageHandler from rust threw an exception.");
}
- LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr);
ret_conv = CResult_NoneLightningErrorZ_clone((LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1));
if (get_jenv_res == JNI_EDETACHED) {
DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
return (int64_t)(res_ptr | 1);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1handle_1node_1announcement(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg) {
- LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
LDKNodeAnnouncement msg_conv;
msg_conv.inner = (void*)(msg & (~1));
msg_conv.is_owned = false;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1handle_1channel_1announcement(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg) {
- LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
LDKChannelAnnouncement msg_conv;
msg_conv.inner = (void*)(msg & (~1));
msg_conv.is_owned = false;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1handle_1channel_1update(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg) {
- LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
LDKChannelUpdate msg_conv;
msg_conv.inner = (void*)(msg & (~1));
msg_conv.is_owned = false;
}
JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1get_1next_1channel_1announcements(JNIEnv *env, jclass clz, int64_t this_arg, int64_t starting_point, int8_t batch_amount) {
- LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ ret_var = (this_arg_conv->get_next_channel_announcements)(this_arg_conv->this_arg, starting_point, batch_amount);
int64_tArray ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
}
JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1get_1next_1node_1announcements(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray starting_point, int8_t batch_amount) {
- LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
LDKPublicKey starting_point_ref;
CHECK((*env)->GetArrayLength(env, starting_point) == 33);
(*env)->GetByteArrayRegion(env, starting_point, 0, 33, starting_point_ref.compressed_form);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1sync_1routing_1table(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t init) {
- LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
(*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1handle_1reply_1channel_1range(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) {
- LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
(*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1handle_1reply_1short_1channel_1ids_1end(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) {
- LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
(*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1handle_1query_1channel_1range(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) {
- LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
(*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1handle_1query_1short_1channel_1ids(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) {
- LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
(*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to read in LDKCustomMessageReader from rust threw an exception.");
}
- LDKCResult_COption_TypeZDecodeErrorZ ret_conv = *(LDKCResult_COption_TypeZDecodeErrorZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_COption_TypeZDecodeErrorZ ret_conv = *(LDKCResult_COption_TypeZDecodeErrorZ*)(ret_ptr);
ret_conv = CResult_COption_TypeZDecodeErrorZ_clone((LDKCResult_COption_TypeZDecodeErrorZ*)(((uint64_t)ret) & ~1));
if (get_jenv_res == JNI_EDETACHED) {
DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
return (uint64_t)res_ptr;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CustomMessageReader_1read(JNIEnv *env, jclass clz, int64_t this_arg, int16_t message_type, int8_tArray buffer) {
- LDKCustomMessageReader* this_arg_conv = (LDKCustomMessageReader*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKCustomMessageReader* this_arg_conv = (LDKCustomMessageReader*)this_arg_ptr;
LDKu8slice buffer_ref;
buffer_ref.datalen = (*env)->GetArrayLength(env, buffer);
buffer_ref.data = (*env)->GetByteArrayElements (env, buffer, NULL);
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to handle_custom_message in LDKCustomMessageHandler from rust threw an exception.");
}
- LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr);
ret_conv = CResult_NoneLightningErrorZ_clone((LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1));
if (get_jenv_res == JNI_EDETACHED) {
DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
int64_t* ret_vals = (*env)->GetLongArrayElements (env, ret, NULL);
for (size_t z = 0; z < ret_constr.datalen; z++) {
int64_t ret_conv_25 = ret_vals[z];
- LDKC2Tuple_PublicKeyTypeZ ret_conv_25_conv = *(LDKC2Tuple_PublicKeyTypeZ*)(((uint64_t)ret_conv_25) & ~1);
+ void* ret_conv_25_ptr = (void*)(((uint64_t)ret_conv_25) & ~1);
+ CHECK_ACCESS(ret_conv_25_ptr);
+ LDKC2Tuple_PublicKeyTypeZ ret_conv_25_conv = *(LDKC2Tuple_PublicKeyTypeZ*)(ret_conv_25_ptr);
ret_conv_25_conv = C2Tuple_PublicKeyTypeZ_clone((LDKC2Tuple_PublicKeyTypeZ*)(((uint64_t)ret_conv_25) & ~1));
ret_constr.data[z] = ret_conv_25_conv;
}
return (int64_t)(res_ptr | 1);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CustomMessageHandler_1handle_1custom_1message(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg, int8_tArray sender_node_id) {
- LDKCustomMessageHandler* this_arg_conv = (LDKCustomMessageHandler*)(((uint64_t)this_arg) & ~1);
- LDKType msg_conv = *(LDKType*)(((uint64_t)msg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKCustomMessageHandler* this_arg_conv = (LDKCustomMessageHandler*)this_arg_ptr;
+ void* msg_ptr = (void*)(((uint64_t)msg) & ~1);
+ CHECK_ACCESS(msg_ptr);
+ LDKType msg_conv = *(LDKType*)(msg_ptr);
if (msg_conv.free == LDKType_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKType_JCalls_cloned(&msg_conv);
}
JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CustomMessageHandler_1get_1and_1clear_1pending_1msg(JNIEnv *env, jclass clz, int64_t this_arg) {
- LDKCustomMessageHandler* this_arg_conv = (LDKCustomMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKCustomMessageHandler* this_arg_conv = (LDKCustomMessageHandler*)this_arg_ptr;
LDKCVec_C2Tuple_PublicKeyTypeZZ ret_var = (this_arg_conv->get_and_clear_pending_msg)(this_arg_conv->this_arg);
int64_tArray ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
return (uint64_t)res_ptr;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1send_1data(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray data, jboolean resume_read) {
- LDKSocketDescriptor* this_arg_conv = (LDKSocketDescriptor*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKSocketDescriptor* this_arg_conv = (LDKSocketDescriptor*)this_arg_ptr;
LDKu8slice data_ref;
data_ref.datalen = (*env)->GetArrayLength(env, data);
data_ref.data = (*env)->GetByteArrayElements (env, data, NULL);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1disconnect_1socket(JNIEnv *env, jclass clz, int64_t this_arg) {
- LDKSocketDescriptor* this_arg_conv = (LDKSocketDescriptor*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKSocketDescriptor* this_arg_conv = (LDKSocketDescriptor*)this_arg_ptr;
(this_arg_conv->disconnect_socket)(this_arg_conv->this_arg);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1hash(JNIEnv *env, jclass clz, int64_t this_arg) {
- LDKSocketDescriptor* this_arg_conv = (LDKSocketDescriptor*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKSocketDescriptor* this_arg_conv = (LDKSocketDescriptor*)this_arg_ptr;
int64_t ret_val = (this_arg_conv->hash)(this_arg_conv->this_arg);
return ret_val;
}
return (uint64_t)res_ptr;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Score_1channel_1penalty_1msat(JNIEnv *env, jclass clz, int64_t this_arg, int64_t short_channel_id) {
- LDKScore* this_arg_conv = (LDKScore*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr;
int64_t ret_val = (this_arg_conv->channel_penalty_msat)(this_arg_conv->this_arg, short_channel_id);
return ret_val;
}
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to persist_manager in LDKChannelManagerPersister from rust threw an exception.");
}
- LDKCResult_NoneErrorZ ret_conv = *(LDKCResult_NoneErrorZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_NoneErrorZ ret_conv = *(LDKCResult_NoneErrorZ*)(ret_ptr);
ret_conv = CResult_NoneErrorZ_clone((LDKCResult_NoneErrorZ*)(((uint64_t)ret) & ~1));
if (get_jenv_res == JNI_EDETACHED) {
DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
return (uint64_t)res_ptr;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerPersister_1persist_1manager(JNIEnv *env, jclass clz, int64_t this_arg, int64_t channel_manager) {
- LDKChannelManagerPersister* this_arg_conv = (LDKChannelManagerPersister*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelManagerPersister* this_arg_conv = (LDKChannelManagerPersister*)this_arg_ptr;
LDKChannelManager channel_manager_conv;
channel_manager_conv.inner = (void*)(channel_manager & (~1));
channel_manager_conv.is_owned = false;
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxOut_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKTxOut _res_conv = *(LDKTxOut*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKTxOut _res_conv = *(LDKTxOut*)(_res_ptr);
FREE((void*)_res);
TxOut_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_SecretKeyErrorZ _res_conv = *(LDKCResult_SecretKeyErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_SecretKeyErrorZ _res_conv = *(LDKCResult_SecretKeyErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_SecretKeyErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_PublicKeyErrorZ _res_conv = *(LDKCResult_PublicKeyErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_PublicKeyErrorZ _res_conv = *(LDKCResult_PublicKeyErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_PublicKeyErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_TxCreationKeysDecodeErrorZ _res_conv = *(LDKCResult_TxCreationKeysDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_TxCreationKeysDecodeErrorZ _res_conv = *(LDKCResult_TxCreationKeysDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_TxCreationKeysDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelPublicKeysDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_ChannelPublicKeysDecodeErrorZ _res_conv = *(LDKCResult_ChannelPublicKeysDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_ChannelPublicKeysDecodeErrorZ _res_conv = *(LDKCResult_ChannelPublicKeysDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_ChannelPublicKeysDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_TxCreationKeysErrorZ _res_conv = *(LDKCResult_TxCreationKeysErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_TxCreationKeysErrorZ _res_conv = *(LDKCResult_TxCreationKeysErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_TxCreationKeysErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1u32Z_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCOption_u32Z _res_conv = *(LDKCOption_u32Z*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCOption_u32Z _res_conv = *(LDKCOption_u32Z*)(_res_ptr);
FREE((void*)_res);
COption_u32Z_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCOutputInCommitmentDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_HTLCOutputInCommitmentDecodeErrorZ _res_conv = *(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_HTLCOutputInCommitmentDecodeErrorZ _res_conv = *(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_HTLCOutputInCommitmentDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyChannelTransactionParametersDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ _res_conv = *(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ _res_conv = *(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTransactionParametersDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_ChannelTransactionParametersDecodeErrorZ _res_conv = *(LDKCResult_ChannelTransactionParametersDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_ChannelTransactionParametersDecodeErrorZ _res_conv = *(LDKCResult_ChannelTransactionParametersDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_ChannelTransactionParametersDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1HolderCommitmentTransactionDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_HolderCommitmentTransactionDecodeErrorZ _res_conv = *(LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_HolderCommitmentTransactionDecodeErrorZ _res_conv = *(LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_HolderCommitmentTransactionDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BuiltCommitmentTransactionDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_BuiltCommitmentTransactionDecodeErrorZ _res_conv = *(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_BuiltCommitmentTransactionDecodeErrorZ _res_conv = *(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_BuiltCommitmentTransactionDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedClosingTransactionNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_TrustedClosingTransactionNoneZ _res_conv = *(LDKCResult_TrustedClosingTransactionNoneZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_TrustedClosingTransactionNoneZ _res_conv = *(LDKCResult_TrustedClosingTransactionNoneZ*)(_res_ptr);
FREE((void*)_res);
CResult_TrustedClosingTransactionNoneZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentTransactionDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_CommitmentTransactionDecodeErrorZ _res_conv = *(LDKCResult_CommitmentTransactionDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_CommitmentTransactionDecodeErrorZ _res_conv = *(LDKCResult_CommitmentTransactionDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_CommitmentTransactionDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedCommitmentTransactionNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_TrustedCommitmentTransactionNoneZ _res_conv = *(LDKCResult_TrustedCommitmentTransactionNoneZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_TrustedCommitmentTransactionNoneZ _res_conv = *(LDKCResult_TrustedCommitmentTransactionNoneZ*)(_res_ptr);
FREE((void*)_res);
CResult_TrustedCommitmentTransactionNoneZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_CVec_SignatureZNoneZ _res_conv = *(LDKCResult_CVec_SignatureZNoneZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_CVec_SignatureZNoneZ _res_conv = *(LDKCResult_CVec_SignatureZNoneZ*)(_res_ptr);
FREE((void*)_res);
CResult_CVec_SignatureZNoneZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_ShutdownScriptDecodeErrorZ _res_conv = *(LDKCResult_ShutdownScriptDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_ShutdownScriptDecodeErrorZ _res_conv = *(LDKCResult_ShutdownScriptDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_ShutdownScriptDecodeErrorZ_free(_res_conv);
}
LDKInvalidShutdownScript e_conv;
e_conv.inner = (void*)(e & (~1));
e_conv.is_owned = (e & 1) || (e == 0);
- // Warning: we need a move here but no clone is available for LDKInvalidShutdownScript
+ e_conv = InvalidShutdownScript_clone(&e_conv);
LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ");
*ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_err(e_conv);
return (uint64_t)ret_conv;
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptInvalidShutdownScriptZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_ShutdownScriptInvalidShutdownScriptZ _res_conv = *(LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_ShutdownScriptInvalidShutdownScriptZ _res_conv = *(LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)(_res_ptr);
FREE((void*)_res);
CResult_ShutdownScriptInvalidShutdownScriptZ_free(_res_conv);
}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptInvalidShutdownScriptZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
+ LDKCResult_ShutdownScriptInvalidShutdownScriptZ* orig_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)(orig & ~1);
+ LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ");
+ *ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_clone(orig_conv);
+ return (uint64_t)ret_conv;
+}
+
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneErrorZ_1ok(JNIEnv *env, jclass clz) {
LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ");
*ret_conv = CResult_NoneErrorZ_ok();
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_NoneErrorZ _res_conv = *(LDKCResult_NoneErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_NoneErrorZ _res_conv = *(LDKCResult_NoneErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_NoneErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_RouteHopDecodeErrorZ _res_conv = *(LDKCResult_RouteHopDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_RouteHopDecodeErrorZ _res_conv = *(LDKCResult_RouteHopDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_RouteHopDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_RouteDecodeErrorZ _res_conv = *(LDKCResult_RouteDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_RouteDecodeErrorZ _res_conv = *(LDKCResult_RouteDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_RouteDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1u64Z_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCOption_u64Z _res_conv = *(LDKCOption_u64Z*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCOption_u64Z _res_conv = *(LDKCOption_u64Z*)(_res_ptr);
FREE((void*)_res);
COption_u64Z_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_RouteLightningErrorZ _res_conv = *(LDKCResult_RouteLightningErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_RouteLightningErrorZ _res_conv = *(LDKCResult_RouteLightningErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_RouteLightningErrorZ_free(_res_conv);
}
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
- LDKTxOut o_conv = *(LDKTxOut*)(((uint64_t)o) & ~1);
+ void* o_ptr = (void*)(((uint64_t)o) & ~1);
+ CHECK_ACCESS(o_ptr);
+ LDKTxOut o_conv = *(LDKTxOut*)(o_ptr);
o_conv = TxOut_clone((LDKTxOut*)(((uint64_t)o) & ~1));
LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ");
*ret_conv = CResult_TxOutAccessErrorZ_ok(o_conv);
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_TxOutAccessErrorZ _res_conv = *(LDKCResult_TxOutAccessErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_TxOutAccessErrorZ _res_conv = *(LDKCResult_TxOutAccessErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_TxOutAccessErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKC2Tuple_usizeTransactionZ _res_conv = *(LDKC2Tuple_usizeTransactionZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKC2Tuple_usizeTransactionZ _res_conv = *(LDKC2Tuple_usizeTransactionZ*)(_res_ptr);
FREE((void*)_res);
C2Tuple_usizeTransactionZ_free(_res_conv);
}
int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
for (size_t c = 0; c < _res_constr.datalen; c++) {
int64_t _res_conv_28 = _res_vals[c];
- LDKC2Tuple_usizeTransactionZ _res_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(((uint64_t)_res_conv_28) & ~1);
+ void* _res_conv_28_ptr = (void*)(((uint64_t)_res_conv_28) & ~1);
+ CHECK_ACCESS(_res_conv_28_ptr);
+ LDKC2Tuple_usizeTransactionZ _res_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(_res_conv_28_ptr);
FREE((void*)_res_conv_28);
_res_constr.data[c] = _res_conv_28_conv;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_NoneChannelMonitorUpdateErrZ _res_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_NoneChannelMonitorUpdateErrZ _res_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(_res_ptr);
FREE((void*)_res);
CResult_NoneChannelMonitorUpdateErrZ_free(_res_conv);
}
int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
for (size_t o = 0; o < _res_constr.datalen; o++) {
int64_t _res_conv_14 = _res_vals[o];
- LDKMonitorEvent _res_conv_14_conv = *(LDKMonitorEvent*)(((uint64_t)_res_conv_14) & ~1);
+ void* _res_conv_14_ptr = (void*)(((uint64_t)_res_conv_14) & ~1);
+ CHECK_ACCESS(_res_conv_14_ptr);
+ LDKMonitorEvent _res_conv_14_conv = *(LDKMonitorEvent*)(_res_conv_14_ptr);
FREE((void*)_res_conv_14);
_res_constr.data[o] = _res_conv_14_conv;
}
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1usizeTransactionZZ_1some(JNIEnv *env, jclass clz, int64_t o) {
- LDKC2Tuple_usizeTransactionZ o_conv = *(LDKC2Tuple_usizeTransactionZ*)(((uint64_t)o) & ~1);
+ void* o_ptr = (void*)(((uint64_t)o) & ~1);
+ CHECK_ACCESS(o_ptr);
+ LDKC2Tuple_usizeTransactionZ o_conv = *(LDKC2Tuple_usizeTransactionZ*)(o_ptr);
o_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)(((uint64_t)o) & ~1));
LDKCOption_C2Tuple_usizeTransactionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_usizeTransactionZZ), "LDKCOption_C2Tuple_usizeTransactionZZ");
*ret_copy = COption_C2Tuple_usizeTransactionZZ_some(o_conv);
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1usizeTransactionZZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCOption_C2Tuple_usizeTransactionZZ _res_conv = *(LDKCOption_C2Tuple_usizeTransactionZZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCOption_C2Tuple_usizeTransactionZZ _res_conv = *(LDKCOption_C2Tuple_usizeTransactionZZ*)(_res_ptr);
FREE((void*)_res);
COption_C2Tuple_usizeTransactionZZ_free(_res_conv);
}
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1NetworkUpdateZ_1some(JNIEnv *env, jclass clz, int64_t o) {
- LDKNetworkUpdate o_conv = *(LDKNetworkUpdate*)(((uint64_t)o) & ~1);
+ void* o_ptr = (void*)(((uint64_t)o) & ~1);
+ CHECK_ACCESS(o_ptr);
+ LDKNetworkUpdate o_conv = *(LDKNetworkUpdate*)(o_ptr);
o_conv = NetworkUpdate_clone((LDKNetworkUpdate*)(((uint64_t)o) & ~1));
LDKCOption_NetworkUpdateZ *ret_copy = MALLOC(sizeof(LDKCOption_NetworkUpdateZ), "LDKCOption_NetworkUpdateZ");
*ret_copy = COption_NetworkUpdateZ_some(o_conv);
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1NetworkUpdateZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCOption_NetworkUpdateZ _res_conv = *(LDKCOption_NetworkUpdateZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCOption_NetworkUpdateZ _res_conv = *(LDKCOption_NetworkUpdateZ*)(_res_ptr);
FREE((void*)_res);
COption_NetworkUpdateZ_free(_res_conv);
}
int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
for (size_t b = 0; b < _res_constr.datalen; b++) {
int64_t _res_conv_27 = _res_vals[b];
- LDKSpendableOutputDescriptor _res_conv_27_conv = *(LDKSpendableOutputDescriptor*)(((uint64_t)_res_conv_27) & ~1);
+ void* _res_conv_27_ptr = (void*)(((uint64_t)_res_conv_27) & ~1);
+ CHECK_ACCESS(_res_conv_27_ptr);
+ LDKSpendableOutputDescriptor _res_conv_27_conv = *(LDKSpendableOutputDescriptor*)(_res_conv_27_ptr);
FREE((void*)_res_conv_27);
_res_constr.data[b] = _res_conv_27_conv;
}
int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
for (size_t s = 0; s < _res_constr.datalen; s++) {
int64_t _res_conv_18 = _res_vals[s];
- LDKMessageSendEvent _res_conv_18_conv = *(LDKMessageSendEvent*)(((uint64_t)_res_conv_18) & ~1);
+ void* _res_conv_18_ptr = (void*)(((uint64_t)_res_conv_18) & ~1);
+ CHECK_ACCESS(_res_conv_18_ptr);
+ LDKMessageSendEvent _res_conv_18_conv = *(LDKMessageSendEvent*)(_res_conv_18_ptr);
FREE((void*)_res_conv_18);
_res_constr.data[s] = _res_conv_18_conv;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_InitFeaturesDecodeErrorZ _res_conv = *(LDKCResult_InitFeaturesDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_InitFeaturesDecodeErrorZ _res_conv = *(LDKCResult_InitFeaturesDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_InitFeaturesDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_NodeFeaturesDecodeErrorZ _res_conv = *(LDKCResult_NodeFeaturesDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_NodeFeaturesDecodeErrorZ _res_conv = *(LDKCResult_NodeFeaturesDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_NodeFeaturesDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_ChannelFeaturesDecodeErrorZ _res_conv = *(LDKCResult_ChannelFeaturesDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_ChannelFeaturesDecodeErrorZ _res_conv = *(LDKCResult_ChannelFeaturesDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_ChannelFeaturesDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_InvoiceFeaturesDecodeErrorZ _res_conv = *(LDKCResult_InvoiceFeaturesDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_InvoiceFeaturesDecodeErrorZ _res_conv = *(LDKCResult_InvoiceFeaturesDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_InvoiceFeaturesDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ _res_conv = *(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ _res_conv = *(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ _res_conv = *(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ _res_conv = *(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free(_res_conv);
}
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
- LDKSpendableOutputDescriptor o_conv = *(LDKSpendableOutputDescriptor*)(((uint64_t)o) & ~1);
+ void* o_ptr = (void*)(((uint64_t)o) & ~1);
+ CHECK_ACCESS(o_ptr);
+ LDKSpendableOutputDescriptor o_conv = *(LDKSpendableOutputDescriptor*)(o_ptr);
o_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)(((uint64_t)o) & ~1));
LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ");
*ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_ok(o_conv);
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_SpendableOutputDescriptorDecodeErrorZ _res_conv = *(LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_SpendableOutputDescriptorDecodeErrorZ _res_conv = *(LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_SpendableOutputDescriptorDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_NoneNoneZ _res_conv = *(LDKCResult_NoneNoneZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_NoneNoneZ _res_conv = *(LDKCResult_NoneNoneZ*)(_res_ptr);
FREE((void*)_res);
CResult_NoneNoneZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKC2Tuple_SignatureCVec_SignatureZZ _res_conv = *(LDKC2Tuple_SignatureCVec_SignatureZZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKC2Tuple_SignatureCVec_SignatureZZ _res_conv = *(LDKC2Tuple_SignatureCVec_SignatureZZ*)(_res_ptr);
FREE((void*)_res);
C2Tuple_SignatureCVec_SignatureZZ_free(_res_conv);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
- LDKC2Tuple_SignatureCVec_SignatureZZ o_conv = *(LDKC2Tuple_SignatureCVec_SignatureZZ*)(((uint64_t)o) & ~1);
+ void* o_ptr = (void*)(((uint64_t)o) & ~1);
+ CHECK_ACCESS(o_ptr);
+ LDKC2Tuple_SignatureCVec_SignatureZZ o_conv = *(LDKC2Tuple_SignatureCVec_SignatureZZ*)(o_ptr);
o_conv = C2Tuple_SignatureCVec_SignatureZZ_clone((LDKC2Tuple_SignatureCVec_SignatureZZ*)(((uint64_t)o) & ~1));
LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ");
*ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(o_conv);
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ _res_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ _res_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(_res_ptr);
FREE((void*)_res);
CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_SignatureNoneZ _res_conv = *(LDKCResult_SignatureNoneZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_SignatureNoneZ _res_conv = *(LDKCResult_SignatureNoneZ*)(_res_ptr);
FREE((void*)_res);
CResult_SignatureNoneZ_free(_res_conv);
}
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
- LDKSign o_conv = *(LDKSign*)(((uint64_t)o) & ~1);
+ void* o_ptr = (void*)(((uint64_t)o) & ~1);
+ CHECK_ACCESS(o_ptr);
+ LDKSign o_conv = *(LDKSign*)(o_ptr);
if (o_conv.free == LDKSign_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKSign_JCalls_cloned(&o_conv);
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_SignDecodeErrorZ _res_conv = *(LDKCResult_SignDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_SignDecodeErrorZ _res_conv = *(LDKCResult_SignDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_SignDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_RecoverableSignatureNoneZ _res_conv = *(LDKCResult_RecoverableSignatureNoneZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_RecoverableSignatureNoneZ _res_conv = *(LDKCResult_RecoverableSignatureNoneZ*)(_res_ptr);
FREE((void*)_res);
CResult_RecoverableSignatureNoneZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_CVec_CVec_u8ZZNoneZ _res_conv = *(LDKCResult_CVec_CVec_u8ZZNoneZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_CVec_CVec_u8ZZNoneZ _res_conv = *(LDKCResult_CVec_CVec_u8ZZNoneZ*)(_res_ptr);
FREE((void*)_res);
CResult_CVec_CVec_u8ZZNoneZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_InMemorySignerDecodeErrorZ _res_conv = *(LDKCResult_InMemorySignerDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_InMemorySignerDecodeErrorZ _res_conv = *(LDKCResult_InMemorySignerDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_InMemorySignerDecodeErrorZ_free(_res_conv);
}
int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
for (size_t h = 0; h < _res_constr.datalen; h++) {
int64_t _res_conv_7 = _res_vals[h];
- LDKTxOut _res_conv_7_conv = *(LDKTxOut*)(((uint64_t)_res_conv_7) & ~1);
+ void* _res_conv_7_ptr = (void*)(((uint64_t)_res_conv_7) & ~1);
+ CHECK_ACCESS(_res_conv_7_ptr);
+ LDKTxOut _res_conv_7_conv = *(LDKTxOut*)(_res_conv_7_ptr);
FREE((void*)_res_conv_7);
_res_constr.data[h] = _res_conv_7_conv;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_TransactionNoneZ _res_conv = *(LDKCResult_TransactionNoneZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_TransactionNoneZ _res_conv = *(LDKCResult_TransactionNoneZ*)(_res_ptr);
FREE((void*)_res);
CResult_TransactionNoneZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMonitorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKC2Tuple_BlockHashChannelMonitorZ _res_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKC2Tuple_BlockHashChannelMonitorZ _res_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(_res_ptr);
FREE((void*)_res);
C2Tuple_BlockHashChannelMonitorZ_free(_res_conv);
}
int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
for (size_t j = 0; j < _res_constr.datalen; j++) {
int64_t _res_conv_35 = _res_vals[j];
- LDKC2Tuple_BlockHashChannelMonitorZ _res_conv_35_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(((uint64_t)_res_conv_35) & ~1);
+ void* _res_conv_35_ptr = (void*)(((uint64_t)_res_conv_35) & ~1);
+ CHECK_ACCESS(_res_conv_35_ptr);
+ LDKC2Tuple_BlockHashChannelMonitorZ _res_conv_35_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(_res_conv_35_ptr);
FREE((void*)_res_conv_35);
_res_constr.data[j] = _res_conv_35_conv;
}
int64_t* o_vals = (*env)->GetLongArrayElements (env, o, NULL);
for (size_t j = 0; j < o_constr.datalen; j++) {
int64_t o_conv_35 = o_vals[j];
- LDKC2Tuple_BlockHashChannelMonitorZ o_conv_35_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(((uint64_t)o_conv_35) & ~1);
+ void* o_conv_35_ptr = (void*)(((uint64_t)o_conv_35) & ~1);
+ CHECK_ACCESS(o_conv_35_ptr);
+ LDKC2Tuple_BlockHashChannelMonitorZ o_conv_35_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(o_conv_35_ptr);
o_conv_35_conv = C2Tuple_BlockHashChannelMonitorZ_clone((LDKC2Tuple_BlockHashChannelMonitorZ*)(((uint64_t)o_conv_35) & ~1));
o_constr.data[j] = o_conv_35_conv;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ _res_conv = *(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ _res_conv = *(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_PaymentIdDecodeErrorZ _res_conv = *(LDKCResult_PaymentIdDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_PaymentIdDecodeErrorZ _res_conv = *(LDKCResult_PaymentIdDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_PaymentIdDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1u16Z_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCOption_u16Z _res_conv = *(LDKCOption_u16Z*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCOption_u16Z _res_conv = *(LDKCOption_u16Z*)(_res_ptr);
FREE((void*)_res);
COption_u16Z_free(_res_conv);
}
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKAPIError e_conv = *(LDKAPIError*)(((uint64_t)e) & ~1);
+ void* e_ptr = (void*)(((uint64_t)e) & ~1);
+ CHECK_ACCESS(e_ptr);
+ LDKAPIError e_conv = *(LDKAPIError*)(e_ptr);
e_conv = APIError_clone((LDKAPIError*)(((uint64_t)e) & ~1));
LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
*ret_conv = CResult_NoneAPIErrorZ_err(e_conv);
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_NoneAPIErrorZ _res_conv = *(LDKCResult_NoneAPIErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_NoneAPIErrorZ _res_conv = *(LDKCResult_NoneAPIErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_NoneAPIErrorZ_free(_res_conv);
}
int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
for (size_t w = 0; w < _res_constr.datalen; w++) {
int64_t _res_conv_22 = _res_vals[w];
- LDKCResult_NoneAPIErrorZ _res_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(((uint64_t)_res_conv_22) & ~1);
+ void* _res_conv_22_ptr = (void*)(((uint64_t)_res_conv_22) & ~1);
+ CHECK_ACCESS(_res_conv_22_ptr);
+ LDKCResult_NoneAPIErrorZ _res_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(_res_conv_22_ptr);
FREE((void*)_res_conv_22);
_res_constr.data[w] = _res_conv_22_conv;
}
int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
for (size_t k = 0; k < _res_constr.datalen; k++) {
int64_t _res_conv_10 = _res_vals[k];
- LDKAPIError _res_conv_10_conv = *(LDKAPIError*)(((uint64_t)_res_conv_10) & ~1);
+ void* _res_conv_10_ptr = (void*)(((uint64_t)_res_conv_10) & ~1);
+ CHECK_ACCESS(_res_conv_10_ptr);
+ LDKAPIError _res_conv_10_conv = *(LDKAPIError*)(_res_conv_10_ptr);
FREE((void*)_res_conv_10);
_res_constr.data[k] = _res_conv_10_conv;
}
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKAPIError e_conv = *(LDKAPIError*)(((uint64_t)e) & ~1);
+ void* e_ptr = (void*)(((uint64_t)e) & ~1);
+ CHECK_ACCESS(e_ptr);
+ LDKAPIError e_conv = *(LDKAPIError*)(e_ptr);
e_conv = APIError_clone((LDKAPIError*)(((uint64_t)e) & ~1));
LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ");
*ret_conv = CResult__u832APIErrorZ_err(e_conv);
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult__u832APIErrorZ _res_conv = *(LDKCResult__u832APIErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult__u832APIErrorZ _res_conv = *(LDKCResult__u832APIErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult__u832APIErrorZ_free(_res_conv);
}
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKPaymentSendFailure e_conv = *(LDKPaymentSendFailure*)(((uint64_t)e) & ~1);
+ void* e_ptr = (void*)(((uint64_t)e) & ~1);
+ CHECK_ACCESS(e_ptr);
+ LDKPaymentSendFailure e_conv = *(LDKPaymentSendFailure*)(e_ptr);
e_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)(((uint64_t)e) & ~1));
LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ");
*ret_conv = CResult_PaymentIdPaymentSendFailureZ_err(e_conv);
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_PaymentIdPaymentSendFailureZ _res_conv = *(LDKCResult_PaymentIdPaymentSendFailureZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_PaymentIdPaymentSendFailureZ _res_conv = *(LDKCResult_PaymentIdPaymentSendFailureZ*)(_res_ptr);
FREE((void*)_res);
CResult_PaymentIdPaymentSendFailureZ_free(_res_conv);
}
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKPaymentSendFailure e_conv = *(LDKPaymentSendFailure*)(((uint64_t)e) & ~1);
+ void* e_ptr = (void*)(((uint64_t)e) & ~1);
+ CHECK_ACCESS(e_ptr);
+ LDKPaymentSendFailure e_conv = *(LDKPaymentSendFailure*)(e_ptr);
e_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)(((uint64_t)e) & ~1));
LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
*ret_conv = CResult_NonePaymentSendFailureZ_err(e_conv);
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_NonePaymentSendFailureZ _res_conv = *(LDKCResult_NonePaymentSendFailureZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_NonePaymentSendFailureZ _res_conv = *(LDKCResult_NonePaymentSendFailureZ*)(_res_ptr);
FREE((void*)_res);
CResult_NonePaymentSendFailureZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentIdZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKC2Tuple_PaymentHashPaymentIdZ _res_conv = *(LDKC2Tuple_PaymentHashPaymentIdZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKC2Tuple_PaymentHashPaymentIdZ _res_conv = *(LDKC2Tuple_PaymentHashPaymentIdZ*)(_res_ptr);
FREE((void*)_res);
C2Tuple_PaymentHashPaymentIdZ_free(_res_conv);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
- LDKC2Tuple_PaymentHashPaymentIdZ o_conv = *(LDKC2Tuple_PaymentHashPaymentIdZ*)(((uint64_t)o) & ~1);
+ void* o_ptr = (void*)(((uint64_t)o) & ~1);
+ CHECK_ACCESS(o_ptr);
+ LDKC2Tuple_PaymentHashPaymentIdZ o_conv = *(LDKC2Tuple_PaymentHashPaymentIdZ*)(o_ptr);
o_conv = C2Tuple_PaymentHashPaymentIdZ_clone((LDKC2Tuple_PaymentHashPaymentIdZ*)(((uint64_t)o) & ~1));
LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ");
*ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_ok(o_conv);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKPaymentSendFailure e_conv = *(LDKPaymentSendFailure*)(((uint64_t)e) & ~1);
+ void* e_ptr = (void*)(((uint64_t)e) & ~1);
+ CHECK_ACCESS(e_ptr);
+ LDKPaymentSendFailure e_conv = *(LDKPaymentSendFailure*)(e_ptr);
e_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)(((uint64_t)e) & ~1));
LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ");
*ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_err(e_conv);
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ _res_conv = *(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ _res_conv = *(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)(_res_ptr);
FREE((void*)_res);
CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_free(_res_conv);
}
int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
for (size_t m = 0; m < _res_constr.datalen; m++) {
int64_t _res_conv_12 = _res_vals[m];
- LDKNetAddress _res_conv_12_conv = *(LDKNetAddress*)(((uint64_t)_res_conv_12) & ~1);
+ void* _res_conv_12_ptr = (void*)(((uint64_t)_res_conv_12) & ~1);
+ CHECK_ACCESS(_res_conv_12_ptr);
+ LDKNetAddress _res_conv_12_conv = *(LDKNetAddress*)(_res_conv_12_ptr);
FREE((void*)_res_conv_12);
_res_constr.data[m] = _res_conv_12_conv;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentSecretZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKC2Tuple_PaymentHashPaymentSecretZ _res_conv = *(LDKC2Tuple_PaymentHashPaymentSecretZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKC2Tuple_PaymentHashPaymentSecretZ _res_conv = *(LDKC2Tuple_PaymentHashPaymentSecretZ*)(_res_ptr);
FREE((void*)_res);
C2Tuple_PaymentHashPaymentSecretZ_free(_res_conv);
}
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKAPIError e_conv = *(LDKAPIError*)(((uint64_t)e) & ~1);
+ void* e_ptr = (void*)(((uint64_t)e) & ~1);
+ CHECK_ACCESS(e_ptr);
+ LDKAPIError e_conv = *(LDKAPIError*)(e_ptr);
e_conv = APIError_clone((LDKAPIError*)(((uint64_t)e) & ~1));
LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ");
*ret_conv = CResult_PaymentSecretAPIErrorZ_err(e_conv);
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_PaymentSecretAPIErrorZ _res_conv = *(LDKCResult_PaymentSecretAPIErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_PaymentSecretAPIErrorZ _res_conv = *(LDKCResult_PaymentSecretAPIErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_PaymentSecretAPIErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelManagerZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKC2Tuple_BlockHashChannelManagerZ _res_conv = *(LDKC2Tuple_BlockHashChannelManagerZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKC2Tuple_BlockHashChannelManagerZ _res_conv = *(LDKC2Tuple_BlockHashChannelManagerZ*)(_res_ptr);
FREE((void*)_res);
C2Tuple_BlockHashChannelManagerZ_free(_res_conv);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelManagerZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
- LDKC2Tuple_BlockHashChannelManagerZ o_conv = *(LDKC2Tuple_BlockHashChannelManagerZ*)(((uint64_t)o) & ~1);
+ void* o_ptr = (void*)(((uint64_t)o) & ~1);
+ CHECK_ACCESS(o_ptr);
+ LDKC2Tuple_BlockHashChannelManagerZ o_conv = *(LDKC2Tuple_BlockHashChannelManagerZ*)(o_ptr);
// Warning: we may need a move here but no clone is available for LDKC2Tuple_BlockHashChannelManagerZ
LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ");
*ret_conv = CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(o_conv);
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelManagerZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ _res_conv = *(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ _res_conv = *(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_ChannelConfigDecodeErrorZ _res_conv = *(LDKCResult_ChannelConfigDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_ChannelConfigDecodeErrorZ _res_conv = *(LDKCResult_ChannelConfigDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_ChannelConfigDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_OutPointDecodeErrorZ _res_conv = *(LDKCResult_OutPointDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_OutPointDecodeErrorZ _res_conv = *(LDKCResult_OutPointDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_OutPointDecodeErrorZ_free(_res_conv);
}
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1TypeZ_1some(JNIEnv *env, jclass clz, int64_t o) {
- LDKType o_conv = *(LDKType*)(((uint64_t)o) & ~1);
+ void* o_ptr = (void*)(((uint64_t)o) & ~1);
+ CHECK_ACCESS(o_ptr);
+ LDKType o_conv = *(LDKType*)(o_ptr);
if (o_conv.free == LDKType_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKType_JCalls_cloned(&o_conv);
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1TypeZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCOption_TypeZ _res_conv = *(LDKCOption_TypeZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCOption_TypeZ _res_conv = *(LDKCOption_TypeZ*)(_res_ptr);
FREE((void*)_res);
COption_TypeZ_free(_res_conv);
}
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
- LDKCOption_TypeZ o_conv = *(LDKCOption_TypeZ*)(((uint64_t)o) & ~1);
+ void* o_ptr = (void*)(((uint64_t)o) & ~1);
+ CHECK_ACCESS(o_ptr);
+ LDKCOption_TypeZ o_conv = *(LDKCOption_TypeZ*)(o_ptr);
o_conv = COption_TypeZ_clone((LDKCOption_TypeZ*)(((uint64_t)o) & ~1));
LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ");
*ret_conv = CResult_COption_TypeZDecodeErrorZ_ok(o_conv);
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_COption_TypeZDecodeErrorZ _res_conv = *(LDKCResult_COption_TypeZDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_COption_TypeZDecodeErrorZ _res_conv = *(LDKCResult_COption_TypeZDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_COption_TypeZDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_SiPrefixNoneZ _res_conv = *(LDKCResult_SiPrefixNoneZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_SiPrefixNoneZ _res_conv = *(LDKCResult_SiPrefixNoneZ*)(_res_ptr);
FREE((void*)_res);
CResult_SiPrefixNoneZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_InvoiceNoneZ _res_conv = *(LDKCResult_InvoiceNoneZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_InvoiceNoneZ _res_conv = *(LDKCResult_InvoiceNoneZ*)(_res_ptr);
FREE((void*)_res);
CResult_InvoiceNoneZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_SignedRawInvoiceNoneZ _res_conv = *(LDKCResult_SignedRawInvoiceNoneZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_SignedRawInvoiceNoneZ _res_conv = *(LDKCResult_SignedRawInvoiceNoneZ*)(_res_ptr);
FREE((void*)_res);
CResult_SignedRawInvoiceNoneZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ _res_conv = *(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ _res_conv = *(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)(_res_ptr);
FREE((void*)_res);
C3Tuple_RawInvoice_u832InvoiceSignatureZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_PayeePubKeyErrorZ _res_conv = *(LDKCResult_PayeePubKeyErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_PayeePubKeyErrorZ _res_conv = *(LDKCResult_PayeePubKeyErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_PayeePubKeyErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_PositiveTimestampCreationErrorZ _res_conv = *(LDKCResult_PositiveTimestampCreationErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_PositiveTimestampCreationErrorZ _res_conv = *(LDKCResult_PositiveTimestampCreationErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_PositiveTimestampCreationErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_NoneSemanticErrorZ _res_conv = *(LDKCResult_NoneSemanticErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_NoneSemanticErrorZ _res_conv = *(LDKCResult_NoneSemanticErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_NoneSemanticErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_InvoiceSemanticErrorZ _res_conv = *(LDKCResult_InvoiceSemanticErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_InvoiceSemanticErrorZ _res_conv = *(LDKCResult_InvoiceSemanticErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_InvoiceSemanticErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_DescriptionCreationErrorZ _res_conv = *(LDKCResult_DescriptionCreationErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_DescriptionCreationErrorZ _res_conv = *(LDKCResult_DescriptionCreationErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_DescriptionCreationErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ExpiryTimeCreationErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_ExpiryTimeCreationErrorZ _res_conv = *(LDKCResult_ExpiryTimeCreationErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_ExpiryTimeCreationErrorZ _res_conv = *(LDKCResult_ExpiryTimeCreationErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_ExpiryTimeCreationErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_PrivateRouteCreationErrorZ _res_conv = *(LDKCResult_PrivateRouteCreationErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_PrivateRouteCreationErrorZ _res_conv = *(LDKCResult_PrivateRouteCreationErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_PrivateRouteCreationErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_StringErrorZ _res_conv = *(LDKCResult_StringErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_StringErrorZ _res_conv = *(LDKCResult_StringErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_StringErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_ChannelMonitorUpdateDecodeErrorZ _res_conv = *(LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_ChannelMonitorUpdateDecodeErrorZ _res_conv = *(LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_ChannelMonitorUpdateDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_HTLCUpdateDecodeErrorZ _res_conv = *(LDKCResult_HTLCUpdateDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_HTLCUpdateDecodeErrorZ _res_conv = *(LDKCResult_HTLCUpdateDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_HTLCUpdateDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_NoneMonitorUpdateErrorZ _res_conv = *(LDKCResult_NoneMonitorUpdateErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_NoneMonitorUpdateErrorZ _res_conv = *(LDKCResult_NoneMonitorUpdateErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_NoneMonitorUpdateErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKC2Tuple_OutPointScriptZ _res_conv = *(LDKC2Tuple_OutPointScriptZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKC2Tuple_OutPointScriptZ _res_conv = *(LDKC2Tuple_OutPointScriptZ*)(_res_ptr);
FREE((void*)_res);
C2Tuple_OutPointScriptZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32ScriptZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKC2Tuple_u32ScriptZ _res_conv = *(LDKC2Tuple_u32ScriptZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKC2Tuple_u32ScriptZ _res_conv = *(LDKC2Tuple_u32ScriptZ*)(_res_ptr);
FREE((void*)_res);
C2Tuple_u32ScriptZ_free(_res_conv);
}
int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
for (size_t v = 0; v < _res_constr.datalen; v++) {
int64_t _res_conv_21 = _res_vals[v];
- LDKC2Tuple_u32ScriptZ _res_conv_21_conv = *(LDKC2Tuple_u32ScriptZ*)(((uint64_t)_res_conv_21) & ~1);
+ void* _res_conv_21_ptr = (void*)(((uint64_t)_res_conv_21) & ~1);
+ CHECK_ACCESS(_res_conv_21_ptr);
+ LDKC2Tuple_u32ScriptZ _res_conv_21_conv = *(LDKC2Tuple_u32ScriptZ*)(_res_conv_21_ptr);
FREE((void*)_res_conv_21);
_res_constr.data[v] = _res_conv_21_conv;
}
int64_t* b_vals = (*env)->GetLongArrayElements (env, b, NULL);
for (size_t v = 0; v < b_constr.datalen; v++) {
int64_t b_conv_21 = b_vals[v];
- LDKC2Tuple_u32ScriptZ b_conv_21_conv = *(LDKC2Tuple_u32ScriptZ*)(((uint64_t)b_conv_21) & ~1);
+ void* b_conv_21_ptr = (void*)(((uint64_t)b_conv_21) & ~1);
+ CHECK_ACCESS(b_conv_21_ptr);
+ LDKC2Tuple_u32ScriptZ b_conv_21_conv = *(LDKC2Tuple_u32ScriptZ*)(b_conv_21_ptr);
b_conv_21_conv = C2Tuple_u32ScriptZ_clone((LDKC2Tuple_u32ScriptZ*)(((uint64_t)b_conv_21) & ~1));
b_constr.data[v] = b_conv_21_conv;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ _res_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ _res_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(_res_ptr);
FREE((void*)_res);
C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_free(_res_conv);
}
int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
for (size_t o = 0; o < _res_constr.datalen; o++) {
int64_t _res_conv_40 = _res_vals[o];
- LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ _res_conv_40_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(((uint64_t)_res_conv_40) & ~1);
+ void* _res_conv_40_ptr = (void*)(((uint64_t)_res_conv_40) & ~1);
+ CHECK_ACCESS(_res_conv_40_ptr);
+ LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ _res_conv_40_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(_res_conv_40_ptr);
FREE((void*)_res_conv_40);
_res_constr.data[o] = _res_conv_40_conv;
}
int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
for (size_t h = 0; h < _res_constr.datalen; h++) {
int64_t _res_conv_7 = _res_vals[h];
- LDKEvent _res_conv_7_conv = *(LDKEvent*)(((uint64_t)_res_conv_7) & ~1);
+ void* _res_conv_7_ptr = (void*)(((uint64_t)_res_conv_7) & ~1);
+ CHECK_ACCESS(_res_conv_7_ptr);
+ LDKEvent _res_conv_7_conv = *(LDKEvent*)(_res_conv_7_ptr);
FREE((void*)_res_conv_7);
_res_constr.data[h] = _res_conv_7_conv;
}
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32TxOutZ_1new(JNIEnv *env, jclass clz, int32_t a, int64_t b) {
- LDKTxOut b_conv = *(LDKTxOut*)(((uint64_t)b) & ~1);
+ void* b_ptr = (void*)(((uint64_t)b) & ~1);
+ CHECK_ACCESS(b_ptr);
+ LDKTxOut b_conv = *(LDKTxOut*)(b_ptr);
b_conv = TxOut_clone((LDKTxOut*)(((uint64_t)b) & ~1));
LDKC2Tuple_u32TxOutZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ), "LDKC2Tuple_u32TxOutZ");
*ret_conv = C2Tuple_u32TxOutZ_new(a, b_conv);
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32TxOutZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKC2Tuple_u32TxOutZ _res_conv = *(LDKC2Tuple_u32TxOutZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKC2Tuple_u32TxOutZ _res_conv = *(LDKC2Tuple_u32TxOutZ*)(_res_ptr);
FREE((void*)_res);
C2Tuple_u32TxOutZ_free(_res_conv);
}
int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
for (size_t u = 0; u < _res_constr.datalen; u++) {
int64_t _res_conv_20 = _res_vals[u];
- LDKC2Tuple_u32TxOutZ _res_conv_20_conv = *(LDKC2Tuple_u32TxOutZ*)(((uint64_t)_res_conv_20) & ~1);
+ void* _res_conv_20_ptr = (void*)(((uint64_t)_res_conv_20) & ~1);
+ CHECK_ACCESS(_res_conv_20_ptr);
+ LDKC2Tuple_u32TxOutZ _res_conv_20_conv = *(LDKC2Tuple_u32TxOutZ*)(_res_conv_20_ptr);
FREE((void*)_res_conv_20);
_res_constr.data[u] = _res_conv_20_conv;
}
int64_t* b_vals = (*env)->GetLongArrayElements (env, b, NULL);
for (size_t u = 0; u < b_constr.datalen; u++) {
int64_t b_conv_20 = b_vals[u];
- LDKC2Tuple_u32TxOutZ b_conv_20_conv = *(LDKC2Tuple_u32TxOutZ*)(((uint64_t)b_conv_20) & ~1);
+ void* b_conv_20_ptr = (void*)(((uint64_t)b_conv_20) & ~1);
+ CHECK_ACCESS(b_conv_20_ptr);
+ LDKC2Tuple_u32TxOutZ b_conv_20_conv = *(LDKC2Tuple_u32TxOutZ*)(b_conv_20_ptr);
b_conv_20_conv = C2Tuple_u32TxOutZ_clone((LDKC2Tuple_u32TxOutZ*)(((uint64_t)b_conv_20) & ~1));
b_constr.data[u] = b_conv_20_conv;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ _res_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ _res_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(_res_ptr);
FREE((void*)_res);
C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free(_res_conv);
}
int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
for (size_t n = 0; n < _res_constr.datalen; n++) {
int64_t _res_conv_39 = _res_vals[n];
- LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ _res_conv_39_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(((uint64_t)_res_conv_39) & ~1);
+ void* _res_conv_39_ptr = (void*)(((uint64_t)_res_conv_39) & ~1);
+ CHECK_ACCESS(_res_conv_39_ptr);
+ LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ _res_conv_39_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(_res_conv_39_ptr);
FREE((void*)_res_conv_39);
_res_constr.data[n] = _res_conv_39_conv;
}
int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
for (size_t j = 0; j < _res_constr.datalen; j++) {
int64_t _res_conv_9 = _res_vals[j];
- LDKBalance _res_conv_9_conv = *(LDKBalance*)(((uint64_t)_res_conv_9) & ~1);
+ void* _res_conv_9_ptr = (void*)(((uint64_t)_res_conv_9) & ~1);
+ CHECK_ACCESS(_res_conv_9_ptr);
+ LDKBalance _res_conv_9_conv = *(LDKBalance*)(_res_conv_9_ptr);
FREE((void*)_res_conv_9);
_res_constr.data[j] = _res_conv_9_conv;
}
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
- LDKC2Tuple_BlockHashChannelMonitorZ o_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(((uint64_t)o) & ~1);
+ void* o_ptr = (void*)(((uint64_t)o) & ~1);
+ CHECK_ACCESS(o_ptr);
+ LDKC2Tuple_BlockHashChannelMonitorZ o_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(o_ptr);
o_conv = C2Tuple_BlockHashChannelMonitorZ_clone((LDKC2Tuple_BlockHashChannelMonitorZ*)(((uint64_t)o) & ~1));
LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ");
*ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(o_conv);
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ _res_conv = *(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ _res_conv = *(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_NoneLightningErrorZ _res_conv = *(LDKCResult_NoneLightningErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_NoneLightningErrorZ _res_conv = *(LDKCResult_NoneLightningErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_NoneLightningErrorZ_free(_res_conv);
}
LDKPublicKey a_ref;
CHECK((*env)->GetArrayLength(env, a) == 33);
(*env)->GetByteArrayRegion(env, a, 0, 33, a_ref.compressed_form);
- LDKType b_conv = *(LDKType*)(((uint64_t)b) & ~1);
+ void* b_ptr = (void*)(((uint64_t)b) & ~1);
+ CHECK_ACCESS(b_ptr);
+ LDKType b_conv = *(LDKType*)(b_ptr);
if (b_conv.free == LDKType_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKType_JCalls_cloned(&b_conv);
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyTypeZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKC2Tuple_PublicKeyTypeZ _res_conv = *(LDKC2Tuple_PublicKeyTypeZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKC2Tuple_PublicKeyTypeZ _res_conv = *(LDKC2Tuple_PublicKeyTypeZ*)(_res_ptr);
FREE((void*)_res);
C2Tuple_PublicKeyTypeZ_free(_res_conv);
}
int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
for (size_t z = 0; z < _res_constr.datalen; z++) {
int64_t _res_conv_25 = _res_vals[z];
- LDKC2Tuple_PublicKeyTypeZ _res_conv_25_conv = *(LDKC2Tuple_PublicKeyTypeZ*)(((uint64_t)_res_conv_25) & ~1);
+ void* _res_conv_25_ptr = (void*)(((uint64_t)_res_conv_25) & ~1);
+ CHECK_ACCESS(_res_conv_25_ptr);
+ LDKC2Tuple_PublicKeyTypeZ _res_conv_25_conv = *(LDKC2Tuple_PublicKeyTypeZ*)(_res_conv_25_ptr);
FREE((void*)_res_conv_25);
_res_constr.data[z] = _res_conv_25_conv;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_boolLightningErrorZ _res_conv = *(LDKCResult_boolLightningErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_boolLightningErrorZ _res_conv = *(LDKCResult_boolLightningErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_boolLightningErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(_res_ptr);
FREE((void*)_res);
C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(_res_conv);
}
int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
for (size_t h = 0; h < _res_constr.datalen; h++) {
int64_t _res_conv_59 = _res_vals[h];
- LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res_conv_59_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(((uint64_t)_res_conv_59) & ~1);
+ void* _res_conv_59_ptr = (void*)(((uint64_t)_res_conv_59) & ~1);
+ CHECK_ACCESS(_res_conv_59_ptr);
+ LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res_conv_59_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(_res_conv_59_ptr);
FREE((void*)_res_conv_59);
_res_constr.data[h] = _res_conv_59_conv;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_CVec_u8ZPeerHandleErrorZ _res_conv = *(LDKCResult_CVec_u8ZPeerHandleErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_CVec_u8ZPeerHandleErrorZ _res_conv = *(LDKCResult_CVec_u8ZPeerHandleErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_CVec_u8ZPeerHandleErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_NonePeerHandleErrorZ _res_conv = *(LDKCResult_NonePeerHandleErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_NonePeerHandleErrorZ _res_conv = *(LDKCResult_NonePeerHandleErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_NonePeerHandleErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_boolPeerHandleErrorZ _res_conv = *(LDKCResult_boolPeerHandleErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_boolPeerHandleErrorZ _res_conv = *(LDKCResult_boolPeerHandleErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_boolPeerHandleErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_NodeIdDecodeErrorZ _res_conv = *(LDKCResult_NodeIdDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_NodeIdDecodeErrorZ _res_conv = *(LDKCResult_NodeIdDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_NodeIdDecodeErrorZ_free(_res_conv);
}
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1AccessZ_1some(JNIEnv *env, jclass clz, int64_t o) {
- LDKAccess o_conv = *(LDKAccess*)(((uint64_t)o) & ~1);
+ void* o_ptr = (void*)(((uint64_t)o) & ~1);
+ CHECK_ACCESS(o_ptr);
+ LDKAccess o_conv = *(LDKAccess*)(o_ptr);
if (o_conv.free == LDKAccess_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKAccess_JCalls_cloned(&o_conv);
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1AccessZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCOption_AccessZ _res_conv = *(LDKCOption_AccessZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCOption_AccessZ _res_conv = *(LDKCOption_AccessZ*)(_res_ptr);
FREE((void*)_res);
COption_AccessZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1DirectionalChannelInfoDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_DirectionalChannelInfoDecodeErrorZ _res_conv = *(LDKCResult_DirectionalChannelInfoDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_DirectionalChannelInfoDecodeErrorZ _res_conv = *(LDKCResult_DirectionalChannelInfoDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_DirectionalChannelInfoDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_ChannelInfoDecodeErrorZ _res_conv = *(LDKCResult_ChannelInfoDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_ChannelInfoDecodeErrorZ _res_conv = *(LDKCResult_ChannelInfoDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_ChannelInfoDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_RoutingFeesDecodeErrorZ _res_conv = *(LDKCResult_RoutingFeesDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_RoutingFeesDecodeErrorZ _res_conv = *(LDKCResult_RoutingFeesDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_RoutingFeesDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_NodeAnnouncementInfoDecodeErrorZ _res_conv = *(LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_NodeAnnouncementInfoDecodeErrorZ _res_conv = *(LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_NodeAnnouncementInfoDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_NodeInfoDecodeErrorZ _res_conv = *(LDKCResult_NodeInfoDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_NodeInfoDecodeErrorZ _res_conv = *(LDKCResult_NodeInfoDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_NodeInfoDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_NetworkGraphDecodeErrorZ _res_conv = *(LDKCResult_NetworkGraphDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_NetworkGraphDecodeErrorZ _res_conv = *(LDKCResult_NetworkGraphDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_NetworkGraphDecodeErrorZ_free(_res_conv);
}
int64_t* o_vals = (*env)->GetLongArrayElements (env, o, NULL);
for (size_t m = 0; m < o_constr.datalen; m++) {
int64_t o_conv_12 = o_vals[m];
- LDKNetAddress o_conv_12_conv = *(LDKNetAddress*)(((uint64_t)o_conv_12) & ~1);
+ void* o_conv_12_ptr = (void*)(((uint64_t)o_conv_12) & ~1);
+ CHECK_ACCESS(o_conv_12_ptr);
+ LDKNetAddress o_conv_12_conv = *(LDKNetAddress*)(o_conv_12_ptr);
o_conv_12_conv = NetAddress_clone((LDKNetAddress*)(((uint64_t)o_conv_12) & ~1));
o_constr.data[m] = o_conv_12_conv;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1CVec_1NetAddressZZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCOption_CVec_NetAddressZZ _res_conv = *(LDKCOption_CVec_NetAddressZZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCOption_CVec_NetAddressZZ _res_conv = *(LDKCOption_CVec_NetAddressZZ*)(_res_ptr);
FREE((void*)_res);
COption_CVec_NetAddressZZ_free(_res_conv);
}
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressu8Z_1ok(JNIEnv *env, jclass clz, int64_t o) {
- LDKNetAddress o_conv = *(LDKNetAddress*)(((uint64_t)o) & ~1);
+ void* o_ptr = (void*)(((uint64_t)o) & ~1);
+ CHECK_ACCESS(o_ptr);
+ LDKNetAddress o_conv = *(LDKNetAddress*)(o_ptr);
o_conv = NetAddress_clone((LDKNetAddress*)(((uint64_t)o) & ~1));
LDKCResult_NetAddressu8Z* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressu8Z), "LDKCResult_NetAddressu8Z");
*ret_conv = CResult_NetAddressu8Z_ok(o_conv);
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressu8Z_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_NetAddressu8Z _res_conv = *(LDKCResult_NetAddressu8Z*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_NetAddressu8Z _res_conv = *(LDKCResult_NetAddressu8Z*)(_res_ptr);
FREE((void*)_res);
CResult_NetAddressu8Z_free(_res_conv);
}
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CResult_1NetAddressu8ZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
- LDKCResult_NetAddressu8Z o_conv = *(LDKCResult_NetAddressu8Z*)(((uint64_t)o) & ~1);
+ void* o_ptr = (void*)(((uint64_t)o) & ~1);
+ CHECK_ACCESS(o_ptr);
+ LDKCResult_NetAddressu8Z o_conv = *(LDKCResult_NetAddressu8Z*)(o_ptr);
o_conv = CResult_NetAddressu8Z_clone((LDKCResult_NetAddressu8Z*)(((uint64_t)o) & ~1));
LDKCResult_CResult_NetAddressu8ZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CResult_NetAddressu8ZDecodeErrorZ), "LDKCResult_CResult_NetAddressu8ZDecodeErrorZ");
*ret_conv = CResult_CResult_NetAddressu8ZDecodeErrorZ_ok(o_conv);
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CResult_1NetAddressu8ZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_CResult_NetAddressu8ZDecodeErrorZ _res_conv = *(LDKCResult_CResult_NetAddressu8ZDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_CResult_NetAddressu8ZDecodeErrorZ _res_conv = *(LDKCResult_CResult_NetAddressu8ZDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_CResult_NetAddressu8ZDecodeErrorZ_free(_res_conv);
}
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
- LDKNetAddress o_conv = *(LDKNetAddress*)(((uint64_t)o) & ~1);
+ void* o_ptr = (void*)(((uint64_t)o) & ~1);
+ CHECK_ACCESS(o_ptr);
+ LDKNetAddress o_conv = *(LDKNetAddress*)(o_ptr);
o_conv = NetAddress_clone((LDKNetAddress*)(((uint64_t)o) & ~1));
LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ");
*ret_conv = CResult_NetAddressDecodeErrorZ_ok(o_conv);
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_NetAddressDecodeErrorZ _res_conv = *(LDKCResult_NetAddressDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_NetAddressDecodeErrorZ _res_conv = *(LDKCResult_NetAddressDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_NetAddressDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1AcceptChannelDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_AcceptChannelDecodeErrorZ _res_conv = *(LDKCResult_AcceptChannelDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_AcceptChannelDecodeErrorZ _res_conv = *(LDKCResult_AcceptChannelDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_AcceptChannelDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1AnnouncementSignaturesDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_AnnouncementSignaturesDecodeErrorZ _res_conv = *(LDKCResult_AnnouncementSignaturesDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_AnnouncementSignaturesDecodeErrorZ _res_conv = *(LDKCResult_AnnouncementSignaturesDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_AnnouncementSignaturesDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReestablishDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_ChannelReestablishDecodeErrorZ _res_conv = *(LDKCResult_ChannelReestablishDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_ChannelReestablishDecodeErrorZ _res_conv = *(LDKCResult_ChannelReestablishDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_ChannelReestablishDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_ClosingSignedDecodeErrorZ _res_conv = *(LDKCResult_ClosingSignedDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_ClosingSignedDecodeErrorZ _res_conv = *(LDKCResult_ClosingSignedDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_ClosingSignedDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedFeeRangeDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_ClosingSignedFeeRangeDecodeErrorZ _res_conv = *(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_ClosingSignedFeeRangeDecodeErrorZ _res_conv = *(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_ClosingSignedFeeRangeDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_CommitmentSignedDecodeErrorZ _res_conv = *(LDKCResult_CommitmentSignedDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_CommitmentSignedDecodeErrorZ _res_conv = *(LDKCResult_CommitmentSignedDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_CommitmentSignedDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1FundingCreatedDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_FundingCreatedDecodeErrorZ _res_conv = *(LDKCResult_FundingCreatedDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_FundingCreatedDecodeErrorZ _res_conv = *(LDKCResult_FundingCreatedDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_FundingCreatedDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1FundingSignedDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_FundingSignedDecodeErrorZ _res_conv = *(LDKCResult_FundingSignedDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_FundingSignedDecodeErrorZ _res_conv = *(LDKCResult_FundingSignedDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_FundingSignedDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1FundingLockedDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_FundingLockedDecodeErrorZ _res_conv = *(LDKCResult_FundingLockedDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_FundingLockedDecodeErrorZ _res_conv = *(LDKCResult_FundingLockedDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_FundingLockedDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InitDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_InitDecodeErrorZ _res_conv = *(LDKCResult_InitDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_InitDecodeErrorZ _res_conv = *(LDKCResult_InitDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_InitDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1OpenChannelDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_OpenChannelDecodeErrorZ _res_conv = *(LDKCResult_OpenChannelDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_OpenChannelDecodeErrorZ _res_conv = *(LDKCResult_OpenChannelDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_OpenChannelDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RevokeAndACKDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_RevokeAndACKDecodeErrorZ _res_conv = *(LDKCResult_RevokeAndACKDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_RevokeAndACKDecodeErrorZ _res_conv = *(LDKCResult_RevokeAndACKDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_RevokeAndACKDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_ShutdownDecodeErrorZ _res_conv = *(LDKCResult_ShutdownDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_ShutdownDecodeErrorZ _res_conv = *(LDKCResult_ShutdownDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_ShutdownDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailHTLCDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_UpdateFailHTLCDecodeErrorZ _res_conv = *(LDKCResult_UpdateFailHTLCDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_UpdateFailHTLCDecodeErrorZ _res_conv = *(LDKCResult_UpdateFailHTLCDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_UpdateFailHTLCDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailMalformedHTLCDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ _res_conv = *(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ _res_conv = *(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFeeDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_UpdateFeeDecodeErrorZ _res_conv = *(LDKCResult_UpdateFeeDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_UpdateFeeDecodeErrorZ _res_conv = *(LDKCResult_UpdateFeeDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_UpdateFeeDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFulfillHTLCDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_UpdateFulfillHTLCDecodeErrorZ _res_conv = *(LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_UpdateFulfillHTLCDecodeErrorZ _res_conv = *(LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_UpdateFulfillHTLCDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateAddHTLCDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_UpdateAddHTLCDecodeErrorZ _res_conv = *(LDKCResult_UpdateAddHTLCDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_UpdateAddHTLCDecodeErrorZ _res_conv = *(LDKCResult_UpdateAddHTLCDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_UpdateAddHTLCDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PingDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_PingDecodeErrorZ _res_conv = *(LDKCResult_PingDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_PingDecodeErrorZ _res_conv = *(LDKCResult_PingDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_PingDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PongDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_PongDecodeErrorZ _res_conv = *(LDKCResult_PongDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_PongDecodeErrorZ _res_conv = *(LDKCResult_PongDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_PongDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelAnnouncementDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ _res_conv = *(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ _res_conv = *(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelAnnouncementDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_ChannelAnnouncementDecodeErrorZ _res_conv = *(LDKCResult_ChannelAnnouncementDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_ChannelAnnouncementDecodeErrorZ _res_conv = *(LDKCResult_ChannelAnnouncementDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_ChannelAnnouncementDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelUpdateDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_UnsignedChannelUpdateDecodeErrorZ _res_conv = *(LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_UnsignedChannelUpdateDecodeErrorZ _res_conv = *(LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_UnsignedChannelUpdateDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_ChannelUpdateDecodeErrorZ _res_conv = *(LDKCResult_ChannelUpdateDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_ChannelUpdateDecodeErrorZ _res_conv = *(LDKCResult_ChannelUpdateDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_ChannelUpdateDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ErrorMessageDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_ErrorMessageDecodeErrorZ _res_conv = *(LDKCResult_ErrorMessageDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_ErrorMessageDecodeErrorZ _res_conv = *(LDKCResult_ErrorMessageDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_ErrorMessageDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedNodeAnnouncementDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ _res_conv = *(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ _res_conv = *(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_NodeAnnouncementDecodeErrorZ _res_conv = *(LDKCResult_NodeAnnouncementDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_NodeAnnouncementDecodeErrorZ _res_conv = *(LDKCResult_NodeAnnouncementDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_NodeAnnouncementDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1QueryShortChannelIdsDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_QueryShortChannelIdsDecodeErrorZ _res_conv = *(LDKCResult_QueryShortChannelIdsDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_QueryShortChannelIdsDecodeErrorZ _res_conv = *(LDKCResult_QueryShortChannelIdsDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_QueryShortChannelIdsDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyShortChannelIdsEndDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ _res_conv = *(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ _res_conv = *(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1QueryChannelRangeDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_QueryChannelRangeDecodeErrorZ _res_conv = *(LDKCResult_QueryChannelRangeDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_QueryChannelRangeDecodeErrorZ _res_conv = *(LDKCResult_QueryChannelRangeDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_QueryChannelRangeDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyChannelRangeDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_ReplyChannelRangeDecodeErrorZ _res_conv = *(LDKCResult_ReplyChannelRangeDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_ReplyChannelRangeDecodeErrorZ _res_conv = *(LDKCResult_ReplyChannelRangeDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_ReplyChannelRangeDecodeErrorZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1GossipTimestampFilterDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_GossipTimestampFilterDecodeErrorZ _res_conv = *(LDKCResult_GossipTimestampFilterDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_GossipTimestampFilterDecodeErrorZ _res_conv = *(LDKCResult_GossipTimestampFilterDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_GossipTimestampFilterDecodeErrorZ_free(_res_conv);
}
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSignOrCreationErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKSignOrCreationError e_conv = *(LDKSignOrCreationError*)(((uint64_t)e) & ~1);
+ void* e_ptr = (void*)(((uint64_t)e) & ~1);
+ CHECK_ACCESS(e_ptr);
+ LDKSignOrCreationError e_conv = *(LDKSignOrCreationError*)(e_ptr);
e_conv = SignOrCreationError_clone((LDKSignOrCreationError*)(((uint64_t)e) & ~1));
LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
*ret_conv = CResult_InvoiceSignOrCreationErrorZ_err(e_conv);
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSignOrCreationErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_InvoiceSignOrCreationErrorZ _res_conv = *(LDKCResult_InvoiceSignOrCreationErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_InvoiceSignOrCreationErrorZ _res_conv = *(LDKCResult_InvoiceSignOrCreationErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_InvoiceSignOrCreationErrorZ_free(_res_conv);
}
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1FilterZ_1some(JNIEnv *env, jclass clz, int64_t o) {
- LDKFilter o_conv = *(LDKFilter*)(((uint64_t)o) & ~1);
+ void* o_ptr = (void*)(((uint64_t)o) & ~1);
+ CHECK_ACCESS(o_ptr);
+ LDKFilter o_conv = *(LDKFilter*)(o_ptr);
if (o_conv.free == LDKFilter_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKFilter_JCalls_cloned(&o_conv);
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1FilterZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCOption_FilterZ _res_conv = *(LDKCOption_FilterZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCOption_FilterZ _res_conv = *(LDKCOption_FilterZ*)(_res_ptr);
FREE((void*)_res);
COption_FilterZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1LockedChannelMonitorNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_LockedChannelMonitorNoneZ _res_conv = *(LDKCResult_LockedChannelMonitorNoneZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_LockedChannelMonitorNoneZ _res_conv = *(LDKCResult_LockedChannelMonitorNoneZ*)(_res_ptr);
FREE((void*)_res);
CResult_LockedChannelMonitorNoneZ_free(_res_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKPaymentPurpose this_ptr_conv = *(LDKPaymentPurpose*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKPaymentPurpose this_ptr_conv = *(LDKPaymentPurpose*)(this_ptr_ptr);
FREE((void*)this_ptr);
PaymentPurpose_free(this_ptr_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosureReason_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKClosureReason this_ptr_conv = *(LDKClosureReason*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKClosureReason this_ptr_conv = *(LDKClosureReason*)(this_ptr_ptr);
FREE((void*)this_ptr);
ClosureReason_free(this_ptr_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Event_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKEvent this_ptr_conv = *(LDKEvent*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKEvent this_ptr_conv = *(LDKEvent*)(this_ptr_ptr);
FREE((void*)this_ptr);
Event_free(this_ptr_conv);
}
LDKThirtyTwoBytes payment_hash_ref;
CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
(*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
- LDKPaymentPurpose purpose_conv = *(LDKPaymentPurpose*)(((uint64_t)purpose) & ~1);
+ void* purpose_ptr = (void*)(((uint64_t)purpose) & ~1);
+ CHECK_ACCESS(purpose_ptr);
+ LDKPaymentPurpose purpose_conv = *(LDKPaymentPurpose*)(purpose_ptr);
purpose_conv = PaymentPurpose_clone((LDKPaymentPurpose*)(((uint64_t)purpose) & ~1));
LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
*ret_copy = Event_payment_received(payment_hash_ref, amt, purpose_conv);
LDKThirtyTwoBytes payment_hash_ref;
CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
(*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
- LDKCOption_NetworkUpdateZ network_update_conv = *(LDKCOption_NetworkUpdateZ*)(((uint64_t)network_update) & ~1);
+ void* network_update_ptr = (void*)(((uint64_t)network_update) & ~1);
+ CHECK_ACCESS(network_update_ptr);
+ LDKCOption_NetworkUpdateZ network_update_conv = *(LDKCOption_NetworkUpdateZ*)(network_update_ptr);
network_update_conv = COption_NetworkUpdateZ_clone((LDKCOption_NetworkUpdateZ*)(((uint64_t)network_update) & ~1));
LDKCVec_RouteHopZ path_constr;
path_constr.datalen = (*env)->GetArrayLength(env, path);
path_constr.data[k] = path_conv_10_conv;
}
(*env)->ReleaseLongArrayElements(env, path, path_vals, 0);
- LDKCOption_u64Z short_channel_id_conv = *(LDKCOption_u64Z*)(((uint64_t)short_channel_id) & ~1);
+ void* short_channel_id_ptr = (void*)(((uint64_t)short_channel_id) & ~1);
+ CHECK_ACCESS(short_channel_id_ptr);
+ LDKCOption_u64Z short_channel_id_conv = *(LDKCOption_u64Z*)(short_channel_id_ptr);
short_channel_id_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)short_channel_id) & ~1));
LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
*ret_copy = Event_payment_path_failed(payment_hash_ref, rejected_by_dest, network_update_conv, all_paths_failed, path_constr, short_channel_id_conv);
int64_t* outputs_vals = (*env)->GetLongArrayElements (env, outputs, NULL);
for (size_t b = 0; b < outputs_constr.datalen; b++) {
int64_t outputs_conv_27 = outputs_vals[b];
- LDKSpendableOutputDescriptor outputs_conv_27_conv = *(LDKSpendableOutputDescriptor*)(((uint64_t)outputs_conv_27) & ~1);
+ void* outputs_conv_27_ptr = (void*)(((uint64_t)outputs_conv_27) & ~1);
+ CHECK_ACCESS(outputs_conv_27_ptr);
+ LDKSpendableOutputDescriptor outputs_conv_27_conv = *(LDKSpendableOutputDescriptor*)(outputs_conv_27_ptr);
outputs_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)(((uint64_t)outputs_conv_27) & ~1));
outputs_constr.data[b] = outputs_conv_27_conv;
}
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1forwarded(JNIEnv *env, jclass clz, int64_t fee_earned_msat, jboolean claim_from_onchain_tx) {
- LDKCOption_u64Z fee_earned_msat_conv = *(LDKCOption_u64Z*)(((uint64_t)fee_earned_msat) & ~1);
+ void* fee_earned_msat_ptr = (void*)(((uint64_t)fee_earned_msat) & ~1);
+ CHECK_ACCESS(fee_earned_msat_ptr);
+ LDKCOption_u64Z fee_earned_msat_conv = *(LDKCOption_u64Z*)(fee_earned_msat_ptr);
fee_earned_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)fee_earned_msat) & ~1));
LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
*ret_copy = Event_payment_forwarded(fee_earned_msat_conv, claim_from_onchain_tx);
LDKThirtyTwoBytes channel_id_ref;
CHECK((*env)->GetArrayLength(env, channel_id) == 32);
(*env)->GetByteArrayRegion(env, channel_id, 0, 32, channel_id_ref.data);
- LDKClosureReason reason_conv = *(LDKClosureReason*)(((uint64_t)reason) & ~1);
+ void* reason_ptr = (void*)(((uint64_t)reason) & ~1);
+ CHECK_ACCESS(reason_ptr);
+ LDKClosureReason reason_conv = *(LDKClosureReason*)(reason_ptr);
reason_conv = ClosureReason_clone((LDKClosureReason*)(((uint64_t)reason) & ~1));
LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
*ret_copy = Event_channel_closed(channel_id_ref, user_channel_id, reason_conv);
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKMessageSendEvent this_ptr_conv = *(LDKMessageSendEvent*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKMessageSendEvent this_ptr_conv = *(LDKMessageSendEvent*)(this_ptr_ptr);
FREE((void*)this_ptr);
MessageSendEvent_free(this_ptr_conv);
}
LDKPublicKey node_id_ref;
CHECK((*env)->GetArrayLength(env, node_id) == 33);
(*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
- LDKErrorAction action_conv = *(LDKErrorAction*)(((uint64_t)action) & ~1);
+ void* action_ptr = (void*)(((uint64_t)action) & ~1);
+ CHECK_ACCESS(action_ptr);
+ LDKErrorAction action_conv = *(LDKErrorAction*)(action_ptr);
action_conv = ErrorAction_clone((LDKErrorAction*)(((uint64_t)action) & ~1));
LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
*ret_copy = MessageSendEvent_handle_error(node_id_ref, action_conv);
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageSendEventsProvider_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKMessageSendEventsProvider this_ptr_conv = *(LDKMessageSendEventsProvider*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKMessageSendEventsProvider this_ptr_conv = *(LDKMessageSendEventsProvider*)(this_ptr_ptr);
FREE((void*)this_ptr);
MessageSendEventsProvider_free(this_ptr_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EventsProvider_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKEventsProvider this_ptr_conv = *(LDKEventsProvider*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKEventsProvider this_ptr_conv = *(LDKEventsProvider*)(this_ptr_ptr);
FREE((void*)this_ptr);
EventsProvider_free(this_ptr_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EventHandler_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKEventHandler this_ptr_conv = *(LDKEventHandler*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKEventHandler this_ptr_conv = *(LDKEventHandler*)(this_ptr_ptr);
FREE((void*)this_ptr);
EventHandler_free(this_ptr_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_APIError_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKAPIError this_ptr_conv = *(LDKAPIError*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKAPIError this_ptr_conv = *(LDKAPIError*)(this_ptr_ptr);
FREE((void*)this_ptr);
APIError_free(this_ptr_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Logger_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKLogger this_ptr_conv = *(LDKLogger*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKLogger this_ptr_conv = *(LDKLogger*)(this_ptr_ptr);
FREE((void*)this_ptr);
Logger_free(this_ptr_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Access_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKAccess this_ptr_conv = *(LDKAccess*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKAccess this_ptr_conv = *(LDKAccess*)(this_ptr_ptr);
FREE((void*)this_ptr);
Access_free(this_ptr_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Listen_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKListen this_ptr_conv = *(LDKListen*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKListen this_ptr_conv = *(LDKListen*)(this_ptr_ptr);
FREE((void*)this_ptr);
Listen_free(this_ptr_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Confirm_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKConfirm this_ptr_conv = *(LDKConfirm*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKConfirm this_ptr_conv = *(LDKConfirm*)(this_ptr_ptr);
FREE((void*)this_ptr);
Confirm_free(this_ptr_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Watch_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKWatch this_ptr_conv = *(LDKWatch*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKWatch this_ptr_conv = *(LDKWatch*)(this_ptr_ptr);
FREE((void*)this_ptr);
Watch_free(this_ptr_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Filter_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKFilter this_ptr_conv = *(LDKFilter*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKFilter this_ptr_conv = *(LDKFilter*)(this_ptr_ptr);
FREE((void*)this_ptr);
Filter_free(this_ptr_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BroadcasterInterface_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKBroadcasterInterface this_ptr_conv = *(LDKBroadcasterInterface*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKBroadcasterInterface this_ptr_conv = *(LDKBroadcasterInterface*)(this_ptr_ptr);
FREE((void*)this_ptr);
BroadcasterInterface_free(this_ptr_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FeeEstimator_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKFeeEstimator this_ptr_conv = *(LDKFeeEstimator*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKFeeEstimator this_ptr_conv = *(LDKFeeEstimator*)(this_ptr_ptr);
FREE((void*)this_ptr);
FeeEstimator_free(this_ptr_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Persist_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKPersist this_ptr_conv = *(LDKPersist*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKPersist this_ptr_conv = *(LDKPersist*)(this_ptr_ptr);
FREE((void*)this_ptr);
Persist_free(this_ptr_conv);
}
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1new(JNIEnv *env, jclass clz, int64_t chain_source, int64_t broadcaster, int64_t logger, int64_t feeest, int64_t persister) {
- LDKCOption_FilterZ chain_source_conv = *(LDKCOption_FilterZ*)(((uint64_t)chain_source) & ~1);
+ void* chain_source_ptr = (void*)(((uint64_t)chain_source) & ~1);
+ CHECK_ACCESS(chain_source_ptr);
+ LDKCOption_FilterZ chain_source_conv = *(LDKCOption_FilterZ*)(chain_source_ptr);
// Warning: we may need a move here but no clone is available for LDKCOption_FilterZ
if (chain_source_conv.tag == LDKCOption_FilterZ_Some) {
// Manually implement clone for Java trait instances
LDKFilter_JCalls_cloned(&chain_source_conv.some);
}
}
- LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(((uint64_t)broadcaster) & ~1);
+ void* broadcaster_ptr = (void*)(((uint64_t)broadcaster) & ~1);
+ CHECK_ACCESS(broadcaster_ptr);
+ LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr);
if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv);
}
- LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1);
+ void* logger_ptr = (void*)(((uint64_t)logger) & ~1);
+ CHECK_ACCESS(logger_ptr);
+ LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
if (logger_conv.free == LDKLogger_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKLogger_JCalls_cloned(&logger_conv);
}
- LDKFeeEstimator feeest_conv = *(LDKFeeEstimator*)(((uint64_t)feeest) & ~1);
+ void* feeest_ptr = (void*)(((uint64_t)feeest) & ~1);
+ CHECK_ACCESS(feeest_ptr);
+ LDKFeeEstimator feeest_conv = *(LDKFeeEstimator*)(feeest_ptr);
if (feeest_conv.free == LDKFeeEstimator_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKFeeEstimator_JCalls_cloned(&feeest_conv);
}
- LDKPersist persister_conv = *(LDKPersist*)(((uint64_t)persister) & ~1);
+ void* persister_ptr = (void*)(((uint64_t)persister) & ~1);
+ CHECK_ACCESS(persister_ptr);
+ LDKPersist persister_conv = *(LDKPersist*)(persister_ptr);
if (persister_conv.free == LDKPersist_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKPersist_JCalls_cloned(&persister_conv);
int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
for (size_t j = 0; j < ret_var.datalen; j++) {
LDKBalance *ret_conv_9_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
- *ret_conv_9_copy = Balance_clone(&ret_var.data[j]);
+ *ret_conv_9_copy = ret_var.data[j];
uint64_t ret_conv_9_ref = (uint64_t)ret_conv_9_copy;
ret_arr_ptr[j] = ret_conv_9_ref;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKMonitorEvent this_ptr_conv = *(LDKMonitorEvent*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKMonitorEvent this_ptr_conv = *(LDKMonitorEvent*)(this_ptr_ptr);
FREE((void*)this_ptr);
MonitorEvent_free(this_ptr_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Balance_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKBalance this_ptr_conv = *(LDKBalance*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKBalance this_ptr_conv = *(LDKBalance*)(this_ptr_ptr);
FREE((void*)this_ptr);
Balance_free(this_ptr_conv);
}
LDKChannelMonitorUpdate updates_conv;
updates_conv.inner = (void*)(updates & (~1));
updates_conv.is_owned = false;
- LDKBroadcasterInterface* broadcaster_conv = (LDKBroadcasterInterface*)(((uint64_t)broadcaster) & ~1);
- LDKFeeEstimator* fee_estimator_conv = (LDKFeeEstimator*)(((uint64_t)fee_estimator) & ~1);
- LDKLogger* logger_conv = (LDKLogger*)(((uint64_t)logger) & ~1);
+ void* broadcaster_ptr = (void*)(((uint64_t)broadcaster) & ~1);
+ if (!(broadcaster & 1)) { CHECK_ACCESS(broadcaster_ptr); }
+ LDKBroadcasterInterface* broadcaster_conv = (LDKBroadcasterInterface*)broadcaster_ptr;
+ void* fee_estimator_ptr = (void*)(((uint64_t)fee_estimator) & ~1);
+ if (!(fee_estimator & 1)) { CHECK_ACCESS(fee_estimator_ptr); }
+ LDKFeeEstimator* fee_estimator_conv = (LDKFeeEstimator*)fee_estimator_ptr;
+ void* logger_ptr = (void*)(((uint64_t)logger) & ~1);
+ if (!(logger & 1)) { CHECK_ACCESS(logger_ptr); }
+ LDKLogger* logger_conv = (LDKLogger*)logger_ptr;
LDKCResult_NoneMonitorUpdateErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneMonitorUpdateErrorZ), "LDKCResult_NoneMonitorUpdateErrorZ");
*ret_conv = ChannelMonitor_update_monitor(&this_arg_conv, &updates_conv, broadcaster_conv, fee_estimator_conv, logger_conv);
return (uint64_t)ret_conv;
LDKChannelMonitor this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKFilter* filter_conv = (LDKFilter*)(((uint64_t)filter) & ~1);
+ void* filter_ptr = (void*)(((uint64_t)filter) & ~1);
+ if (!(filter & 1)) { CHECK_ACCESS(filter_ptr); }
+ LDKFilter* filter_conv = (LDKFilter*)filter_ptr;
ChannelMonitor_load_outputs_to_watch(&this_arg_conv, filter_conv);
}
int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
for (size_t o = 0; o < ret_var.datalen; o++) {
LDKMonitorEvent *ret_conv_14_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
- *ret_conv_14_copy = MonitorEvent_clone(&ret_var.data[o]);
+ *ret_conv_14_copy = ret_var.data[o];
uint64_t ret_conv_14_ref = (uint64_t)ret_conv_14_copy;
ret_arr_ptr[o] = ret_conv_14_ref;
}
int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
for (size_t h = 0; h < ret_var.datalen; h++) {
LDKEvent *ret_conv_7_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
- *ret_conv_7_copy = Event_clone(&ret_var.data[h]);
+ *ret_conv_7_copy = ret_var.data[h];
uint64_t ret_conv_7_ref = (uint64_t)ret_conv_7_copy;
ret_arr_ptr[h] = ret_conv_7_ref;
}
LDKChannelMonitor this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKLogger* logger_conv = (LDKLogger*)(((uint64_t)logger) & ~1);
+ void* logger_ptr = (void*)(((uint64_t)logger) & ~1);
+ if (!(logger & 1)) { CHECK_ACCESS(logger_ptr); }
+ LDKLogger* logger_conv = (LDKLogger*)logger_ptr;
LDKCVec_TransactionZ ret_var = ChannelMonitor_get_latest_holder_commitment_txn(&this_arg_conv, logger_conv);
jobjectArray ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL);
;
int64_t* txdata_vals = (*env)->GetLongArrayElements (env, txdata, NULL);
for (size_t c = 0; c < txdata_constr.datalen; c++) {
int64_t txdata_conv_28 = txdata_vals[c];
- LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(((uint64_t)txdata_conv_28) & ~1);
+ void* txdata_conv_28_ptr = (void*)(((uint64_t)txdata_conv_28) & ~1);
+ CHECK_ACCESS(txdata_conv_28_ptr);
+ LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(txdata_conv_28_ptr);
txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)(((uint64_t)txdata_conv_28) & ~1));
txdata_constr.data[c] = txdata_conv_28_conv;
}
(*env)->ReleaseLongArrayElements(env, txdata, txdata_vals, 0);
- LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(((uint64_t)broadcaster) & ~1);
+ void* broadcaster_ptr = (void*)(((uint64_t)broadcaster) & ~1);
+ CHECK_ACCESS(broadcaster_ptr);
+ LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr);
if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv);
}
- LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(((uint64_t)fee_estimator) & ~1);
+ void* fee_estimator_ptr = (void*)(((uint64_t)fee_estimator) & ~1);
+ CHECK_ACCESS(fee_estimator_ptr);
+ LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr);
if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv);
}
- LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1);
+ void* logger_ptr = (void*)(((uint64_t)logger) & ~1);
+ CHECK_ACCESS(logger_ptr);
+ LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
if (logger_conv.free == LDKLogger_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKLogger_JCalls_cloned(&logger_conv);
CHECK((*env)->GetArrayLength(env, header) == 80);
(*env)->GetByteArrayRegion(env, header, 0, 80, header_arr);
unsigned char (*header_ref)[80] = &header_arr;
- LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(((uint64_t)broadcaster) & ~1);
+ void* broadcaster_ptr = (void*)(((uint64_t)broadcaster) & ~1);
+ CHECK_ACCESS(broadcaster_ptr);
+ LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr);
if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv);
}
- LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(((uint64_t)fee_estimator) & ~1);
+ void* fee_estimator_ptr = (void*)(((uint64_t)fee_estimator) & ~1);
+ CHECK_ACCESS(fee_estimator_ptr);
+ LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr);
if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv);
}
- LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1);
+ void* logger_ptr = (void*)(((uint64_t)logger) & ~1);
+ CHECK_ACCESS(logger_ptr);
+ LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
if (logger_conv.free == LDKLogger_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKLogger_JCalls_cloned(&logger_conv);
int64_t* txdata_vals = (*env)->GetLongArrayElements (env, txdata, NULL);
for (size_t c = 0; c < txdata_constr.datalen; c++) {
int64_t txdata_conv_28 = txdata_vals[c];
- LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(((uint64_t)txdata_conv_28) & ~1);
+ void* txdata_conv_28_ptr = (void*)(((uint64_t)txdata_conv_28) & ~1);
+ CHECK_ACCESS(txdata_conv_28_ptr);
+ LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(txdata_conv_28_ptr);
txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)(((uint64_t)txdata_conv_28) & ~1));
txdata_constr.data[c] = txdata_conv_28_conv;
}
(*env)->ReleaseLongArrayElements(env, txdata, txdata_vals, 0);
- LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(((uint64_t)broadcaster) & ~1);
+ void* broadcaster_ptr = (void*)(((uint64_t)broadcaster) & ~1);
+ CHECK_ACCESS(broadcaster_ptr);
+ LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr);
if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv);
}
- LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(((uint64_t)fee_estimator) & ~1);
+ void* fee_estimator_ptr = (void*)(((uint64_t)fee_estimator) & ~1);
+ CHECK_ACCESS(fee_estimator_ptr);
+ LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr);
if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv);
}
- LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1);
+ void* logger_ptr = (void*)(((uint64_t)logger) & ~1);
+ CHECK_ACCESS(logger_ptr);
+ LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
if (logger_conv.free == LDKLogger_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKLogger_JCalls_cloned(&logger_conv);
CHECK((*env)->GetArrayLength(env, txid) == 32);
(*env)->GetByteArrayRegion(env, txid, 0, 32, txid_arr);
unsigned char (*txid_ref)[32] = &txid_arr;
- LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(((uint64_t)broadcaster) & ~1);
+ void* broadcaster_ptr = (void*)(((uint64_t)broadcaster) & ~1);
+ CHECK_ACCESS(broadcaster_ptr);
+ LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr);
if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv);
}
- LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(((uint64_t)fee_estimator) & ~1);
+ void* fee_estimator_ptr = (void*)(((uint64_t)fee_estimator) & ~1);
+ CHECK_ACCESS(fee_estimator_ptr);
+ LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr);
if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv);
}
- LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1);
+ void* logger_ptr = (void*)(((uint64_t)logger) & ~1);
+ CHECK_ACCESS(logger_ptr);
+ LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
if (logger_conv.free == LDKLogger_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKLogger_JCalls_cloned(&logger_conv);
CHECK((*env)->GetArrayLength(env, header) == 80);
(*env)->GetByteArrayRegion(env, header, 0, 80, header_arr);
unsigned char (*header_ref)[80] = &header_arr;
- LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(((uint64_t)broadcaster) & ~1);
+ void* broadcaster_ptr = (void*)(((uint64_t)broadcaster) & ~1);
+ CHECK_ACCESS(broadcaster_ptr);
+ LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr);
if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv);
}
- LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(((uint64_t)fee_estimator) & ~1);
+ void* fee_estimator_ptr = (void*)(((uint64_t)fee_estimator) & ~1);
+ CHECK_ACCESS(fee_estimator_ptr);
+ LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr);
if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv);
}
- LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1);
+ void* logger_ptr = (void*)(((uint64_t)logger) & ~1);
+ CHECK_ACCESS(logger_ptr);
+ LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
if (logger_conv.free == LDKLogger_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKLogger_JCalls_cloned(&logger_conv);
int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
for (size_t j = 0; j < ret_var.datalen; j++) {
LDKBalance *ret_conv_9_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
- *ret_conv_9_copy = Balance_clone(&ret_var.data[j]);
+ *ret_conv_9_copy = ret_var.data[j];
uint64_t ret_conv_9_ref = (uint64_t)ret_conv_9_copy;
ret_arr_ptr[j] = ret_conv_9_ref;
}
LDKu8slice ser_ref;
ser_ref.datalen = (*env)->GetArrayLength(env, ser);
ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
- LDKKeysInterface* arg_conv = (LDKKeysInterface*)(((uint64_t)arg) & ~1);
+ void* arg_ptr = (void*)(((uint64_t)arg) & ~1);
+ if (!(arg & 1)) { CHECK_ACCESS(arg_ptr); }
+ LDKKeysInterface* arg_conv = (LDKKeysInterface*)arg_ptr;
LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ");
*ret_conv = C2Tuple_BlockHashChannelMonitorZ_read(ser_ref, arg_conv);
(*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
LDKDelayedPaymentOutputDescriptor this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- LDKTxOut val_conv = *(LDKTxOut*)(((uint64_t)val) & ~1);
+ void* val_ptr = (void*)(((uint64_t)val) & ~1);
+ CHECK_ACCESS(val_ptr);
+ LDKTxOut val_conv = *(LDKTxOut*)(val_ptr);
val_conv = TxOut_clone((LDKTxOut*)(((uint64_t)val) & ~1));
DelayedPaymentOutputDescriptor_set_output(&this_ptr_conv, val_conv);
}
LDKPublicKey per_commitment_point_arg_ref;
CHECK((*env)->GetArrayLength(env, per_commitment_point_arg) == 33);
(*env)->GetByteArrayRegion(env, per_commitment_point_arg, 0, 33, per_commitment_point_arg_ref.compressed_form);
- LDKTxOut output_arg_conv = *(LDKTxOut*)(((uint64_t)output_arg) & ~1);
+ void* output_arg_ptr = (void*)(((uint64_t)output_arg) & ~1);
+ CHECK_ACCESS(output_arg_ptr);
+ LDKTxOut output_arg_conv = *(LDKTxOut*)(output_arg_ptr);
output_arg_conv = TxOut_clone((LDKTxOut*)(((uint64_t)output_arg) & ~1));
LDKPublicKey revocation_pubkey_arg_ref;
CHECK((*env)->GetArrayLength(env, revocation_pubkey_arg) == 33);
LDKStaticPaymentOutputDescriptor this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- LDKTxOut val_conv = *(LDKTxOut*)(((uint64_t)val) & ~1);
+ void* val_ptr = (void*)(((uint64_t)val) & ~1);
+ CHECK_ACCESS(val_ptr);
+ LDKTxOut val_conv = *(LDKTxOut*)(val_ptr);
val_conv = TxOut_clone((LDKTxOut*)(((uint64_t)val) & ~1));
StaticPaymentOutputDescriptor_set_output(&this_ptr_conv, val_conv);
}
outpoint_arg_conv.inner = (void*)(outpoint_arg & (~1));
outpoint_arg_conv.is_owned = (outpoint_arg & 1) || (outpoint_arg == 0);
outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv);
- LDKTxOut output_arg_conv = *(LDKTxOut*)(((uint64_t)output_arg) & ~1);
+ void* output_arg_ptr = (void*)(((uint64_t)output_arg) & ~1);
+ CHECK_ACCESS(output_arg_ptr);
+ LDKTxOut output_arg_conv = *(LDKTxOut*)(output_arg_ptr);
output_arg_conv = TxOut_clone((LDKTxOut*)(((uint64_t)output_arg) & ~1));
LDKThirtyTwoBytes channel_keys_id_arg_ref;
CHECK((*env)->GetArrayLength(env, channel_keys_id_arg) == 32);
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKSpendableOutputDescriptor this_ptr_conv = *(LDKSpendableOutputDescriptor*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKSpendableOutputDescriptor this_ptr_conv = *(LDKSpendableOutputDescriptor*)(this_ptr_ptr);
FREE((void*)this_ptr);
SpendableOutputDescriptor_free(this_ptr_conv);
}
outpoint_conv.inner = (void*)(outpoint & (~1));
outpoint_conv.is_owned = (outpoint & 1) || (outpoint == 0);
outpoint_conv = OutPoint_clone(&outpoint_conv);
- LDKTxOut output_conv = *(LDKTxOut*)(((uint64_t)output) & ~1);
+ void* output_ptr = (void*)(((uint64_t)output) & ~1);
+ CHECK_ACCESS(output_ptr);
+ LDKTxOut output_conv = *(LDKTxOut*)(output_ptr);
output_conv = TxOut_clone((LDKTxOut*)(((uint64_t)output) & ~1));
LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor");
*ret_copy = SpendableOutputDescriptor_static_output(outpoint_conv, output_conv);
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BaseSign_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKBaseSign this_ptr_conv = *(LDKBaseSign*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKBaseSign this_ptr_conv = *(LDKBaseSign*)(this_ptr_ptr);
FREE((void*)this_ptr);
BaseSign_free(this_ptr_conv);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Sign_1clone(JNIEnv *env, jclass clz, int64_t orig) {
- LDKSign* orig_conv = (LDKSign*)(((uint64_t)orig) & ~1);
+ void* orig_ptr = (void*)(((uint64_t)orig) & ~1);
+ if (!(orig & 1)) { CHECK_ACCESS(orig_ptr); }
+ LDKSign* orig_conv = (LDKSign*)orig_ptr;
LDKSign* ret_ret =MALLOC(sizeof(LDKSign), "LDKSign");
*ret_ret = Sign_clone(orig_conv);
return (uint64_t)ret_ret;
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Sign_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKSign this_ptr_conv = *(LDKSign*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKSign this_ptr_conv = *(LDKSign*)(this_ptr_ptr);
FREE((void*)this_ptr);
Sign_free(this_ptr_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_KeysInterface_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKKeysInterface this_ptr_conv = *(LDKKeysInterface*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKKeysInterface this_ptr_conv = *(LDKKeysInterface*)(this_ptr_ptr);
FREE((void*)this_ptr);
KeysInterface_free(this_ptr_conv);
}
int64_t* descriptors_vals = (*env)->GetLongArrayElements (env, descriptors, NULL);
for (size_t b = 0; b < descriptors_constr.datalen; b++) {
int64_t descriptors_conv_27 = descriptors_vals[b];
- LDKSpendableOutputDescriptor descriptors_conv_27_conv = *(LDKSpendableOutputDescriptor*)(((uint64_t)descriptors_conv_27) & ~1);
+ void* descriptors_conv_27_ptr = (void*)(((uint64_t)descriptors_conv_27) & ~1);
+ CHECK_ACCESS(descriptors_conv_27_ptr);
+ LDKSpendableOutputDescriptor descriptors_conv_27_conv = *(LDKSpendableOutputDescriptor*)(descriptors_conv_27_ptr);
descriptors_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)(((uint64_t)descriptors_conv_27) & ~1));
descriptors_constr.data[b] = descriptors_conv_27_conv;
}
int64_t* outputs_vals = (*env)->GetLongArrayElements (env, outputs, NULL);
for (size_t h = 0; h < outputs_constr.datalen; h++) {
int64_t outputs_conv_7 = outputs_vals[h];
- LDKTxOut outputs_conv_7_conv = *(LDKTxOut*)(((uint64_t)outputs_conv_7) & ~1);
+ void* outputs_conv_7_ptr = (void*)(((uint64_t)outputs_conv_7) & ~1);
+ CHECK_ACCESS(outputs_conv_7_ptr);
+ LDKTxOut outputs_conv_7_conv = *(LDKTxOut*)(outputs_conv_7_ptr);
outputs_conv_7_conv = TxOut_clone((LDKTxOut*)(((uint64_t)outputs_conv_7) & ~1));
outputs_constr.data[h] = outputs_conv_7_conv;
}
LDKChannelDetails this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(((uint64_t)val) & ~1);
+ void* val_ptr = (void*)(((uint64_t)val) & ~1);
+ CHECK_ACCESS(val_ptr);
+ LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
val_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)val) & ~1));
ChannelDetails_set_short_channel_id(&this_ptr_conv, val_conv);
}
LDKChannelDetails this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(((uint64_t)val) & ~1);
+ void* val_ptr = (void*)(((uint64_t)val) & ~1);
+ CHECK_ACCESS(val_ptr);
+ LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
val_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)val) & ~1));
ChannelDetails_set_unspendable_punishment_reserve(&this_ptr_conv, val_conv);
}
LDKChannelDetails this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(((uint64_t)val) & ~1);
+ void* val_ptr = (void*)(((uint64_t)val) & ~1);
+ CHECK_ACCESS(val_ptr);
+ LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(val_ptr);
val_conv = COption_u32Z_clone((LDKCOption_u32Z*)(((uint64_t)val) & ~1));
ChannelDetails_set_confirmations_required(&this_ptr_conv, val_conv);
}
LDKChannelDetails this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- LDKCOption_u16Z val_conv = *(LDKCOption_u16Z*)(((uint64_t)val) & ~1);
+ void* val_ptr = (void*)(((uint64_t)val) & ~1);
+ CHECK_ACCESS(val_ptr);
+ LDKCOption_u16Z val_conv = *(LDKCOption_u16Z*)(val_ptr);
val_conv = COption_u16Z_clone((LDKCOption_u16Z*)(((uint64_t)val) & ~1));
ChannelDetails_set_force_close_spend_delay(&this_ptr_conv, val_conv);
}
funding_txo_arg_conv.inner = (void*)(funding_txo_arg & (~1));
funding_txo_arg_conv.is_owned = (funding_txo_arg & 1) || (funding_txo_arg == 0);
funding_txo_arg_conv = OutPoint_clone(&funding_txo_arg_conv);
- LDKCOption_u64Z short_channel_id_arg_conv = *(LDKCOption_u64Z*)(((uint64_t)short_channel_id_arg) & ~1);
+ void* short_channel_id_arg_ptr = (void*)(((uint64_t)short_channel_id_arg) & ~1);
+ CHECK_ACCESS(short_channel_id_arg_ptr);
+ LDKCOption_u64Z short_channel_id_arg_conv = *(LDKCOption_u64Z*)(short_channel_id_arg_ptr);
short_channel_id_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)short_channel_id_arg) & ~1));
- LDKCOption_u64Z unspendable_punishment_reserve_arg_conv = *(LDKCOption_u64Z*)(((uint64_t)unspendable_punishment_reserve_arg) & ~1);
- LDKCOption_u32Z confirmations_required_arg_conv = *(LDKCOption_u32Z*)(((uint64_t)confirmations_required_arg) & ~1);
+ void* unspendable_punishment_reserve_arg_ptr = (void*)(((uint64_t)unspendable_punishment_reserve_arg) & ~1);
+ CHECK_ACCESS(unspendable_punishment_reserve_arg_ptr);
+ LDKCOption_u64Z unspendable_punishment_reserve_arg_conv = *(LDKCOption_u64Z*)(unspendable_punishment_reserve_arg_ptr);
+ void* confirmations_required_arg_ptr = (void*)(((uint64_t)confirmations_required_arg) & ~1);
+ CHECK_ACCESS(confirmations_required_arg_ptr);
+ LDKCOption_u32Z confirmations_required_arg_conv = *(LDKCOption_u32Z*)(confirmations_required_arg_ptr);
confirmations_required_arg_conv = COption_u32Z_clone((LDKCOption_u32Z*)(((uint64_t)confirmations_required_arg) & ~1));
- LDKCOption_u16Z force_close_spend_delay_arg_conv = *(LDKCOption_u16Z*)(((uint64_t)force_close_spend_delay_arg) & ~1);
+ void* force_close_spend_delay_arg_ptr = (void*)(((uint64_t)force_close_spend_delay_arg) & ~1);
+ CHECK_ACCESS(force_close_spend_delay_arg_ptr);
+ LDKCOption_u16Z force_close_spend_delay_arg_conv = *(LDKCOption_u16Z*)(force_close_spend_delay_arg_ptr);
force_close_spend_delay_arg_conv = COption_u16Z_clone((LDKCOption_u16Z*)(((uint64_t)force_close_spend_delay_arg) & ~1));
LDKChannelDetails ret_var = ChannelDetails_new(channel_id_arg_ref, counterparty_arg_conv, funding_txo_arg_conv, short_channel_id_arg_conv, channel_value_satoshis_arg, unspendable_punishment_reserve_arg_conv, user_channel_id_arg, outbound_capacity_msat_arg, inbound_capacity_msat_arg, confirmations_required_arg_conv, force_close_spend_delay_arg_conv, is_outbound_arg, is_funding_locked_arg, is_usable_arg, is_public_arg);
CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKPaymentSendFailure this_ptr_conv = *(LDKPaymentSendFailure*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKPaymentSendFailure this_ptr_conv = *(LDKPaymentSendFailure*)(this_ptr_ptr);
FREE((void*)this_ptr);
PaymentSendFailure_free(this_ptr_conv);
}
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1parameter_1error(JNIEnv *env, jclass clz, int64_t a) {
- LDKAPIError a_conv = *(LDKAPIError*)(((uint64_t)a) & ~1);
+ void* a_ptr = (void*)(((uint64_t)a) & ~1);
+ CHECK_ACCESS(a_ptr);
+ LDKAPIError a_conv = *(LDKAPIError*)(a_ptr);
a_conv = APIError_clone((LDKAPIError*)(((uint64_t)a) & ~1));
LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
*ret_copy = PaymentSendFailure_parameter_error(a_conv);
int64_t* a_vals = (*env)->GetLongArrayElements (env, a, NULL);
for (size_t w = 0; w < a_constr.datalen; w++) {
int64_t a_conv_22 = a_vals[w];
- LDKCResult_NoneAPIErrorZ a_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(((uint64_t)a_conv_22) & ~1);
+ void* a_conv_22_ptr = (void*)(((uint64_t)a_conv_22) & ~1);
+ CHECK_ACCESS(a_conv_22_ptr);
+ LDKCResult_NoneAPIErrorZ a_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(a_conv_22_ptr);
a_conv_22_conv = CResult_NoneAPIErrorZ_clone((LDKCResult_NoneAPIErrorZ*)(((uint64_t)a_conv_22) & ~1));
a_constr.data[w] = a_conv_22_conv;
}
int64_t* a_vals = (*env)->GetLongArrayElements (env, a, NULL);
for (size_t k = 0; k < a_constr.datalen; k++) {
int64_t a_conv_10 = a_vals[k];
- LDKAPIError a_conv_10_conv = *(LDKAPIError*)(((uint64_t)a_conv_10) & ~1);
+ void* a_conv_10_ptr = (void*)(((uint64_t)a_conv_10) & ~1);
+ CHECK_ACCESS(a_conv_10_ptr);
+ LDKAPIError a_conv_10_conv = *(LDKAPIError*)(a_conv_10_ptr);
a_conv_10_conv = APIError_clone((LDKAPIError*)(((uint64_t)a_conv_10) & ~1));
a_constr.data[k] = a_conv_10_conv;
}
int64_t* a_vals = (*env)->GetLongArrayElements (env, a, NULL);
for (size_t w = 0; w < a_constr.datalen; w++) {
int64_t a_conv_22 = a_vals[w];
- LDKCResult_NoneAPIErrorZ a_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(((uint64_t)a_conv_22) & ~1);
+ void* a_conv_22_ptr = (void*)(((uint64_t)a_conv_22) & ~1);
+ CHECK_ACCESS(a_conv_22_ptr);
+ LDKCResult_NoneAPIErrorZ a_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(a_conv_22_ptr);
a_conv_22_conv = CResult_NoneAPIErrorZ_clone((LDKCResult_NoneAPIErrorZ*)(((uint64_t)a_conv_22) & ~1));
a_constr.data[w] = a_conv_22_conv;
}
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1new(JNIEnv *env, jclass clz, int64_t fee_est, int64_t chain_monitor, int64_t tx_broadcaster, int64_t logger, int64_t keys_manager, int64_t config, int64_t params) {
- LDKFeeEstimator fee_est_conv = *(LDKFeeEstimator*)(((uint64_t)fee_est) & ~1);
+ void* fee_est_ptr = (void*)(((uint64_t)fee_est) & ~1);
+ CHECK_ACCESS(fee_est_ptr);
+ LDKFeeEstimator fee_est_conv = *(LDKFeeEstimator*)(fee_est_ptr);
if (fee_est_conv.free == LDKFeeEstimator_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKFeeEstimator_JCalls_cloned(&fee_est_conv);
}
- LDKWatch chain_monitor_conv = *(LDKWatch*)(((uint64_t)chain_monitor) & ~1);
+ void* chain_monitor_ptr = (void*)(((uint64_t)chain_monitor) & ~1);
+ CHECK_ACCESS(chain_monitor_ptr);
+ LDKWatch chain_monitor_conv = *(LDKWatch*)(chain_monitor_ptr);
if (chain_monitor_conv.free == LDKWatch_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKWatch_JCalls_cloned(&chain_monitor_conv);
}
- LDKBroadcasterInterface tx_broadcaster_conv = *(LDKBroadcasterInterface*)(((uint64_t)tx_broadcaster) & ~1);
+ void* tx_broadcaster_ptr = (void*)(((uint64_t)tx_broadcaster) & ~1);
+ CHECK_ACCESS(tx_broadcaster_ptr);
+ LDKBroadcasterInterface tx_broadcaster_conv = *(LDKBroadcasterInterface*)(tx_broadcaster_ptr);
if (tx_broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKBroadcasterInterface_JCalls_cloned(&tx_broadcaster_conv);
}
- LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1);
+ void* logger_ptr = (void*)(((uint64_t)logger) & ~1);
+ CHECK_ACCESS(logger_ptr);
+ LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
if (logger_conv.free == LDKLogger_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKLogger_JCalls_cloned(&logger_conv);
}
- LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(((uint64_t)keys_manager) & ~1);
+ void* keys_manager_ptr = (void*)(((uint64_t)keys_manager) & ~1);
+ CHECK_ACCESS(keys_manager_ptr);
+ LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(keys_manager_ptr);
if (keys_manager_conv.free == LDKKeysInterface_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKKeysInterface_JCalls_cloned(&keys_manager_conv);
int64_t* addresses_vals = (*env)->GetLongArrayElements (env, addresses, NULL);
for (size_t m = 0; m < addresses_constr.datalen; m++) {
int64_t addresses_conv_12 = addresses_vals[m];
- LDKNetAddress addresses_conv_12_conv = *(LDKNetAddress*)(((uint64_t)addresses_conv_12) & ~1);
+ void* addresses_conv_12_ptr = (void*)(((uint64_t)addresses_conv_12) & ~1);
+ CHECK_ACCESS(addresses_conv_12_ptr);
+ LDKNetAddress addresses_conv_12_conv = *(LDKNetAddress*)(addresses_conv_12_ptr);
addresses_constr.data[m] = addresses_conv_12_conv;
}
(*env)->ReleaseLongArrayElements(env, addresses, addresses_vals, 0);
LDKChannelManager this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(((uint64_t)min_value_msat) & ~1);
+ void* min_value_msat_ptr = (void*)(((uint64_t)min_value_msat) & ~1);
+ CHECK_ACCESS(min_value_msat_ptr);
+ LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr);
min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)min_value_msat) & ~1));
LDKC2Tuple_PaymentHashPaymentSecretZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ");
*ret_conv = ChannelManager_create_inbound_payment(&this_arg_conv, min_value_msat_conv, invoice_expiry_delta_secs, user_payment_id);
LDKThirtyTwoBytes payment_hash_ref;
CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
(*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
- LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(((uint64_t)min_value_msat) & ~1);
+ void* min_value_msat_ptr = (void*)(((uint64_t)min_value_msat) & ~1);
+ CHECK_ACCESS(min_value_msat_ptr);
+ LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr);
min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)min_value_msat) & ~1));
LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ");
*ret_conv = ChannelManager_create_inbound_payment_for_hash(&this_arg_conv, payment_hash_ref, min_value_msat_conv, invoice_expiry_delta_secs, user_payment_id);
LDKChannelManagerReadArgs this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- LDKKeysInterface val_conv = *(LDKKeysInterface*)(((uint64_t)val) & ~1);
+ void* val_ptr = (void*)(((uint64_t)val) & ~1);
+ CHECK_ACCESS(val_ptr);
+ LDKKeysInterface val_conv = *(LDKKeysInterface*)(val_ptr);
if (val_conv.free == LDKKeysInterface_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKKeysInterface_JCalls_cloned(&val_conv);
LDKChannelManagerReadArgs this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- LDKFeeEstimator val_conv = *(LDKFeeEstimator*)(((uint64_t)val) & ~1);
+ void* val_ptr = (void*)(((uint64_t)val) & ~1);
+ CHECK_ACCESS(val_ptr);
+ LDKFeeEstimator val_conv = *(LDKFeeEstimator*)(val_ptr);
if (val_conv.free == LDKFeeEstimator_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKFeeEstimator_JCalls_cloned(&val_conv);
LDKChannelManagerReadArgs this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- LDKWatch val_conv = *(LDKWatch*)(((uint64_t)val) & ~1);
+ void* val_ptr = (void*)(((uint64_t)val) & ~1);
+ CHECK_ACCESS(val_ptr);
+ LDKWatch val_conv = *(LDKWatch*)(val_ptr);
if (val_conv.free == LDKWatch_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKWatch_JCalls_cloned(&val_conv);
LDKChannelManagerReadArgs this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- LDKBroadcasterInterface val_conv = *(LDKBroadcasterInterface*)(((uint64_t)val) & ~1);
+ void* val_ptr = (void*)(((uint64_t)val) & ~1);
+ CHECK_ACCESS(val_ptr);
+ LDKBroadcasterInterface val_conv = *(LDKBroadcasterInterface*)(val_ptr);
if (val_conv.free == LDKBroadcasterInterface_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKBroadcasterInterface_JCalls_cloned(&val_conv);
LDKChannelManagerReadArgs this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- LDKLogger val_conv = *(LDKLogger*)(((uint64_t)val) & ~1);
+ void* val_ptr = (void*)(((uint64_t)val) & ~1);
+ CHECK_ACCESS(val_ptr);
+ LDKLogger val_conv = *(LDKLogger*)(val_ptr);
if (val_conv.free == LDKLogger_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKLogger_JCalls_cloned(&val_conv);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1new(JNIEnv *env, jclass clz, int64_t keys_manager, int64_t fee_estimator, int64_t chain_monitor, int64_t tx_broadcaster, int64_t logger, int64_t default_config, int64_tArray channel_monitors) {
- LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(((uint64_t)keys_manager) & ~1);
+ void* keys_manager_ptr = (void*)(((uint64_t)keys_manager) & ~1);
+ CHECK_ACCESS(keys_manager_ptr);
+ LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(keys_manager_ptr);
if (keys_manager_conv.free == LDKKeysInterface_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKKeysInterface_JCalls_cloned(&keys_manager_conv);
}
- LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(((uint64_t)fee_estimator) & ~1);
+ void* fee_estimator_ptr = (void*)(((uint64_t)fee_estimator) & ~1);
+ CHECK_ACCESS(fee_estimator_ptr);
+ LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr);
if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv);
}
- LDKWatch chain_monitor_conv = *(LDKWatch*)(((uint64_t)chain_monitor) & ~1);
+ void* chain_monitor_ptr = (void*)(((uint64_t)chain_monitor) & ~1);
+ CHECK_ACCESS(chain_monitor_ptr);
+ LDKWatch chain_monitor_conv = *(LDKWatch*)(chain_monitor_ptr);
if (chain_monitor_conv.free == LDKWatch_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKWatch_JCalls_cloned(&chain_monitor_conv);
}
- LDKBroadcasterInterface tx_broadcaster_conv = *(LDKBroadcasterInterface*)(((uint64_t)tx_broadcaster) & ~1);
+ void* tx_broadcaster_ptr = (void*)(((uint64_t)tx_broadcaster) & ~1);
+ CHECK_ACCESS(tx_broadcaster_ptr);
+ LDKBroadcasterInterface tx_broadcaster_conv = *(LDKBroadcasterInterface*)(tx_broadcaster_ptr);
if (tx_broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKBroadcasterInterface_JCalls_cloned(&tx_broadcaster_conv);
}
- LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1);
+ void* logger_ptr = (void*)(((uint64_t)logger) & ~1);
+ CHECK_ACCESS(logger_ptr);
+ LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
if (logger_conv.free == LDKLogger_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKLogger_JCalls_cloned(&logger_conv);
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetAddress_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKNetAddress this_ptr_conv = *(LDKNetAddress*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKNetAddress this_ptr_conv = *(LDKNetAddress*)(this_ptr_ptr);
FREE((void*)this_ptr);
NetAddress_free(this_ptr_conv);
}
int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL);
for (size_t m = 0; m < val_constr.datalen; m++) {
int64_t val_conv_12 = val_vals[m];
- LDKNetAddress val_conv_12_conv = *(LDKNetAddress*)(((uint64_t)val_conv_12) & ~1);
+ void* val_conv_12_ptr = (void*)(((uint64_t)val_conv_12) & ~1);
+ CHECK_ACCESS(val_conv_12_ptr);
+ LDKNetAddress val_conv_12_conv = *(LDKNetAddress*)(val_conv_12_ptr);
val_conv_12_conv = NetAddress_clone((LDKNetAddress*)(((uint64_t)val_conv_12) & ~1));
val_constr.data[m] = val_conv_12_conv;
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorAction_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKErrorAction this_ptr_conv = *(LDKErrorAction*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKErrorAction this_ptr_conv = *(LDKErrorAction*)(this_ptr_ptr);
FREE((void*)this_ptr);
ErrorAction_free(this_ptr_conv);
}
LDKLightningError this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- LDKErrorAction val_conv = *(LDKErrorAction*)(((uint64_t)val) & ~1);
+ void* val_ptr = (void*)(((uint64_t)val) & ~1);
+ CHECK_ACCESS(val_ptr);
+ LDKErrorAction val_conv = *(LDKErrorAction*)(val_ptr);
val_conv = ErrorAction_clone((LDKErrorAction*)(((uint64_t)val) & ~1));
LightningError_set_action(&this_ptr_conv, val_conv);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LightningError_1new(JNIEnv *env, jclass clz, jstring err_arg, int64_t action_arg) {
LDKStr err_arg_conv = java_to_owned_str(env, err_arg);
- LDKErrorAction action_arg_conv = *(LDKErrorAction*)(((uint64_t)action_arg) & ~1);
+ void* action_arg_ptr = (void*)(((uint64_t)action_arg) & ~1);
+ CHECK_ACCESS(action_arg_ptr);
+ LDKErrorAction action_arg_conv = *(LDKErrorAction*)(action_arg_ptr);
action_arg_conv = ErrorAction_clone((LDKErrorAction*)(((uint64_t)action_arg) & ~1));
LDKLightningError ret_var = LightningError_new(err_arg_conv, action_arg_conv);
CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKChannelMessageHandler this_ptr_conv = *(LDKChannelMessageHandler*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKChannelMessageHandler this_ptr_conv = *(LDKChannelMessageHandler*)(this_ptr_ptr);
FREE((void*)this_ptr);
ChannelMessageHandler_free(this_ptr_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKRoutingMessageHandler this_ptr_conv = *(LDKRoutingMessageHandler*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKRoutingMessageHandler this_ptr_conv = *(LDKRoutingMessageHandler*)(this_ptr_ptr);
FREE((void*)this_ptr);
RoutingMessageHandler_free(this_ptr_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CustomMessageHandler_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKCustomMessageHandler this_ptr_conv = *(LDKCustomMessageHandler*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKCustomMessageHandler this_ptr_conv = *(LDKCustomMessageHandler*)(this_ptr_ptr);
FREE((void*)this_ptr);
CustomMessageHandler_free(this_ptr_conv);
}
LDKMessageHandler this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- LDKChannelMessageHandler val_conv = *(LDKChannelMessageHandler*)(((uint64_t)val) & ~1);
+ void* val_ptr = (void*)(((uint64_t)val) & ~1);
+ CHECK_ACCESS(val_ptr);
+ LDKChannelMessageHandler val_conv = *(LDKChannelMessageHandler*)(val_ptr);
if (val_conv.free == LDKChannelMessageHandler_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKChannelMessageHandler_JCalls_cloned(&val_conv);
LDKMessageHandler this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- LDKRoutingMessageHandler val_conv = *(LDKRoutingMessageHandler*)(((uint64_t)val) & ~1);
+ void* val_ptr = (void*)(((uint64_t)val) & ~1);
+ CHECK_ACCESS(val_ptr);
+ LDKRoutingMessageHandler val_conv = *(LDKRoutingMessageHandler*)(val_ptr);
if (val_conv.free == LDKRoutingMessageHandler_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKRoutingMessageHandler_JCalls_cloned(&val_conv);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageHandler_1new(JNIEnv *env, jclass clz, int64_t chan_handler_arg, int64_t route_handler_arg) {
- LDKChannelMessageHandler chan_handler_arg_conv = *(LDKChannelMessageHandler*)(((uint64_t)chan_handler_arg) & ~1);
+ void* chan_handler_arg_ptr = (void*)(((uint64_t)chan_handler_arg) & ~1);
+ CHECK_ACCESS(chan_handler_arg_ptr);
+ LDKChannelMessageHandler chan_handler_arg_conv = *(LDKChannelMessageHandler*)(chan_handler_arg_ptr);
if (chan_handler_arg_conv.free == LDKChannelMessageHandler_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKChannelMessageHandler_JCalls_cloned(&chan_handler_arg_conv);
}
- LDKRoutingMessageHandler route_handler_arg_conv = *(LDKRoutingMessageHandler*)(((uint64_t)route_handler_arg) & ~1);
+ void* route_handler_arg_ptr = (void*)(((uint64_t)route_handler_arg) & ~1);
+ CHECK_ACCESS(route_handler_arg_ptr);
+ LDKRoutingMessageHandler route_handler_arg_conv = *(LDKRoutingMessageHandler*)(route_handler_arg_ptr);
if (route_handler_arg_conv.free == LDKRoutingMessageHandler_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKRoutingMessageHandler_JCalls_cloned(&route_handler_arg_conv);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1clone(JNIEnv *env, jclass clz, int64_t orig) {
- LDKSocketDescriptor* orig_conv = (LDKSocketDescriptor*)(((uint64_t)orig) & ~1);
+ void* orig_ptr = (void*)(((uint64_t)orig) & ~1);
+ if (!(orig & 1)) { CHECK_ACCESS(orig_ptr); }
+ LDKSocketDescriptor* orig_conv = (LDKSocketDescriptor*)orig_ptr;
LDKSocketDescriptor* ret_ret =MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor");
*ret_ret = SocketDescriptor_clone(orig_conv);
return (uint64_t)ret_ret;
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKSocketDescriptor this_ptr_conv = *(LDKSocketDescriptor*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKSocketDescriptor this_ptr_conv = *(LDKSocketDescriptor*)(this_ptr_ptr);
FREE((void*)this_ptr);
SocketDescriptor_free(this_ptr_conv);
}
CHECK((*env)->GetArrayLength(env, ephemeral_random_data) == 32);
(*env)->GetByteArrayRegion(env, ephemeral_random_data, 0, 32, ephemeral_random_data_arr);
unsigned char (*ephemeral_random_data_ref)[32] = &ephemeral_random_data_arr;
- LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1);
+ void* logger_ptr = (void*)(((uint64_t)logger) & ~1);
+ CHECK_ACCESS(logger_ptr);
+ LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
if (logger_conv.free == LDKLogger_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKLogger_JCalls_cloned(&logger_conv);
}
- LDKCustomMessageHandler custom_message_handler_conv = *(LDKCustomMessageHandler*)(((uint64_t)custom_message_handler) & ~1);
+ void* custom_message_handler_ptr = (void*)(((uint64_t)custom_message_handler) & ~1);
+ CHECK_ACCESS(custom_message_handler_ptr);
+ LDKCustomMessageHandler custom_message_handler_conv = *(LDKCustomMessageHandler*)(custom_message_handler_ptr);
if (custom_message_handler_conv.free == LDKCustomMessageHandler_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKCustomMessageHandler_JCalls_cloned(&custom_message_handler_conv);
LDKPublicKey their_node_id_ref;
CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
(*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
- LDKSocketDescriptor descriptor_conv = *(LDKSocketDescriptor*)(((uint64_t)descriptor) & ~1);
+ void* descriptor_ptr = (void*)(((uint64_t)descriptor) & ~1);
+ CHECK_ACCESS(descriptor_ptr);
+ LDKSocketDescriptor descriptor_conv = *(LDKSocketDescriptor*)(descriptor_ptr);
if (descriptor_conv.free == LDKSocketDescriptor_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKSocketDescriptor_JCalls_cloned(&descriptor_conv);
LDKPeerManager this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKSocketDescriptor descriptor_conv = *(LDKSocketDescriptor*)(((uint64_t)descriptor) & ~1);
+ void* descriptor_ptr = (void*)(((uint64_t)descriptor) & ~1);
+ CHECK_ACCESS(descriptor_ptr);
+ LDKSocketDescriptor descriptor_conv = *(LDKSocketDescriptor*)(descriptor_ptr);
if (descriptor_conv.free == LDKSocketDescriptor_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKSocketDescriptor_JCalls_cloned(&descriptor_conv);
LDKPeerManager this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)(((uint64_t)descriptor) & ~1);
+ void* descriptor_ptr = (void*)(((uint64_t)descriptor) & ~1);
+ if (!(descriptor & 1)) { CHECK_ACCESS(descriptor_ptr); }
+ LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)descriptor_ptr;
LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
*ret_conv = PeerManager_write_buffer_space_avail(&this_arg_conv, descriptor_conv);
return (uint64_t)ret_conv;
LDKPeerManager this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKSocketDescriptor* peer_descriptor_conv = (LDKSocketDescriptor*)(((uint64_t)peer_descriptor) & ~1);
+ void* peer_descriptor_ptr = (void*)(((uint64_t)peer_descriptor) & ~1);
+ if (!(peer_descriptor & 1)) { CHECK_ACCESS(peer_descriptor_ptr); }
+ LDKSocketDescriptor* peer_descriptor_conv = (LDKSocketDescriptor*)peer_descriptor_ptr;
LDKu8slice data_ref;
data_ref.datalen = (*env)->GetArrayLength(env, data);
data_ref.data = (*env)->GetByteArrayElements (env, data, NULL);
LDKPeerManager this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)(((uint64_t)descriptor) & ~1);
+ void* descriptor_ptr = (void*)(((uint64_t)descriptor) & ~1);
+ if (!(descriptor & 1)) { CHECK_ACCESS(descriptor_ptr); }
+ LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)descriptor_ptr;
PeerManager_socket_disconnected(&this_arg_conv, descriptor_conv);
}
LDKHTLCOutputInCommitment this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(((uint64_t)val) & ~1);
+ void* val_ptr = (void*)(((uint64_t)val) & ~1);
+ CHECK_ACCESS(val_ptr);
+ LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(val_ptr);
val_conv = COption_u32Z_clone((LDKCOption_u32Z*)(((uint64_t)val) & ~1));
HTLCOutputInCommitment_set_transaction_output_index(&this_ptr_conv, val_conv);
}
LDKThirtyTwoBytes payment_hash_arg_ref;
CHECK((*env)->GetArrayLength(env, payment_hash_arg) == 32);
(*env)->GetByteArrayRegion(env, payment_hash_arg, 0, 32, payment_hash_arg_ref.data);
- LDKCOption_u32Z transaction_output_index_arg_conv = *(LDKCOption_u32Z*)(((uint64_t)transaction_output_index_arg) & ~1);
+ void* transaction_output_index_arg_ptr = (void*)(((uint64_t)transaction_output_index_arg) & ~1);
+ CHECK_ACCESS(transaction_output_index_arg_ptr);
+ LDKCOption_u32Z transaction_output_index_arg_conv = *(LDKCOption_u32Z*)(transaction_output_index_arg_ptr);
transaction_output_index_arg_conv = COption_u32Z_clone((LDKCOption_u32Z*)(((uint64_t)transaction_output_index_arg) & ~1));
LDKHTLCOutputInCommitment ret_var = HTLCOutputInCommitment_new(offered_arg, amount_msat_arg, cltv_expiry_arg, payment_hash_arg_ref, transaction_output_index_arg_conv);
CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
ClosingTransaction_free(this_obj_conv);
}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1clone(JNIEnv *env, jclass clz, int64_t orig) {
+ LDKClosingTransaction orig_conv;
+ orig_conv.inner = (void*)(orig & (~1));
+ orig_conv.is_owned = false;
+ LDKClosingTransaction ret_var = ClosingTransaction_clone(&orig_conv);
+ CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ uint64_t ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1hash(JNIEnv *env, jclass clz, int64_t o) {
+ LDKClosingTransaction o_conv;
+ o_conv.inner = (void*)(o & (~1));
+ o_conv.is_owned = false;
+ int64_t ret_val = ClosingTransaction_hash(&o_conv);
+ return ret_val;
+}
+
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1new(JNIEnv *env, jclass clz, int64_t to_holder_value_sat, int64_t to_counterparty_value_sat, int8_tArray to_holder_script, int8_tArray to_counterparty_script, int64_t funding_outpoint) {
LDKCVec_u8Z to_holder_script_ref;
to_holder_script_ref.datalen = (*env)->GetArrayLength(env, to_holder_script);
return ret_ref;
}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1clone(JNIEnv *env, jclass clz, int64_t orig) {
+ LDKInvalidShutdownScript orig_conv;
+ orig_conv.inner = (void*)(orig & (~1));
+ orig_conv.is_owned = false;
+ LDKInvalidShutdownScript ret_var = InvalidShutdownScript_clone(&orig_conv);
+ CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ uint64_t ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ return ret_ref;
+}
+
JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1write(JNIEnv *env, jclass clz, int64_t obj) {
LDKShutdownScript obj_conv;
obj_conv.inner = (void*)(obj & (~1));
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CustomMessageReader_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKCustomMessageReader this_ptr_conv = *(LDKCustomMessageReader*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKCustomMessageReader this_ptr_conv = *(LDKCustomMessageReader*)(this_ptr_ptr);
FREE((void*)this_ptr);
CustomMessageReader_free(this_ptr_conv);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Type_1clone(JNIEnv *env, jclass clz, int64_t orig) {
- LDKType* orig_conv = (LDKType*)(((uint64_t)orig) & ~1);
+ void* orig_ptr = (void*)(((uint64_t)orig) & ~1);
+ if (!(orig & 1)) { CHECK_ACCESS(orig_ptr); }
+ LDKType* orig_conv = (LDKType*)orig_ptr;
LDKType* ret_ret =MALLOC(sizeof(LDKType), "LDKType");
*ret_ret = Type_clone(orig_conv);
return (uint64_t)ret_ret;
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Type_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKType this_ptr_conv = *(LDKType*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKType this_ptr_conv = *(LDKType*)(this_ptr_ptr);
FREE((void*)this_ptr);
Type_free(this_ptr_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Score_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKScore this_ptr_conv = *(LDKScore*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKScore this_ptr_conv = *(LDKScore*)(this_ptr_ptr);
FREE((void*)this_ptr);
Score_free(this_ptr_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKNetworkUpdate this_ptr_conv = *(LDKNetworkUpdate*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKNetworkUpdate this_ptr_conv = *(LDKNetworkUpdate*)(this_ptr_ptr);
FREE((void*)this_ptr);
NetworkUpdate_free(this_ptr_conv);
}
network_graph_conv.inner = (void*)(network_graph & (~1));
network_graph_conv.is_owned = (network_graph & 1) || (network_graph == 0);
network_graph_conv = NetworkGraph_clone(&network_graph_conv);
- LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(((uint64_t)chain_access) & ~1);
+ void* chain_access_ptr = (void*)(((uint64_t)chain_access) & ~1);
+ CHECK_ACCESS(chain_access_ptr);
+ LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(chain_access_ptr);
// Warning: we may need a move here but no clone is available for LDKCOption_AccessZ
if (chain_access_conv.tag == LDKCOption_AccessZ_Some) {
// Manually implement clone for Java trait instances
LDKAccess_JCalls_cloned(&chain_access_conv.some);
}
}
- LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1);
+ void* logger_ptr = (void*)(((uint64_t)logger) & ~1);
+ CHECK_ACCESS(logger_ptr);
+ LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
if (logger_conv.free == LDKLogger_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKLogger_JCalls_cloned(&logger_conv);
LDKNetGraphMsgHandler this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(((uint64_t)chain_access) & ~1);
+ void* chain_access_ptr = (void*)(((uint64_t)chain_access) & ~1);
+ CHECK_ACCESS(chain_access_ptr);
+ LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(chain_access_ptr);
// Warning: we may need a move here but no clone is available for LDKCOption_AccessZ
if (chain_access_conv.tag == LDKCOption_AccessZ_Some) {
// Manually implement clone for Java trait instances
LDKDirectionalChannelInfo this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(((uint64_t)val) & ~1);
+ void* val_ptr = (void*)(((uint64_t)val) & ~1);
+ CHECK_ACCESS(val_ptr);
+ LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
val_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)val) & ~1));
DirectionalChannelInfo_set_htlc_maximum_msat(&this_ptr_conv, val_conv);
}
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1new(JNIEnv *env, jclass clz, int32_t last_update_arg, jboolean enabled_arg, int16_t cltv_expiry_delta_arg, int64_t htlc_minimum_msat_arg, int64_t htlc_maximum_msat_arg, int64_t fees_arg, int64_t last_update_message_arg) {
- LDKCOption_u64Z htlc_maximum_msat_arg_conv = *(LDKCOption_u64Z*)(((uint64_t)htlc_maximum_msat_arg) & ~1);
+ void* htlc_maximum_msat_arg_ptr = (void*)(((uint64_t)htlc_maximum_msat_arg) & ~1);
+ CHECK_ACCESS(htlc_maximum_msat_arg_ptr);
+ LDKCOption_u64Z htlc_maximum_msat_arg_conv = *(LDKCOption_u64Z*)(htlc_maximum_msat_arg_ptr);
htlc_maximum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)htlc_maximum_msat_arg) & ~1));
LDKRoutingFees fees_arg_conv;
fees_arg_conv.inner = (void*)(fees_arg & (~1));
LDKChannelInfo this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(((uint64_t)val) & ~1);
+ void* val_ptr = (void*)(((uint64_t)val) & ~1);
+ CHECK_ACCESS(val_ptr);
+ LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
val_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)val) & ~1));
ChannelInfo_set_capacity_sats(&this_ptr_conv, val_conv);
}
two_to_one_arg_conv.inner = (void*)(two_to_one_arg & (~1));
two_to_one_arg_conv.is_owned = (two_to_one_arg & 1) || (two_to_one_arg == 0);
two_to_one_arg_conv = DirectionalChannelInfo_clone(&two_to_one_arg_conv);
- LDKCOption_u64Z capacity_sats_arg_conv = *(LDKCOption_u64Z*)(((uint64_t)capacity_sats_arg) & ~1);
+ void* capacity_sats_arg_ptr = (void*)(((uint64_t)capacity_sats_arg) & ~1);
+ CHECK_ACCESS(capacity_sats_arg_ptr);
+ LDKCOption_u64Z capacity_sats_arg_conv = *(LDKCOption_u64Z*)(capacity_sats_arg_ptr);
capacity_sats_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)capacity_sats_arg) & ~1));
LDKChannelAnnouncement announcement_message_arg_conv;
announcement_message_arg_conv.inner = (void*)(announcement_message_arg & (~1));
int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL);
for (size_t m = 0; m < val_constr.datalen; m++) {
int64_t val_conv_12 = val_vals[m];
- LDKNetAddress val_conv_12_conv = *(LDKNetAddress*)(((uint64_t)val_conv_12) & ~1);
+ void* val_conv_12_ptr = (void*)(((uint64_t)val_conv_12) & ~1);
+ CHECK_ACCESS(val_conv_12_ptr);
+ LDKNetAddress val_conv_12_conv = *(LDKNetAddress*)(val_conv_12_ptr);
val_conv_12_conv = NetAddress_clone((LDKNetAddress*)(((uint64_t)val_conv_12) & ~1));
val_constr.data[m] = val_conv_12_conv;
}
int64_t* addresses_arg_vals = (*env)->GetLongArrayElements (env, addresses_arg, NULL);
for (size_t m = 0; m < addresses_arg_constr.datalen; m++) {
int64_t addresses_arg_conv_12 = addresses_arg_vals[m];
- LDKNetAddress addresses_arg_conv_12_conv = *(LDKNetAddress*)(((uint64_t)addresses_arg_conv_12) & ~1);
+ void* addresses_arg_conv_12_ptr = (void*)(((uint64_t)addresses_arg_conv_12) & ~1);
+ CHECK_ACCESS(addresses_arg_conv_12_ptr);
+ LDKNetAddress addresses_arg_conv_12_conv = *(LDKNetAddress*)(addresses_arg_conv_12_ptr);
addresses_arg_constr.data[m] = addresses_arg_conv_12_conv;
}
(*env)->ReleaseLongArrayElements(env, addresses_arg, addresses_arg_vals, 0);
LDKChannelAnnouncement msg_conv;
msg_conv.inner = (void*)(msg & (~1));
msg_conv.is_owned = false;
- LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(((uint64_t)chain_access) & ~1);
+ void* chain_access_ptr = (void*)(((uint64_t)chain_access) & ~1);
+ CHECK_ACCESS(chain_access_ptr);
+ LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(chain_access_ptr);
// Warning: we may need a move here but no clone is available for LDKCOption_AccessZ
if (chain_access_conv.tag == LDKCOption_AccessZ_Some) {
// Manually implement clone for Java trait instances
LDKUnsignedChannelAnnouncement msg_conv;
msg_conv.inner = (void*)(msg & (~1));
msg_conv.is_owned = false;
- LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(((uint64_t)chain_access) & ~1);
+ void* chain_access_ptr = (void*)(((uint64_t)chain_access) & ~1);
+ CHECK_ACCESS(chain_access_ptr);
+ LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(chain_access_ptr);
// Warning: we may need a move here but no clone is available for LDKCOption_AccessZ
if (chain_access_conv.tag == LDKCOption_AccessZ_Some) {
// Manually implement clone for Java trait instances
LDKRouteHintHop this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(((uint64_t)val) & ~1);
+ void* val_ptr = (void*)(((uint64_t)val) & ~1);
+ CHECK_ACCESS(val_ptr);
+ LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
val_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)val) & ~1));
RouteHintHop_set_htlc_minimum_msat(&this_ptr_conv, val_conv);
}
LDKRouteHintHop this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(((uint64_t)val) & ~1);
+ void* val_ptr = (void*)(((uint64_t)val) & ~1);
+ CHECK_ACCESS(val_ptr);
+ LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
val_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)val) & ~1));
RouteHintHop_set_htlc_maximum_msat(&this_ptr_conv, val_conv);
}
fees_arg_conv.inner = (void*)(fees_arg & (~1));
fees_arg_conv.is_owned = (fees_arg & 1) || (fees_arg == 0);
fees_arg_conv = RoutingFees_clone(&fees_arg_conv);
- LDKCOption_u64Z htlc_minimum_msat_arg_conv = *(LDKCOption_u64Z*)(((uint64_t)htlc_minimum_msat_arg) & ~1);
+ void* htlc_minimum_msat_arg_ptr = (void*)(((uint64_t)htlc_minimum_msat_arg) & ~1);
+ CHECK_ACCESS(htlc_minimum_msat_arg_ptr);
+ LDKCOption_u64Z htlc_minimum_msat_arg_conv = *(LDKCOption_u64Z*)(htlc_minimum_msat_arg_ptr);
htlc_minimum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)htlc_minimum_msat_arg) & ~1));
- LDKCOption_u64Z htlc_maximum_msat_arg_conv = *(LDKCOption_u64Z*)(((uint64_t)htlc_maximum_msat_arg) & ~1);
+ void* htlc_maximum_msat_arg_ptr = (void*)(((uint64_t)htlc_maximum_msat_arg) & ~1);
+ CHECK_ACCESS(htlc_maximum_msat_arg_ptr);
+ LDKCOption_u64Z htlc_maximum_msat_arg_conv = *(LDKCOption_u64Z*)(htlc_maximum_msat_arg_ptr);
htlc_maximum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)htlc_maximum_msat_arg) & ~1));
LDKRouteHintHop ret_var = RouteHintHop_new(src_node_id_arg_ref, short_channel_id_arg, fees_arg_conv, cltv_expiry_delta_arg, htlc_minimum_msat_arg_conv, htlc_maximum_msat_arg_conv);
CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
last_hops_constr.data[l] = last_hops_conv_11_conv;
}
(*env)->ReleaseLongArrayElements(env, last_hops, last_hops_vals, 0);
- LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1);
+ void* logger_ptr = (void*)(((uint64_t)logger) & ~1);
+ CHECK_ACCESS(logger_ptr);
+ LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
if (logger_conv.free == LDKLogger_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKLogger_JCalls_cloned(&logger_conv);
}
- LDKScore* scorer_conv = (LDKScore*)(((uint64_t)scorer) & ~1);
+ void* scorer_ptr = (void*)(((uint64_t)scorer) & ~1);
+ if (!(scorer & 1)) { CHECK_ACCESS(scorer_ptr); }
+ LDKScore* scorer_conv = (LDKScore*)scorer_ptr;
LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
*ret_conv = get_keysend_route(our_node_pubkey_ref, &network_conv, payee_ref, first_hops_ptr, last_hops_constr, final_value_msat, final_cltv, logger_conv, scorer_conv);
if (first_hops_ptr != NULL) { FREE(first_hops_constr.data); }
last_hops_constr.data[l] = last_hops_conv_11_conv;
}
(*env)->ReleaseLongArrayElements(env, last_hops, last_hops_vals, 0);
- LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1);
+ void* logger_ptr = (void*)(((uint64_t)logger) & ~1);
+ CHECK_ACCESS(logger_ptr);
+ LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
if (logger_conv.free == LDKLogger_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKLogger_JCalls_cloned(&logger_conv);
}
- LDKScore* scorer_conv = (LDKScore*)(((uint64_t)scorer) & ~1);
+ void* scorer_ptr = (void*)(((uint64_t)scorer) & ~1);
+ if (!(scorer & 1)) { CHECK_ACCESS(scorer_ptr); }
+ LDKScore* scorer_conv = (LDKScore*)scorer_ptr;
LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
*ret_conv = get_route(our_node_pubkey_ref, &network_conv, payee_ref, payee_features_conv, first_hops_ptr, last_hops_constr, final_value_msat, final_cltv, logger_conv, scorer_conv);
if (first_hops_ptr != NULL) { FREE(first_hops_constr.data); }
LDKFilesystemPersister this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(((uint64_t)keys_manager) & ~1);
+ void* keys_manager_ptr = (void*)(((uint64_t)keys_manager) & ~1);
+ CHECK_ACCESS(keys_manager_ptr);
+ LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(keys_manager_ptr);
if (keys_manager_conv.free == LDKKeysInterface_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKKeysInterface_JCalls_cloned(&keys_manager_conv);
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerPersister_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKChannelManagerPersister this_ptr_conv = *(LDKChannelManagerPersister*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKChannelManagerPersister this_ptr_conv = *(LDKChannelManagerPersister*)(this_ptr_ptr);
FREE((void*)this_ptr);
ChannelManagerPersister_free(this_ptr_conv);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BackgroundProcessor_1start(JNIEnv *env, jclass clz, int64_t persister, int64_t event_handler, int64_t chain_monitor, int64_t channel_manager, int64_t net_graph_msg_handler, int64_t peer_manager, int64_t logger) {
- LDKChannelManagerPersister persister_conv = *(LDKChannelManagerPersister*)(((uint64_t)persister) & ~1);
+ void* persister_ptr = (void*)(((uint64_t)persister) & ~1);
+ CHECK_ACCESS(persister_ptr);
+ LDKChannelManagerPersister persister_conv = *(LDKChannelManagerPersister*)(persister_ptr);
if (persister_conv.free == LDKChannelManagerPersister_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKChannelManagerPersister_JCalls_cloned(&persister_conv);
}
- LDKEventHandler event_handler_conv = *(LDKEventHandler*)(((uint64_t)event_handler) & ~1);
+ void* event_handler_ptr = (void*)(((uint64_t)event_handler) & ~1);
+ CHECK_ACCESS(event_handler_ptr);
+ LDKEventHandler event_handler_conv = *(LDKEventHandler*)(event_handler_ptr);
if (event_handler_conv.free == LDKEventHandler_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKEventHandler_JCalls_cloned(&event_handler_conv);
LDKPeerManager peer_manager_conv;
peer_manager_conv.inner = (void*)(peer_manager & (~1));
peer_manager_conv.is_owned = false;
- LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1);
+ void* logger_ptr = (void*)(((uint64_t)logger) & ~1);
+ CHECK_ACCESS(logger_ptr);
+ LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
if (logger_conv.free == LDKLogger_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKLogger_JCalls_cloned(&logger_conv);
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Fallback_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKFallback this_ptr_conv = *(LDKFallback*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKFallback this_ptr_conv = *(LDKFallback*)(this_ptr_ptr);
FREE((void*)this_ptr);
Fallback_free(this_ptr_conv);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SignOrCreationError_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKSignOrCreationError this_ptr_conv = *(LDKSignOrCreationError*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKSignOrCreationError this_ptr_conv = *(LDKSignOrCreationError*)(this_ptr_ptr);
FREE((void*)this_ptr);
SignOrCreationError_free(this_ptr_conv);
}
LDKChannelManager channelmanager_conv;
channelmanager_conv.inner = (void*)(channelmanager & (~1));
channelmanager_conv.is_owned = false;
- LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(((uint64_t)keys_manager) & ~1);
+ void* keys_manager_ptr = (void*)(((uint64_t)keys_manager) & ~1);
+ CHECK_ACCESS(keys_manager_ptr);
+ LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(keys_manager_ptr);
if (keys_manager_conv.free == LDKKeysInterface_JCalls_free) {
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKKeysInterface_JCalls_cloned(&keys_manager_conv);
}
LDKCurrency network_conv = LDKCurrency_from_java(env, network);
- LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(((uint64_t)amt_msat) & ~1);
+ void* amt_msat_ptr = (void*)(((uint64_t)amt_msat) & ~1);
+ CHECK_ACCESS(amt_msat_ptr);
+ LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr);
amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)amt_msat) & ~1));
LDKStr description_conv = java_to_owned_str(env, description);
LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxOutAccessErrorZ_1get_1err
(JNIEnv *, jclass, jlong);
-/*
- * Class: org_ldk_impl_bindings
- * Method: LDKC2Tuple_usizeTransactionZ_new
- * Signature: (J[B)J
- */
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1usizeTransactionZ_1new
- (JNIEnv *, jclass, jlong, jbyteArray);
-
/*
* Class: org_ldk_impl_bindings
* Method: C2Tuple_usizeTransactionZ_get_a
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneNoneZ_1get_1err
(JNIEnv *, jclass, jlong);
-/*
- * Class: org_ldk_impl_bindings
- * Method: LDKC2Tuple_SignatureCVec_SignatureZZ_new
- * Signature: ([B[[B)J
- */
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1SignatureCVec_1SignatureZZ_1new
- (JNIEnv *, jclass, jbyteArray, jobjectArray);
-
/*
* Class: org_ldk_impl_bindings
* Method: C2Tuple_SignatureCVec_SignatureZZ_get_a
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TransactionNoneZ_1get_1err
(JNIEnv *, jclass, jlong);
-/*
- * Class: org_ldk_impl_bindings
- * Method: LDKC2Tuple_BlockHashChannelMonitorZ_new
- * Signature: ([BJ)J
- */
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1BlockHashChannelMonitorZ_1new
- (JNIEnv *, jclass, jbyteArray, jlong);
-
/*
* Class: org_ldk_impl_bindings
* Method: C2Tuple_BlockHashChannelMonitorZ_get_a
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NonePaymentSendFailureZ_1get_1err
(JNIEnv *, jclass, jlong);
-/*
- * Class: org_ldk_impl_bindings
- * Method: LDKC2Tuple_PaymentHashPaymentIdZ_new
- * Signature: ([BJ)J
- */
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1PaymentHashPaymentIdZ_1new
- (JNIEnv *, jclass, jbyteArray, jlong);
-
/*
* Class: org_ldk_impl_bindings
* Method: C2Tuple_PaymentHashPaymentIdZ_get_a
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1NetAddressZ_1new
(JNIEnv *, jclass, jlongArray);
-/*
- * Class: org_ldk_impl_bindings
- * Method: LDKC2Tuple_PaymentHashPaymentSecretZ_new
- * Signature: ([B[B)J
- */
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1PaymentHashPaymentSecretZ_1new
- (JNIEnv *, jclass, jbyteArray, jbyteArray);
-
/*
* Class: org_ldk_impl_bindings
* Method: C2Tuple_PaymentHashPaymentSecretZ_get_a
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKLogger_1new
(JNIEnv *, jclass, jobject);
-/*
- * Class: org_ldk_impl_bindings
- * Method: LDKC2Tuple_BlockHashChannelManagerZ_new
- * Signature: ([BJ)J
- */
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1BlockHashChannelManagerZ_1new
- (JNIEnv *, jclass, jbyteArray, jlong);
-
/*
* Class: org_ldk_impl_bindings
* Method: C2Tuple_BlockHashChannelManagerZ_get_a
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SignedRawInvoiceNoneZ_1get_1err
(JNIEnv *, jclass, jlong);
-/*
- * Class: org_ldk_impl_bindings
- * Method: LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ_new
- * Signature: (J[BJ)J
- */
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1new
- (JNIEnv *, jclass, jlong, jbyteArray, jlong);
-
/*
* Class: org_ldk_impl_bindings
* Method: C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_a
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneMonitorUpdateErrorZ_1get_1err
(JNIEnv *, jclass, jlong);
-/*
- * Class: org_ldk_impl_bindings
- * Method: LDKC2Tuple_OutPointScriptZ_new
- * Signature: (J[B)J
- */
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1OutPointScriptZ_1new
- (JNIEnv *, jclass, jlong, jbyteArray);
-
/*
* Class: org_ldk_impl_bindings
* Method: C2Tuple_OutPointScriptZ_get_a
JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1get_1b
(JNIEnv *, jclass, jlong);
-/*
- * Class: org_ldk_impl_bindings
- * Method: LDKC2Tuple_u32ScriptZ_new
- * Signature: (I[B)J
- */
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1u32ScriptZ_1new
- (JNIEnv *, jclass, jint, jbyteArray);
-
/*
* Class: org_ldk_impl_bindings
* Method: C2Tuple_u32ScriptZ_get_a
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1C2Tuple_1u32ScriptZZ_1new
(JNIEnv *, jclass, jlongArray);
-/*
- * Class: org_ldk_impl_bindings
- * Method: LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new
- * Signature: ([B[J)J
- */
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZ_1new
- (JNIEnv *, jclass, jbyteArray, jlongArray);
-
/*
* Class: org_ldk_impl_bindings
* Method: C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_a
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1EventZ_1new
(JNIEnv *, jclass, jlongArray);
-/*
- * Class: org_ldk_impl_bindings
- * Method: LDKC2Tuple_u32TxOutZ_new
- * Signature: (IJ)J
- */
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1u32TxOutZ_1new
- (JNIEnv *, jclass, jint, jlong);
-
/*
* Class: org_ldk_impl_bindings
* Method: C2Tuple_u32TxOutZ_get_a
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1C2Tuple_1u32TxOutZZ_1new
(JNIEnv *, jclass, jlongArray);
-/*
- * Class: org_ldk_impl_bindings
- * Method: LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new
- * Signature: ([B[J)J
- */
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZ_1new
- (JNIEnv *, jclass, jbyteArray, jlongArray);
-
/*
* Class: org_ldk_impl_bindings
* Method: C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_a
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneLightningErrorZ_1get_1err
(JNIEnv *, jclass, jlong);
-/*
- * Class: org_ldk_impl_bindings
- * Method: LDKC2Tuple_PublicKeyTypeZ_new
- * Signature: ([BJ)J
- */
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1PublicKeyTypeZ_1new
- (JNIEnv *, jclass, jbyteArray, jlong);
-
/*
* Class: org_ldk_impl_bindings
* Method: C2Tuple_PublicKeyTypeZ_get_a
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1boolLightningErrorZ_1get_1err
(JNIEnv *, jclass, jlong);
-/*
- * Class: org_ldk_impl_bindings
- * Method: LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new
- * Signature: (JJJ)J
- */
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1new
- (JNIEnv *, jclass, jlong, jlong, jlong);
-
/*
* Class: org_ldk_impl_bindings
* Method: C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptInvalidShutdownScriptZ_1free
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CResult_ShutdownScriptInvalidShutdownScriptZ_clone
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptInvalidShutdownScriptZ_1clone
+ (JNIEnv *, jclass, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: CResult_NoneErrorZ_ok
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1free
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: ClosingTransaction_clone
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1clone
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: ClosingTransaction_hash
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1hash
+ (JNIEnv *, jclass, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: ClosingTransaction_new
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1new
(JNIEnv *, jclass, jbyteArray);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: InvalidShutdownScript_clone
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1clone
+ (JNIEnv *, jclass, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: ShutdownScript_write
#define FREE(p) if ((unsigned long)(p) > 1024) { free(p); }
#define DO_ASSERT(a) (void)(a)
#define CHECK(a)
+#define CHECK_ACCESS(p)
// We assume that CVec_u8Z and u8slice are the same size and layout (and thus pointers to the two can be mixed)
_Static_assert(sizeof(LDKCVec_u8Z) == sizeof(LDKu8slice), "Vec<u8> and [u8] need to have been mapped identically");
uint32_t err_conv = LDKAccessError_to_js((*val->contents.err));
return err_conv;
}
-uint32_t __attribute__((visibility("default"))) TS_LDKC2Tuple_usizeTransactionZ_new(int64_t a, int8_tArray b) {
- LDKC2Tuple_usizeTransactionZ* ret = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ");
- ret->a = a;
- LDKTransaction b_ref;
- b_ref.datalen = *((uint32_t*)b);
- b_ref.data = MALLOC(b_ref.datalen, "LDKTransaction Bytes");
- memcpy(b_ref.data, (uint8_t*)(b + 4), b_ref.datalen);
- b_ref.data_is_owned = false;
- ret->b = b_ref;
- return (uint64_t)ret;
-}
static inline uintptr_t C2Tuple_usizeTransactionZ_get_a(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR tuple){
return tuple->a;
}
uint32_t *java_elems = (uint32_t*)(elems + 4);
for (size_t i = 0; i < ret->datalen; i++) {
uint32_t arr_elem = java_elems[i];
- LDKC2Tuple_usizeTransactionZ arr_elem_conv = *(LDKC2Tuple_usizeTransactionZ*)(((uint64_t)arr_elem) & ~1);
+ void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1);
+ CHECK_ACCESS(arr_elem_ptr);
+ LDKC2Tuple_usizeTransactionZ arr_elem_conv = *(LDKC2Tuple_usizeTransactionZ*)(arr_elem_ptr);
arr_elem_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)(((uint64_t)arr_elem) & ~1));
ret->data[i] = arr_elem_conv;
}
uint32_t *java_elems = (uint32_t*)(elems + 4);
for (size_t i = 0; i < ret->datalen; i++) {
uint32_t arr_elem = java_elems[i];
- LDKMonitorEvent arr_elem_conv = *(LDKMonitorEvent*)(((uint64_t)arr_elem) & ~1);
+ void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1);
+ CHECK_ACCESS(arr_elem_ptr);
+ LDKMonitorEvent arr_elem_conv = *(LDKMonitorEvent*)(arr_elem_ptr);
arr_elem_conv = MonitorEvent_clone((LDKMonitorEvent*)(((uint64_t)arr_elem) & ~1));
ret->data[i] = arr_elem_conv;
}
uint32_t *java_elems = (uint32_t*)(elems + 4);
for (size_t i = 0; i < ret->datalen; i++) {
uint32_t arr_elem = java_elems[i];
- LDKSpendableOutputDescriptor arr_elem_conv = *(LDKSpendableOutputDescriptor*)(((uint64_t)arr_elem) & ~1);
+ void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1);
+ CHECK_ACCESS(arr_elem_ptr);
+ LDKSpendableOutputDescriptor arr_elem_conv = *(LDKSpendableOutputDescriptor*)(arr_elem_ptr);
arr_elem_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)(((uint64_t)arr_elem) & ~1));
ret->data[i] = arr_elem_conv;
}
uint32_t *java_elems = (uint32_t*)(elems + 4);
for (size_t i = 0; i < ret->datalen; i++) {
uint32_t arr_elem = java_elems[i];
- LDKMessageSendEvent arr_elem_conv = *(LDKMessageSendEvent*)(((uint64_t)arr_elem) & ~1);
+ void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1);
+ CHECK_ACCESS(arr_elem_ptr);
+ LDKMessageSendEvent arr_elem_conv = *(LDKMessageSendEvent*)(arr_elem_ptr);
arr_elem_conv = MessageSendEvent_clone((LDKMessageSendEvent*)(((uint64_t)arr_elem) & ~1));
ret->data[i] = arr_elem_conv;
}
CHECK(!val->result_ok);
return *val->contents.err;
}
-uint32_t __attribute__((visibility("default"))) TS_LDKC2Tuple_SignatureCVec_SignatureZZ_new(int8_tArray a, ptrArray b) {
- LDKC2Tuple_SignatureCVec_SignatureZZ* ret = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ");
- LDKSignature a_ref;
- CHECK(*((uint32_t*)a) == 64);
- memcpy(a_ref.compact_form, (uint8_t*)(a + 4), 64);
- ret->a = a_ref;
- LDKCVec_SignatureZ b_constr;
- b_constr.datalen = *((uint32_t*)b);
- if (b_constr.datalen > 0)
- b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements");
- else
- b_constr.data = NULL;
- int8_tArray* b_vals = (int8_tArray*)(b + 4);
- for (size_t m = 0; m < b_constr.datalen; m++) {
- int8_tArray b_conv_12 = b_vals[m];
- LDKSignature b_conv_12_ref;
- CHECK(*((uint32_t*)b_conv_12) == 64);
- memcpy(b_conv_12_ref.compact_form, (uint8_t*)(b_conv_12 + 4), 64);
- b_constr.data[m] = b_conv_12_ref;
- }
- ret->b = b_constr;
- return (uint64_t)ret;
-}
static inline struct LDKSignature C2Tuple_SignatureCVec_SignatureZZ_get_a(LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR tuple){
return tuple->a;
}
holder_tx_ref |= 1;
}
uint32_t ret = js_invoke_function_1(j_calls->validate_holder_commitment_meth, holder_tx_ref);
- LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(ret_ptr);
ret_conv = CResult_NoneNoneZ_clone((LDKCResult_NoneNoneZ*)(((uint64_t)ret) & ~1));
return ret_conv;
}
commitment_tx_ref |= 1;
}
uint32_t ret = js_invoke_function_1(j_calls->sign_counterparty_commitment_meth, commitment_tx_ref);
- LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(ret_ptr);
ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone((LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(((uint64_t)ret) & ~1));
return ret_conv;
}
int8_tArray secret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(secret_arr + 4), *secret, 32);
uint32_t ret = js_invoke_function_2(j_calls->validate_counterparty_revocation_meth, idx, secret_arr);
- LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(ret_ptr);
ret_conv = CResult_NoneNoneZ_clone((LDKCResult_NoneNoneZ*)(((uint64_t)ret) & ~1));
return ret_conv;
}
commitment_tx_ref |= 1;
}
uint32_t ret = js_invoke_function_1(j_calls->sign_holder_commitment_and_htlcs_meth, commitment_tx_ref);
- LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(ret_ptr);
ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone((LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(((uint64_t)ret) & ~1));
return ret_conv;
}
int8_tArray per_commitment_key_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(per_commitment_key_arr + 4), *per_commitment_key, 32);
uint32_t ret = js_invoke_function_4(j_calls->sign_justice_revoked_output_meth, justice_tx_arr, input, amount, per_commitment_key_arr);
- LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr);
ret_conv = CResult_SignatureNoneZ_clone((LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1));
return ret_conv;
}
htlc_ref |= 1;
}
uint32_t ret = js_invoke_function_5(j_calls->sign_justice_revoked_htlc_meth, justice_tx_arr, input, amount, per_commitment_key_arr, htlc_ref);
- LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr);
ret_conv = CResult_SignatureNoneZ_clone((LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1));
return ret_conv;
}
htlc_ref |= 1;
}
uint32_t ret = js_invoke_function_5(j_calls->sign_counterparty_htlc_transaction_meth, htlc_tx_arr, input, amount, per_commitment_point_arr, htlc_ref);
- LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr);
ret_conv = CResult_SignatureNoneZ_clone((LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1));
return ret_conv;
}
LDKCResult_SignatureNoneZ sign_closing_transaction_LDKBaseSign_jcall(const void* this_arg, const LDKClosingTransaction * closing_tx) {
LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
LDKClosingTransaction closing_tx_var = *closing_tx;
- // Warning: we may need a move here but no clone is available for LDKClosingTransaction
+ closing_tx_var = ClosingTransaction_clone(closing_tx);
CHECK((((uint64_t)closing_tx_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&closing_tx_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
uint64_t closing_tx_ref = (uint64_t)closing_tx_var.inner;
closing_tx_ref |= 1;
}
uint32_t ret = js_invoke_function_1(j_calls->sign_closing_transaction_meth, closing_tx_ref);
- LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr);
ret_conv = CResult_SignatureNoneZ_clone((LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1));
return ret_conv;
}
msg_ref |= 1;
}
uint32_t ret = js_invoke_function_1(j_calls->sign_channel_announcement_meth, msg_ref);
- LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr);
ret_conv = CResult_SignatureNoneZ_clone((LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1));
return ret_conv;
}
return (long)res_ptr;
}
int8_tArray __attribute__((visibility("default"))) TS_BaseSign_get_per_commitment_point(uint32_t this_arg, int64_t idx) {
- LDKBaseSign* this_arg_conv = (LDKBaseSign*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(ret_arr + 4), (this_arg_conv->get_per_commitment_point)(this_arg_conv->this_arg, idx).compressed_form, 33);
return ret_arr;
}
int8_tArray __attribute__((visibility("default"))) TS_BaseSign_release_commitment_secret(uint32_t this_arg, int64_t idx) {
- LDKBaseSign* this_arg_conv = (LDKBaseSign*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(ret_arr + 4), (this_arg_conv->release_commitment_secret)(this_arg_conv->this_arg, idx).data, 32);
return ret_arr;
}
uint32_t __attribute__((visibility("default"))) TS_BaseSign_validate_holder_commitment(uint32_t this_arg, uint32_t holder_tx) {
- LDKBaseSign* this_arg_conv = (LDKBaseSign*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
LDKHolderCommitmentTransaction holder_tx_conv;
holder_tx_conv.inner = (void*)(holder_tx & (~1));
holder_tx_conv.is_owned = false;
}
int8_tArray __attribute__((visibility("default"))) TS_BaseSign_channel_keys_id(uint32_t this_arg) {
- LDKBaseSign* this_arg_conv = (LDKBaseSign*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(ret_arr + 4), (this_arg_conv->channel_keys_id)(this_arg_conv->this_arg).data, 32);
return ret_arr;
}
uint32_t __attribute__((visibility("default"))) TS_BaseSign_sign_counterparty_commitment(uint32_t this_arg, uint32_t commitment_tx) {
- LDKBaseSign* this_arg_conv = (LDKBaseSign*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
LDKCommitmentTransaction commitment_tx_conv;
commitment_tx_conv.inner = (void*)(commitment_tx & (~1));
commitment_tx_conv.is_owned = false;
}
uint32_t __attribute__((visibility("default"))) TS_BaseSign_validate_counterparty_revocation(uint32_t this_arg, int64_t idx, int8_tArray secret) {
- LDKBaseSign* this_arg_conv = (LDKBaseSign*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
unsigned char secret_arr[32];
CHECK(*((uint32_t*)secret) == 32);
memcpy(secret_arr, (uint8_t*)(secret + 4), 32);
}
uint32_t __attribute__((visibility("default"))) TS_BaseSign_sign_holder_commitment_and_htlcs(uint32_t this_arg, uint32_t commitment_tx) {
- LDKBaseSign* this_arg_conv = (LDKBaseSign*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
LDKHolderCommitmentTransaction commitment_tx_conv;
commitment_tx_conv.inner = (void*)(commitment_tx & (~1));
commitment_tx_conv.is_owned = false;
}
uint32_t __attribute__((visibility("default"))) TS_BaseSign_sign_justice_revoked_output(uint32_t this_arg, int8_tArray justice_tx, int64_t input, int64_t amount, int8_tArray per_commitment_key) {
- LDKBaseSign* this_arg_conv = (LDKBaseSign*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
LDKTransaction justice_tx_ref;
justice_tx_ref.datalen = *((uint32_t*)justice_tx);
justice_tx_ref.data = MALLOC(justice_tx_ref.datalen, "LDKTransaction Bytes");
}
uint32_t __attribute__((visibility("default"))) TS_BaseSign_sign_justice_revoked_htlc(uint32_t this_arg, int8_tArray justice_tx, int64_t input, int64_t amount, int8_tArray per_commitment_key, uint32_t htlc) {
- LDKBaseSign* this_arg_conv = (LDKBaseSign*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
LDKTransaction justice_tx_ref;
justice_tx_ref.datalen = *((uint32_t*)justice_tx);
justice_tx_ref.data = MALLOC(justice_tx_ref.datalen, "LDKTransaction Bytes");
}
uint32_t __attribute__((visibility("default"))) TS_BaseSign_sign_counterparty_htlc_transaction(uint32_t this_arg, int8_tArray htlc_tx, int64_t input, int64_t amount, int8_tArray per_commitment_point, uint32_t htlc) {
- LDKBaseSign* this_arg_conv = (LDKBaseSign*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
LDKTransaction htlc_tx_ref;
htlc_tx_ref.datalen = *((uint32_t*)htlc_tx);
htlc_tx_ref.data = MALLOC(htlc_tx_ref.datalen, "LDKTransaction Bytes");
}
uint32_t __attribute__((visibility("default"))) TS_BaseSign_sign_closing_transaction(uint32_t this_arg, uint32_t closing_tx) {
- LDKBaseSign* this_arg_conv = (LDKBaseSign*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
LDKClosingTransaction closing_tx_conv;
closing_tx_conv.inner = (void*)(closing_tx & (~1));
closing_tx_conv.is_owned = false;
}
uint32_t __attribute__((visibility("default"))) TS_BaseSign_sign_channel_announcement(uint32_t this_arg, uint32_t msg) {
- LDKBaseSign* this_arg_conv = (LDKBaseSign*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
LDKUnsignedChannelAnnouncement msg_conv;
msg_conv.inner = (void*)(msg & (~1));
msg_conv.is_owned = false;
}
void __attribute__((visibility("default"))) TS_BaseSign_ready_channel(uint32_t this_arg, uint32_t channel_parameters) {
- LDKBaseSign* this_arg_conv = (LDKBaseSign*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
LDKChannelTransactionParameters channel_parameters_conv;
channel_parameters_conv.inner = (void*)(channel_parameters & (~1));
channel_parameters_conv.is_owned = false;
return this_arg->pubkeys;
}
uint32_t __attribute__((visibility("default"))) TS_BaseSign_get_pubkeys(uint32_t this_arg) {
- LDKBaseSign* this_arg_conv = (LDKBaseSign*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
LDKChannelPublicKeys ret_var = LDKBaseSign_set_get_pubkeys(this_arg_conv);
CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
return (long)res_ptr;
}
int8_tArray __attribute__((visibility("default"))) TS_Sign_write(uint32_t this_arg) {
- LDKSign* this_arg_conv = (LDKSign*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKSign* this_arg_conv = (LDKSign*)this_arg_ptr;
LDKCVec_u8Z ret_var = (this_arg_conv->write)(this_arg_conv->this_arg);
int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
uint32_t *java_elems = (uint32_t*)(elems + 4);
for (size_t i = 0; i < ret->datalen; i++) {
uint32_t arr_elem = java_elems[i];
- LDKTxOut arr_elem_conv = *(LDKTxOut*)(((uint64_t)arr_elem) & ~1);
+ void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1);
+ CHECK_ACCESS(arr_elem_ptr);
+ LDKTxOut arr_elem_conv = *(LDKTxOut*)(arr_elem_ptr);
arr_elem_conv = TxOut_clone((LDKTxOut*)(((uint64_t)arr_elem) & ~1));
ret->data[i] = arr_elem_conv;
}
CHECK(!val->result_ok);
return *val->contents.err;
}
-uint32_t __attribute__((visibility("default"))) TS_LDKC2Tuple_BlockHashChannelMonitorZ_new(int8_tArray a, uint32_t b) {
- LDKC2Tuple_BlockHashChannelMonitorZ* ret = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKC2Tuple_BlockHashChannelMonitorZ");
- LDKThirtyTwoBytes a_ref;
- CHECK(*((uint32_t*)a) == 32);
- memcpy(a_ref.data, (uint8_t*)(a + 4), 32);
- ret->a = a_ref;
- LDKChannelMonitor b_conv;
- b_conv.inner = (void*)(b & (~1));
- b_conv.is_owned = (b & 1) || (b == 0);
- b_conv = ChannelMonitor_clone(&b_conv);
- ret->b = b_conv;
- return (uint64_t)ret;
-}
static inline struct LDKThirtyTwoBytes C2Tuple_BlockHashChannelMonitorZ_get_a(LDKC2Tuple_BlockHashChannelMonitorZ *NONNULL_PTR tuple){
return ThirtyTwoBytes_clone(&tuple->a);
}
uint32_t *java_elems = (uint32_t*)(elems + 4);
for (size_t i = 0; i < ret->datalen; i++) {
uint32_t arr_elem = java_elems[i];
- LDKC2Tuple_BlockHashChannelMonitorZ arr_elem_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(((uint64_t)arr_elem) & ~1);
+ void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1);
+ CHECK_ACCESS(arr_elem_ptr);
+ LDKC2Tuple_BlockHashChannelMonitorZ arr_elem_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(arr_elem_ptr);
arr_elem_conv = C2Tuple_BlockHashChannelMonitorZ_clone((LDKC2Tuple_BlockHashChannelMonitorZ*)(((uint64_t)arr_elem) & ~1));
ret->data[i] = arr_elem_conv;
}
uint32_t *java_elems = (uint32_t*)(elems + 4);
for (size_t i = 0; i < ret->datalen; i++) {
uint32_t arr_elem = java_elems[i];
- LDKCResult_NoneAPIErrorZ arr_elem_conv = *(LDKCResult_NoneAPIErrorZ*)(((uint64_t)arr_elem) & ~1);
+ void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1);
+ CHECK_ACCESS(arr_elem_ptr);
+ LDKCResult_NoneAPIErrorZ arr_elem_conv = *(LDKCResult_NoneAPIErrorZ*)(arr_elem_ptr);
arr_elem_conv = CResult_NoneAPIErrorZ_clone((LDKCResult_NoneAPIErrorZ*)(((uint64_t)arr_elem) & ~1));
ret->data[i] = arr_elem_conv;
}
uint32_t *java_elems = (uint32_t*)(elems + 4);
for (size_t i = 0; i < ret->datalen; i++) {
uint32_t arr_elem = java_elems[i];
- LDKAPIError arr_elem_conv = *(LDKAPIError*)(((uint64_t)arr_elem) & ~1);
+ void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1);
+ CHECK_ACCESS(arr_elem_ptr);
+ LDKAPIError arr_elem_conv = *(LDKAPIError*)(arr_elem_ptr);
arr_elem_conv = APIError_clone((LDKAPIError*)(((uint64_t)arr_elem) & ~1));
ret->data[i] = arr_elem_conv;
}
uint64_t err_ref = ((uint64_t)&(*val->contents.err)) | 1;
return err_ref;
}
-uint32_t __attribute__((visibility("default"))) TS_LDKC2Tuple_PaymentHashPaymentIdZ_new(int8_tArray a, uint32_t b) {
- LDKC2Tuple_PaymentHashPaymentIdZ* ret = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentIdZ), "LDKC2Tuple_PaymentHashPaymentIdZ");
- LDKThirtyTwoBytes a_ref;
- CHECK(*((uint32_t*)a) == 32);
- memcpy(a_ref.data, (uint8_t*)(a + 4), 32);
- ret->a = a_ref;
- LDKPaymentId b_conv;
- b_conv.inner = (void*)(b & (~1));
- b_conv.is_owned = (b & 1) || (b == 0);
- b_conv = PaymentId_clone(&b_conv);
- ret->b = b_conv;
- return (uint64_t)ret;
-}
static inline struct LDKThirtyTwoBytes C2Tuple_PaymentHashPaymentIdZ_get_a(LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR tuple){
return ThirtyTwoBytes_clone(&tuple->a);
}
uint32_t *java_elems = (uint32_t*)(elems + 4);
for (size_t i = 0; i < ret->datalen; i++) {
uint32_t arr_elem = java_elems[i];
- LDKNetAddress arr_elem_conv = *(LDKNetAddress*)(((uint64_t)arr_elem) & ~1);
+ void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1);
+ CHECK_ACCESS(arr_elem_ptr);
+ LDKNetAddress arr_elem_conv = *(LDKNetAddress*)(arr_elem_ptr);
arr_elem_conv = NetAddress_clone((LDKNetAddress*)(((uint64_t)arr_elem) & ~1));
ret->data[i] = arr_elem_conv;
}
}
return ret;
}
-uint32_t __attribute__((visibility("default"))) TS_LDKC2Tuple_PaymentHashPaymentSecretZ_new(int8_tArray a, int8_tArray b) {
- LDKC2Tuple_PaymentHashPaymentSecretZ* ret = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ");
- LDKThirtyTwoBytes a_ref;
- CHECK(*((uint32_t*)a) == 32);
- memcpy(a_ref.data, (uint8_t*)(a + 4), 32);
- ret->a = a_ref;
- LDKThirtyTwoBytes b_ref;
- CHECK(*((uint32_t*)b) == 32);
- memcpy(b_ref.data, (uint8_t*)(b + 4), 32);
- ret->b = b_ref;
- return (uint64_t)ret;
-}
static inline struct LDKThirtyTwoBytes C2Tuple_PaymentHashPaymentSecretZ_get_a(LDKC2Tuple_PaymentHashPaymentSecretZ *NONNULL_PTR tuple){
return ThirtyTwoBytes_clone(&tuple->a);
}
monitor_ref |= 1;
}
uint32_t ret = js_invoke_function_2(j_calls->watch_channel_meth, funding_txo_ref, monitor_ref);
- LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr);
ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone((LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)ret) & ~1));
return ret_conv;
}
update_ref |= 1;
}
uint32_t ret = js_invoke_function_2(j_calls->update_channel_meth, funding_txo_ref, update_ref);
- LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr);
ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone((LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)ret) & ~1));
return ret_conv;
}
uint32_t* ret_vals = (uint32_t*)(ret + 4);
for (size_t o = 0; o < ret_constr.datalen; o++) {
uint32_t ret_conv_14 = ret_vals[o];
- LDKMonitorEvent ret_conv_14_conv = *(LDKMonitorEvent*)(((uint64_t)ret_conv_14) & ~1);
+ void* ret_conv_14_ptr = (void*)(((uint64_t)ret_conv_14) & ~1);
+ CHECK_ACCESS(ret_conv_14_ptr);
+ LDKMonitorEvent ret_conv_14_conv = *(LDKMonitorEvent*)(ret_conv_14_ptr);
ret_conv_14_conv = MonitorEvent_clone((LDKMonitorEvent*)(((uint64_t)ret_conv_14) & ~1));
ret_constr.data[o] = ret_conv_14_conv;
}
return (long)res_ptr;
}
uint32_t __attribute__((visibility("default"))) TS_Watch_watch_channel(uint32_t this_arg, uint32_t funding_txo, uint32_t monitor) {
- LDKWatch* this_arg_conv = (LDKWatch*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKWatch* this_arg_conv = (LDKWatch*)this_arg_ptr;
LDKOutPoint funding_txo_conv;
funding_txo_conv.inner = (void*)(funding_txo & (~1));
funding_txo_conv.is_owned = (funding_txo & 1) || (funding_txo == 0);
}
uint32_t __attribute__((visibility("default"))) TS_Watch_update_channel(uint32_t this_arg, uint32_t funding_txo, uint32_t update) {
- LDKWatch* this_arg_conv = (LDKWatch*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKWatch* this_arg_conv = (LDKWatch*)this_arg_ptr;
LDKOutPoint funding_txo_conv;
funding_txo_conv.inner = (void*)(funding_txo & (~1));
funding_txo_conv.is_owned = (funding_txo & 1) || (funding_txo == 0);
}
uint32_tArray __attribute__((visibility("default"))) TS_Watch_release_pending_monitor_events(uint32_t this_arg) {
- LDKWatch* this_arg_conv = (LDKWatch*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKWatch* this_arg_conv = (LDKWatch*)this_arg_ptr;
LDKCVec_MonitorEventZ ret_var = (this_arg_conv->release_pending_monitor_events)(this_arg_conv->this_arg);
uint32_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4);
for (size_t o = 0; o < ret_var.datalen; o++) {
LDKMonitorEvent *ret_conv_14_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
- *ret_conv_14_copy = MonitorEvent_clone(&ret_var.data[o]);
+ *ret_conv_14_copy = ret_var.data[o];
uint64_t ret_conv_14_ref = (uint64_t)ret_conv_14_copy;
ret_arr_ptr[o] = ret_conv_14_ref;
}
return (long)res_ptr;
}
void __attribute__((visibility("default"))) TS_BroadcasterInterface_broadcast_transaction(uint32_t this_arg, int8_tArray tx) {
- LDKBroadcasterInterface* this_arg_conv = (LDKBroadcasterInterface*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKBroadcasterInterface* this_arg_conv = (LDKBroadcasterInterface*)this_arg_ptr;
LDKTransaction tx_ref;
tx_ref.datalen = *((uint32_t*)tx);
tx_ref.data = MALLOC(tx_ref.datalen, "LDKTransaction Bytes");
LDKSign get_channel_signer_LDKKeysInterface_jcall(const void* this_arg, bool inbound, uint64_t channel_value_satoshis) {
LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
uint32_t ret = js_invoke_function_2(j_calls->get_channel_signer_meth, inbound, channel_value_satoshis);
- LDKSign ret_conv = *(LDKSign*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKSign ret_conv = *(LDKSign*)(ret_ptr);
ret_conv = Sign_clone(&ret_conv);
return ret_conv;
}
int8_tArray reader_arr = init_arr(reader_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(reader_arr + 4), reader_var.data, reader_var.datalen);
uint32_t ret = js_invoke_function_1(j_calls->read_chan_signer_meth, reader_arr);
- LDKCResult_SignDecodeErrorZ ret_conv = *(LDKCResult_SignDecodeErrorZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_SignDecodeErrorZ ret_conv = *(LDKCResult_SignDecodeErrorZ*)(ret_ptr);
ret_conv = CResult_SignDecodeErrorZ_clone((LDKCResult_SignDecodeErrorZ*)(((uint64_t)ret) & ~1));
return ret_conv;
}
memcpy((uint8_t*)(invoice_preimage_arr + 4), invoice_preimage_var.data, invoice_preimage_var.datalen);
CVec_u8Z_free(invoice_preimage_var);
uint32_t ret = js_invoke_function_1(j_calls->sign_invoice_meth, invoice_preimage_arr);
- LDKCResult_RecoverableSignatureNoneZ ret_conv = *(LDKCResult_RecoverableSignatureNoneZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_RecoverableSignatureNoneZ ret_conv = *(LDKCResult_RecoverableSignatureNoneZ*)(ret_ptr);
ret_conv = CResult_RecoverableSignatureNoneZ_clone((LDKCResult_RecoverableSignatureNoneZ*)(((uint64_t)ret) & ~1));
return ret_conv;
}
return (long)res_ptr;
}
int8_tArray __attribute__((visibility("default"))) TS_KeysInterface_get_node_secret(uint32_t this_arg) {
- LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(ret_arr + 4), (this_arg_conv->get_node_secret)(this_arg_conv->this_arg).bytes, 32);
return ret_arr;
}
int8_tArray __attribute__((visibility("default"))) TS_KeysInterface_get_destination_script(uint32_t this_arg) {
- LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
LDKCVec_u8Z ret_var = (this_arg_conv->get_destination_script)(this_arg_conv->this_arg);
int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
}
uint32_t __attribute__((visibility("default"))) TS_KeysInterface_get_shutdown_scriptpubkey(uint32_t this_arg) {
- LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
LDKShutdownScript ret_var = (this_arg_conv->get_shutdown_scriptpubkey)(this_arg_conv->this_arg);
CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
}
uint32_t __attribute__((visibility("default"))) TS_KeysInterface_get_channel_signer(uint32_t this_arg, jboolean inbound, int64_t channel_value_satoshis) {
- LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
LDKSign* ret_ret =MALLOC(sizeof(LDKSign), "LDKSign");
*ret_ret = (this_arg_conv->get_channel_signer)(this_arg_conv->this_arg, inbound, channel_value_satoshis);
return (uint64_t)ret_ret;
}
int8_tArray __attribute__((visibility("default"))) TS_KeysInterface_get_secure_random_bytes(uint32_t this_arg) {
- LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(ret_arr + 4), (this_arg_conv->get_secure_random_bytes)(this_arg_conv->this_arg).data, 32);
return ret_arr;
}
uint32_t __attribute__((visibility("default"))) TS_KeysInterface_read_chan_signer(uint32_t this_arg, int8_tArray reader) {
- LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
LDKu8slice reader_ref;
reader_ref.datalen = *((uint32_t*)reader);
reader_ref.data = (int8_t*)(reader + 4);
}
uint32_t __attribute__((visibility("default"))) TS_KeysInterface_sign_invoice(uint32_t this_arg, int8_tArray invoice_preimage) {
- LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
LDKCVec_u8Z invoice_preimage_ref;
invoice_preimage_ref.datalen = *((uint32_t*)invoice_preimage);
invoice_preimage_ref.data = MALLOC(invoice_preimage_ref.datalen, "LDKCVec_u8Z Bytes");
return (long)res_ptr;
}
int32_t __attribute__((visibility("default"))) TS_FeeEstimator_get_est_sat_per_1000_weight(uint32_t this_arg, uint32_t confirmation_target) {
- LDKFeeEstimator* this_arg_conv = (LDKFeeEstimator*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKFeeEstimator* this_arg_conv = (LDKFeeEstimator*)this_arg_ptr;
LDKConfirmationTarget confirmation_target_conv = LDKConfirmationTarget_from_js(confirmation_target);
int32_t ret_val = (this_arg_conv->get_est_sat_per_1000_weight)(this_arg_conv->this_arg, confirmation_target_conv);
return ret_val;
*res_ptr = LDKLogger_init(o);
return (long)res_ptr;
}
-uint32_t __attribute__((visibility("default"))) TS_LDKC2Tuple_BlockHashChannelManagerZ_new(int8_tArray a, uint32_t b) {
- LDKC2Tuple_BlockHashChannelManagerZ* ret = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelManagerZ), "LDKC2Tuple_BlockHashChannelManagerZ");
- LDKThirtyTwoBytes a_ref;
- CHECK(*((uint32_t*)a) == 32);
- memcpy(a_ref.data, (uint8_t*)(a + 4), 32);
- ret->a = a_ref;
- LDKChannelManager b_conv;
- b_conv.inner = (void*)(b & (~1));
- b_conv.is_owned = (b & 1) || (b == 0);
- // Warning: we need a move here but no clone is available for LDKChannelManager
- ret->b = b_conv;
- return (uint64_t)ret;
-}
static inline struct LDKThirtyTwoBytes C2Tuple_BlockHashChannelManagerZ_get_a(LDKC2Tuple_BlockHashChannelManagerZ *NONNULL_PTR tuple){
return ThirtyTwoBytes_clone(&tuple->a);
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_ok(uint32_t arg) {
LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ *val = (LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
- LDKC2Tuple_BlockHashChannelManagerZ* res_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelManagerZ), "LDKC2Tuple_BlockHashChannelManagerZ");
- *res_conv = (*val->contents.result);
+ LDKC2Tuple_BlockHashChannelManagerZ* res_conv = &(*val->contents.result);
// Warning: we really need to clone here, but no clone is available for LDKC2Tuple_BlockHashChannelManagerZ
return ((uint64_t)res_conv) | 1;
}
return (long)res_ptr;
}
int16_t __attribute__((visibility("default"))) TS_Type_type_id(uint32_t this_arg) {
- LDKType* this_arg_conv = (LDKType*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKType* this_arg_conv = (LDKType*)this_arg_ptr;
int16_t ret_val = (this_arg_conv->type_id)(this_arg_conv->this_arg);
return ret_val;
}
jstring __attribute__((visibility("default"))) TS_Type_debug_str(uint32_t this_arg) {
- LDKType* this_arg_conv = (LDKType*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKType* this_arg_conv = (LDKType*)this_arg_ptr;
LDKStr ret_str = (this_arg_conv->debug_str)(this_arg_conv->this_arg);
jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
Str_free(ret_str);
}
int8_tArray __attribute__((visibility("default"))) TS_Type_write(uint32_t this_arg) {
- LDKType* this_arg_conv = (LDKType*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKType* this_arg_conv = (LDKType*)this_arg_ptr;
LDKCVec_u8Z ret_var = (this_arg_conv->write)(this_arg_conv->this_arg);
int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
CHECK(!val->result_ok);
return *val->contents.err;
}
-uint32_t __attribute__((visibility("default"))) TS_LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ_new(uint32_t a, int8_tArray b, uint32_t c) {
- LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* ret = MALLOC(sizeof(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ), "LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ");
- LDKRawInvoice a_conv;
- a_conv.inner = (void*)(a & (~1));
- a_conv.is_owned = (a & 1) || (a == 0);
- a_conv = RawInvoice_clone(&a_conv);
- ret->a = a_conv;
- LDKThirtyTwoBytes b_ref;
- CHECK(*((uint32_t*)b) == 32);
- memcpy(b_ref.data, (uint8_t*)(b + 4), 32);
- ret->b = b_ref;
- LDKInvoiceSignature c_conv;
- c_conv.inner = (void*)(c & (~1));
- c_conv.is_owned = (c & 1) || (c == 0);
- c_conv = InvoiceSignature_clone(&c_conv);
- ret->c = c_conv;
- return (uint64_t)ret;
-}
static inline struct LDKRawInvoice C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_a(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR tuple){
return RawInvoice_clone(&tuple->a);
}
uint64_t err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
-uint32_t __attribute__((visibility("default"))) TS_LDKC2Tuple_OutPointScriptZ_new(uint32_t a, int8_tArray b) {
- LDKC2Tuple_OutPointScriptZ* ret = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ");
- LDKOutPoint a_conv;
- a_conv.inner = (void*)(a & (~1));
- a_conv.is_owned = (a & 1) || (a == 0);
- a_conv = OutPoint_clone(&a_conv);
- ret->a = a_conv;
- LDKCVec_u8Z b_ref;
- b_ref.datalen = *((uint32_t*)b);
- b_ref.data = MALLOC(b_ref.datalen, "LDKCVec_u8Z Bytes");
- memcpy(b_ref.data, (uint8_t*)(b + 4), b_ref.datalen);
- ret->b = b_ref;
- return (uint64_t)ret;
-}
static inline struct LDKOutPoint C2Tuple_OutPointScriptZ_get_a(LDKC2Tuple_OutPointScriptZ *NONNULL_PTR tuple){
return OutPoint_clone(&tuple->a);
}
return ret_arr;
}
-uint32_t __attribute__((visibility("default"))) TS_LDKC2Tuple_u32ScriptZ_new(int32_t a, int8_tArray b) {
- LDKC2Tuple_u32ScriptZ* ret = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ), "LDKC2Tuple_u32ScriptZ");
- ret->a = a;
- LDKCVec_u8Z b_ref;
- b_ref.datalen = *((uint32_t*)b);
- b_ref.data = MALLOC(b_ref.datalen, "LDKCVec_u8Z Bytes");
- memcpy(b_ref.data, (uint8_t*)(b + 4), b_ref.datalen);
- ret->b = b_ref;
- return (uint64_t)ret;
-}
static inline uint32_t C2Tuple_u32ScriptZ_get_a(LDKC2Tuple_u32ScriptZ *NONNULL_PTR tuple){
return tuple->a;
}
uint32_t *java_elems = (uint32_t*)(elems + 4);
for (size_t i = 0; i < ret->datalen; i++) {
uint32_t arr_elem = java_elems[i];
- LDKC2Tuple_u32ScriptZ arr_elem_conv = *(LDKC2Tuple_u32ScriptZ*)(((uint64_t)arr_elem) & ~1);
+ void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1);
+ CHECK_ACCESS(arr_elem_ptr);
+ LDKC2Tuple_u32ScriptZ arr_elem_conv = *(LDKC2Tuple_u32ScriptZ*)(arr_elem_ptr);
arr_elem_conv = C2Tuple_u32ScriptZ_clone((LDKC2Tuple_u32ScriptZ*)(((uint64_t)arr_elem) & ~1));
ret->data[i] = arr_elem_conv;
}
}
return ret;
}
-uint32_t __attribute__((visibility("default"))) TS_LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new(int8_tArray a, uint32_tArray b) {
- LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* ret = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ");
- LDKThirtyTwoBytes a_ref;
- CHECK(*((uint32_t*)a) == 32);
- memcpy(a_ref.data, (uint8_t*)(a + 4), 32);
- ret->a = a_ref;
- LDKCVec_C2Tuple_u32ScriptZZ b_constr;
- b_constr.datalen = *((uint32_t*)b);
- if (b_constr.datalen > 0)
- b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKC2Tuple_u32ScriptZ), "LDKCVec_C2Tuple_u32ScriptZZ Elements");
- else
- b_constr.data = NULL;
- uint32_t* b_vals = (uint32_t*)(b + 4);
- for (size_t v = 0; v < b_constr.datalen; v++) {
- uint32_t b_conv_21 = b_vals[v];
- LDKC2Tuple_u32ScriptZ b_conv_21_conv = *(LDKC2Tuple_u32ScriptZ*)(((uint64_t)b_conv_21) & ~1);
- b_conv_21_conv = C2Tuple_u32ScriptZ_clone((LDKC2Tuple_u32ScriptZ*)(((uint64_t)b_conv_21) & ~1));
- b_constr.data[v] = b_conv_21_conv;
- }
- ret->b = b_constr;
- return (uint64_t)ret;
-}
static inline struct LDKThirtyTwoBytes C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_a(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *NONNULL_PTR tuple){
return ThirtyTwoBytes_clone(&tuple->a);
}
uint32_t *java_elems = (uint32_t*)(elems + 4);
for (size_t i = 0; i < ret->datalen; i++) {
uint32_t arr_elem = java_elems[i];
- LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ arr_elem_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(((uint64_t)arr_elem) & ~1);
+ void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1);
+ CHECK_ACCESS(arr_elem_ptr);
+ LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ arr_elem_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(arr_elem_ptr);
arr_elem_conv = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone((LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(((uint64_t)arr_elem) & ~1));
ret->data[i] = arr_elem_conv;
}
uint32_t *java_elems = (uint32_t*)(elems + 4);
for (size_t i = 0; i < ret->datalen; i++) {
uint32_t arr_elem = java_elems[i];
- LDKEvent arr_elem_conv = *(LDKEvent*)(((uint64_t)arr_elem) & ~1);
+ void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1);
+ CHECK_ACCESS(arr_elem_ptr);
+ LDKEvent arr_elem_conv = *(LDKEvent*)(arr_elem_ptr);
arr_elem_conv = Event_clone((LDKEvent*)(((uint64_t)arr_elem) & ~1));
ret->data[i] = arr_elem_conv;
}
}
return ret;
}
-uint32_t __attribute__((visibility("default"))) TS_LDKC2Tuple_u32TxOutZ_new(int32_t a, uint32_t b) {
- LDKC2Tuple_u32TxOutZ* ret = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ), "LDKC2Tuple_u32TxOutZ");
- ret->a = a;
- LDKTxOut b_conv = *(LDKTxOut*)(((uint64_t)b) & ~1);
- b_conv = TxOut_clone((LDKTxOut*)(((uint64_t)b) & ~1));
- ret->b = b_conv;
- return (uint64_t)ret;
-}
static inline uint32_t C2Tuple_u32TxOutZ_get_a(LDKC2Tuple_u32TxOutZ *NONNULL_PTR tuple){
return tuple->a;
}
uint32_t *java_elems = (uint32_t*)(elems + 4);
for (size_t i = 0; i < ret->datalen; i++) {
uint32_t arr_elem = java_elems[i];
- LDKC2Tuple_u32TxOutZ arr_elem_conv = *(LDKC2Tuple_u32TxOutZ*)(((uint64_t)arr_elem) & ~1);
+ void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1);
+ CHECK_ACCESS(arr_elem_ptr);
+ LDKC2Tuple_u32TxOutZ arr_elem_conv = *(LDKC2Tuple_u32TxOutZ*)(arr_elem_ptr);
arr_elem_conv = C2Tuple_u32TxOutZ_clone((LDKC2Tuple_u32TxOutZ*)(((uint64_t)arr_elem) & ~1));
ret->data[i] = arr_elem_conv;
}
}
return ret;
}
-uint32_t __attribute__((visibility("default"))) TS_LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(int8_tArray a, uint32_tArray b) {
- LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ");
- LDKThirtyTwoBytes a_ref;
- CHECK(*((uint32_t*)a) == 32);
- memcpy(a_ref.data, (uint8_t*)(a + 4), 32);
- ret->a = a_ref;
- LDKCVec_C2Tuple_u32TxOutZZ b_constr;
- b_constr.datalen = *((uint32_t*)b);
- if (b_constr.datalen > 0)
- b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKC2Tuple_u32TxOutZ), "LDKCVec_C2Tuple_u32TxOutZZ Elements");
- else
- b_constr.data = NULL;
- uint32_t* b_vals = (uint32_t*)(b + 4);
- for (size_t u = 0; u < b_constr.datalen; u++) {
- uint32_t b_conv_20 = b_vals[u];
- LDKC2Tuple_u32TxOutZ b_conv_20_conv = *(LDKC2Tuple_u32TxOutZ*)(((uint64_t)b_conv_20) & ~1);
- b_conv_20_conv = C2Tuple_u32TxOutZ_clone((LDKC2Tuple_u32TxOutZ*)(((uint64_t)b_conv_20) & ~1));
- b_constr.data[u] = b_conv_20_conv;
- }
- ret->b = b_constr;
- return (uint64_t)ret;
-}
static inline struct LDKThirtyTwoBytes C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_a(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR tuple){
return ThirtyTwoBytes_clone(&tuple->a);
}
uint32_t *java_elems = (uint32_t*)(elems + 4);
for (size_t i = 0; i < ret->datalen; i++) {
uint32_t arr_elem = java_elems[i];
- LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ arr_elem_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(((uint64_t)arr_elem) & ~1);
+ void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1);
+ CHECK_ACCESS(arr_elem_ptr);
+ LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ arr_elem_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(arr_elem_ptr);
arr_elem_conv = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone((LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(((uint64_t)arr_elem) & ~1));
ret->data[i] = arr_elem_conv;
}
uint32_t *java_elems = (uint32_t*)(elems + 4);
for (size_t i = 0; i < ret->datalen; i++) {
uint32_t arr_elem = java_elems[i];
- LDKBalance arr_elem_conv = *(LDKBalance*)(((uint64_t)arr_elem) & ~1);
+ void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1);
+ CHECK_ACCESS(arr_elem_ptr);
+ LDKBalance arr_elem_conv = *(LDKBalance*)(arr_elem_ptr);
arr_elem_conv = Balance_clone((LDKBalance*)(((uint64_t)arr_elem) & ~1));
ret->data[i] = arr_elem_conv;
}
uint64_t err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
-uint32_t __attribute__((visibility("default"))) TS_LDKC2Tuple_PublicKeyTypeZ_new(int8_tArray a, uint32_t b) {
- LDKC2Tuple_PublicKeyTypeZ* ret = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKC2Tuple_PublicKeyTypeZ");
- LDKPublicKey a_ref;
- CHECK(*((uint32_t*)a) == 33);
- memcpy(a_ref.compressed_form, (uint8_t*)(a + 4), 33);
- ret->a = a_ref;
- LDKType b_conv = *(LDKType*)(((uint64_t)b) & ~1);
- b_conv = Type_clone(&b_conv);
- ret->b = b_conv;
- return (uint64_t)ret;
-}
static inline struct LDKPublicKey C2Tuple_PublicKeyTypeZ_get_a(LDKC2Tuple_PublicKeyTypeZ *NONNULL_PTR tuple){
return tuple->a;
}
uint32_t *java_elems = (uint32_t*)(elems + 4);
for (size_t i = 0; i < ret->datalen; i++) {
uint32_t arr_elem = java_elems[i];
- LDKC2Tuple_PublicKeyTypeZ arr_elem_conv = *(LDKC2Tuple_PublicKeyTypeZ*)(((uint64_t)arr_elem) & ~1);
+ void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1);
+ CHECK_ACCESS(arr_elem_ptr);
+ LDKC2Tuple_PublicKeyTypeZ arr_elem_conv = *(LDKC2Tuple_PublicKeyTypeZ*)(arr_elem_ptr);
arr_elem_conv = C2Tuple_PublicKeyTypeZ_clone((LDKC2Tuple_PublicKeyTypeZ*)(((uint64_t)arr_elem) & ~1));
ret->data[i] = arr_elem_conv;
}
uint64_t err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
-uint32_t __attribute__((visibility("default"))) TS_LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(uint32_t a, uint32_t b, uint32_t c) {
- LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ");
- LDKChannelAnnouncement a_conv;
- a_conv.inner = (void*)(a & (~1));
- a_conv.is_owned = (a & 1) || (a == 0);
- a_conv = ChannelAnnouncement_clone(&a_conv);
- ret->a = a_conv;
- LDKChannelUpdate b_conv;
- b_conv.inner = (void*)(b & (~1));
- b_conv.is_owned = (b & 1) || (b == 0);
- b_conv = ChannelUpdate_clone(&b_conv);
- ret->b = b_conv;
- LDKChannelUpdate c_conv;
- c_conv.inner = (void*)(c & (~1));
- c_conv.is_owned = (c & 1) || (c == 0);
- c_conv = ChannelUpdate_clone(&c_conv);
- ret->c = c_conv;
- return (uint64_t)ret;
-}
static inline struct LDKChannelAnnouncement C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR tuple){
return ChannelAnnouncement_clone(&tuple->a);
}
uint32_t *java_elems = (uint32_t*)(elems + 4);
for (size_t i = 0; i < ret->datalen; i++) {
uint32_t arr_elem = java_elems[i];
- LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ arr_elem_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(((uint64_t)arr_elem) & ~1);
+ void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1);
+ CHECK_ACCESS(arr_elem_ptr);
+ LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ arr_elem_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(arr_elem_ptr);
arr_elem_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone((LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(((uint64_t)arr_elem) & ~1));
ret->data[i] = arr_elem_conv;
}
int8_tArray genesis_hash_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(genesis_hash_arr + 4), *genesis_hash, 32);
uint32_t ret = js_invoke_function_2(j_calls->get_utxo_meth, genesis_hash_arr, short_channel_id);
- LDKCResult_TxOutAccessErrorZ ret_conv = *(LDKCResult_TxOutAccessErrorZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_TxOutAccessErrorZ ret_conv = *(LDKCResult_TxOutAccessErrorZ*)(ret_ptr);
ret_conv = CResult_TxOutAccessErrorZ_clone((LDKCResult_TxOutAccessErrorZ*)(((uint64_t)ret) & ~1));
return ret_conv;
}
return (long)res_ptr;
}
uint32_t __attribute__((visibility("default"))) TS_Access_get_utxo(uint32_t this_arg, int8_tArray genesis_hash, int64_t short_channel_id) {
- LDKAccess* this_arg_conv = (LDKAccess*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKAccess* this_arg_conv = (LDKAccess*)this_arg_ptr;
unsigned char genesis_hash_arr[32];
CHECK(*((uint32_t*)genesis_hash) == 32);
memcpy(genesis_hash_arr, (uint8_t*)(genesis_hash + 4), 32);
output_ref |= 1;
}
uint32_t ret = js_invoke_function_1(j_calls->register_output_meth, output_ref);
- LDKCOption_C2Tuple_usizeTransactionZZ ret_conv = *(LDKCOption_C2Tuple_usizeTransactionZZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCOption_C2Tuple_usizeTransactionZZ ret_conv = *(LDKCOption_C2Tuple_usizeTransactionZZ*)(ret_ptr);
ret_conv = COption_C2Tuple_usizeTransactionZZ_clone((LDKCOption_C2Tuple_usizeTransactionZZ*)(((uint64_t)ret) & ~1));
return ret_conv;
}
return (long)res_ptr;
}
void __attribute__((visibility("default"))) TS_Filter_register_tx(uint32_t this_arg, int8_tArray txid, int8_tArray script_pubkey) {
- LDKFilter* this_arg_conv = (LDKFilter*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKFilter* this_arg_conv = (LDKFilter*)this_arg_ptr;
unsigned char txid_arr[32];
CHECK(*((uint32_t*)txid) == 32);
memcpy(txid_arr, (uint8_t*)(txid + 4), 32);
}
uint32_t __attribute__((visibility("default"))) TS_Filter_register_output(uint32_t this_arg, uint32_t output) {
- LDKFilter* this_arg_conv = (LDKFilter*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKFilter* this_arg_conv = (LDKFilter*)this_arg_ptr;
LDKWatchedOutput output_conv;
output_conv.inner = (void*)(output & (~1));
output_conv.is_owned = (output & 1) || (output == 0);
uint32_t* ret_vals = (uint32_t*)(ret + 4);
for (size_t s = 0; s < ret_constr.datalen; s++) {
uint32_t ret_conv_18 = ret_vals[s];
- LDKMessageSendEvent ret_conv_18_conv = *(LDKMessageSendEvent*)(((uint64_t)ret_conv_18) & ~1);
+ void* ret_conv_18_ptr = (void*)(((uint64_t)ret_conv_18) & ~1);
+ CHECK_ACCESS(ret_conv_18_ptr);
+ LDKMessageSendEvent ret_conv_18_conv = *(LDKMessageSendEvent*)(ret_conv_18_ptr);
ret_conv_18_conv = MessageSendEvent_clone((LDKMessageSendEvent*)(((uint64_t)ret_conv_18) & ~1));
ret_constr.data[s] = ret_conv_18_conv;
}
return (long)res_ptr;
}
uint32_tArray __attribute__((visibility("default"))) TS_MessageSendEventsProvider_get_and_clear_pending_msg_events(uint32_t this_arg) {
- LDKMessageSendEventsProvider* this_arg_conv = (LDKMessageSendEventsProvider*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKMessageSendEventsProvider* this_arg_conv = (LDKMessageSendEventsProvider*)this_arg_ptr;
LDKCVec_MessageSendEventZ ret_var = (this_arg_conv->get_and_clear_pending_msg_events)(this_arg_conv->this_arg);
uint32_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4);
for (size_t s = 0; s < ret_var.datalen; s++) {
LDKMessageSendEvent *ret_conv_18_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
- *ret_conv_18_copy = MessageSendEvent_clone(&ret_var.data[s]);
+ *ret_conv_18_copy = ret_var.data[s];
uint64_t ret_conv_18_ref = (uint64_t)ret_conv_18_copy;
ret_arr_ptr[s] = ret_conv_18_ref;
}
return (long)res_ptr;
}
void __attribute__((visibility("default"))) TS_EventHandler_handle_event(uint32_t this_arg, uint32_t event) {
- LDKEventHandler* this_arg_conv = (LDKEventHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKEventHandler* this_arg_conv = (LDKEventHandler*)this_arg_ptr;
LDKEvent* event_conv = (LDKEvent*)event;
(this_arg_conv->handle_event)(this_arg_conv->this_arg, event_conv);
}
return (long)res_ptr;
}
void __attribute__((visibility("default"))) TS_EventsProvider_process_pending_events(uint32_t this_arg, uint32_t handler) {
- LDKEventsProvider* this_arg_conv = (LDKEventsProvider*)(((uint64_t)this_arg) & ~1);
- LDKEventHandler handler_conv = *(LDKEventHandler*)(((uint64_t)handler) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKEventsProvider* this_arg_conv = (LDKEventsProvider*)this_arg_ptr;
+ void* handler_ptr = (void*)(((uint64_t)handler) & ~1);
+ CHECK_ACCESS(handler_ptr);
+ LDKEventHandler handler_conv = *(LDKEventHandler*)(handler_ptr);
(this_arg_conv->process_pending_events)(this_arg_conv->this_arg, handler_conv);
}
return (long)res_ptr;
}
void __attribute__((visibility("default"))) TS_Listen_block_connected(uint32_t this_arg, int8_tArray block, int32_t height) {
- LDKListen* this_arg_conv = (LDKListen*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKListen* this_arg_conv = (LDKListen*)this_arg_ptr;
LDKu8slice block_ref;
block_ref.datalen = *((uint32_t*)block);
block_ref.data = (int8_t*)(block + 4);
}
void __attribute__((visibility("default"))) TS_Listen_block_disconnected(uint32_t this_arg, int8_tArray header, int32_t height) {
- LDKListen* this_arg_conv = (LDKListen*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKListen* this_arg_conv = (LDKListen*)this_arg_ptr;
unsigned char header_arr[80];
CHECK(*((uint32_t*)header) == 80);
memcpy(header_arr, (uint8_t*)(header + 4), 80);
return (long)res_ptr;
}
void __attribute__((visibility("default"))) TS_Confirm_transactions_confirmed(uint32_t this_arg, int8_tArray header, uint32_tArray txdata, int32_t height) {
- LDKConfirm* this_arg_conv = (LDKConfirm*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKConfirm* this_arg_conv = (LDKConfirm*)this_arg_ptr;
unsigned char header_arr[80];
CHECK(*((uint32_t*)header) == 80);
memcpy(header_arr, (uint8_t*)(header + 4), 80);
uint32_t* txdata_vals = (uint32_t*)(txdata + 4);
for (size_t c = 0; c < txdata_constr.datalen; c++) {
uint32_t txdata_conv_28 = txdata_vals[c];
- LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(((uint64_t)txdata_conv_28) & ~1);
+ void* txdata_conv_28_ptr = (void*)(((uint64_t)txdata_conv_28) & ~1);
+ CHECK_ACCESS(txdata_conv_28_ptr);
+ LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(txdata_conv_28_ptr);
txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)(((uint64_t)txdata_conv_28) & ~1));
txdata_constr.data[c] = txdata_conv_28_conv;
}
}
void __attribute__((visibility("default"))) TS_Confirm_transaction_unconfirmed(uint32_t this_arg, int8_tArray txid) {
- LDKConfirm* this_arg_conv = (LDKConfirm*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKConfirm* this_arg_conv = (LDKConfirm*)this_arg_ptr;
unsigned char txid_arr[32];
CHECK(*((uint32_t*)txid) == 32);
memcpy(txid_arr, (uint8_t*)(txid + 4), 32);
}
void __attribute__((visibility("default"))) TS_Confirm_best_block_updated(uint32_t this_arg, int8_tArray header, int32_t height) {
- LDKConfirm* this_arg_conv = (LDKConfirm*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKConfirm* this_arg_conv = (LDKConfirm*)this_arg_ptr;
unsigned char header_arr[80];
CHECK(*((uint32_t*)header) == 80);
memcpy(header_arr, (uint8_t*)(header + 4), 80);
}
ptrArray __attribute__((visibility("default"))) TS_Confirm_get_relevant_txids(uint32_t this_arg) {
- LDKConfirm* this_arg_conv = (LDKConfirm*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKConfirm* this_arg_conv = (LDKConfirm*)this_arg_ptr;
LDKCVec_TxidZ ret_var = (this_arg_conv->get_relevant_txids)(this_arg_conv->this_arg);
ptrArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native ptrArray Bytes");
int8_tArray *ret_arr_ptr = (int8_tArray*)(ret_arr + 4);
data_ref |= 1;
}
uint32_t ret = js_invoke_function_2(j_calls->persist_new_channel_meth, id_ref, data_ref);
- LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr);
ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone((LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)ret) & ~1));
return ret_conv;
}
data_ref |= 1;
}
uint32_t ret = js_invoke_function_3(j_calls->update_persisted_channel_meth, id_ref, update_ref, data_ref);
- LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr);
ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone((LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)ret) & ~1));
return ret_conv;
}
return (long)res_ptr;
}
uint32_t __attribute__((visibility("default"))) TS_Persist_persist_new_channel(uint32_t this_arg, uint32_t id, uint32_t data) {
- LDKPersist* this_arg_conv = (LDKPersist*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKPersist* this_arg_conv = (LDKPersist*)this_arg_ptr;
LDKOutPoint id_conv;
id_conv.inner = (void*)(id & (~1));
id_conv.is_owned = (id & 1) || (id == 0);
}
uint32_t __attribute__((visibility("default"))) TS_Persist_update_persisted_channel(uint32_t this_arg, uint32_t id, uint32_t update, uint32_t data) {
- LDKPersist* this_arg_conv = (LDKPersist*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKPersist* this_arg_conv = (LDKPersist*)this_arg_ptr;
LDKOutPoint id_conv;
id_conv.inner = (void*)(id & (~1));
id_conv.is_owned = (id & 1) || (id == 0);
return (long)res_ptr;
}
void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_open_channel(uint32_t this_arg, int8_tArray their_node_id, uint32_t their_features, uint32_t msg) {
- LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK(*((uint32_t*)their_node_id) == 33);
memcpy(their_node_id_ref.compressed_form, (uint8_t*)(their_node_id + 4), 33);
}
void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_accept_channel(uint32_t this_arg, int8_tArray their_node_id, uint32_t their_features, uint32_t msg) {
- LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK(*((uint32_t*)their_node_id) == 33);
memcpy(their_node_id_ref.compressed_form, (uint8_t*)(their_node_id + 4), 33);
}
void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_funding_created(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) {
- LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK(*((uint32_t*)their_node_id) == 33);
memcpy(their_node_id_ref.compressed_form, (uint8_t*)(their_node_id + 4), 33);
}
void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_funding_signed(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) {
- LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK(*((uint32_t*)their_node_id) == 33);
memcpy(their_node_id_ref.compressed_form, (uint8_t*)(their_node_id + 4), 33);
}
void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_funding_locked(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) {
- LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK(*((uint32_t*)their_node_id) == 33);
memcpy(their_node_id_ref.compressed_form, (uint8_t*)(their_node_id + 4), 33);
}
void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_shutdown(uint32_t this_arg, int8_tArray their_node_id, uint32_t their_features, uint32_t msg) {
- LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK(*((uint32_t*)their_node_id) == 33);
memcpy(their_node_id_ref.compressed_form, (uint8_t*)(their_node_id + 4), 33);
}
void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_closing_signed(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) {
- LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK(*((uint32_t*)their_node_id) == 33);
memcpy(their_node_id_ref.compressed_form, (uint8_t*)(their_node_id + 4), 33);
}
void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_update_add_htlc(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) {
- LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK(*((uint32_t*)their_node_id) == 33);
memcpy(their_node_id_ref.compressed_form, (uint8_t*)(their_node_id + 4), 33);
}
void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_update_fulfill_htlc(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) {
- LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK(*((uint32_t*)their_node_id) == 33);
memcpy(their_node_id_ref.compressed_form, (uint8_t*)(their_node_id + 4), 33);
}
void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_update_fail_htlc(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) {
- LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK(*((uint32_t*)their_node_id) == 33);
memcpy(their_node_id_ref.compressed_form, (uint8_t*)(their_node_id + 4), 33);
}
void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_update_fail_malformed_htlc(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) {
- LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK(*((uint32_t*)their_node_id) == 33);
memcpy(their_node_id_ref.compressed_form, (uint8_t*)(their_node_id + 4), 33);
}
void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_commitment_signed(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) {
- LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK(*((uint32_t*)their_node_id) == 33);
memcpy(their_node_id_ref.compressed_form, (uint8_t*)(their_node_id + 4), 33);
}
void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_revoke_and_ack(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) {
- LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK(*((uint32_t*)their_node_id) == 33);
memcpy(their_node_id_ref.compressed_form, (uint8_t*)(their_node_id + 4), 33);
}
void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_update_fee(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) {
- LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK(*((uint32_t*)their_node_id) == 33);
memcpy(their_node_id_ref.compressed_form, (uint8_t*)(their_node_id + 4), 33);
}
void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_announcement_signatures(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) {
- LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK(*((uint32_t*)their_node_id) == 33);
memcpy(their_node_id_ref.compressed_form, (uint8_t*)(their_node_id + 4), 33);
}
void __attribute__((visibility("default"))) TS_ChannelMessageHandler_peer_disconnected(uint32_t this_arg, int8_tArray their_node_id, jboolean no_connection_possible) {
- LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK(*((uint32_t*)their_node_id) == 33);
memcpy(their_node_id_ref.compressed_form, (uint8_t*)(their_node_id + 4), 33);
}
void __attribute__((visibility("default"))) TS_ChannelMessageHandler_peer_connected(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) {
- LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK(*((uint32_t*)their_node_id) == 33);
memcpy(their_node_id_ref.compressed_form, (uint8_t*)(their_node_id + 4), 33);
}
void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_channel_reestablish(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) {
- LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK(*((uint32_t*)their_node_id) == 33);
memcpy(their_node_id_ref.compressed_form, (uint8_t*)(their_node_id + 4), 33);
}
void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_channel_update(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) {
- LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK(*((uint32_t*)their_node_id) == 33);
memcpy(their_node_id_ref.compressed_form, (uint8_t*)(their_node_id + 4), 33);
}
void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_error(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) {
- LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK(*((uint32_t*)their_node_id) == 33);
memcpy(their_node_id_ref.compressed_form, (uint8_t*)(their_node_id + 4), 33);
msg_ref |= 1;
}
uint32_t ret = js_invoke_function_1(j_calls->handle_node_announcement_meth, msg_ref);
- LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(ret_ptr);
ret_conv = CResult_boolLightningErrorZ_clone((LDKCResult_boolLightningErrorZ*)(((uint64_t)ret) & ~1));
return ret_conv;
}
msg_ref |= 1;
}
uint32_t ret = js_invoke_function_1(j_calls->handle_channel_announcement_meth, msg_ref);
- LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(ret_ptr);
ret_conv = CResult_boolLightningErrorZ_clone((LDKCResult_boolLightningErrorZ*)(((uint64_t)ret) & ~1));
return ret_conv;
}
msg_ref |= 1;
}
uint32_t ret = js_invoke_function_1(j_calls->handle_channel_update_meth, msg_ref);
- LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(ret_ptr);
ret_conv = CResult_boolLightningErrorZ_clone((LDKCResult_boolLightningErrorZ*)(((uint64_t)ret) & ~1));
return ret_conv;
}
uint32_t* ret_vals = (uint32_t*)(ret + 4);
for (size_t h = 0; h < ret_constr.datalen; h++) {
uint32_t ret_conv_59 = ret_vals[h];
- LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ ret_conv_59_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(((uint64_t)ret_conv_59) & ~1);
+ void* ret_conv_59_ptr = (void*)(((uint64_t)ret_conv_59) & ~1);
+ CHECK_ACCESS(ret_conv_59_ptr);
+ LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ ret_conv_59_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(ret_conv_59_ptr);
ret_conv_59_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone((LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(((uint64_t)ret_conv_59) & ~1));
ret_constr.data[h] = ret_conv_59_conv;
}
msg_ref |= 1;
}
uint32_t ret = js_invoke_function_2(j_calls->handle_reply_channel_range_meth, their_node_id_arr, msg_ref);
- LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr);
ret_conv = CResult_NoneLightningErrorZ_clone((LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1));
return ret_conv;
}
msg_ref |= 1;
}
uint32_t ret = js_invoke_function_2(j_calls->handle_reply_short_channel_ids_end_meth, their_node_id_arr, msg_ref);
- LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr);
ret_conv = CResult_NoneLightningErrorZ_clone((LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1));
return ret_conv;
}
msg_ref |= 1;
}
uint32_t ret = js_invoke_function_2(j_calls->handle_query_channel_range_meth, their_node_id_arr, msg_ref);
- LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr);
ret_conv = CResult_NoneLightningErrorZ_clone((LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1));
return ret_conv;
}
msg_ref |= 1;
}
uint32_t ret = js_invoke_function_2(j_calls->handle_query_short_channel_ids_meth, their_node_id_arr, msg_ref);
- LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr);
ret_conv = CResult_NoneLightningErrorZ_clone((LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1));
return ret_conv;
}
return (long)res_ptr;
}
uint32_t __attribute__((visibility("default"))) TS_RoutingMessageHandler_handle_node_announcement(uint32_t this_arg, uint32_t msg) {
- LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
LDKNodeAnnouncement msg_conv;
msg_conv.inner = (void*)(msg & (~1));
msg_conv.is_owned = false;
}
uint32_t __attribute__((visibility("default"))) TS_RoutingMessageHandler_handle_channel_announcement(uint32_t this_arg, uint32_t msg) {
- LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
LDKChannelAnnouncement msg_conv;
msg_conv.inner = (void*)(msg & (~1));
msg_conv.is_owned = false;
}
uint32_t __attribute__((visibility("default"))) TS_RoutingMessageHandler_handle_channel_update(uint32_t this_arg, uint32_t msg) {
- LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
LDKChannelUpdate msg_conv;
msg_conv.inner = (void*)(msg & (~1));
msg_conv.is_owned = false;
}
uint32_tArray __attribute__((visibility("default"))) TS_RoutingMessageHandler_get_next_channel_announcements(uint32_t this_arg, int64_t starting_point, int8_t batch_amount) {
- LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ ret_var = (this_arg_conv->get_next_channel_announcements)(this_arg_conv->this_arg, starting_point, batch_amount);
uint32_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4);
}
uint32_tArray __attribute__((visibility("default"))) TS_RoutingMessageHandler_get_next_node_announcements(uint32_t this_arg, int8_tArray starting_point, int8_t batch_amount) {
- LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
LDKPublicKey starting_point_ref;
CHECK(*((uint32_t*)starting_point) == 33);
memcpy(starting_point_ref.compressed_form, (uint8_t*)(starting_point + 4), 33);
}
void __attribute__((visibility("default"))) TS_RoutingMessageHandler_sync_routing_table(uint32_t this_arg, int8_tArray their_node_id, uint32_t init) {
- LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK(*((uint32_t*)their_node_id) == 33);
memcpy(their_node_id_ref.compressed_form, (uint8_t*)(their_node_id + 4), 33);
}
uint32_t __attribute__((visibility("default"))) TS_RoutingMessageHandler_handle_reply_channel_range(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) {
- LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK(*((uint32_t*)their_node_id) == 33);
memcpy(their_node_id_ref.compressed_form, (uint8_t*)(their_node_id + 4), 33);
}
uint32_t __attribute__((visibility("default"))) TS_RoutingMessageHandler_handle_reply_short_channel_ids_end(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) {
- LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK(*((uint32_t*)their_node_id) == 33);
memcpy(their_node_id_ref.compressed_form, (uint8_t*)(their_node_id + 4), 33);
}
uint32_t __attribute__((visibility("default"))) TS_RoutingMessageHandler_handle_query_channel_range(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) {
- LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK(*((uint32_t*)their_node_id) == 33);
memcpy(their_node_id_ref.compressed_form, (uint8_t*)(their_node_id + 4), 33);
}
uint32_t __attribute__((visibility("default"))) TS_RoutingMessageHandler_handle_query_short_channel_ids(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) {
- LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK(*((uint32_t*)their_node_id) == 33);
memcpy(their_node_id_ref.compressed_form, (uint8_t*)(their_node_id + 4), 33);
int8_tArray buffer_arr = init_arr(buffer_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(buffer_arr + 4), buffer_var.data, buffer_var.datalen);
uint32_t ret = js_invoke_function_2(j_calls->read_meth, message_type, buffer_arr);
- LDKCResult_COption_TypeZDecodeErrorZ ret_conv = *(LDKCResult_COption_TypeZDecodeErrorZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_COption_TypeZDecodeErrorZ ret_conv = *(LDKCResult_COption_TypeZDecodeErrorZ*)(ret_ptr);
ret_conv = CResult_COption_TypeZDecodeErrorZ_clone((LDKCResult_COption_TypeZDecodeErrorZ*)(((uint64_t)ret) & ~1));
return ret_conv;
}
return (long)res_ptr;
}
uint32_t __attribute__((visibility("default"))) TS_CustomMessageReader_read(uint32_t this_arg, int16_t message_type, int8_tArray buffer) {
- LDKCustomMessageReader* this_arg_conv = (LDKCustomMessageReader*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKCustomMessageReader* this_arg_conv = (LDKCustomMessageReader*)this_arg_ptr;
LDKu8slice buffer_ref;
buffer_ref.datalen = *((uint32_t*)buffer);
buffer_ref.data = (int8_t*)(buffer + 4);
int8_tArray sender_node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(sender_node_id_arr + 4), sender_node_id.compressed_form, 33);
uint32_t ret = js_invoke_function_2(j_calls->handle_custom_message_meth, (uint64_t)msg_ret, sender_node_id_arr);
- LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr);
ret_conv = CResult_NoneLightningErrorZ_clone((LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1));
return ret_conv;
}
uint32_t* ret_vals = (uint32_t*)(ret + 4);
for (size_t z = 0; z < ret_constr.datalen; z++) {
uint32_t ret_conv_25 = ret_vals[z];
- LDKC2Tuple_PublicKeyTypeZ ret_conv_25_conv = *(LDKC2Tuple_PublicKeyTypeZ*)(((uint64_t)ret_conv_25) & ~1);
+ void* ret_conv_25_ptr = (void*)(((uint64_t)ret_conv_25) & ~1);
+ CHECK_ACCESS(ret_conv_25_ptr);
+ LDKC2Tuple_PublicKeyTypeZ ret_conv_25_conv = *(LDKC2Tuple_PublicKeyTypeZ*)(ret_conv_25_ptr);
ret_conv_25_conv = C2Tuple_PublicKeyTypeZ_clone((LDKC2Tuple_PublicKeyTypeZ*)(((uint64_t)ret_conv_25) & ~1));
ret_constr.data[z] = ret_conv_25_conv;
}
return (long)res_ptr;
}
uint32_t __attribute__((visibility("default"))) TS_CustomMessageHandler_handle_custom_message(uint32_t this_arg, uint32_t msg, int8_tArray sender_node_id) {
- LDKCustomMessageHandler* this_arg_conv = (LDKCustomMessageHandler*)(((uint64_t)this_arg) & ~1);
- LDKType msg_conv = *(LDKType*)(((uint64_t)msg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKCustomMessageHandler* this_arg_conv = (LDKCustomMessageHandler*)this_arg_ptr;
+ void* msg_ptr = (void*)(((uint64_t)msg) & ~1);
+ CHECK_ACCESS(msg_ptr);
+ LDKType msg_conv = *(LDKType*)(msg_ptr);
LDKPublicKey sender_node_id_ref;
CHECK(*((uint32_t*)sender_node_id) == 33);
memcpy(sender_node_id_ref.compressed_form, (uint8_t*)(sender_node_id + 4), 33);
}
uint32_tArray __attribute__((visibility("default"))) TS_CustomMessageHandler_get_and_clear_pending_msg(uint32_t this_arg) {
- LDKCustomMessageHandler* this_arg_conv = (LDKCustomMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKCustomMessageHandler* this_arg_conv = (LDKCustomMessageHandler*)this_arg_ptr;
LDKCVec_C2Tuple_PublicKeyTypeZZ ret_var = (this_arg_conv->get_and_clear_pending_msg)(this_arg_conv->this_arg);
uint32_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4);
return (long)res_ptr;
}
int64_t __attribute__((visibility("default"))) TS_SocketDescriptor_send_data(uint32_t this_arg, int8_tArray data, jboolean resume_read) {
- LDKSocketDescriptor* this_arg_conv = (LDKSocketDescriptor*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKSocketDescriptor* this_arg_conv = (LDKSocketDescriptor*)this_arg_ptr;
LDKu8slice data_ref;
data_ref.datalen = *((uint32_t*)data);
data_ref.data = (int8_t*)(data + 4);
}
void __attribute__((visibility("default"))) TS_SocketDescriptor_disconnect_socket(uint32_t this_arg) {
- LDKSocketDescriptor* this_arg_conv = (LDKSocketDescriptor*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKSocketDescriptor* this_arg_conv = (LDKSocketDescriptor*)this_arg_ptr;
(this_arg_conv->disconnect_socket)(this_arg_conv->this_arg);
}
int64_t __attribute__((visibility("default"))) TS_SocketDescriptor_hash(uint32_t this_arg) {
- LDKSocketDescriptor* this_arg_conv = (LDKSocketDescriptor*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKSocketDescriptor* this_arg_conv = (LDKSocketDescriptor*)this_arg_ptr;
int64_t ret_val = (this_arg_conv->hash)(this_arg_conv->this_arg);
return ret_val;
}
return (long)res_ptr;
}
int64_t __attribute__((visibility("default"))) TS_Score_channel_penalty_msat(uint32_t this_arg, int64_t short_channel_id) {
- LDKScore* this_arg_conv = (LDKScore*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr;
int64_t ret_val = (this_arg_conv->channel_penalty_msat)(this_arg_conv->this_arg, short_channel_id);
return ret_val;
}
channel_manager_ref |= 1;
}
uint32_t ret = js_invoke_function_1(j_calls->persist_manager_meth, channel_manager_ref);
- LDKCResult_NoneErrorZ ret_conv = *(LDKCResult_NoneErrorZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_NoneErrorZ ret_conv = *(LDKCResult_NoneErrorZ*)(ret_ptr);
ret_conv = CResult_NoneErrorZ_clone((LDKCResult_NoneErrorZ*)(((uint64_t)ret) & ~1));
return ret_conv;
}
return (long)res_ptr;
}
uint32_t __attribute__((visibility("default"))) TS_ChannelManagerPersister_persist_manager(uint32_t this_arg, uint32_t channel_manager) {
- LDKChannelManagerPersister* this_arg_conv = (LDKChannelManagerPersister*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelManagerPersister* this_arg_conv = (LDKChannelManagerPersister*)this_arg_ptr;
LDKChannelManager channel_manager_conv;
channel_manager_conv.inner = (void*)(channel_manager & (~1));
channel_manager_conv.is_owned = false;
void __attribute__((visibility("default"))) TS_TxOut_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKTxOut _res_conv = *(LDKTxOut*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKTxOut _res_conv = *(LDKTxOut*)(_res_ptr);
FREE((void*)_res);
TxOut_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_SecretKeyErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_SecretKeyErrorZ _res_conv = *(LDKCResult_SecretKeyErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_SecretKeyErrorZ _res_conv = *(LDKCResult_SecretKeyErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_SecretKeyErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_PublicKeyErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_PublicKeyErrorZ _res_conv = *(LDKCResult_PublicKeyErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_PublicKeyErrorZ _res_conv = *(LDKCResult_PublicKeyErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_PublicKeyErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_TxCreationKeysDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_TxCreationKeysDecodeErrorZ _res_conv = *(LDKCResult_TxCreationKeysDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_TxCreationKeysDecodeErrorZ _res_conv = *(LDKCResult_TxCreationKeysDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_TxCreationKeysDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_ChannelPublicKeysDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_ChannelPublicKeysDecodeErrorZ _res_conv = *(LDKCResult_ChannelPublicKeysDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_ChannelPublicKeysDecodeErrorZ _res_conv = *(LDKCResult_ChannelPublicKeysDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_ChannelPublicKeysDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_TxCreationKeysErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_TxCreationKeysErrorZ _res_conv = *(LDKCResult_TxCreationKeysErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_TxCreationKeysErrorZ _res_conv = *(LDKCResult_TxCreationKeysErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_TxCreationKeysErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_COption_u32Z_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCOption_u32Z _res_conv = *(LDKCOption_u32Z*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCOption_u32Z _res_conv = *(LDKCOption_u32Z*)(_res_ptr);
FREE((void*)_res);
COption_u32Z_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_HTLCOutputInCommitmentDecodeErrorZ _res_conv = *(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_HTLCOutputInCommitmentDecodeErrorZ _res_conv = *(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_HTLCOutputInCommitmentDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ _res_conv = *(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ _res_conv = *(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_ChannelTransactionParametersDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_ChannelTransactionParametersDecodeErrorZ _res_conv = *(LDKCResult_ChannelTransactionParametersDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_ChannelTransactionParametersDecodeErrorZ _res_conv = *(LDKCResult_ChannelTransactionParametersDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_ChannelTransactionParametersDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_HolderCommitmentTransactionDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_HolderCommitmentTransactionDecodeErrorZ _res_conv = *(LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_HolderCommitmentTransactionDecodeErrorZ _res_conv = *(LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_HolderCommitmentTransactionDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_BuiltCommitmentTransactionDecodeErrorZ _res_conv = *(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_BuiltCommitmentTransactionDecodeErrorZ _res_conv = *(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_BuiltCommitmentTransactionDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_TrustedClosingTransactionNoneZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_TrustedClosingTransactionNoneZ _res_conv = *(LDKCResult_TrustedClosingTransactionNoneZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_TrustedClosingTransactionNoneZ _res_conv = *(LDKCResult_TrustedClosingTransactionNoneZ*)(_res_ptr);
FREE((void*)_res);
CResult_TrustedClosingTransactionNoneZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_CommitmentTransactionDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_CommitmentTransactionDecodeErrorZ _res_conv = *(LDKCResult_CommitmentTransactionDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_CommitmentTransactionDecodeErrorZ _res_conv = *(LDKCResult_CommitmentTransactionDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_CommitmentTransactionDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_TrustedCommitmentTransactionNoneZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_TrustedCommitmentTransactionNoneZ _res_conv = *(LDKCResult_TrustedCommitmentTransactionNoneZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_TrustedCommitmentTransactionNoneZ _res_conv = *(LDKCResult_TrustedCommitmentTransactionNoneZ*)(_res_ptr);
FREE((void*)_res);
CResult_TrustedCommitmentTransactionNoneZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_CVec_SignatureZNoneZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_CVec_SignatureZNoneZ _res_conv = *(LDKCResult_CVec_SignatureZNoneZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_CVec_SignatureZNoneZ _res_conv = *(LDKCResult_CVec_SignatureZNoneZ*)(_res_ptr);
FREE((void*)_res);
CResult_CVec_SignatureZNoneZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_ShutdownScriptDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_ShutdownScriptDecodeErrorZ _res_conv = *(LDKCResult_ShutdownScriptDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_ShutdownScriptDecodeErrorZ _res_conv = *(LDKCResult_ShutdownScriptDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_ShutdownScriptDecodeErrorZ_free(_res_conv);
}
LDKInvalidShutdownScript e_conv;
e_conv.inner = (void*)(e & (~1));
e_conv.is_owned = (e & 1) || (e == 0);
- // Warning: we need a move here but no clone is available for LDKInvalidShutdownScript
+ e_conv = InvalidShutdownScript_clone(&e_conv);
LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ");
*ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_err(e_conv);
return (uint64_t)ret_conv;
void __attribute__((visibility("default"))) TS_CResult_ShutdownScriptInvalidShutdownScriptZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_ShutdownScriptInvalidShutdownScriptZ _res_conv = *(LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_ShutdownScriptInvalidShutdownScriptZ _res_conv = *(LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)(_res_ptr);
FREE((void*)_res);
CResult_ShutdownScriptInvalidShutdownScriptZ_free(_res_conv);
}
+uint32_t __attribute__((visibility("default"))) TS_CResult_ShutdownScriptInvalidShutdownScriptZ_clone(uint32_t orig) {
+ LDKCResult_ShutdownScriptInvalidShutdownScriptZ* orig_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)(orig & ~1);
+ LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ");
+ *ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_clone(orig_conv);
+ return (uint64_t)ret_conv;
+}
+
uint32_t __attribute__((visibility("default"))) TS_CResult_NoneErrorZ_ok() {
LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ");
*ret_conv = CResult_NoneErrorZ_ok();
void __attribute__((visibility("default"))) TS_CResult_NoneErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_NoneErrorZ _res_conv = *(LDKCResult_NoneErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_NoneErrorZ _res_conv = *(LDKCResult_NoneErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_NoneErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_RouteHopDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_RouteHopDecodeErrorZ _res_conv = *(LDKCResult_RouteHopDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_RouteHopDecodeErrorZ _res_conv = *(LDKCResult_RouteHopDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_RouteHopDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_RouteDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_RouteDecodeErrorZ _res_conv = *(LDKCResult_RouteDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_RouteDecodeErrorZ _res_conv = *(LDKCResult_RouteDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_RouteDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_COption_u64Z_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCOption_u64Z _res_conv = *(LDKCOption_u64Z*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCOption_u64Z _res_conv = *(LDKCOption_u64Z*)(_res_ptr);
FREE((void*)_res);
COption_u64Z_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_RouteLightningErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_RouteLightningErrorZ _res_conv = *(LDKCResult_RouteLightningErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_RouteLightningErrorZ _res_conv = *(LDKCResult_RouteLightningErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_RouteLightningErrorZ_free(_res_conv);
}
}
uint32_t __attribute__((visibility("default"))) TS_CResult_TxOutAccessErrorZ_ok(uint32_t o) {
- LDKTxOut o_conv = *(LDKTxOut*)(((uint64_t)o) & ~1);
+ void* o_ptr = (void*)(((uint64_t)o) & ~1);
+ CHECK_ACCESS(o_ptr);
+ LDKTxOut o_conv = *(LDKTxOut*)(o_ptr);
o_conv = TxOut_clone((LDKTxOut*)(((uint64_t)o) & ~1));
LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ");
*ret_conv = CResult_TxOutAccessErrorZ_ok(o_conv);
void __attribute__((visibility("default"))) TS_CResult_TxOutAccessErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_TxOutAccessErrorZ _res_conv = *(LDKCResult_TxOutAccessErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_TxOutAccessErrorZ _res_conv = *(LDKCResult_TxOutAccessErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_TxOutAccessErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_C2Tuple_usizeTransactionZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKC2Tuple_usizeTransactionZ _res_conv = *(LDKC2Tuple_usizeTransactionZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKC2Tuple_usizeTransactionZ _res_conv = *(LDKC2Tuple_usizeTransactionZ*)(_res_ptr);
FREE((void*)_res);
C2Tuple_usizeTransactionZ_free(_res_conv);
}
uint32_t* _res_vals = (uint32_t*)(_res + 4);
for (size_t c = 0; c < _res_constr.datalen; c++) {
uint32_t _res_conv_28 = _res_vals[c];
- LDKC2Tuple_usizeTransactionZ _res_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(((uint64_t)_res_conv_28) & ~1);
+ void* _res_conv_28_ptr = (void*)(((uint64_t)_res_conv_28) & ~1);
+ CHECK_ACCESS(_res_conv_28_ptr);
+ LDKC2Tuple_usizeTransactionZ _res_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(_res_conv_28_ptr);
FREE((void*)_res_conv_28);
_res_constr.data[c] = _res_conv_28_conv;
}
void __attribute__((visibility("default"))) TS_CResult_NoneChannelMonitorUpdateErrZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_NoneChannelMonitorUpdateErrZ _res_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_NoneChannelMonitorUpdateErrZ _res_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(_res_ptr);
FREE((void*)_res);
CResult_NoneChannelMonitorUpdateErrZ_free(_res_conv);
}
uint32_t* _res_vals = (uint32_t*)(_res + 4);
for (size_t o = 0; o < _res_constr.datalen; o++) {
uint32_t _res_conv_14 = _res_vals[o];
- LDKMonitorEvent _res_conv_14_conv = *(LDKMonitorEvent*)(((uint64_t)_res_conv_14) & ~1);
+ void* _res_conv_14_ptr = (void*)(((uint64_t)_res_conv_14) & ~1);
+ CHECK_ACCESS(_res_conv_14_ptr);
+ LDKMonitorEvent _res_conv_14_conv = *(LDKMonitorEvent*)(_res_conv_14_ptr);
FREE((void*)_res_conv_14);
_res_constr.data[o] = _res_conv_14_conv;
}
}
uint32_t __attribute__((visibility("default"))) TS_COption_C2Tuple_usizeTransactionZZ_some(uint32_t o) {
- LDKC2Tuple_usizeTransactionZ o_conv = *(LDKC2Tuple_usizeTransactionZ*)(((uint64_t)o) & ~1);
+ void* o_ptr = (void*)(((uint64_t)o) & ~1);
+ CHECK_ACCESS(o_ptr);
+ LDKC2Tuple_usizeTransactionZ o_conv = *(LDKC2Tuple_usizeTransactionZ*)(o_ptr);
o_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)(((uint64_t)o) & ~1));
LDKCOption_C2Tuple_usizeTransactionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_usizeTransactionZZ), "LDKCOption_C2Tuple_usizeTransactionZZ");
*ret_copy = COption_C2Tuple_usizeTransactionZZ_some(o_conv);
void __attribute__((visibility("default"))) TS_COption_C2Tuple_usizeTransactionZZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCOption_C2Tuple_usizeTransactionZZ _res_conv = *(LDKCOption_C2Tuple_usizeTransactionZZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCOption_C2Tuple_usizeTransactionZZ _res_conv = *(LDKCOption_C2Tuple_usizeTransactionZZ*)(_res_ptr);
FREE((void*)_res);
COption_C2Tuple_usizeTransactionZZ_free(_res_conv);
}
}
uint32_t __attribute__((visibility("default"))) TS_COption_NetworkUpdateZ_some(uint32_t o) {
- LDKNetworkUpdate o_conv = *(LDKNetworkUpdate*)(((uint64_t)o) & ~1);
+ void* o_ptr = (void*)(((uint64_t)o) & ~1);
+ CHECK_ACCESS(o_ptr);
+ LDKNetworkUpdate o_conv = *(LDKNetworkUpdate*)(o_ptr);
o_conv = NetworkUpdate_clone((LDKNetworkUpdate*)(((uint64_t)o) & ~1));
LDKCOption_NetworkUpdateZ *ret_copy = MALLOC(sizeof(LDKCOption_NetworkUpdateZ), "LDKCOption_NetworkUpdateZ");
*ret_copy = COption_NetworkUpdateZ_some(o_conv);
void __attribute__((visibility("default"))) TS_COption_NetworkUpdateZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCOption_NetworkUpdateZ _res_conv = *(LDKCOption_NetworkUpdateZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCOption_NetworkUpdateZ _res_conv = *(LDKCOption_NetworkUpdateZ*)(_res_ptr);
FREE((void*)_res);
COption_NetworkUpdateZ_free(_res_conv);
}
uint32_t* _res_vals = (uint32_t*)(_res + 4);
for (size_t b = 0; b < _res_constr.datalen; b++) {
uint32_t _res_conv_27 = _res_vals[b];
- LDKSpendableOutputDescriptor _res_conv_27_conv = *(LDKSpendableOutputDescriptor*)(((uint64_t)_res_conv_27) & ~1);
+ void* _res_conv_27_ptr = (void*)(((uint64_t)_res_conv_27) & ~1);
+ CHECK_ACCESS(_res_conv_27_ptr);
+ LDKSpendableOutputDescriptor _res_conv_27_conv = *(LDKSpendableOutputDescriptor*)(_res_conv_27_ptr);
FREE((void*)_res_conv_27);
_res_constr.data[b] = _res_conv_27_conv;
}
uint32_t* _res_vals = (uint32_t*)(_res + 4);
for (size_t s = 0; s < _res_constr.datalen; s++) {
uint32_t _res_conv_18 = _res_vals[s];
- LDKMessageSendEvent _res_conv_18_conv = *(LDKMessageSendEvent*)(((uint64_t)_res_conv_18) & ~1);
+ void* _res_conv_18_ptr = (void*)(((uint64_t)_res_conv_18) & ~1);
+ CHECK_ACCESS(_res_conv_18_ptr);
+ LDKMessageSendEvent _res_conv_18_conv = *(LDKMessageSendEvent*)(_res_conv_18_ptr);
FREE((void*)_res_conv_18);
_res_constr.data[s] = _res_conv_18_conv;
}
void __attribute__((visibility("default"))) TS_CResult_InitFeaturesDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_InitFeaturesDecodeErrorZ _res_conv = *(LDKCResult_InitFeaturesDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_InitFeaturesDecodeErrorZ _res_conv = *(LDKCResult_InitFeaturesDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_InitFeaturesDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_NodeFeaturesDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_NodeFeaturesDecodeErrorZ _res_conv = *(LDKCResult_NodeFeaturesDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_NodeFeaturesDecodeErrorZ _res_conv = *(LDKCResult_NodeFeaturesDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_NodeFeaturesDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_ChannelFeaturesDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_ChannelFeaturesDecodeErrorZ _res_conv = *(LDKCResult_ChannelFeaturesDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_ChannelFeaturesDecodeErrorZ _res_conv = *(LDKCResult_ChannelFeaturesDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_ChannelFeaturesDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_InvoiceFeaturesDecodeErrorZ _res_conv = *(LDKCResult_InvoiceFeaturesDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_InvoiceFeaturesDecodeErrorZ _res_conv = *(LDKCResult_InvoiceFeaturesDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_InvoiceFeaturesDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ _res_conv = *(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ _res_conv = *(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ _res_conv = *(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ _res_conv = *(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free(_res_conv);
}
}
uint32_t __attribute__((visibility("default"))) TS_CResult_SpendableOutputDescriptorDecodeErrorZ_ok(uint32_t o) {
- LDKSpendableOutputDescriptor o_conv = *(LDKSpendableOutputDescriptor*)(((uint64_t)o) & ~1);
+ void* o_ptr = (void*)(((uint64_t)o) & ~1);
+ CHECK_ACCESS(o_ptr);
+ LDKSpendableOutputDescriptor o_conv = *(LDKSpendableOutputDescriptor*)(o_ptr);
o_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)(((uint64_t)o) & ~1));
LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ");
*ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_ok(o_conv);
void __attribute__((visibility("default"))) TS_CResult_SpendableOutputDescriptorDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_SpendableOutputDescriptorDecodeErrorZ _res_conv = *(LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_SpendableOutputDescriptorDecodeErrorZ _res_conv = *(LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_SpendableOutputDescriptorDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_NoneNoneZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_NoneNoneZ _res_conv = *(LDKCResult_NoneNoneZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_NoneNoneZ _res_conv = *(LDKCResult_NoneNoneZ*)(_res_ptr);
FREE((void*)_res);
CResult_NoneNoneZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_C2Tuple_SignatureCVec_SignatureZZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKC2Tuple_SignatureCVec_SignatureZZ _res_conv = *(LDKC2Tuple_SignatureCVec_SignatureZZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKC2Tuple_SignatureCVec_SignatureZZ _res_conv = *(LDKC2Tuple_SignatureCVec_SignatureZZ*)(_res_ptr);
FREE((void*)_res);
C2Tuple_SignatureCVec_SignatureZZ_free(_res_conv);
}
uint32_t __attribute__((visibility("default"))) TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(uint32_t o) {
- LDKC2Tuple_SignatureCVec_SignatureZZ o_conv = *(LDKC2Tuple_SignatureCVec_SignatureZZ*)(((uint64_t)o) & ~1);
+ void* o_ptr = (void*)(((uint64_t)o) & ~1);
+ CHECK_ACCESS(o_ptr);
+ LDKC2Tuple_SignatureCVec_SignatureZZ o_conv = *(LDKC2Tuple_SignatureCVec_SignatureZZ*)(o_ptr);
o_conv = C2Tuple_SignatureCVec_SignatureZZ_clone((LDKC2Tuple_SignatureCVec_SignatureZZ*)(((uint64_t)o) & ~1));
LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ");
*ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(o_conv);
void __attribute__((visibility("default"))) TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ _res_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ _res_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(_res_ptr);
FREE((void*)_res);
CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_SignatureNoneZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_SignatureNoneZ _res_conv = *(LDKCResult_SignatureNoneZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_SignatureNoneZ _res_conv = *(LDKCResult_SignatureNoneZ*)(_res_ptr);
FREE((void*)_res);
CResult_SignatureNoneZ_free(_res_conv);
}
}
uint32_t __attribute__((visibility("default"))) TS_CResult_SignDecodeErrorZ_ok(uint32_t o) {
- LDKSign o_conv = *(LDKSign*)(((uint64_t)o) & ~1);
+ void* o_ptr = (void*)(((uint64_t)o) & ~1);
+ CHECK_ACCESS(o_ptr);
+ LDKSign o_conv = *(LDKSign*)(o_ptr);
LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ");
*ret_conv = CResult_SignDecodeErrorZ_ok(o_conv);
return (uint64_t)ret_conv;
void __attribute__((visibility("default"))) TS_CResult_SignDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_SignDecodeErrorZ _res_conv = *(LDKCResult_SignDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_SignDecodeErrorZ _res_conv = *(LDKCResult_SignDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_SignDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_RecoverableSignatureNoneZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_RecoverableSignatureNoneZ _res_conv = *(LDKCResult_RecoverableSignatureNoneZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_RecoverableSignatureNoneZ _res_conv = *(LDKCResult_RecoverableSignatureNoneZ*)(_res_ptr);
FREE((void*)_res);
CResult_RecoverableSignatureNoneZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_CVec_CVec_u8ZZNoneZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_CVec_CVec_u8ZZNoneZ _res_conv = *(LDKCResult_CVec_CVec_u8ZZNoneZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_CVec_CVec_u8ZZNoneZ _res_conv = *(LDKCResult_CVec_CVec_u8ZZNoneZ*)(_res_ptr);
FREE((void*)_res);
CResult_CVec_CVec_u8ZZNoneZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_InMemorySignerDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_InMemorySignerDecodeErrorZ _res_conv = *(LDKCResult_InMemorySignerDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_InMemorySignerDecodeErrorZ _res_conv = *(LDKCResult_InMemorySignerDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_InMemorySignerDecodeErrorZ_free(_res_conv);
}
uint32_t* _res_vals = (uint32_t*)(_res + 4);
for (size_t h = 0; h < _res_constr.datalen; h++) {
uint32_t _res_conv_7 = _res_vals[h];
- LDKTxOut _res_conv_7_conv = *(LDKTxOut*)(((uint64_t)_res_conv_7) & ~1);
+ void* _res_conv_7_ptr = (void*)(((uint64_t)_res_conv_7) & ~1);
+ CHECK_ACCESS(_res_conv_7_ptr);
+ LDKTxOut _res_conv_7_conv = *(LDKTxOut*)(_res_conv_7_ptr);
FREE((void*)_res_conv_7);
_res_constr.data[h] = _res_conv_7_conv;
}
void __attribute__((visibility("default"))) TS_CResult_TransactionNoneZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_TransactionNoneZ _res_conv = *(LDKCResult_TransactionNoneZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_TransactionNoneZ _res_conv = *(LDKCResult_TransactionNoneZ*)(_res_ptr);
FREE((void*)_res);
CResult_TransactionNoneZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_C2Tuple_BlockHashChannelMonitorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKC2Tuple_BlockHashChannelMonitorZ _res_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKC2Tuple_BlockHashChannelMonitorZ _res_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(_res_ptr);
FREE((void*)_res);
C2Tuple_BlockHashChannelMonitorZ_free(_res_conv);
}
uint32_t* _res_vals = (uint32_t*)(_res + 4);
for (size_t j = 0; j < _res_constr.datalen; j++) {
uint32_t _res_conv_35 = _res_vals[j];
- LDKC2Tuple_BlockHashChannelMonitorZ _res_conv_35_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(((uint64_t)_res_conv_35) & ~1);
+ void* _res_conv_35_ptr = (void*)(((uint64_t)_res_conv_35) & ~1);
+ CHECK_ACCESS(_res_conv_35_ptr);
+ LDKC2Tuple_BlockHashChannelMonitorZ _res_conv_35_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(_res_conv_35_ptr);
FREE((void*)_res_conv_35);
_res_constr.data[j] = _res_conv_35_conv;
}
uint32_t* o_vals = (uint32_t*)(o + 4);
for (size_t j = 0; j < o_constr.datalen; j++) {
uint32_t o_conv_35 = o_vals[j];
- LDKC2Tuple_BlockHashChannelMonitorZ o_conv_35_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(((uint64_t)o_conv_35) & ~1);
+ void* o_conv_35_ptr = (void*)(((uint64_t)o_conv_35) & ~1);
+ CHECK_ACCESS(o_conv_35_ptr);
+ LDKC2Tuple_BlockHashChannelMonitorZ o_conv_35_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(o_conv_35_ptr);
o_conv_35_conv = C2Tuple_BlockHashChannelMonitorZ_clone((LDKC2Tuple_BlockHashChannelMonitorZ*)(((uint64_t)o_conv_35) & ~1));
o_constr.data[j] = o_conv_35_conv;
}
void __attribute__((visibility("default"))) TS_CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ _res_conv = *(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ _res_conv = *(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_PaymentIdDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_PaymentIdDecodeErrorZ _res_conv = *(LDKCResult_PaymentIdDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_PaymentIdDecodeErrorZ _res_conv = *(LDKCResult_PaymentIdDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_PaymentIdDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_COption_u16Z_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCOption_u16Z _res_conv = *(LDKCOption_u16Z*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCOption_u16Z _res_conv = *(LDKCOption_u16Z*)(_res_ptr);
FREE((void*)_res);
COption_u16Z_free(_res_conv);
}
}
uint32_t __attribute__((visibility("default"))) TS_CResult_NoneAPIErrorZ_err(uint32_t e) {
- LDKAPIError e_conv = *(LDKAPIError*)(((uint64_t)e) & ~1);
+ void* e_ptr = (void*)(((uint64_t)e) & ~1);
+ CHECK_ACCESS(e_ptr);
+ LDKAPIError e_conv = *(LDKAPIError*)(e_ptr);
e_conv = APIError_clone((LDKAPIError*)(((uint64_t)e) & ~1));
LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
*ret_conv = CResult_NoneAPIErrorZ_err(e_conv);
void __attribute__((visibility("default"))) TS_CResult_NoneAPIErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_NoneAPIErrorZ _res_conv = *(LDKCResult_NoneAPIErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_NoneAPIErrorZ _res_conv = *(LDKCResult_NoneAPIErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_NoneAPIErrorZ_free(_res_conv);
}
uint32_t* _res_vals = (uint32_t*)(_res + 4);
for (size_t w = 0; w < _res_constr.datalen; w++) {
uint32_t _res_conv_22 = _res_vals[w];
- LDKCResult_NoneAPIErrorZ _res_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(((uint64_t)_res_conv_22) & ~1);
+ void* _res_conv_22_ptr = (void*)(((uint64_t)_res_conv_22) & ~1);
+ CHECK_ACCESS(_res_conv_22_ptr);
+ LDKCResult_NoneAPIErrorZ _res_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(_res_conv_22_ptr);
FREE((void*)_res_conv_22);
_res_constr.data[w] = _res_conv_22_conv;
}
uint32_t* _res_vals = (uint32_t*)(_res + 4);
for (size_t k = 0; k < _res_constr.datalen; k++) {
uint32_t _res_conv_10 = _res_vals[k];
- LDKAPIError _res_conv_10_conv = *(LDKAPIError*)(((uint64_t)_res_conv_10) & ~1);
+ void* _res_conv_10_ptr = (void*)(((uint64_t)_res_conv_10) & ~1);
+ CHECK_ACCESS(_res_conv_10_ptr);
+ LDKAPIError _res_conv_10_conv = *(LDKAPIError*)(_res_conv_10_ptr);
FREE((void*)_res_conv_10);
_res_constr.data[k] = _res_conv_10_conv;
}
}
uint32_t __attribute__((visibility("default"))) TS_CResult__u832APIErrorZ_err(uint32_t e) {
- LDKAPIError e_conv = *(LDKAPIError*)(((uint64_t)e) & ~1);
+ void* e_ptr = (void*)(((uint64_t)e) & ~1);
+ CHECK_ACCESS(e_ptr);
+ LDKAPIError e_conv = *(LDKAPIError*)(e_ptr);
e_conv = APIError_clone((LDKAPIError*)(((uint64_t)e) & ~1));
LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ");
*ret_conv = CResult__u832APIErrorZ_err(e_conv);
void __attribute__((visibility("default"))) TS_CResult__u832APIErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult__u832APIErrorZ _res_conv = *(LDKCResult__u832APIErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult__u832APIErrorZ _res_conv = *(LDKCResult__u832APIErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult__u832APIErrorZ_free(_res_conv);
}
}
uint32_t __attribute__((visibility("default"))) TS_CResult_PaymentIdPaymentSendFailureZ_err(uint32_t e) {
- LDKPaymentSendFailure e_conv = *(LDKPaymentSendFailure*)(((uint64_t)e) & ~1);
+ void* e_ptr = (void*)(((uint64_t)e) & ~1);
+ CHECK_ACCESS(e_ptr);
+ LDKPaymentSendFailure e_conv = *(LDKPaymentSendFailure*)(e_ptr);
e_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)(((uint64_t)e) & ~1));
LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ");
*ret_conv = CResult_PaymentIdPaymentSendFailureZ_err(e_conv);
void __attribute__((visibility("default"))) TS_CResult_PaymentIdPaymentSendFailureZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_PaymentIdPaymentSendFailureZ _res_conv = *(LDKCResult_PaymentIdPaymentSendFailureZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_PaymentIdPaymentSendFailureZ _res_conv = *(LDKCResult_PaymentIdPaymentSendFailureZ*)(_res_ptr);
FREE((void*)_res);
CResult_PaymentIdPaymentSendFailureZ_free(_res_conv);
}
}
uint32_t __attribute__((visibility("default"))) TS_CResult_NonePaymentSendFailureZ_err(uint32_t e) {
- LDKPaymentSendFailure e_conv = *(LDKPaymentSendFailure*)(((uint64_t)e) & ~1);
+ void* e_ptr = (void*)(((uint64_t)e) & ~1);
+ CHECK_ACCESS(e_ptr);
+ LDKPaymentSendFailure e_conv = *(LDKPaymentSendFailure*)(e_ptr);
e_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)(((uint64_t)e) & ~1));
LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
*ret_conv = CResult_NonePaymentSendFailureZ_err(e_conv);
void __attribute__((visibility("default"))) TS_CResult_NonePaymentSendFailureZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_NonePaymentSendFailureZ _res_conv = *(LDKCResult_NonePaymentSendFailureZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_NonePaymentSendFailureZ _res_conv = *(LDKCResult_NonePaymentSendFailureZ*)(_res_ptr);
FREE((void*)_res);
CResult_NonePaymentSendFailureZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_C2Tuple_PaymentHashPaymentIdZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKC2Tuple_PaymentHashPaymentIdZ _res_conv = *(LDKC2Tuple_PaymentHashPaymentIdZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKC2Tuple_PaymentHashPaymentIdZ _res_conv = *(LDKC2Tuple_PaymentHashPaymentIdZ*)(_res_ptr);
FREE((void*)_res);
C2Tuple_PaymentHashPaymentIdZ_free(_res_conv);
}
uint32_t __attribute__((visibility("default"))) TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_ok(uint32_t o) {
- LDKC2Tuple_PaymentHashPaymentIdZ o_conv = *(LDKC2Tuple_PaymentHashPaymentIdZ*)(((uint64_t)o) & ~1);
+ void* o_ptr = (void*)(((uint64_t)o) & ~1);
+ CHECK_ACCESS(o_ptr);
+ LDKC2Tuple_PaymentHashPaymentIdZ o_conv = *(LDKC2Tuple_PaymentHashPaymentIdZ*)(o_ptr);
o_conv = C2Tuple_PaymentHashPaymentIdZ_clone((LDKC2Tuple_PaymentHashPaymentIdZ*)(((uint64_t)o) & ~1));
LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ");
*ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_ok(o_conv);
}
uint32_t __attribute__((visibility("default"))) TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_err(uint32_t e) {
- LDKPaymentSendFailure e_conv = *(LDKPaymentSendFailure*)(((uint64_t)e) & ~1);
+ void* e_ptr = (void*)(((uint64_t)e) & ~1);
+ CHECK_ACCESS(e_ptr);
+ LDKPaymentSendFailure e_conv = *(LDKPaymentSendFailure*)(e_ptr);
e_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)(((uint64_t)e) & ~1));
LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ");
*ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_err(e_conv);
void __attribute__((visibility("default"))) TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ _res_conv = *(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ _res_conv = *(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)(_res_ptr);
FREE((void*)_res);
CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_free(_res_conv);
}
uint32_t* _res_vals = (uint32_t*)(_res + 4);
for (size_t m = 0; m < _res_constr.datalen; m++) {
uint32_t _res_conv_12 = _res_vals[m];
- LDKNetAddress _res_conv_12_conv = *(LDKNetAddress*)(((uint64_t)_res_conv_12) & ~1);
+ void* _res_conv_12_ptr = (void*)(((uint64_t)_res_conv_12) & ~1);
+ CHECK_ACCESS(_res_conv_12_ptr);
+ LDKNetAddress _res_conv_12_conv = *(LDKNetAddress*)(_res_conv_12_ptr);
FREE((void*)_res_conv_12);
_res_constr.data[m] = _res_conv_12_conv;
}
void __attribute__((visibility("default"))) TS_C2Tuple_PaymentHashPaymentSecretZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKC2Tuple_PaymentHashPaymentSecretZ _res_conv = *(LDKC2Tuple_PaymentHashPaymentSecretZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKC2Tuple_PaymentHashPaymentSecretZ _res_conv = *(LDKC2Tuple_PaymentHashPaymentSecretZ*)(_res_ptr);
FREE((void*)_res);
C2Tuple_PaymentHashPaymentSecretZ_free(_res_conv);
}
}
uint32_t __attribute__((visibility("default"))) TS_CResult_PaymentSecretAPIErrorZ_err(uint32_t e) {
- LDKAPIError e_conv = *(LDKAPIError*)(((uint64_t)e) & ~1);
+ void* e_ptr = (void*)(((uint64_t)e) & ~1);
+ CHECK_ACCESS(e_ptr);
+ LDKAPIError e_conv = *(LDKAPIError*)(e_ptr);
e_conv = APIError_clone((LDKAPIError*)(((uint64_t)e) & ~1));
LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ");
*ret_conv = CResult_PaymentSecretAPIErrorZ_err(e_conv);
void __attribute__((visibility("default"))) TS_CResult_PaymentSecretAPIErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_PaymentSecretAPIErrorZ _res_conv = *(LDKCResult_PaymentSecretAPIErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_PaymentSecretAPIErrorZ _res_conv = *(LDKCResult_PaymentSecretAPIErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_PaymentSecretAPIErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_C2Tuple_BlockHashChannelManagerZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKC2Tuple_BlockHashChannelManagerZ _res_conv = *(LDKC2Tuple_BlockHashChannelManagerZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKC2Tuple_BlockHashChannelManagerZ _res_conv = *(LDKC2Tuple_BlockHashChannelManagerZ*)(_res_ptr);
FREE((void*)_res);
C2Tuple_BlockHashChannelManagerZ_free(_res_conv);
}
uint32_t __attribute__((visibility("default"))) TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(uint32_t o) {
- LDKC2Tuple_BlockHashChannelManagerZ o_conv = *(LDKC2Tuple_BlockHashChannelManagerZ*)(((uint64_t)o) & ~1);
+ void* o_ptr = (void*)(((uint64_t)o) & ~1);
+ CHECK_ACCESS(o_ptr);
+ LDKC2Tuple_BlockHashChannelManagerZ o_conv = *(LDKC2Tuple_BlockHashChannelManagerZ*)(o_ptr);
// Warning: we may need a move here but no clone is available for LDKC2Tuple_BlockHashChannelManagerZ
LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ");
*ret_conv = CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(o_conv);
void __attribute__((visibility("default"))) TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ _res_conv = *(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ _res_conv = *(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_ChannelConfigDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_ChannelConfigDecodeErrorZ _res_conv = *(LDKCResult_ChannelConfigDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_ChannelConfigDecodeErrorZ _res_conv = *(LDKCResult_ChannelConfigDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_ChannelConfigDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_OutPointDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_OutPointDecodeErrorZ _res_conv = *(LDKCResult_OutPointDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_OutPointDecodeErrorZ _res_conv = *(LDKCResult_OutPointDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_OutPointDecodeErrorZ_free(_res_conv);
}
}
uint32_t __attribute__((visibility("default"))) TS_COption_TypeZ_some(uint32_t o) {
- LDKType o_conv = *(LDKType*)(((uint64_t)o) & ~1);
+ void* o_ptr = (void*)(((uint64_t)o) & ~1);
+ CHECK_ACCESS(o_ptr);
+ LDKType o_conv = *(LDKType*)(o_ptr);
LDKCOption_TypeZ *ret_copy = MALLOC(sizeof(LDKCOption_TypeZ), "LDKCOption_TypeZ");
*ret_copy = COption_TypeZ_some(o_conv);
uint64_t ret_ref = (uint64_t)ret_copy;
void __attribute__((visibility("default"))) TS_COption_TypeZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCOption_TypeZ _res_conv = *(LDKCOption_TypeZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCOption_TypeZ _res_conv = *(LDKCOption_TypeZ*)(_res_ptr);
FREE((void*)_res);
COption_TypeZ_free(_res_conv);
}
}
uint32_t __attribute__((visibility("default"))) TS_CResult_COption_TypeZDecodeErrorZ_ok(uint32_t o) {
- LDKCOption_TypeZ o_conv = *(LDKCOption_TypeZ*)(((uint64_t)o) & ~1);
+ void* o_ptr = (void*)(((uint64_t)o) & ~1);
+ CHECK_ACCESS(o_ptr);
+ LDKCOption_TypeZ o_conv = *(LDKCOption_TypeZ*)(o_ptr);
o_conv = COption_TypeZ_clone((LDKCOption_TypeZ*)(((uint64_t)o) & ~1));
LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ");
*ret_conv = CResult_COption_TypeZDecodeErrorZ_ok(o_conv);
void __attribute__((visibility("default"))) TS_CResult_COption_TypeZDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_COption_TypeZDecodeErrorZ _res_conv = *(LDKCResult_COption_TypeZDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_COption_TypeZDecodeErrorZ _res_conv = *(LDKCResult_COption_TypeZDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_COption_TypeZDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_SiPrefixNoneZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_SiPrefixNoneZ _res_conv = *(LDKCResult_SiPrefixNoneZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_SiPrefixNoneZ _res_conv = *(LDKCResult_SiPrefixNoneZ*)(_res_ptr);
FREE((void*)_res);
CResult_SiPrefixNoneZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_InvoiceNoneZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_InvoiceNoneZ _res_conv = *(LDKCResult_InvoiceNoneZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_InvoiceNoneZ _res_conv = *(LDKCResult_InvoiceNoneZ*)(_res_ptr);
FREE((void*)_res);
CResult_InvoiceNoneZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_SignedRawInvoiceNoneZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_SignedRawInvoiceNoneZ _res_conv = *(LDKCResult_SignedRawInvoiceNoneZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_SignedRawInvoiceNoneZ _res_conv = *(LDKCResult_SignedRawInvoiceNoneZ*)(_res_ptr);
FREE((void*)_res);
CResult_SignedRawInvoiceNoneZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ _res_conv = *(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ _res_conv = *(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)(_res_ptr);
FREE((void*)_res);
C3Tuple_RawInvoice_u832InvoiceSignatureZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_PayeePubKeyErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_PayeePubKeyErrorZ _res_conv = *(LDKCResult_PayeePubKeyErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_PayeePubKeyErrorZ _res_conv = *(LDKCResult_PayeePubKeyErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_PayeePubKeyErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_PositiveTimestampCreationErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_PositiveTimestampCreationErrorZ _res_conv = *(LDKCResult_PositiveTimestampCreationErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_PositiveTimestampCreationErrorZ _res_conv = *(LDKCResult_PositiveTimestampCreationErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_PositiveTimestampCreationErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_NoneSemanticErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_NoneSemanticErrorZ _res_conv = *(LDKCResult_NoneSemanticErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_NoneSemanticErrorZ _res_conv = *(LDKCResult_NoneSemanticErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_NoneSemanticErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_InvoiceSemanticErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_InvoiceSemanticErrorZ _res_conv = *(LDKCResult_InvoiceSemanticErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_InvoiceSemanticErrorZ _res_conv = *(LDKCResult_InvoiceSemanticErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_InvoiceSemanticErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_DescriptionCreationErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_DescriptionCreationErrorZ _res_conv = *(LDKCResult_DescriptionCreationErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_DescriptionCreationErrorZ _res_conv = *(LDKCResult_DescriptionCreationErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_DescriptionCreationErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_ExpiryTimeCreationErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_ExpiryTimeCreationErrorZ _res_conv = *(LDKCResult_ExpiryTimeCreationErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_ExpiryTimeCreationErrorZ _res_conv = *(LDKCResult_ExpiryTimeCreationErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_ExpiryTimeCreationErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_PrivateRouteCreationErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_PrivateRouteCreationErrorZ _res_conv = *(LDKCResult_PrivateRouteCreationErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_PrivateRouteCreationErrorZ _res_conv = *(LDKCResult_PrivateRouteCreationErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_PrivateRouteCreationErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_StringErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_StringErrorZ _res_conv = *(LDKCResult_StringErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_StringErrorZ _res_conv = *(LDKCResult_StringErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_StringErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_ChannelMonitorUpdateDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_ChannelMonitorUpdateDecodeErrorZ _res_conv = *(LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_ChannelMonitorUpdateDecodeErrorZ _res_conv = *(LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_ChannelMonitorUpdateDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_HTLCUpdateDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_HTLCUpdateDecodeErrorZ _res_conv = *(LDKCResult_HTLCUpdateDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_HTLCUpdateDecodeErrorZ _res_conv = *(LDKCResult_HTLCUpdateDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_HTLCUpdateDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_NoneMonitorUpdateErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_NoneMonitorUpdateErrorZ _res_conv = *(LDKCResult_NoneMonitorUpdateErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_NoneMonitorUpdateErrorZ _res_conv = *(LDKCResult_NoneMonitorUpdateErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_NoneMonitorUpdateErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_C2Tuple_OutPointScriptZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKC2Tuple_OutPointScriptZ _res_conv = *(LDKC2Tuple_OutPointScriptZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKC2Tuple_OutPointScriptZ _res_conv = *(LDKC2Tuple_OutPointScriptZ*)(_res_ptr);
FREE((void*)_res);
C2Tuple_OutPointScriptZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_C2Tuple_u32ScriptZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKC2Tuple_u32ScriptZ _res_conv = *(LDKC2Tuple_u32ScriptZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKC2Tuple_u32ScriptZ _res_conv = *(LDKC2Tuple_u32ScriptZ*)(_res_ptr);
FREE((void*)_res);
C2Tuple_u32ScriptZ_free(_res_conv);
}
uint32_t* _res_vals = (uint32_t*)(_res + 4);
for (size_t v = 0; v < _res_constr.datalen; v++) {
uint32_t _res_conv_21 = _res_vals[v];
- LDKC2Tuple_u32ScriptZ _res_conv_21_conv = *(LDKC2Tuple_u32ScriptZ*)(((uint64_t)_res_conv_21) & ~1);
+ void* _res_conv_21_ptr = (void*)(((uint64_t)_res_conv_21) & ~1);
+ CHECK_ACCESS(_res_conv_21_ptr);
+ LDKC2Tuple_u32ScriptZ _res_conv_21_conv = *(LDKC2Tuple_u32ScriptZ*)(_res_conv_21_ptr);
FREE((void*)_res_conv_21);
_res_constr.data[v] = _res_conv_21_conv;
}
uint32_t* b_vals = (uint32_t*)(b + 4);
for (size_t v = 0; v < b_constr.datalen; v++) {
uint32_t b_conv_21 = b_vals[v];
- LDKC2Tuple_u32ScriptZ b_conv_21_conv = *(LDKC2Tuple_u32ScriptZ*)(((uint64_t)b_conv_21) & ~1);
+ void* b_conv_21_ptr = (void*)(((uint64_t)b_conv_21) & ~1);
+ CHECK_ACCESS(b_conv_21_ptr);
+ LDKC2Tuple_u32ScriptZ b_conv_21_conv = *(LDKC2Tuple_u32ScriptZ*)(b_conv_21_ptr);
b_conv_21_conv = C2Tuple_u32ScriptZ_clone((LDKC2Tuple_u32ScriptZ*)(((uint64_t)b_conv_21) & ~1));
b_constr.data[v] = b_conv_21_conv;
}
void __attribute__((visibility("default"))) TS_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ _res_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ _res_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(_res_ptr);
FREE((void*)_res);
C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_free(_res_conv);
}
uint32_t* _res_vals = (uint32_t*)(_res + 4);
for (size_t o = 0; o < _res_constr.datalen; o++) {
uint32_t _res_conv_40 = _res_vals[o];
- LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ _res_conv_40_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(((uint64_t)_res_conv_40) & ~1);
+ void* _res_conv_40_ptr = (void*)(((uint64_t)_res_conv_40) & ~1);
+ CHECK_ACCESS(_res_conv_40_ptr);
+ LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ _res_conv_40_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(_res_conv_40_ptr);
FREE((void*)_res_conv_40);
_res_constr.data[o] = _res_conv_40_conv;
}
uint32_t* _res_vals = (uint32_t*)(_res + 4);
for (size_t h = 0; h < _res_constr.datalen; h++) {
uint32_t _res_conv_7 = _res_vals[h];
- LDKEvent _res_conv_7_conv = *(LDKEvent*)(((uint64_t)_res_conv_7) & ~1);
+ void* _res_conv_7_ptr = (void*)(((uint64_t)_res_conv_7) & ~1);
+ CHECK_ACCESS(_res_conv_7_ptr);
+ LDKEvent _res_conv_7_conv = *(LDKEvent*)(_res_conv_7_ptr);
FREE((void*)_res_conv_7);
_res_constr.data[h] = _res_conv_7_conv;
}
}
uint32_t __attribute__((visibility("default"))) TS_C2Tuple_u32TxOutZ_new(int32_t a, uint32_t b) {
- LDKTxOut b_conv = *(LDKTxOut*)(((uint64_t)b) & ~1);
+ void* b_ptr = (void*)(((uint64_t)b) & ~1);
+ CHECK_ACCESS(b_ptr);
+ LDKTxOut b_conv = *(LDKTxOut*)(b_ptr);
b_conv = TxOut_clone((LDKTxOut*)(((uint64_t)b) & ~1));
LDKC2Tuple_u32TxOutZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ), "LDKC2Tuple_u32TxOutZ");
*ret_conv = C2Tuple_u32TxOutZ_new(a, b_conv);
void __attribute__((visibility("default"))) TS_C2Tuple_u32TxOutZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKC2Tuple_u32TxOutZ _res_conv = *(LDKC2Tuple_u32TxOutZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKC2Tuple_u32TxOutZ _res_conv = *(LDKC2Tuple_u32TxOutZ*)(_res_ptr);
FREE((void*)_res);
C2Tuple_u32TxOutZ_free(_res_conv);
}
uint32_t* _res_vals = (uint32_t*)(_res + 4);
for (size_t u = 0; u < _res_constr.datalen; u++) {
uint32_t _res_conv_20 = _res_vals[u];
- LDKC2Tuple_u32TxOutZ _res_conv_20_conv = *(LDKC2Tuple_u32TxOutZ*)(((uint64_t)_res_conv_20) & ~1);
+ void* _res_conv_20_ptr = (void*)(((uint64_t)_res_conv_20) & ~1);
+ CHECK_ACCESS(_res_conv_20_ptr);
+ LDKC2Tuple_u32TxOutZ _res_conv_20_conv = *(LDKC2Tuple_u32TxOutZ*)(_res_conv_20_ptr);
FREE((void*)_res_conv_20);
_res_constr.data[u] = _res_conv_20_conv;
}
uint32_t* b_vals = (uint32_t*)(b + 4);
for (size_t u = 0; u < b_constr.datalen; u++) {
uint32_t b_conv_20 = b_vals[u];
- LDKC2Tuple_u32TxOutZ b_conv_20_conv = *(LDKC2Tuple_u32TxOutZ*)(((uint64_t)b_conv_20) & ~1);
+ void* b_conv_20_ptr = (void*)(((uint64_t)b_conv_20) & ~1);
+ CHECK_ACCESS(b_conv_20_ptr);
+ LDKC2Tuple_u32TxOutZ b_conv_20_conv = *(LDKC2Tuple_u32TxOutZ*)(b_conv_20_ptr);
b_conv_20_conv = C2Tuple_u32TxOutZ_clone((LDKC2Tuple_u32TxOutZ*)(((uint64_t)b_conv_20) & ~1));
b_constr.data[u] = b_conv_20_conv;
}
void __attribute__((visibility("default"))) TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ _res_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ _res_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(_res_ptr);
FREE((void*)_res);
C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free(_res_conv);
}
uint32_t* _res_vals = (uint32_t*)(_res + 4);
for (size_t n = 0; n < _res_constr.datalen; n++) {
uint32_t _res_conv_39 = _res_vals[n];
- LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ _res_conv_39_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(((uint64_t)_res_conv_39) & ~1);
+ void* _res_conv_39_ptr = (void*)(((uint64_t)_res_conv_39) & ~1);
+ CHECK_ACCESS(_res_conv_39_ptr);
+ LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ _res_conv_39_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(_res_conv_39_ptr);
FREE((void*)_res_conv_39);
_res_constr.data[n] = _res_conv_39_conv;
}
uint32_t* _res_vals = (uint32_t*)(_res + 4);
for (size_t j = 0; j < _res_constr.datalen; j++) {
uint32_t _res_conv_9 = _res_vals[j];
- LDKBalance _res_conv_9_conv = *(LDKBalance*)(((uint64_t)_res_conv_9) & ~1);
+ void* _res_conv_9_ptr = (void*)(((uint64_t)_res_conv_9) & ~1);
+ CHECK_ACCESS(_res_conv_9_ptr);
+ LDKBalance _res_conv_9_conv = *(LDKBalance*)(_res_conv_9_ptr);
FREE((void*)_res_conv_9);
_res_constr.data[j] = _res_conv_9_conv;
}
}
uint32_t __attribute__((visibility("default"))) TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(uint32_t o) {
- LDKC2Tuple_BlockHashChannelMonitorZ o_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(((uint64_t)o) & ~1);
+ void* o_ptr = (void*)(((uint64_t)o) & ~1);
+ CHECK_ACCESS(o_ptr);
+ LDKC2Tuple_BlockHashChannelMonitorZ o_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(o_ptr);
o_conv = C2Tuple_BlockHashChannelMonitorZ_clone((LDKC2Tuple_BlockHashChannelMonitorZ*)(((uint64_t)o) & ~1));
LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ");
*ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(o_conv);
void __attribute__((visibility("default"))) TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ _res_conv = *(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ _res_conv = *(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_NoneLightningErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_NoneLightningErrorZ _res_conv = *(LDKCResult_NoneLightningErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_NoneLightningErrorZ _res_conv = *(LDKCResult_NoneLightningErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_NoneLightningErrorZ_free(_res_conv);
}
LDKPublicKey a_ref;
CHECK(*((uint32_t*)a) == 33);
memcpy(a_ref.compressed_form, (uint8_t*)(a + 4), 33);
- LDKType b_conv = *(LDKType*)(((uint64_t)b) & ~1);
+ void* b_ptr = (void*)(((uint64_t)b) & ~1);
+ CHECK_ACCESS(b_ptr);
+ LDKType b_conv = *(LDKType*)(b_ptr);
LDKC2Tuple_PublicKeyTypeZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKC2Tuple_PublicKeyTypeZ");
*ret_conv = C2Tuple_PublicKeyTypeZ_new(a_ref, b_conv);
return ((uint64_t)ret_conv);
void __attribute__((visibility("default"))) TS_C2Tuple_PublicKeyTypeZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKC2Tuple_PublicKeyTypeZ _res_conv = *(LDKC2Tuple_PublicKeyTypeZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKC2Tuple_PublicKeyTypeZ _res_conv = *(LDKC2Tuple_PublicKeyTypeZ*)(_res_ptr);
FREE((void*)_res);
C2Tuple_PublicKeyTypeZ_free(_res_conv);
}
uint32_t* _res_vals = (uint32_t*)(_res + 4);
for (size_t z = 0; z < _res_constr.datalen; z++) {
uint32_t _res_conv_25 = _res_vals[z];
- LDKC2Tuple_PublicKeyTypeZ _res_conv_25_conv = *(LDKC2Tuple_PublicKeyTypeZ*)(((uint64_t)_res_conv_25) & ~1);
+ void* _res_conv_25_ptr = (void*)(((uint64_t)_res_conv_25) & ~1);
+ CHECK_ACCESS(_res_conv_25_ptr);
+ LDKC2Tuple_PublicKeyTypeZ _res_conv_25_conv = *(LDKC2Tuple_PublicKeyTypeZ*)(_res_conv_25_ptr);
FREE((void*)_res_conv_25);
_res_constr.data[z] = _res_conv_25_conv;
}
void __attribute__((visibility("default"))) TS_CResult_boolLightningErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_boolLightningErrorZ _res_conv = *(LDKCResult_boolLightningErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_boolLightningErrorZ _res_conv = *(LDKCResult_boolLightningErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_boolLightningErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(_res_ptr);
FREE((void*)_res);
C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(_res_conv);
}
uint32_t* _res_vals = (uint32_t*)(_res + 4);
for (size_t h = 0; h < _res_constr.datalen; h++) {
uint32_t _res_conv_59 = _res_vals[h];
- LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res_conv_59_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(((uint64_t)_res_conv_59) & ~1);
+ void* _res_conv_59_ptr = (void*)(((uint64_t)_res_conv_59) & ~1);
+ CHECK_ACCESS(_res_conv_59_ptr);
+ LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res_conv_59_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(_res_conv_59_ptr);
FREE((void*)_res_conv_59);
_res_constr.data[h] = _res_conv_59_conv;
}
void __attribute__((visibility("default"))) TS_CResult_CVec_u8ZPeerHandleErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_CVec_u8ZPeerHandleErrorZ _res_conv = *(LDKCResult_CVec_u8ZPeerHandleErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_CVec_u8ZPeerHandleErrorZ _res_conv = *(LDKCResult_CVec_u8ZPeerHandleErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_CVec_u8ZPeerHandleErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_NonePeerHandleErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_NonePeerHandleErrorZ _res_conv = *(LDKCResult_NonePeerHandleErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_NonePeerHandleErrorZ _res_conv = *(LDKCResult_NonePeerHandleErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_NonePeerHandleErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_boolPeerHandleErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_boolPeerHandleErrorZ _res_conv = *(LDKCResult_boolPeerHandleErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_boolPeerHandleErrorZ _res_conv = *(LDKCResult_boolPeerHandleErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_boolPeerHandleErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_NodeIdDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_NodeIdDecodeErrorZ _res_conv = *(LDKCResult_NodeIdDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_NodeIdDecodeErrorZ _res_conv = *(LDKCResult_NodeIdDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_NodeIdDecodeErrorZ_free(_res_conv);
}
}
uint32_t __attribute__((visibility("default"))) TS_COption_AccessZ_some(uint32_t o) {
- LDKAccess o_conv = *(LDKAccess*)(((uint64_t)o) & ~1);
+ void* o_ptr = (void*)(((uint64_t)o) & ~1);
+ CHECK_ACCESS(o_ptr);
+ LDKAccess o_conv = *(LDKAccess*)(o_ptr);
LDKCOption_AccessZ *ret_copy = MALLOC(sizeof(LDKCOption_AccessZ), "LDKCOption_AccessZ");
*ret_copy = COption_AccessZ_some(o_conv);
uint64_t ret_ref = (uint64_t)ret_copy;
void __attribute__((visibility("default"))) TS_COption_AccessZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCOption_AccessZ _res_conv = *(LDKCOption_AccessZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCOption_AccessZ _res_conv = *(LDKCOption_AccessZ*)(_res_ptr);
FREE((void*)_res);
COption_AccessZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_DirectionalChannelInfoDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_DirectionalChannelInfoDecodeErrorZ _res_conv = *(LDKCResult_DirectionalChannelInfoDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_DirectionalChannelInfoDecodeErrorZ _res_conv = *(LDKCResult_DirectionalChannelInfoDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_DirectionalChannelInfoDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_ChannelInfoDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_ChannelInfoDecodeErrorZ _res_conv = *(LDKCResult_ChannelInfoDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_ChannelInfoDecodeErrorZ _res_conv = *(LDKCResult_ChannelInfoDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_ChannelInfoDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_RoutingFeesDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_RoutingFeesDecodeErrorZ _res_conv = *(LDKCResult_RoutingFeesDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_RoutingFeesDecodeErrorZ _res_conv = *(LDKCResult_RoutingFeesDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_RoutingFeesDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_NodeAnnouncementInfoDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_NodeAnnouncementInfoDecodeErrorZ _res_conv = *(LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_NodeAnnouncementInfoDecodeErrorZ _res_conv = *(LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_NodeAnnouncementInfoDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_NodeInfoDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_NodeInfoDecodeErrorZ _res_conv = *(LDKCResult_NodeInfoDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_NodeInfoDecodeErrorZ _res_conv = *(LDKCResult_NodeInfoDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_NodeInfoDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_NetworkGraphDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_NetworkGraphDecodeErrorZ _res_conv = *(LDKCResult_NetworkGraphDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_NetworkGraphDecodeErrorZ _res_conv = *(LDKCResult_NetworkGraphDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_NetworkGraphDecodeErrorZ_free(_res_conv);
}
uint32_t* o_vals = (uint32_t*)(o + 4);
for (size_t m = 0; m < o_constr.datalen; m++) {
uint32_t o_conv_12 = o_vals[m];
- LDKNetAddress o_conv_12_conv = *(LDKNetAddress*)(((uint64_t)o_conv_12) & ~1);
+ void* o_conv_12_ptr = (void*)(((uint64_t)o_conv_12) & ~1);
+ CHECK_ACCESS(o_conv_12_ptr);
+ LDKNetAddress o_conv_12_conv = *(LDKNetAddress*)(o_conv_12_ptr);
o_conv_12_conv = NetAddress_clone((LDKNetAddress*)(((uint64_t)o_conv_12) & ~1));
o_constr.data[m] = o_conv_12_conv;
}
void __attribute__((visibility("default"))) TS_COption_CVec_NetAddressZZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCOption_CVec_NetAddressZZ _res_conv = *(LDKCOption_CVec_NetAddressZZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCOption_CVec_NetAddressZZ _res_conv = *(LDKCOption_CVec_NetAddressZZ*)(_res_ptr);
FREE((void*)_res);
COption_CVec_NetAddressZZ_free(_res_conv);
}
}
uint32_t __attribute__((visibility("default"))) TS_CResult_NetAddressu8Z_ok(uint32_t o) {
- LDKNetAddress o_conv = *(LDKNetAddress*)(((uint64_t)o) & ~1);
+ void* o_ptr = (void*)(((uint64_t)o) & ~1);
+ CHECK_ACCESS(o_ptr);
+ LDKNetAddress o_conv = *(LDKNetAddress*)(o_ptr);
o_conv = NetAddress_clone((LDKNetAddress*)(((uint64_t)o) & ~1));
LDKCResult_NetAddressu8Z* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressu8Z), "LDKCResult_NetAddressu8Z");
*ret_conv = CResult_NetAddressu8Z_ok(o_conv);
void __attribute__((visibility("default"))) TS_CResult_NetAddressu8Z_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_NetAddressu8Z _res_conv = *(LDKCResult_NetAddressu8Z*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_NetAddressu8Z _res_conv = *(LDKCResult_NetAddressu8Z*)(_res_ptr);
FREE((void*)_res);
CResult_NetAddressu8Z_free(_res_conv);
}
}
uint32_t __attribute__((visibility("default"))) TS_CResult_CResult_NetAddressu8ZDecodeErrorZ_ok(uint32_t o) {
- LDKCResult_NetAddressu8Z o_conv = *(LDKCResult_NetAddressu8Z*)(((uint64_t)o) & ~1);
+ void* o_ptr = (void*)(((uint64_t)o) & ~1);
+ CHECK_ACCESS(o_ptr);
+ LDKCResult_NetAddressu8Z o_conv = *(LDKCResult_NetAddressu8Z*)(o_ptr);
o_conv = CResult_NetAddressu8Z_clone((LDKCResult_NetAddressu8Z*)(((uint64_t)o) & ~1));
LDKCResult_CResult_NetAddressu8ZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CResult_NetAddressu8ZDecodeErrorZ), "LDKCResult_CResult_NetAddressu8ZDecodeErrorZ");
*ret_conv = CResult_CResult_NetAddressu8ZDecodeErrorZ_ok(o_conv);
void __attribute__((visibility("default"))) TS_CResult_CResult_NetAddressu8ZDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_CResult_NetAddressu8ZDecodeErrorZ _res_conv = *(LDKCResult_CResult_NetAddressu8ZDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_CResult_NetAddressu8ZDecodeErrorZ _res_conv = *(LDKCResult_CResult_NetAddressu8ZDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_CResult_NetAddressu8ZDecodeErrorZ_free(_res_conv);
}
}
uint32_t __attribute__((visibility("default"))) TS_CResult_NetAddressDecodeErrorZ_ok(uint32_t o) {
- LDKNetAddress o_conv = *(LDKNetAddress*)(((uint64_t)o) & ~1);
+ void* o_ptr = (void*)(((uint64_t)o) & ~1);
+ CHECK_ACCESS(o_ptr);
+ LDKNetAddress o_conv = *(LDKNetAddress*)(o_ptr);
o_conv = NetAddress_clone((LDKNetAddress*)(((uint64_t)o) & ~1));
LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ");
*ret_conv = CResult_NetAddressDecodeErrorZ_ok(o_conv);
void __attribute__((visibility("default"))) TS_CResult_NetAddressDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_NetAddressDecodeErrorZ _res_conv = *(LDKCResult_NetAddressDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_NetAddressDecodeErrorZ _res_conv = *(LDKCResult_NetAddressDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_NetAddressDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_AcceptChannelDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_AcceptChannelDecodeErrorZ _res_conv = *(LDKCResult_AcceptChannelDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_AcceptChannelDecodeErrorZ _res_conv = *(LDKCResult_AcceptChannelDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_AcceptChannelDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_AnnouncementSignaturesDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_AnnouncementSignaturesDecodeErrorZ _res_conv = *(LDKCResult_AnnouncementSignaturesDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_AnnouncementSignaturesDecodeErrorZ _res_conv = *(LDKCResult_AnnouncementSignaturesDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_AnnouncementSignaturesDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_ChannelReestablishDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_ChannelReestablishDecodeErrorZ _res_conv = *(LDKCResult_ChannelReestablishDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_ChannelReestablishDecodeErrorZ _res_conv = *(LDKCResult_ChannelReestablishDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_ChannelReestablishDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_ClosingSignedDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_ClosingSignedDecodeErrorZ _res_conv = *(LDKCResult_ClosingSignedDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_ClosingSignedDecodeErrorZ _res_conv = *(LDKCResult_ClosingSignedDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_ClosingSignedDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_ClosingSignedFeeRangeDecodeErrorZ _res_conv = *(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_ClosingSignedFeeRangeDecodeErrorZ _res_conv = *(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_ClosingSignedFeeRangeDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_CommitmentSignedDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_CommitmentSignedDecodeErrorZ _res_conv = *(LDKCResult_CommitmentSignedDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_CommitmentSignedDecodeErrorZ _res_conv = *(LDKCResult_CommitmentSignedDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_CommitmentSignedDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_FundingCreatedDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_FundingCreatedDecodeErrorZ _res_conv = *(LDKCResult_FundingCreatedDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_FundingCreatedDecodeErrorZ _res_conv = *(LDKCResult_FundingCreatedDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_FundingCreatedDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_FundingSignedDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_FundingSignedDecodeErrorZ _res_conv = *(LDKCResult_FundingSignedDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_FundingSignedDecodeErrorZ _res_conv = *(LDKCResult_FundingSignedDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_FundingSignedDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_FundingLockedDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_FundingLockedDecodeErrorZ _res_conv = *(LDKCResult_FundingLockedDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_FundingLockedDecodeErrorZ _res_conv = *(LDKCResult_FundingLockedDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_FundingLockedDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_InitDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_InitDecodeErrorZ _res_conv = *(LDKCResult_InitDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_InitDecodeErrorZ _res_conv = *(LDKCResult_InitDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_InitDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_OpenChannelDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_OpenChannelDecodeErrorZ _res_conv = *(LDKCResult_OpenChannelDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_OpenChannelDecodeErrorZ _res_conv = *(LDKCResult_OpenChannelDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_OpenChannelDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_RevokeAndACKDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_RevokeAndACKDecodeErrorZ _res_conv = *(LDKCResult_RevokeAndACKDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_RevokeAndACKDecodeErrorZ _res_conv = *(LDKCResult_RevokeAndACKDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_RevokeAndACKDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_ShutdownDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_ShutdownDecodeErrorZ _res_conv = *(LDKCResult_ShutdownDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_ShutdownDecodeErrorZ _res_conv = *(LDKCResult_ShutdownDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_ShutdownDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_UpdateFailHTLCDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_UpdateFailHTLCDecodeErrorZ _res_conv = *(LDKCResult_UpdateFailHTLCDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_UpdateFailHTLCDecodeErrorZ _res_conv = *(LDKCResult_UpdateFailHTLCDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_UpdateFailHTLCDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ _res_conv = *(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ _res_conv = *(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_UpdateFeeDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_UpdateFeeDecodeErrorZ _res_conv = *(LDKCResult_UpdateFeeDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_UpdateFeeDecodeErrorZ _res_conv = *(LDKCResult_UpdateFeeDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_UpdateFeeDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_UpdateFulfillHTLCDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_UpdateFulfillHTLCDecodeErrorZ _res_conv = *(LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_UpdateFulfillHTLCDecodeErrorZ _res_conv = *(LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_UpdateFulfillHTLCDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_UpdateAddHTLCDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_UpdateAddHTLCDecodeErrorZ _res_conv = *(LDKCResult_UpdateAddHTLCDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_UpdateAddHTLCDecodeErrorZ _res_conv = *(LDKCResult_UpdateAddHTLCDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_UpdateAddHTLCDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_PingDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_PingDecodeErrorZ _res_conv = *(LDKCResult_PingDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_PingDecodeErrorZ _res_conv = *(LDKCResult_PingDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_PingDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_PongDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_PongDecodeErrorZ _res_conv = *(LDKCResult_PongDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_PongDecodeErrorZ _res_conv = *(LDKCResult_PongDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_PongDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ _res_conv = *(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ _res_conv = *(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_ChannelAnnouncementDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_ChannelAnnouncementDecodeErrorZ _res_conv = *(LDKCResult_ChannelAnnouncementDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_ChannelAnnouncementDecodeErrorZ _res_conv = *(LDKCResult_ChannelAnnouncementDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_ChannelAnnouncementDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_UnsignedChannelUpdateDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_UnsignedChannelUpdateDecodeErrorZ _res_conv = *(LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_UnsignedChannelUpdateDecodeErrorZ _res_conv = *(LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_UnsignedChannelUpdateDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_ChannelUpdateDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_ChannelUpdateDecodeErrorZ _res_conv = *(LDKCResult_ChannelUpdateDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_ChannelUpdateDecodeErrorZ _res_conv = *(LDKCResult_ChannelUpdateDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_ChannelUpdateDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_ErrorMessageDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_ErrorMessageDecodeErrorZ _res_conv = *(LDKCResult_ErrorMessageDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_ErrorMessageDecodeErrorZ _res_conv = *(LDKCResult_ErrorMessageDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_ErrorMessageDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ _res_conv = *(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ _res_conv = *(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_NodeAnnouncementDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_NodeAnnouncementDecodeErrorZ _res_conv = *(LDKCResult_NodeAnnouncementDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_NodeAnnouncementDecodeErrorZ _res_conv = *(LDKCResult_NodeAnnouncementDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_NodeAnnouncementDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_QueryShortChannelIdsDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_QueryShortChannelIdsDecodeErrorZ _res_conv = *(LDKCResult_QueryShortChannelIdsDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_QueryShortChannelIdsDecodeErrorZ _res_conv = *(LDKCResult_QueryShortChannelIdsDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_QueryShortChannelIdsDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ _res_conv = *(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ _res_conv = *(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_QueryChannelRangeDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_QueryChannelRangeDecodeErrorZ _res_conv = *(LDKCResult_QueryChannelRangeDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_QueryChannelRangeDecodeErrorZ _res_conv = *(LDKCResult_QueryChannelRangeDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_QueryChannelRangeDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_ReplyChannelRangeDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_ReplyChannelRangeDecodeErrorZ _res_conv = *(LDKCResult_ReplyChannelRangeDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_ReplyChannelRangeDecodeErrorZ _res_conv = *(LDKCResult_ReplyChannelRangeDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_ReplyChannelRangeDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_GossipTimestampFilterDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_GossipTimestampFilterDecodeErrorZ _res_conv = *(LDKCResult_GossipTimestampFilterDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_GossipTimestampFilterDecodeErrorZ _res_conv = *(LDKCResult_GossipTimestampFilterDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_GossipTimestampFilterDecodeErrorZ_free(_res_conv);
}
}
uint32_t __attribute__((visibility("default"))) TS_CResult_InvoiceSignOrCreationErrorZ_err(uint32_t e) {
- LDKSignOrCreationError e_conv = *(LDKSignOrCreationError*)(((uint64_t)e) & ~1);
+ void* e_ptr = (void*)(((uint64_t)e) & ~1);
+ CHECK_ACCESS(e_ptr);
+ LDKSignOrCreationError e_conv = *(LDKSignOrCreationError*)(e_ptr);
e_conv = SignOrCreationError_clone((LDKSignOrCreationError*)(((uint64_t)e) & ~1));
LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
*ret_conv = CResult_InvoiceSignOrCreationErrorZ_err(e_conv);
void __attribute__((visibility("default"))) TS_CResult_InvoiceSignOrCreationErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_InvoiceSignOrCreationErrorZ _res_conv = *(LDKCResult_InvoiceSignOrCreationErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_InvoiceSignOrCreationErrorZ _res_conv = *(LDKCResult_InvoiceSignOrCreationErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_InvoiceSignOrCreationErrorZ_free(_res_conv);
}
}
uint32_t __attribute__((visibility("default"))) TS_COption_FilterZ_some(uint32_t o) {
- LDKFilter o_conv = *(LDKFilter*)(((uint64_t)o) & ~1);
+ void* o_ptr = (void*)(((uint64_t)o) & ~1);
+ CHECK_ACCESS(o_ptr);
+ LDKFilter o_conv = *(LDKFilter*)(o_ptr);
LDKCOption_FilterZ *ret_copy = MALLOC(sizeof(LDKCOption_FilterZ), "LDKCOption_FilterZ");
*ret_copy = COption_FilterZ_some(o_conv);
uint64_t ret_ref = (uint64_t)ret_copy;
void __attribute__((visibility("default"))) TS_COption_FilterZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCOption_FilterZ _res_conv = *(LDKCOption_FilterZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCOption_FilterZ _res_conv = *(LDKCOption_FilterZ*)(_res_ptr);
FREE((void*)_res);
COption_FilterZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_LockedChannelMonitorNoneZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_LockedChannelMonitorNoneZ _res_conv = *(LDKCResult_LockedChannelMonitorNoneZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_LockedChannelMonitorNoneZ _res_conv = *(LDKCResult_LockedChannelMonitorNoneZ*)(_res_ptr);
FREE((void*)_res);
CResult_LockedChannelMonitorNoneZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_PaymentPurpose_free(uint32_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKPaymentPurpose this_ptr_conv = *(LDKPaymentPurpose*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKPaymentPurpose this_ptr_conv = *(LDKPaymentPurpose*)(this_ptr_ptr);
FREE((void*)this_ptr);
PaymentPurpose_free(this_ptr_conv);
}
void __attribute__((visibility("default"))) TS_ClosureReason_free(uint32_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKClosureReason this_ptr_conv = *(LDKClosureReason*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKClosureReason this_ptr_conv = *(LDKClosureReason*)(this_ptr_ptr);
FREE((void*)this_ptr);
ClosureReason_free(this_ptr_conv);
}
void __attribute__((visibility("default"))) TS_Event_free(uint32_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKEvent this_ptr_conv = *(LDKEvent*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKEvent this_ptr_conv = *(LDKEvent*)(this_ptr_ptr);
FREE((void*)this_ptr);
Event_free(this_ptr_conv);
}
LDKThirtyTwoBytes payment_hash_ref;
CHECK(*((uint32_t*)payment_hash) == 32);
memcpy(payment_hash_ref.data, (uint8_t*)(payment_hash + 4), 32);
- LDKPaymentPurpose purpose_conv = *(LDKPaymentPurpose*)(((uint64_t)purpose) & ~1);
+ void* purpose_ptr = (void*)(((uint64_t)purpose) & ~1);
+ CHECK_ACCESS(purpose_ptr);
+ LDKPaymentPurpose purpose_conv = *(LDKPaymentPurpose*)(purpose_ptr);
purpose_conv = PaymentPurpose_clone((LDKPaymentPurpose*)(((uint64_t)purpose) & ~1));
LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
*ret_copy = Event_payment_received(payment_hash_ref, amt, purpose_conv);
LDKThirtyTwoBytes payment_hash_ref;
CHECK(*((uint32_t*)payment_hash) == 32);
memcpy(payment_hash_ref.data, (uint8_t*)(payment_hash + 4), 32);
- LDKCOption_NetworkUpdateZ network_update_conv = *(LDKCOption_NetworkUpdateZ*)(((uint64_t)network_update) & ~1);
+ void* network_update_ptr = (void*)(((uint64_t)network_update) & ~1);
+ CHECK_ACCESS(network_update_ptr);
+ LDKCOption_NetworkUpdateZ network_update_conv = *(LDKCOption_NetworkUpdateZ*)(network_update_ptr);
network_update_conv = COption_NetworkUpdateZ_clone((LDKCOption_NetworkUpdateZ*)(((uint64_t)network_update) & ~1));
LDKCVec_RouteHopZ path_constr;
path_constr.datalen = *((uint32_t*)path);
path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
path_constr.data[k] = path_conv_10_conv;
}
- LDKCOption_u64Z short_channel_id_conv = *(LDKCOption_u64Z*)(((uint64_t)short_channel_id) & ~1);
+ void* short_channel_id_ptr = (void*)(((uint64_t)short_channel_id) & ~1);
+ CHECK_ACCESS(short_channel_id_ptr);
+ LDKCOption_u64Z short_channel_id_conv = *(LDKCOption_u64Z*)(short_channel_id_ptr);
short_channel_id_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)short_channel_id) & ~1));
LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
*ret_copy = Event_payment_path_failed(payment_hash_ref, rejected_by_dest, network_update_conv, all_paths_failed, path_constr, short_channel_id_conv);
uint32_t* outputs_vals = (uint32_t*)(outputs + 4);
for (size_t b = 0; b < outputs_constr.datalen; b++) {
uint32_t outputs_conv_27 = outputs_vals[b];
- LDKSpendableOutputDescriptor outputs_conv_27_conv = *(LDKSpendableOutputDescriptor*)(((uint64_t)outputs_conv_27) & ~1);
+ void* outputs_conv_27_ptr = (void*)(((uint64_t)outputs_conv_27) & ~1);
+ CHECK_ACCESS(outputs_conv_27_ptr);
+ LDKSpendableOutputDescriptor outputs_conv_27_conv = *(LDKSpendableOutputDescriptor*)(outputs_conv_27_ptr);
outputs_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)(((uint64_t)outputs_conv_27) & ~1));
outputs_constr.data[b] = outputs_conv_27_conv;
}
}
uint32_t __attribute__((visibility("default"))) TS_Event_payment_forwarded(uint32_t fee_earned_msat, jboolean claim_from_onchain_tx) {
- LDKCOption_u64Z fee_earned_msat_conv = *(LDKCOption_u64Z*)(((uint64_t)fee_earned_msat) & ~1);
+ void* fee_earned_msat_ptr = (void*)(((uint64_t)fee_earned_msat) & ~1);
+ CHECK_ACCESS(fee_earned_msat_ptr);
+ LDKCOption_u64Z fee_earned_msat_conv = *(LDKCOption_u64Z*)(fee_earned_msat_ptr);
fee_earned_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)fee_earned_msat) & ~1));
LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
*ret_copy = Event_payment_forwarded(fee_earned_msat_conv, claim_from_onchain_tx);
LDKThirtyTwoBytes channel_id_ref;
CHECK(*((uint32_t*)channel_id) == 32);
memcpy(channel_id_ref.data, (uint8_t*)(channel_id + 4), 32);
- LDKClosureReason reason_conv = *(LDKClosureReason*)(((uint64_t)reason) & ~1);
+ void* reason_ptr = (void*)(((uint64_t)reason) & ~1);
+ CHECK_ACCESS(reason_ptr);
+ LDKClosureReason reason_conv = *(LDKClosureReason*)(reason_ptr);
reason_conv = ClosureReason_clone((LDKClosureReason*)(((uint64_t)reason) & ~1));
LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
*ret_copy = Event_channel_closed(channel_id_ref, user_channel_id, reason_conv);
void __attribute__((visibility("default"))) TS_MessageSendEvent_free(uint32_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKMessageSendEvent this_ptr_conv = *(LDKMessageSendEvent*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKMessageSendEvent this_ptr_conv = *(LDKMessageSendEvent*)(this_ptr_ptr);
FREE((void*)this_ptr);
MessageSendEvent_free(this_ptr_conv);
}
LDKPublicKey node_id_ref;
CHECK(*((uint32_t*)node_id) == 33);
memcpy(node_id_ref.compressed_form, (uint8_t*)(node_id + 4), 33);
- LDKErrorAction action_conv = *(LDKErrorAction*)(((uint64_t)action) & ~1);
+ void* action_ptr = (void*)(((uint64_t)action) & ~1);
+ CHECK_ACCESS(action_ptr);
+ LDKErrorAction action_conv = *(LDKErrorAction*)(action_ptr);
action_conv = ErrorAction_clone((LDKErrorAction*)(((uint64_t)action) & ~1));
LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
*ret_copy = MessageSendEvent_handle_error(node_id_ref, action_conv);
void __attribute__((visibility("default"))) TS_MessageSendEventsProvider_free(uint32_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKMessageSendEventsProvider this_ptr_conv = *(LDKMessageSendEventsProvider*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKMessageSendEventsProvider this_ptr_conv = *(LDKMessageSendEventsProvider*)(this_ptr_ptr);
FREE((void*)this_ptr);
MessageSendEventsProvider_free(this_ptr_conv);
}
void __attribute__((visibility("default"))) TS_EventsProvider_free(uint32_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKEventsProvider this_ptr_conv = *(LDKEventsProvider*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKEventsProvider this_ptr_conv = *(LDKEventsProvider*)(this_ptr_ptr);
FREE((void*)this_ptr);
EventsProvider_free(this_ptr_conv);
}
void __attribute__((visibility("default"))) TS_EventHandler_free(uint32_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKEventHandler this_ptr_conv = *(LDKEventHandler*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKEventHandler this_ptr_conv = *(LDKEventHandler*)(this_ptr_ptr);
FREE((void*)this_ptr);
EventHandler_free(this_ptr_conv);
}
void __attribute__((visibility("default"))) TS_APIError_free(uint32_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKAPIError this_ptr_conv = *(LDKAPIError*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKAPIError this_ptr_conv = *(LDKAPIError*)(this_ptr_ptr);
FREE((void*)this_ptr);
APIError_free(this_ptr_conv);
}
void __attribute__((visibility("default"))) TS_Logger_free(uint32_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKLogger this_ptr_conv = *(LDKLogger*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKLogger this_ptr_conv = *(LDKLogger*)(this_ptr_ptr);
FREE((void*)this_ptr);
Logger_free(this_ptr_conv);
}
void __attribute__((visibility("default"))) TS_Access_free(uint32_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKAccess this_ptr_conv = *(LDKAccess*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKAccess this_ptr_conv = *(LDKAccess*)(this_ptr_ptr);
FREE((void*)this_ptr);
Access_free(this_ptr_conv);
}
void __attribute__((visibility("default"))) TS_Listen_free(uint32_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKListen this_ptr_conv = *(LDKListen*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKListen this_ptr_conv = *(LDKListen*)(this_ptr_ptr);
FREE((void*)this_ptr);
Listen_free(this_ptr_conv);
}
void __attribute__((visibility("default"))) TS_Confirm_free(uint32_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKConfirm this_ptr_conv = *(LDKConfirm*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKConfirm this_ptr_conv = *(LDKConfirm*)(this_ptr_ptr);
FREE((void*)this_ptr);
Confirm_free(this_ptr_conv);
}
void __attribute__((visibility("default"))) TS_Watch_free(uint32_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKWatch this_ptr_conv = *(LDKWatch*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKWatch this_ptr_conv = *(LDKWatch*)(this_ptr_ptr);
FREE((void*)this_ptr);
Watch_free(this_ptr_conv);
}
void __attribute__((visibility("default"))) TS_Filter_free(uint32_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKFilter this_ptr_conv = *(LDKFilter*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKFilter this_ptr_conv = *(LDKFilter*)(this_ptr_ptr);
FREE((void*)this_ptr);
Filter_free(this_ptr_conv);
}
void __attribute__((visibility("default"))) TS_BroadcasterInterface_free(uint32_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKBroadcasterInterface this_ptr_conv = *(LDKBroadcasterInterface*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKBroadcasterInterface this_ptr_conv = *(LDKBroadcasterInterface*)(this_ptr_ptr);
FREE((void*)this_ptr);
BroadcasterInterface_free(this_ptr_conv);
}
void __attribute__((visibility("default"))) TS_FeeEstimator_free(uint32_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKFeeEstimator this_ptr_conv = *(LDKFeeEstimator*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKFeeEstimator this_ptr_conv = *(LDKFeeEstimator*)(this_ptr_ptr);
FREE((void*)this_ptr);
FeeEstimator_free(this_ptr_conv);
}
void __attribute__((visibility("default"))) TS_Persist_free(uint32_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKPersist this_ptr_conv = *(LDKPersist*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKPersist this_ptr_conv = *(LDKPersist*)(this_ptr_ptr);
FREE((void*)this_ptr);
Persist_free(this_ptr_conv);
}
}
uint32_t __attribute__((visibility("default"))) TS_ChainMonitor_new(uint32_t chain_source, uint32_t broadcaster, uint32_t logger, uint32_t feeest, uint32_t persister) {
- LDKCOption_FilterZ chain_source_conv = *(LDKCOption_FilterZ*)(((uint64_t)chain_source) & ~1);
+ void* chain_source_ptr = (void*)(((uint64_t)chain_source) & ~1);
+ CHECK_ACCESS(chain_source_ptr);
+ LDKCOption_FilterZ chain_source_conv = *(LDKCOption_FilterZ*)(chain_source_ptr);
// Warning: we may need a move here but no clone is available for LDKCOption_FilterZ
if (chain_source_conv.tag == LDKCOption_FilterZ_Some) {
// Manually implement clone for Java trait instances
}
- LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(((uint64_t)broadcaster) & ~1);
- LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1);
- LDKFeeEstimator feeest_conv = *(LDKFeeEstimator*)(((uint64_t)feeest) & ~1);
- LDKPersist persister_conv = *(LDKPersist*)(((uint64_t)persister) & ~1);
+ void* broadcaster_ptr = (void*)(((uint64_t)broadcaster) & ~1);
+ CHECK_ACCESS(broadcaster_ptr);
+ LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr);
+ void* logger_ptr = (void*)(((uint64_t)logger) & ~1);
+ CHECK_ACCESS(logger_ptr);
+ LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
+ void* feeest_ptr = (void*)(((uint64_t)feeest) & ~1);
+ CHECK_ACCESS(feeest_ptr);
+ LDKFeeEstimator feeest_conv = *(LDKFeeEstimator*)(feeest_ptr);
+ void* persister_ptr = (void*)(((uint64_t)persister) & ~1);
+ CHECK_ACCESS(persister_ptr);
+ LDKPersist persister_conv = *(LDKPersist*)(persister_ptr);
LDKChainMonitor ret_var = ChainMonitor_new(chain_source_conv, broadcaster_conv, logger_conv, feeest_conv, persister_conv);
CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4);
for (size_t j = 0; j < ret_var.datalen; j++) {
LDKBalance *ret_conv_9_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
- *ret_conv_9_copy = Balance_clone(&ret_var.data[j]);
+ *ret_conv_9_copy = ret_var.data[j];
uint64_t ret_conv_9_ref = (uint64_t)ret_conv_9_copy;
ret_arr_ptr[j] = ret_conv_9_ref;
}
void __attribute__((visibility("default"))) TS_MonitorEvent_free(uint32_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKMonitorEvent this_ptr_conv = *(LDKMonitorEvent*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKMonitorEvent this_ptr_conv = *(LDKMonitorEvent*)(this_ptr_ptr);
FREE((void*)this_ptr);
MonitorEvent_free(this_ptr_conv);
}
void __attribute__((visibility("default"))) TS_Balance_free(uint32_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKBalance this_ptr_conv = *(LDKBalance*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKBalance this_ptr_conv = *(LDKBalance*)(this_ptr_ptr);
FREE((void*)this_ptr);
Balance_free(this_ptr_conv);
}
LDKChannelMonitorUpdate updates_conv;
updates_conv.inner = (void*)(updates & (~1));
updates_conv.is_owned = false;
- LDKBroadcasterInterface* broadcaster_conv = (LDKBroadcasterInterface*)(((uint64_t)broadcaster) & ~1);
- LDKFeeEstimator* fee_estimator_conv = (LDKFeeEstimator*)(((uint64_t)fee_estimator) & ~1);
- LDKLogger* logger_conv = (LDKLogger*)(((uint64_t)logger) & ~1);
+ void* broadcaster_ptr = (void*)(((uint64_t)broadcaster) & ~1);
+ if (!(broadcaster & 1)) { CHECK_ACCESS(broadcaster_ptr); }
+ LDKBroadcasterInterface* broadcaster_conv = (LDKBroadcasterInterface*)broadcaster_ptr;
+ void* fee_estimator_ptr = (void*)(((uint64_t)fee_estimator) & ~1);
+ if (!(fee_estimator & 1)) { CHECK_ACCESS(fee_estimator_ptr); }
+ LDKFeeEstimator* fee_estimator_conv = (LDKFeeEstimator*)fee_estimator_ptr;
+ void* logger_ptr = (void*)(((uint64_t)logger) & ~1);
+ if (!(logger & 1)) { CHECK_ACCESS(logger_ptr); }
+ LDKLogger* logger_conv = (LDKLogger*)logger_ptr;
LDKCResult_NoneMonitorUpdateErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneMonitorUpdateErrorZ), "LDKCResult_NoneMonitorUpdateErrorZ");
*ret_conv = ChannelMonitor_update_monitor(&this_arg_conv, &updates_conv, broadcaster_conv, fee_estimator_conv, logger_conv);
return (uint64_t)ret_conv;
LDKChannelMonitor this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKFilter* filter_conv = (LDKFilter*)(((uint64_t)filter) & ~1);
+ void* filter_ptr = (void*)(((uint64_t)filter) & ~1);
+ if (!(filter & 1)) { CHECK_ACCESS(filter_ptr); }
+ LDKFilter* filter_conv = (LDKFilter*)filter_ptr;
ChannelMonitor_load_outputs_to_watch(&this_arg_conv, filter_conv);
}
uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4);
for (size_t o = 0; o < ret_var.datalen; o++) {
LDKMonitorEvent *ret_conv_14_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
- *ret_conv_14_copy = MonitorEvent_clone(&ret_var.data[o]);
+ *ret_conv_14_copy = ret_var.data[o];
uint64_t ret_conv_14_ref = (uint64_t)ret_conv_14_copy;
ret_arr_ptr[o] = ret_conv_14_ref;
}
uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4);
for (size_t h = 0; h < ret_var.datalen; h++) {
LDKEvent *ret_conv_7_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
- *ret_conv_7_copy = Event_clone(&ret_var.data[h]);
+ *ret_conv_7_copy = ret_var.data[h];
uint64_t ret_conv_7_ref = (uint64_t)ret_conv_7_copy;
ret_arr_ptr[h] = ret_conv_7_ref;
}
LDKChannelMonitor this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKLogger* logger_conv = (LDKLogger*)(((uint64_t)logger) & ~1);
+ void* logger_ptr = (void*)(((uint64_t)logger) & ~1);
+ if (!(logger & 1)) { CHECK_ACCESS(logger_ptr); }
+ LDKLogger* logger_conv = (LDKLogger*)logger_ptr;
LDKCVec_TransactionZ ret_var = ChannelMonitor_get_latest_holder_commitment_txn(&this_arg_conv, logger_conv);
ptrArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native ptrArray Bytes");
int8_tArray *ret_arr_ptr = (int8_tArray*)(ret_arr + 4);
uint32_t* txdata_vals = (uint32_t*)(txdata + 4);
for (size_t c = 0; c < txdata_constr.datalen; c++) {
uint32_t txdata_conv_28 = txdata_vals[c];
- LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(((uint64_t)txdata_conv_28) & ~1);
+ void* txdata_conv_28_ptr = (void*)(((uint64_t)txdata_conv_28) & ~1);
+ CHECK_ACCESS(txdata_conv_28_ptr);
+ LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(txdata_conv_28_ptr);
txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)(((uint64_t)txdata_conv_28) & ~1));
txdata_constr.data[c] = txdata_conv_28_conv;
}
- LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(((uint64_t)broadcaster) & ~1);
- LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(((uint64_t)fee_estimator) & ~1);
- LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1);
+ void* broadcaster_ptr = (void*)(((uint64_t)broadcaster) & ~1);
+ CHECK_ACCESS(broadcaster_ptr);
+ LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr);
+ void* fee_estimator_ptr = (void*)(((uint64_t)fee_estimator) & ~1);
+ CHECK_ACCESS(fee_estimator_ptr);
+ LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr);
+ void* logger_ptr = (void*)(((uint64_t)logger) & ~1);
+ CHECK_ACCESS(logger_ptr);
+ LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ ret_var = ChannelMonitor_block_connected(&this_arg_conv, header_ref, txdata_constr, height, broadcaster_conv, fee_estimator_conv, logger_conv);
uint32_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4);
CHECK(*((uint32_t*)header) == 80);
memcpy(header_arr, (uint8_t*)(header + 4), 80);
unsigned char (*header_ref)[80] = &header_arr;
- LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(((uint64_t)broadcaster) & ~1);
- LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(((uint64_t)fee_estimator) & ~1);
- LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1);
+ void* broadcaster_ptr = (void*)(((uint64_t)broadcaster) & ~1);
+ CHECK_ACCESS(broadcaster_ptr);
+ LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr);
+ void* fee_estimator_ptr = (void*)(((uint64_t)fee_estimator) & ~1);
+ CHECK_ACCESS(fee_estimator_ptr);
+ LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr);
+ void* logger_ptr = (void*)(((uint64_t)logger) & ~1);
+ CHECK_ACCESS(logger_ptr);
+ LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
ChannelMonitor_block_disconnected(&this_arg_conv, header_ref, height, broadcaster_conv, fee_estimator_conv, logger_conv);
}
uint32_t* txdata_vals = (uint32_t*)(txdata + 4);
for (size_t c = 0; c < txdata_constr.datalen; c++) {
uint32_t txdata_conv_28 = txdata_vals[c];
- LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(((uint64_t)txdata_conv_28) & ~1);
+ void* txdata_conv_28_ptr = (void*)(((uint64_t)txdata_conv_28) & ~1);
+ CHECK_ACCESS(txdata_conv_28_ptr);
+ LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(txdata_conv_28_ptr);
txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)(((uint64_t)txdata_conv_28) & ~1));
txdata_constr.data[c] = txdata_conv_28_conv;
}
- LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(((uint64_t)broadcaster) & ~1);
- LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(((uint64_t)fee_estimator) & ~1);
- LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1);
+ void* broadcaster_ptr = (void*)(((uint64_t)broadcaster) & ~1);
+ CHECK_ACCESS(broadcaster_ptr);
+ LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr);
+ void* fee_estimator_ptr = (void*)(((uint64_t)fee_estimator) & ~1);
+ CHECK_ACCESS(fee_estimator_ptr);
+ LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr);
+ void* logger_ptr = (void*)(((uint64_t)logger) & ~1);
+ CHECK_ACCESS(logger_ptr);
+ LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ ret_var = ChannelMonitor_transactions_confirmed(&this_arg_conv, header_ref, txdata_constr, height, broadcaster_conv, fee_estimator_conv, logger_conv);
uint32_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4);
CHECK(*((uint32_t*)txid) == 32);
memcpy(txid_arr, (uint8_t*)(txid + 4), 32);
unsigned char (*txid_ref)[32] = &txid_arr;
- LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(((uint64_t)broadcaster) & ~1);
- LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(((uint64_t)fee_estimator) & ~1);
- LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1);
+ void* broadcaster_ptr = (void*)(((uint64_t)broadcaster) & ~1);
+ CHECK_ACCESS(broadcaster_ptr);
+ LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr);
+ void* fee_estimator_ptr = (void*)(((uint64_t)fee_estimator) & ~1);
+ CHECK_ACCESS(fee_estimator_ptr);
+ LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr);
+ void* logger_ptr = (void*)(((uint64_t)logger) & ~1);
+ CHECK_ACCESS(logger_ptr);
+ LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
ChannelMonitor_transaction_unconfirmed(&this_arg_conv, txid_ref, broadcaster_conv, fee_estimator_conv, logger_conv);
}
CHECK(*((uint32_t*)header) == 80);
memcpy(header_arr, (uint8_t*)(header + 4), 80);
unsigned char (*header_ref)[80] = &header_arr;
- LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(((uint64_t)broadcaster) & ~1);
- LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(((uint64_t)fee_estimator) & ~1);
- LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1);
+ void* broadcaster_ptr = (void*)(((uint64_t)broadcaster) & ~1);
+ CHECK_ACCESS(broadcaster_ptr);
+ LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr);
+ void* fee_estimator_ptr = (void*)(((uint64_t)fee_estimator) & ~1);
+ CHECK_ACCESS(fee_estimator_ptr);
+ LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr);
+ void* logger_ptr = (void*)(((uint64_t)logger) & ~1);
+ CHECK_ACCESS(logger_ptr);
+ LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ ret_var = ChannelMonitor_best_block_updated(&this_arg_conv, header_ref, height, broadcaster_conv, fee_estimator_conv, logger_conv);
uint32_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4);
uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4);
for (size_t j = 0; j < ret_var.datalen; j++) {
LDKBalance *ret_conv_9_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
- *ret_conv_9_copy = Balance_clone(&ret_var.data[j]);
+ *ret_conv_9_copy = ret_var.data[j];
uint64_t ret_conv_9_ref = (uint64_t)ret_conv_9_copy;
ret_arr_ptr[j] = ret_conv_9_ref;
}
LDKu8slice ser_ref;
ser_ref.datalen = *((uint32_t*)ser);
ser_ref.data = (int8_t*)(ser + 4);
- LDKKeysInterface* arg_conv = (LDKKeysInterface*)(((uint64_t)arg) & ~1);
+ void* arg_ptr = (void*)(((uint64_t)arg) & ~1);
+ if (!(arg & 1)) { CHECK_ACCESS(arg_ptr); }
+ LDKKeysInterface* arg_conv = (LDKKeysInterface*)arg_ptr;
LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ");
*ret_conv = C2Tuple_BlockHashChannelMonitorZ_read(ser_ref, arg_conv);
return (uint64_t)ret_conv;
LDKDelayedPaymentOutputDescriptor this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- LDKTxOut val_conv = *(LDKTxOut*)(((uint64_t)val) & ~1);
+ void* val_ptr = (void*)(((uint64_t)val) & ~1);
+ CHECK_ACCESS(val_ptr);
+ LDKTxOut val_conv = *(LDKTxOut*)(val_ptr);
val_conv = TxOut_clone((LDKTxOut*)(((uint64_t)val) & ~1));
DelayedPaymentOutputDescriptor_set_output(&this_ptr_conv, val_conv);
}
LDKPublicKey per_commitment_point_arg_ref;
CHECK(*((uint32_t*)per_commitment_point_arg) == 33);
memcpy(per_commitment_point_arg_ref.compressed_form, (uint8_t*)(per_commitment_point_arg + 4), 33);
- LDKTxOut output_arg_conv = *(LDKTxOut*)(((uint64_t)output_arg) & ~1);
+ void* output_arg_ptr = (void*)(((uint64_t)output_arg) & ~1);
+ CHECK_ACCESS(output_arg_ptr);
+ LDKTxOut output_arg_conv = *(LDKTxOut*)(output_arg_ptr);
output_arg_conv = TxOut_clone((LDKTxOut*)(((uint64_t)output_arg) & ~1));
LDKPublicKey revocation_pubkey_arg_ref;
CHECK(*((uint32_t*)revocation_pubkey_arg) == 33);
LDKStaticPaymentOutputDescriptor this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- LDKTxOut val_conv = *(LDKTxOut*)(((uint64_t)val) & ~1);
+ void* val_ptr = (void*)(((uint64_t)val) & ~1);
+ CHECK_ACCESS(val_ptr);
+ LDKTxOut val_conv = *(LDKTxOut*)(val_ptr);
val_conv = TxOut_clone((LDKTxOut*)(((uint64_t)val) & ~1));
StaticPaymentOutputDescriptor_set_output(&this_ptr_conv, val_conv);
}
outpoint_arg_conv.inner = (void*)(outpoint_arg & (~1));
outpoint_arg_conv.is_owned = (outpoint_arg & 1) || (outpoint_arg == 0);
outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv);
- LDKTxOut output_arg_conv = *(LDKTxOut*)(((uint64_t)output_arg) & ~1);
+ void* output_arg_ptr = (void*)(((uint64_t)output_arg) & ~1);
+ CHECK_ACCESS(output_arg_ptr);
+ LDKTxOut output_arg_conv = *(LDKTxOut*)(output_arg_ptr);
output_arg_conv = TxOut_clone((LDKTxOut*)(((uint64_t)output_arg) & ~1));
LDKThirtyTwoBytes channel_keys_id_arg_ref;
CHECK(*((uint32_t*)channel_keys_id_arg) == 32);
void __attribute__((visibility("default"))) TS_SpendableOutputDescriptor_free(uint32_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKSpendableOutputDescriptor this_ptr_conv = *(LDKSpendableOutputDescriptor*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKSpendableOutputDescriptor this_ptr_conv = *(LDKSpendableOutputDescriptor*)(this_ptr_ptr);
FREE((void*)this_ptr);
SpendableOutputDescriptor_free(this_ptr_conv);
}
outpoint_conv.inner = (void*)(outpoint & (~1));
outpoint_conv.is_owned = (outpoint & 1) || (outpoint == 0);
outpoint_conv = OutPoint_clone(&outpoint_conv);
- LDKTxOut output_conv = *(LDKTxOut*)(((uint64_t)output) & ~1);
+ void* output_ptr = (void*)(((uint64_t)output) & ~1);
+ CHECK_ACCESS(output_ptr);
+ LDKTxOut output_conv = *(LDKTxOut*)(output_ptr);
output_conv = TxOut_clone((LDKTxOut*)(((uint64_t)output) & ~1));
LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor");
*ret_copy = SpendableOutputDescriptor_static_output(outpoint_conv, output_conv);
void __attribute__((visibility("default"))) TS_BaseSign_free(uint32_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKBaseSign this_ptr_conv = *(LDKBaseSign*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKBaseSign this_ptr_conv = *(LDKBaseSign*)(this_ptr_ptr);
FREE((void*)this_ptr);
BaseSign_free(this_ptr_conv);
}
uint32_t __attribute__((visibility("default"))) TS_Sign_clone(uint32_t orig) {
- LDKSign* orig_conv = (LDKSign*)(((uint64_t)orig) & ~1);
+ void* orig_ptr = (void*)(((uint64_t)orig) & ~1);
+ if (!(orig & 1)) { CHECK_ACCESS(orig_ptr); }
+ LDKSign* orig_conv = (LDKSign*)orig_ptr;
LDKSign* ret_ret =MALLOC(sizeof(LDKSign), "LDKSign");
*ret_ret = Sign_clone(orig_conv);
return (uint64_t)ret_ret;
void __attribute__((visibility("default"))) TS_Sign_free(uint32_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKSign this_ptr_conv = *(LDKSign*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKSign this_ptr_conv = *(LDKSign*)(this_ptr_ptr);
FREE((void*)this_ptr);
Sign_free(this_ptr_conv);
}
void __attribute__((visibility("default"))) TS_KeysInterface_free(uint32_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKKeysInterface this_ptr_conv = *(LDKKeysInterface*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKKeysInterface this_ptr_conv = *(LDKKeysInterface*)(this_ptr_ptr);
FREE((void*)this_ptr);
KeysInterface_free(this_ptr_conv);
}
uint32_t* descriptors_vals = (uint32_t*)(descriptors + 4);
for (size_t b = 0; b < descriptors_constr.datalen; b++) {
uint32_t descriptors_conv_27 = descriptors_vals[b];
- LDKSpendableOutputDescriptor descriptors_conv_27_conv = *(LDKSpendableOutputDescriptor*)(((uint64_t)descriptors_conv_27) & ~1);
+ void* descriptors_conv_27_ptr = (void*)(((uint64_t)descriptors_conv_27) & ~1);
+ CHECK_ACCESS(descriptors_conv_27_ptr);
+ LDKSpendableOutputDescriptor descriptors_conv_27_conv = *(LDKSpendableOutputDescriptor*)(descriptors_conv_27_ptr);
descriptors_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)(((uint64_t)descriptors_conv_27) & ~1));
descriptors_constr.data[b] = descriptors_conv_27_conv;
}
uint32_t* outputs_vals = (uint32_t*)(outputs + 4);
for (size_t h = 0; h < outputs_constr.datalen; h++) {
uint32_t outputs_conv_7 = outputs_vals[h];
- LDKTxOut outputs_conv_7_conv = *(LDKTxOut*)(((uint64_t)outputs_conv_7) & ~1);
+ void* outputs_conv_7_ptr = (void*)(((uint64_t)outputs_conv_7) & ~1);
+ CHECK_ACCESS(outputs_conv_7_ptr);
+ LDKTxOut outputs_conv_7_conv = *(LDKTxOut*)(outputs_conv_7_ptr);
outputs_conv_7_conv = TxOut_clone((LDKTxOut*)(((uint64_t)outputs_conv_7) & ~1));
outputs_constr.data[h] = outputs_conv_7_conv;
}
LDKChannelDetails this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(((uint64_t)val) & ~1);
+ void* val_ptr = (void*)(((uint64_t)val) & ~1);
+ CHECK_ACCESS(val_ptr);
+ LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
val_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)val) & ~1));
ChannelDetails_set_short_channel_id(&this_ptr_conv, val_conv);
}
LDKChannelDetails this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(((uint64_t)val) & ~1);
+ void* val_ptr = (void*)(((uint64_t)val) & ~1);
+ CHECK_ACCESS(val_ptr);
+ LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
val_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)val) & ~1));
ChannelDetails_set_unspendable_punishment_reserve(&this_ptr_conv, val_conv);
}
LDKChannelDetails this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(((uint64_t)val) & ~1);
+ void* val_ptr = (void*)(((uint64_t)val) & ~1);
+ CHECK_ACCESS(val_ptr);
+ LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(val_ptr);
val_conv = COption_u32Z_clone((LDKCOption_u32Z*)(((uint64_t)val) & ~1));
ChannelDetails_set_confirmations_required(&this_ptr_conv, val_conv);
}
LDKChannelDetails this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- LDKCOption_u16Z val_conv = *(LDKCOption_u16Z*)(((uint64_t)val) & ~1);
+ void* val_ptr = (void*)(((uint64_t)val) & ~1);
+ CHECK_ACCESS(val_ptr);
+ LDKCOption_u16Z val_conv = *(LDKCOption_u16Z*)(val_ptr);
val_conv = COption_u16Z_clone((LDKCOption_u16Z*)(((uint64_t)val) & ~1));
ChannelDetails_set_force_close_spend_delay(&this_ptr_conv, val_conv);
}
funding_txo_arg_conv.inner = (void*)(funding_txo_arg & (~1));
funding_txo_arg_conv.is_owned = (funding_txo_arg & 1) || (funding_txo_arg == 0);
funding_txo_arg_conv = OutPoint_clone(&funding_txo_arg_conv);
- LDKCOption_u64Z short_channel_id_arg_conv = *(LDKCOption_u64Z*)(((uint64_t)short_channel_id_arg) & ~1);
+ void* short_channel_id_arg_ptr = (void*)(((uint64_t)short_channel_id_arg) & ~1);
+ CHECK_ACCESS(short_channel_id_arg_ptr);
+ LDKCOption_u64Z short_channel_id_arg_conv = *(LDKCOption_u64Z*)(short_channel_id_arg_ptr);
short_channel_id_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)short_channel_id_arg) & ~1));
- LDKCOption_u64Z unspendable_punishment_reserve_arg_conv = *(LDKCOption_u64Z*)(((uint64_t)unspendable_punishment_reserve_arg) & ~1);
- LDKCOption_u32Z confirmations_required_arg_conv = *(LDKCOption_u32Z*)(((uint64_t)confirmations_required_arg) & ~1);
+ void* unspendable_punishment_reserve_arg_ptr = (void*)(((uint64_t)unspendable_punishment_reserve_arg) & ~1);
+ CHECK_ACCESS(unspendable_punishment_reserve_arg_ptr);
+ LDKCOption_u64Z unspendable_punishment_reserve_arg_conv = *(LDKCOption_u64Z*)(unspendable_punishment_reserve_arg_ptr);
+ void* confirmations_required_arg_ptr = (void*)(((uint64_t)confirmations_required_arg) & ~1);
+ CHECK_ACCESS(confirmations_required_arg_ptr);
+ LDKCOption_u32Z confirmations_required_arg_conv = *(LDKCOption_u32Z*)(confirmations_required_arg_ptr);
confirmations_required_arg_conv = COption_u32Z_clone((LDKCOption_u32Z*)(((uint64_t)confirmations_required_arg) & ~1));
- LDKCOption_u16Z force_close_spend_delay_arg_conv = *(LDKCOption_u16Z*)(((uint64_t)force_close_spend_delay_arg) & ~1);
+ void* force_close_spend_delay_arg_ptr = (void*)(((uint64_t)force_close_spend_delay_arg) & ~1);
+ CHECK_ACCESS(force_close_spend_delay_arg_ptr);
+ LDKCOption_u16Z force_close_spend_delay_arg_conv = *(LDKCOption_u16Z*)(force_close_spend_delay_arg_ptr);
force_close_spend_delay_arg_conv = COption_u16Z_clone((LDKCOption_u16Z*)(((uint64_t)force_close_spend_delay_arg) & ~1));
LDKChannelDetails ret_var = ChannelDetails_new(channel_id_arg_ref, counterparty_arg_conv, funding_txo_arg_conv, short_channel_id_arg_conv, channel_value_satoshis_arg, unspendable_punishment_reserve_arg_conv, user_channel_id_arg, outbound_capacity_msat_arg, inbound_capacity_msat_arg, confirmations_required_arg_conv, force_close_spend_delay_arg_conv, is_outbound_arg, is_funding_locked_arg, is_usable_arg, is_public_arg);
CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
void __attribute__((visibility("default"))) TS_PaymentSendFailure_free(uint32_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKPaymentSendFailure this_ptr_conv = *(LDKPaymentSendFailure*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKPaymentSendFailure this_ptr_conv = *(LDKPaymentSendFailure*)(this_ptr_ptr);
FREE((void*)this_ptr);
PaymentSendFailure_free(this_ptr_conv);
}
}
uint32_t __attribute__((visibility("default"))) TS_PaymentSendFailure_parameter_error(uint32_t a) {
- LDKAPIError a_conv = *(LDKAPIError*)(((uint64_t)a) & ~1);
+ void* a_ptr = (void*)(((uint64_t)a) & ~1);
+ CHECK_ACCESS(a_ptr);
+ LDKAPIError a_conv = *(LDKAPIError*)(a_ptr);
a_conv = APIError_clone((LDKAPIError*)(((uint64_t)a) & ~1));
LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
*ret_copy = PaymentSendFailure_parameter_error(a_conv);
uint32_t* a_vals = (uint32_t*)(a + 4);
for (size_t w = 0; w < a_constr.datalen; w++) {
uint32_t a_conv_22 = a_vals[w];
- LDKCResult_NoneAPIErrorZ a_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(((uint64_t)a_conv_22) & ~1);
+ void* a_conv_22_ptr = (void*)(((uint64_t)a_conv_22) & ~1);
+ CHECK_ACCESS(a_conv_22_ptr);
+ LDKCResult_NoneAPIErrorZ a_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(a_conv_22_ptr);
a_conv_22_conv = CResult_NoneAPIErrorZ_clone((LDKCResult_NoneAPIErrorZ*)(((uint64_t)a_conv_22) & ~1));
a_constr.data[w] = a_conv_22_conv;
}
uint32_t* a_vals = (uint32_t*)(a + 4);
for (size_t k = 0; k < a_constr.datalen; k++) {
uint32_t a_conv_10 = a_vals[k];
- LDKAPIError a_conv_10_conv = *(LDKAPIError*)(((uint64_t)a_conv_10) & ~1);
+ void* a_conv_10_ptr = (void*)(((uint64_t)a_conv_10) & ~1);
+ CHECK_ACCESS(a_conv_10_ptr);
+ LDKAPIError a_conv_10_conv = *(LDKAPIError*)(a_conv_10_ptr);
a_conv_10_conv = APIError_clone((LDKAPIError*)(((uint64_t)a_conv_10) & ~1));
a_constr.data[k] = a_conv_10_conv;
}
uint32_t* a_vals = (uint32_t*)(a + 4);
for (size_t w = 0; w < a_constr.datalen; w++) {
uint32_t a_conv_22 = a_vals[w];
- LDKCResult_NoneAPIErrorZ a_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(((uint64_t)a_conv_22) & ~1);
+ void* a_conv_22_ptr = (void*)(((uint64_t)a_conv_22) & ~1);
+ CHECK_ACCESS(a_conv_22_ptr);
+ LDKCResult_NoneAPIErrorZ a_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(a_conv_22_ptr);
a_conv_22_conv = CResult_NoneAPIErrorZ_clone((LDKCResult_NoneAPIErrorZ*)(((uint64_t)a_conv_22) & ~1));
a_constr.data[w] = a_conv_22_conv;
}
}
uint32_t __attribute__((visibility("default"))) TS_ChannelManager_new(uint32_t fee_est, uint32_t chain_monitor, uint32_t tx_broadcaster, uint32_t logger, uint32_t keys_manager, uint32_t config, uint32_t params) {
- LDKFeeEstimator fee_est_conv = *(LDKFeeEstimator*)(((uint64_t)fee_est) & ~1);
- LDKWatch chain_monitor_conv = *(LDKWatch*)(((uint64_t)chain_monitor) & ~1);
- LDKBroadcasterInterface tx_broadcaster_conv = *(LDKBroadcasterInterface*)(((uint64_t)tx_broadcaster) & ~1);
- LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1);
- LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(((uint64_t)keys_manager) & ~1);
+ void* fee_est_ptr = (void*)(((uint64_t)fee_est) & ~1);
+ CHECK_ACCESS(fee_est_ptr);
+ LDKFeeEstimator fee_est_conv = *(LDKFeeEstimator*)(fee_est_ptr);
+ void* chain_monitor_ptr = (void*)(((uint64_t)chain_monitor) & ~1);
+ CHECK_ACCESS(chain_monitor_ptr);
+ LDKWatch chain_monitor_conv = *(LDKWatch*)(chain_monitor_ptr);
+ void* tx_broadcaster_ptr = (void*)(((uint64_t)tx_broadcaster) & ~1);
+ CHECK_ACCESS(tx_broadcaster_ptr);
+ LDKBroadcasterInterface tx_broadcaster_conv = *(LDKBroadcasterInterface*)(tx_broadcaster_ptr);
+ void* logger_ptr = (void*)(((uint64_t)logger) & ~1);
+ CHECK_ACCESS(logger_ptr);
+ LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
+ void* keys_manager_ptr = (void*)(((uint64_t)keys_manager) & ~1);
+ CHECK_ACCESS(keys_manager_ptr);
+ LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(keys_manager_ptr);
LDKUserConfig config_conv;
config_conv.inner = (void*)(config & (~1));
config_conv.is_owned = (config & 1) || (config == 0);
uint32_t* addresses_vals = (uint32_t*)(addresses + 4);
for (size_t m = 0; m < addresses_constr.datalen; m++) {
uint32_t addresses_conv_12 = addresses_vals[m];
- LDKNetAddress addresses_conv_12_conv = *(LDKNetAddress*)(((uint64_t)addresses_conv_12) & ~1);
+ void* addresses_conv_12_ptr = (void*)(((uint64_t)addresses_conv_12) & ~1);
+ CHECK_ACCESS(addresses_conv_12_ptr);
+ LDKNetAddress addresses_conv_12_conv = *(LDKNetAddress*)(addresses_conv_12_ptr);
addresses_constr.data[m] = addresses_conv_12_conv;
}
ChannelManager_broadcast_node_announcement(&this_arg_conv, rgb_ref, alias_ref, addresses_constr);
LDKChannelManager this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(((uint64_t)min_value_msat) & ~1);
+ void* min_value_msat_ptr = (void*)(((uint64_t)min_value_msat) & ~1);
+ CHECK_ACCESS(min_value_msat_ptr);
+ LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr);
min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)min_value_msat) & ~1));
LDKC2Tuple_PaymentHashPaymentSecretZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ");
*ret_conv = ChannelManager_create_inbound_payment(&this_arg_conv, min_value_msat_conv, invoice_expiry_delta_secs, user_payment_id);
LDKThirtyTwoBytes payment_hash_ref;
CHECK(*((uint32_t*)payment_hash) == 32);
memcpy(payment_hash_ref.data, (uint8_t*)(payment_hash + 4), 32);
- LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(((uint64_t)min_value_msat) & ~1);
+ void* min_value_msat_ptr = (void*)(((uint64_t)min_value_msat) & ~1);
+ CHECK_ACCESS(min_value_msat_ptr);
+ LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr);
min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)min_value_msat) & ~1));
LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ");
*ret_conv = ChannelManager_create_inbound_payment_for_hash(&this_arg_conv, payment_hash_ref, min_value_msat_conv, invoice_expiry_delta_secs, user_payment_id);
LDKChannelManagerReadArgs this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- LDKKeysInterface val_conv = *(LDKKeysInterface*)(((uint64_t)val) & ~1);
+ void* val_ptr = (void*)(((uint64_t)val) & ~1);
+ CHECK_ACCESS(val_ptr);
+ LDKKeysInterface val_conv = *(LDKKeysInterface*)(val_ptr);
ChannelManagerReadArgs_set_keys_manager(&this_ptr_conv, val_conv);
}
LDKChannelManagerReadArgs this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- LDKFeeEstimator val_conv = *(LDKFeeEstimator*)(((uint64_t)val) & ~1);
+ void* val_ptr = (void*)(((uint64_t)val) & ~1);
+ CHECK_ACCESS(val_ptr);
+ LDKFeeEstimator val_conv = *(LDKFeeEstimator*)(val_ptr);
ChannelManagerReadArgs_set_fee_estimator(&this_ptr_conv, val_conv);
}
LDKChannelManagerReadArgs this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- LDKWatch val_conv = *(LDKWatch*)(((uint64_t)val) & ~1);
+ void* val_ptr = (void*)(((uint64_t)val) & ~1);
+ CHECK_ACCESS(val_ptr);
+ LDKWatch val_conv = *(LDKWatch*)(val_ptr);
ChannelManagerReadArgs_set_chain_monitor(&this_ptr_conv, val_conv);
}
LDKChannelManagerReadArgs this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- LDKBroadcasterInterface val_conv = *(LDKBroadcasterInterface*)(((uint64_t)val) & ~1);
+ void* val_ptr = (void*)(((uint64_t)val) & ~1);
+ CHECK_ACCESS(val_ptr);
+ LDKBroadcasterInterface val_conv = *(LDKBroadcasterInterface*)(val_ptr);
ChannelManagerReadArgs_set_tx_broadcaster(&this_ptr_conv, val_conv);
}
LDKChannelManagerReadArgs this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- LDKLogger val_conv = *(LDKLogger*)(((uint64_t)val) & ~1);
+ void* val_ptr = (void*)(((uint64_t)val) & ~1);
+ CHECK_ACCESS(val_ptr);
+ LDKLogger val_conv = *(LDKLogger*)(val_ptr);
ChannelManagerReadArgs_set_logger(&this_ptr_conv, val_conv);
}
}
uint32_t __attribute__((visibility("default"))) TS_ChannelManagerReadArgs_new(uint32_t keys_manager, uint32_t fee_estimator, uint32_t chain_monitor, uint32_t tx_broadcaster, uint32_t logger, uint32_t default_config, uint32_tArray channel_monitors) {
- LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(((uint64_t)keys_manager) & ~1);
- LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(((uint64_t)fee_estimator) & ~1);
- LDKWatch chain_monitor_conv = *(LDKWatch*)(((uint64_t)chain_monitor) & ~1);
- LDKBroadcasterInterface tx_broadcaster_conv = *(LDKBroadcasterInterface*)(((uint64_t)tx_broadcaster) & ~1);
- LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1);
+ void* keys_manager_ptr = (void*)(((uint64_t)keys_manager) & ~1);
+ CHECK_ACCESS(keys_manager_ptr);
+ LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(keys_manager_ptr);
+ void* fee_estimator_ptr = (void*)(((uint64_t)fee_estimator) & ~1);
+ CHECK_ACCESS(fee_estimator_ptr);
+ LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr);
+ void* chain_monitor_ptr = (void*)(((uint64_t)chain_monitor) & ~1);
+ CHECK_ACCESS(chain_monitor_ptr);
+ LDKWatch chain_monitor_conv = *(LDKWatch*)(chain_monitor_ptr);
+ void* tx_broadcaster_ptr = (void*)(((uint64_t)tx_broadcaster) & ~1);
+ CHECK_ACCESS(tx_broadcaster_ptr);
+ LDKBroadcasterInterface tx_broadcaster_conv = *(LDKBroadcasterInterface*)(tx_broadcaster_ptr);
+ void* logger_ptr = (void*)(((uint64_t)logger) & ~1);
+ CHECK_ACCESS(logger_ptr);
+ LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
LDKUserConfig default_config_conv;
default_config_conv.inner = (void*)(default_config & (~1));
default_config_conv.is_owned = (default_config & 1) || (default_config == 0);
void __attribute__((visibility("default"))) TS_NetAddress_free(uint32_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKNetAddress this_ptr_conv = *(LDKNetAddress*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKNetAddress this_ptr_conv = *(LDKNetAddress*)(this_ptr_ptr);
FREE((void*)this_ptr);
NetAddress_free(this_ptr_conv);
}
uint32_t* val_vals = (uint32_t*)(val + 4);
for (size_t m = 0; m < val_constr.datalen; m++) {
uint32_t val_conv_12 = val_vals[m];
- LDKNetAddress val_conv_12_conv = *(LDKNetAddress*)(((uint64_t)val_conv_12) & ~1);
+ void* val_conv_12_ptr = (void*)(((uint64_t)val_conv_12) & ~1);
+ CHECK_ACCESS(val_conv_12_ptr);
+ LDKNetAddress val_conv_12_conv = *(LDKNetAddress*)(val_conv_12_ptr);
val_conv_12_conv = NetAddress_clone((LDKNetAddress*)(((uint64_t)val_conv_12) & ~1));
val_constr.data[m] = val_conv_12_conv;
}
void __attribute__((visibility("default"))) TS_ErrorAction_free(uint32_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKErrorAction this_ptr_conv = *(LDKErrorAction*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKErrorAction this_ptr_conv = *(LDKErrorAction*)(this_ptr_ptr);
FREE((void*)this_ptr);
ErrorAction_free(this_ptr_conv);
}
LDKLightningError this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- LDKErrorAction val_conv = *(LDKErrorAction*)(((uint64_t)val) & ~1);
+ void* val_ptr = (void*)(((uint64_t)val) & ~1);
+ CHECK_ACCESS(val_ptr);
+ LDKErrorAction val_conv = *(LDKErrorAction*)(val_ptr);
val_conv = ErrorAction_clone((LDKErrorAction*)(((uint64_t)val) & ~1));
LightningError_set_action(&this_ptr_conv, val_conv);
}
uint32_t __attribute__((visibility("default"))) TS_LightningError_new(jstring err_arg, uint32_t action_arg) {
LDKStr err_arg_conv = str_ref_to_owned_c(err_arg);
- LDKErrorAction action_arg_conv = *(LDKErrorAction*)(((uint64_t)action_arg) & ~1);
+ void* action_arg_ptr = (void*)(((uint64_t)action_arg) & ~1);
+ CHECK_ACCESS(action_arg_ptr);
+ LDKErrorAction action_arg_conv = *(LDKErrorAction*)(action_arg_ptr);
action_arg_conv = ErrorAction_clone((LDKErrorAction*)(((uint64_t)action_arg) & ~1));
LDKLightningError ret_var = LightningError_new(err_arg_conv, action_arg_conv);
CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
void __attribute__((visibility("default"))) TS_ChannelMessageHandler_free(uint32_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKChannelMessageHandler this_ptr_conv = *(LDKChannelMessageHandler*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKChannelMessageHandler this_ptr_conv = *(LDKChannelMessageHandler*)(this_ptr_ptr);
FREE((void*)this_ptr);
ChannelMessageHandler_free(this_ptr_conv);
}
void __attribute__((visibility("default"))) TS_RoutingMessageHandler_free(uint32_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKRoutingMessageHandler this_ptr_conv = *(LDKRoutingMessageHandler*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKRoutingMessageHandler this_ptr_conv = *(LDKRoutingMessageHandler*)(this_ptr_ptr);
FREE((void*)this_ptr);
RoutingMessageHandler_free(this_ptr_conv);
}
void __attribute__((visibility("default"))) TS_CustomMessageHandler_free(uint32_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKCustomMessageHandler this_ptr_conv = *(LDKCustomMessageHandler*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKCustomMessageHandler this_ptr_conv = *(LDKCustomMessageHandler*)(this_ptr_ptr);
FREE((void*)this_ptr);
CustomMessageHandler_free(this_ptr_conv);
}
LDKMessageHandler this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- LDKChannelMessageHandler val_conv = *(LDKChannelMessageHandler*)(((uint64_t)val) & ~1);
+ void* val_ptr = (void*)(((uint64_t)val) & ~1);
+ CHECK_ACCESS(val_ptr);
+ LDKChannelMessageHandler val_conv = *(LDKChannelMessageHandler*)(val_ptr);
MessageHandler_set_chan_handler(&this_ptr_conv, val_conv);
}
LDKMessageHandler this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- LDKRoutingMessageHandler val_conv = *(LDKRoutingMessageHandler*)(((uint64_t)val) & ~1);
+ void* val_ptr = (void*)(((uint64_t)val) & ~1);
+ CHECK_ACCESS(val_ptr);
+ LDKRoutingMessageHandler val_conv = *(LDKRoutingMessageHandler*)(val_ptr);
MessageHandler_set_route_handler(&this_ptr_conv, val_conv);
}
uint32_t __attribute__((visibility("default"))) TS_MessageHandler_new(uint32_t chan_handler_arg, uint32_t route_handler_arg) {
- LDKChannelMessageHandler chan_handler_arg_conv = *(LDKChannelMessageHandler*)(((uint64_t)chan_handler_arg) & ~1);
- LDKRoutingMessageHandler route_handler_arg_conv = *(LDKRoutingMessageHandler*)(((uint64_t)route_handler_arg) & ~1);
+ void* chan_handler_arg_ptr = (void*)(((uint64_t)chan_handler_arg) & ~1);
+ CHECK_ACCESS(chan_handler_arg_ptr);
+ LDKChannelMessageHandler chan_handler_arg_conv = *(LDKChannelMessageHandler*)(chan_handler_arg_ptr);
+ void* route_handler_arg_ptr = (void*)(((uint64_t)route_handler_arg) & ~1);
+ CHECK_ACCESS(route_handler_arg_ptr);
+ LDKRoutingMessageHandler route_handler_arg_conv = *(LDKRoutingMessageHandler*)(route_handler_arg_ptr);
LDKMessageHandler ret_var = MessageHandler_new(chan_handler_arg_conv, route_handler_arg_conv);
CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
}
uint32_t __attribute__((visibility("default"))) TS_SocketDescriptor_clone(uint32_t orig) {
- LDKSocketDescriptor* orig_conv = (LDKSocketDescriptor*)(((uint64_t)orig) & ~1);
+ void* orig_ptr = (void*)(((uint64_t)orig) & ~1);
+ if (!(orig & 1)) { CHECK_ACCESS(orig_ptr); }
+ LDKSocketDescriptor* orig_conv = (LDKSocketDescriptor*)orig_ptr;
LDKSocketDescriptor* ret_ret =MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor");
*ret_ret = SocketDescriptor_clone(orig_conv);
return (uint64_t)ret_ret;
void __attribute__((visibility("default"))) TS_SocketDescriptor_free(uint32_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKSocketDescriptor this_ptr_conv = *(LDKSocketDescriptor*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKSocketDescriptor this_ptr_conv = *(LDKSocketDescriptor*)(this_ptr_ptr);
FREE((void*)this_ptr);
SocketDescriptor_free(this_ptr_conv);
}
CHECK(*((uint32_t*)ephemeral_random_data) == 32);
memcpy(ephemeral_random_data_arr, (uint8_t*)(ephemeral_random_data + 4), 32);
unsigned char (*ephemeral_random_data_ref)[32] = &ephemeral_random_data_arr;
- LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1);
- LDKCustomMessageHandler custom_message_handler_conv = *(LDKCustomMessageHandler*)(((uint64_t)custom_message_handler) & ~1);
+ void* logger_ptr = (void*)(((uint64_t)logger) & ~1);
+ CHECK_ACCESS(logger_ptr);
+ LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
+ void* custom_message_handler_ptr = (void*)(((uint64_t)custom_message_handler) & ~1);
+ CHECK_ACCESS(custom_message_handler_ptr);
+ LDKCustomMessageHandler custom_message_handler_conv = *(LDKCustomMessageHandler*)(custom_message_handler_ptr);
LDKPeerManager ret_var = PeerManager_new(message_handler_conv, our_node_secret_ref, ephemeral_random_data_ref, logger_conv, custom_message_handler_conv);
CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
LDKPublicKey their_node_id_ref;
CHECK(*((uint32_t*)their_node_id) == 33);
memcpy(their_node_id_ref.compressed_form, (uint8_t*)(their_node_id + 4), 33);
- LDKSocketDescriptor descriptor_conv = *(LDKSocketDescriptor*)(((uint64_t)descriptor) & ~1);
+ void* descriptor_ptr = (void*)(((uint64_t)descriptor) & ~1);
+ CHECK_ACCESS(descriptor_ptr);
+ LDKSocketDescriptor descriptor_conv = *(LDKSocketDescriptor*)(descriptor_ptr);
LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ");
*ret_conv = PeerManager_new_outbound_connection(&this_arg_conv, their_node_id_ref, descriptor_conv);
return (uint64_t)ret_conv;
LDKPeerManager this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKSocketDescriptor descriptor_conv = *(LDKSocketDescriptor*)(((uint64_t)descriptor) & ~1);
+ void* descriptor_ptr = (void*)(((uint64_t)descriptor) & ~1);
+ CHECK_ACCESS(descriptor_ptr);
+ LDKSocketDescriptor descriptor_conv = *(LDKSocketDescriptor*)(descriptor_ptr);
LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
*ret_conv = PeerManager_new_inbound_connection(&this_arg_conv, descriptor_conv);
return (uint64_t)ret_conv;
LDKPeerManager this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)(((uint64_t)descriptor) & ~1);
+ void* descriptor_ptr = (void*)(((uint64_t)descriptor) & ~1);
+ if (!(descriptor & 1)) { CHECK_ACCESS(descriptor_ptr); }
+ LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)descriptor_ptr;
LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
*ret_conv = PeerManager_write_buffer_space_avail(&this_arg_conv, descriptor_conv);
return (uint64_t)ret_conv;
LDKPeerManager this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKSocketDescriptor* peer_descriptor_conv = (LDKSocketDescriptor*)(((uint64_t)peer_descriptor) & ~1);
+ void* peer_descriptor_ptr = (void*)(((uint64_t)peer_descriptor) & ~1);
+ if (!(peer_descriptor & 1)) { CHECK_ACCESS(peer_descriptor_ptr); }
+ LDKSocketDescriptor* peer_descriptor_conv = (LDKSocketDescriptor*)peer_descriptor_ptr;
LDKu8slice data_ref;
data_ref.datalen = *((uint32_t*)data);
data_ref.data = (int8_t*)(data + 4);
LDKPeerManager this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)(((uint64_t)descriptor) & ~1);
+ void* descriptor_ptr = (void*)(((uint64_t)descriptor) & ~1);
+ if (!(descriptor & 1)) { CHECK_ACCESS(descriptor_ptr); }
+ LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)descriptor_ptr;
PeerManager_socket_disconnected(&this_arg_conv, descriptor_conv);
}
LDKHTLCOutputInCommitment this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(((uint64_t)val) & ~1);
+ void* val_ptr = (void*)(((uint64_t)val) & ~1);
+ CHECK_ACCESS(val_ptr);
+ LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(val_ptr);
val_conv = COption_u32Z_clone((LDKCOption_u32Z*)(((uint64_t)val) & ~1));
HTLCOutputInCommitment_set_transaction_output_index(&this_ptr_conv, val_conv);
}
LDKThirtyTwoBytes payment_hash_arg_ref;
CHECK(*((uint32_t*)payment_hash_arg) == 32);
memcpy(payment_hash_arg_ref.data, (uint8_t*)(payment_hash_arg + 4), 32);
- LDKCOption_u32Z transaction_output_index_arg_conv = *(LDKCOption_u32Z*)(((uint64_t)transaction_output_index_arg) & ~1);
+ void* transaction_output_index_arg_ptr = (void*)(((uint64_t)transaction_output_index_arg) & ~1);
+ CHECK_ACCESS(transaction_output_index_arg_ptr);
+ LDKCOption_u32Z transaction_output_index_arg_conv = *(LDKCOption_u32Z*)(transaction_output_index_arg_ptr);
transaction_output_index_arg_conv = COption_u32Z_clone((LDKCOption_u32Z*)(((uint64_t)transaction_output_index_arg) & ~1));
LDKHTLCOutputInCommitment ret_var = HTLCOutputInCommitment_new(offered_arg, amount_msat_arg, cltv_expiry_arg, payment_hash_arg_ref, transaction_output_index_arg_conv);
CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
ClosingTransaction_free(this_obj_conv);
}
+uint32_t __attribute__((visibility("default"))) TS_ClosingTransaction_clone(uint32_t orig) {
+ LDKClosingTransaction orig_conv;
+ orig_conv.inner = (void*)(orig & (~1));
+ orig_conv.is_owned = false;
+ LDKClosingTransaction ret_var = ClosingTransaction_clone(&orig_conv);
+ CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ uint64_t ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ return ret_ref;
+}
+
+int64_t __attribute__((visibility("default"))) TS_ClosingTransaction_hash(uint32_t o) {
+ LDKClosingTransaction o_conv;
+ o_conv.inner = (void*)(o & (~1));
+ o_conv.is_owned = false;
+ int64_t ret_val = ClosingTransaction_hash(&o_conv);
+ return ret_val;
+}
+
uint32_t __attribute__((visibility("default"))) TS_ClosingTransaction_new(int64_t to_holder_value_sat, int64_t to_counterparty_value_sat, int8_tArray to_holder_script, int8_tArray to_counterparty_script, uint32_t funding_outpoint) {
LDKCVec_u8Z to_holder_script_ref;
to_holder_script_ref.datalen = *((uint32_t*)to_holder_script);
return ret_ref;
}
+uint32_t __attribute__((visibility("default"))) TS_InvalidShutdownScript_clone(uint32_t orig) {
+ LDKInvalidShutdownScript orig_conv;
+ orig_conv.inner = (void*)(orig & (~1));
+ orig_conv.is_owned = false;
+ LDKInvalidShutdownScript ret_var = InvalidShutdownScript_clone(&orig_conv);
+ CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ uint64_t ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ return ret_ref;
+}
+
int8_tArray __attribute__((visibility("default"))) TS_ShutdownScript_write(uint32_t obj) {
LDKShutdownScript obj_conv;
obj_conv.inner = (void*)(obj & (~1));
void __attribute__((visibility("default"))) TS_CustomMessageReader_free(uint32_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKCustomMessageReader this_ptr_conv = *(LDKCustomMessageReader*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKCustomMessageReader this_ptr_conv = *(LDKCustomMessageReader*)(this_ptr_ptr);
FREE((void*)this_ptr);
CustomMessageReader_free(this_ptr_conv);
}
uint32_t __attribute__((visibility("default"))) TS_Type_clone(uint32_t orig) {
- LDKType* orig_conv = (LDKType*)(((uint64_t)orig) & ~1);
+ void* orig_ptr = (void*)(((uint64_t)orig) & ~1);
+ if (!(orig & 1)) { CHECK_ACCESS(orig_ptr); }
+ LDKType* orig_conv = (LDKType*)orig_ptr;
LDKType* ret_ret =MALLOC(sizeof(LDKType), "LDKType");
*ret_ret = Type_clone(orig_conv);
return (uint64_t)ret_ret;
void __attribute__((visibility("default"))) TS_Type_free(uint32_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKType this_ptr_conv = *(LDKType*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKType this_ptr_conv = *(LDKType*)(this_ptr_ptr);
FREE((void*)this_ptr);
Type_free(this_ptr_conv);
}
void __attribute__((visibility("default"))) TS_Score_free(uint32_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKScore this_ptr_conv = *(LDKScore*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKScore this_ptr_conv = *(LDKScore*)(this_ptr_ptr);
FREE((void*)this_ptr);
Score_free(this_ptr_conv);
}
void __attribute__((visibility("default"))) TS_NetworkUpdate_free(uint32_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKNetworkUpdate this_ptr_conv = *(LDKNetworkUpdate*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKNetworkUpdate this_ptr_conv = *(LDKNetworkUpdate*)(this_ptr_ptr);
FREE((void*)this_ptr);
NetworkUpdate_free(this_ptr_conv);
}
network_graph_conv.inner = (void*)(network_graph & (~1));
network_graph_conv.is_owned = (network_graph & 1) || (network_graph == 0);
network_graph_conv = NetworkGraph_clone(&network_graph_conv);
- LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(((uint64_t)chain_access) & ~1);
+ void* chain_access_ptr = (void*)(((uint64_t)chain_access) & ~1);
+ CHECK_ACCESS(chain_access_ptr);
+ LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(chain_access_ptr);
// Warning: we may need a move here but no clone is available for LDKCOption_AccessZ
if (chain_access_conv.tag == LDKCOption_AccessZ_Some) {
// Manually implement clone for Java trait instances
}
- LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1);
+ void* logger_ptr = (void*)(((uint64_t)logger) & ~1);
+ CHECK_ACCESS(logger_ptr);
+ LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
LDKNetGraphMsgHandler ret_var = NetGraphMsgHandler_new(network_graph_conv, chain_access_conv, logger_conv);
CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
LDKNetGraphMsgHandler this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(((uint64_t)chain_access) & ~1);
+ void* chain_access_ptr = (void*)(((uint64_t)chain_access) & ~1);
+ CHECK_ACCESS(chain_access_ptr);
+ LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(chain_access_ptr);
// Warning: we may need a move here but no clone is available for LDKCOption_AccessZ
if (chain_access_conv.tag == LDKCOption_AccessZ_Some) {
// Manually implement clone for Java trait instances
LDKDirectionalChannelInfo this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(((uint64_t)val) & ~1);
+ void* val_ptr = (void*)(((uint64_t)val) & ~1);
+ CHECK_ACCESS(val_ptr);
+ LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
val_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)val) & ~1));
DirectionalChannelInfo_set_htlc_maximum_msat(&this_ptr_conv, val_conv);
}
}
uint32_t __attribute__((visibility("default"))) TS_DirectionalChannelInfo_new(int32_t last_update_arg, jboolean enabled_arg, int16_t cltv_expiry_delta_arg, int64_t htlc_minimum_msat_arg, uint32_t htlc_maximum_msat_arg, uint32_t fees_arg, uint32_t last_update_message_arg) {
- LDKCOption_u64Z htlc_maximum_msat_arg_conv = *(LDKCOption_u64Z*)(((uint64_t)htlc_maximum_msat_arg) & ~1);
+ void* htlc_maximum_msat_arg_ptr = (void*)(((uint64_t)htlc_maximum_msat_arg) & ~1);
+ CHECK_ACCESS(htlc_maximum_msat_arg_ptr);
+ LDKCOption_u64Z htlc_maximum_msat_arg_conv = *(LDKCOption_u64Z*)(htlc_maximum_msat_arg_ptr);
htlc_maximum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)htlc_maximum_msat_arg) & ~1));
LDKRoutingFees fees_arg_conv;
fees_arg_conv.inner = (void*)(fees_arg & (~1));
LDKChannelInfo this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(((uint64_t)val) & ~1);
+ void* val_ptr = (void*)(((uint64_t)val) & ~1);
+ CHECK_ACCESS(val_ptr);
+ LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
val_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)val) & ~1));
ChannelInfo_set_capacity_sats(&this_ptr_conv, val_conv);
}
two_to_one_arg_conv.inner = (void*)(two_to_one_arg & (~1));
two_to_one_arg_conv.is_owned = (two_to_one_arg & 1) || (two_to_one_arg == 0);
two_to_one_arg_conv = DirectionalChannelInfo_clone(&two_to_one_arg_conv);
- LDKCOption_u64Z capacity_sats_arg_conv = *(LDKCOption_u64Z*)(((uint64_t)capacity_sats_arg) & ~1);
+ void* capacity_sats_arg_ptr = (void*)(((uint64_t)capacity_sats_arg) & ~1);
+ CHECK_ACCESS(capacity_sats_arg_ptr);
+ LDKCOption_u64Z capacity_sats_arg_conv = *(LDKCOption_u64Z*)(capacity_sats_arg_ptr);
capacity_sats_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)capacity_sats_arg) & ~1));
LDKChannelAnnouncement announcement_message_arg_conv;
announcement_message_arg_conv.inner = (void*)(announcement_message_arg & (~1));
uint32_t* val_vals = (uint32_t*)(val + 4);
for (size_t m = 0; m < val_constr.datalen; m++) {
uint32_t val_conv_12 = val_vals[m];
- LDKNetAddress val_conv_12_conv = *(LDKNetAddress*)(((uint64_t)val_conv_12) & ~1);
+ void* val_conv_12_ptr = (void*)(((uint64_t)val_conv_12) & ~1);
+ CHECK_ACCESS(val_conv_12_ptr);
+ LDKNetAddress val_conv_12_conv = *(LDKNetAddress*)(val_conv_12_ptr);
val_conv_12_conv = NetAddress_clone((LDKNetAddress*)(((uint64_t)val_conv_12) & ~1));
val_constr.data[m] = val_conv_12_conv;
}
uint32_t* addresses_arg_vals = (uint32_t*)(addresses_arg + 4);
for (size_t m = 0; m < addresses_arg_constr.datalen; m++) {
uint32_t addresses_arg_conv_12 = addresses_arg_vals[m];
- LDKNetAddress addresses_arg_conv_12_conv = *(LDKNetAddress*)(((uint64_t)addresses_arg_conv_12) & ~1);
+ void* addresses_arg_conv_12_ptr = (void*)(((uint64_t)addresses_arg_conv_12) & ~1);
+ CHECK_ACCESS(addresses_arg_conv_12_ptr);
+ LDKNetAddress addresses_arg_conv_12_conv = *(LDKNetAddress*)(addresses_arg_conv_12_ptr);
addresses_arg_constr.data[m] = addresses_arg_conv_12_conv;
}
LDKNodeAnnouncement announcement_message_arg_conv;
LDKChannelAnnouncement msg_conv;
msg_conv.inner = (void*)(msg & (~1));
msg_conv.is_owned = false;
- LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(((uint64_t)chain_access) & ~1);
+ void* chain_access_ptr = (void*)(((uint64_t)chain_access) & ~1);
+ CHECK_ACCESS(chain_access_ptr);
+ LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(chain_access_ptr);
// Warning: we may need a move here but no clone is available for LDKCOption_AccessZ
if (chain_access_conv.tag == LDKCOption_AccessZ_Some) {
// Manually implement clone for Java trait instances
LDKUnsignedChannelAnnouncement msg_conv;
msg_conv.inner = (void*)(msg & (~1));
msg_conv.is_owned = false;
- LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(((uint64_t)chain_access) & ~1);
+ void* chain_access_ptr = (void*)(((uint64_t)chain_access) & ~1);
+ CHECK_ACCESS(chain_access_ptr);
+ LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(chain_access_ptr);
// Warning: we may need a move here but no clone is available for LDKCOption_AccessZ
if (chain_access_conv.tag == LDKCOption_AccessZ_Some) {
// Manually implement clone for Java trait instances
LDKRouteHintHop this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(((uint64_t)val) & ~1);
+ void* val_ptr = (void*)(((uint64_t)val) & ~1);
+ CHECK_ACCESS(val_ptr);
+ LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
val_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)val) & ~1));
RouteHintHop_set_htlc_minimum_msat(&this_ptr_conv, val_conv);
}
LDKRouteHintHop this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(((uint64_t)val) & ~1);
+ void* val_ptr = (void*)(((uint64_t)val) & ~1);
+ CHECK_ACCESS(val_ptr);
+ LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
val_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)val) & ~1));
RouteHintHop_set_htlc_maximum_msat(&this_ptr_conv, val_conv);
}
fees_arg_conv.inner = (void*)(fees_arg & (~1));
fees_arg_conv.is_owned = (fees_arg & 1) || (fees_arg == 0);
fees_arg_conv = RoutingFees_clone(&fees_arg_conv);
- LDKCOption_u64Z htlc_minimum_msat_arg_conv = *(LDKCOption_u64Z*)(((uint64_t)htlc_minimum_msat_arg) & ~1);
+ void* htlc_minimum_msat_arg_ptr = (void*)(((uint64_t)htlc_minimum_msat_arg) & ~1);
+ CHECK_ACCESS(htlc_minimum_msat_arg_ptr);
+ LDKCOption_u64Z htlc_minimum_msat_arg_conv = *(LDKCOption_u64Z*)(htlc_minimum_msat_arg_ptr);
htlc_minimum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)htlc_minimum_msat_arg) & ~1));
- LDKCOption_u64Z htlc_maximum_msat_arg_conv = *(LDKCOption_u64Z*)(((uint64_t)htlc_maximum_msat_arg) & ~1);
+ void* htlc_maximum_msat_arg_ptr = (void*)(((uint64_t)htlc_maximum_msat_arg) & ~1);
+ CHECK_ACCESS(htlc_maximum_msat_arg_ptr);
+ LDKCOption_u64Z htlc_maximum_msat_arg_conv = *(LDKCOption_u64Z*)(htlc_maximum_msat_arg_ptr);
htlc_maximum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)htlc_maximum_msat_arg) & ~1));
LDKRouteHintHop ret_var = RouteHintHop_new(src_node_id_arg_ref, short_channel_id_arg, fees_arg_conv, cltv_expiry_delta_arg, htlc_minimum_msat_arg_conv, htlc_maximum_msat_arg_conv);
CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
last_hops_conv_11_conv = RouteHint_clone(&last_hops_conv_11_conv);
last_hops_constr.data[l] = last_hops_conv_11_conv;
}
- LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1);
- LDKScore* scorer_conv = (LDKScore*)(((uint64_t)scorer) & ~1);
+ void* logger_ptr = (void*)(((uint64_t)logger) & ~1);
+ CHECK_ACCESS(logger_ptr);
+ LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
+ void* scorer_ptr = (void*)(((uint64_t)scorer) & ~1);
+ if (!(scorer & 1)) { CHECK_ACCESS(scorer_ptr); }
+ LDKScore* scorer_conv = (LDKScore*)scorer_ptr;
LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
*ret_conv = get_keysend_route(our_node_pubkey_ref, &network_conv, payee_ref, first_hops_ptr, last_hops_constr, final_value_msat, final_cltv, logger_conv, scorer_conv);
if (first_hops_ptr != NULL) { FREE(first_hops_constr.data); }
last_hops_conv_11_conv = RouteHint_clone(&last_hops_conv_11_conv);
last_hops_constr.data[l] = last_hops_conv_11_conv;
}
- LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1);
- LDKScore* scorer_conv = (LDKScore*)(((uint64_t)scorer) & ~1);
+ void* logger_ptr = (void*)(((uint64_t)logger) & ~1);
+ CHECK_ACCESS(logger_ptr);
+ LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
+ void* scorer_ptr = (void*)(((uint64_t)scorer) & ~1);
+ if (!(scorer & 1)) { CHECK_ACCESS(scorer_ptr); }
+ LDKScore* scorer_conv = (LDKScore*)scorer_ptr;
LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
*ret_conv = get_route(our_node_pubkey_ref, &network_conv, payee_ref, payee_features_conv, first_hops_ptr, last_hops_constr, final_value_msat, final_cltv, logger_conv, scorer_conv);
if (first_hops_ptr != NULL) { FREE(first_hops_constr.data); }
LDKFilesystemPersister this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(((uint64_t)keys_manager) & ~1);
+ void* keys_manager_ptr = (void*)(((uint64_t)keys_manager) & ~1);
+ CHECK_ACCESS(keys_manager_ptr);
+ LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(keys_manager_ptr);
LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ), "LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ");
*ret_conv = FilesystemPersister_read_channelmonitors(&this_arg_conv, keys_manager_conv);
return (uint64_t)ret_conv;
void __attribute__((visibility("default"))) TS_ChannelManagerPersister_free(uint32_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKChannelManagerPersister this_ptr_conv = *(LDKChannelManagerPersister*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKChannelManagerPersister this_ptr_conv = *(LDKChannelManagerPersister*)(this_ptr_ptr);
FREE((void*)this_ptr);
ChannelManagerPersister_free(this_ptr_conv);
}
uint32_t __attribute__((visibility("default"))) TS_BackgroundProcessor_start(uint32_t persister, uint32_t event_handler, uint32_t chain_monitor, uint32_t channel_manager, uint32_t net_graph_msg_handler, uint32_t peer_manager, uint32_t logger) {
- LDKChannelManagerPersister persister_conv = *(LDKChannelManagerPersister*)(((uint64_t)persister) & ~1);
- LDKEventHandler event_handler_conv = *(LDKEventHandler*)(((uint64_t)event_handler) & ~1);
+ void* persister_ptr = (void*)(((uint64_t)persister) & ~1);
+ CHECK_ACCESS(persister_ptr);
+ LDKChannelManagerPersister persister_conv = *(LDKChannelManagerPersister*)(persister_ptr);
+ void* event_handler_ptr = (void*)(((uint64_t)event_handler) & ~1);
+ CHECK_ACCESS(event_handler_ptr);
+ LDKEventHandler event_handler_conv = *(LDKEventHandler*)(event_handler_ptr);
LDKChainMonitor chain_monitor_conv;
chain_monitor_conv.inner = (void*)(chain_monitor & (~1));
chain_monitor_conv.is_owned = false;
LDKPeerManager peer_manager_conv;
peer_manager_conv.inner = (void*)(peer_manager & (~1));
peer_manager_conv.is_owned = false;
- LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1);
+ void* logger_ptr = (void*)(((uint64_t)logger) & ~1);
+ CHECK_ACCESS(logger_ptr);
+ LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
LDKBackgroundProcessor ret_var = BackgroundProcessor_start(persister_conv, event_handler_conv, &chain_monitor_conv, &channel_manager_conv, net_graph_msg_handler_conv, &peer_manager_conv, logger_conv);
CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
void __attribute__((visibility("default"))) TS_Fallback_free(uint32_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKFallback this_ptr_conv = *(LDKFallback*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKFallback this_ptr_conv = *(LDKFallback*)(this_ptr_ptr);
FREE((void*)this_ptr);
Fallback_free(this_ptr_conv);
}
void __attribute__((visibility("default"))) TS_SignOrCreationError_free(uint32_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKSignOrCreationError this_ptr_conv = *(LDKSignOrCreationError*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKSignOrCreationError this_ptr_conv = *(LDKSignOrCreationError*)(this_ptr_ptr);
FREE((void*)this_ptr);
SignOrCreationError_free(this_ptr_conv);
}
LDKChannelManager channelmanager_conv;
channelmanager_conv.inner = (void*)(channelmanager & (~1));
channelmanager_conv.is_owned = false;
- LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(((uint64_t)keys_manager) & ~1);
+ void* keys_manager_ptr = (void*)(((uint64_t)keys_manager) & ~1);
+ CHECK_ACCESS(keys_manager_ptr);
+ LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(keys_manager_ptr);
LDKCurrency network_conv = LDKCurrency_from_js(network);
- LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(((uint64_t)amt_msat) & ~1);
+ void* amt_msat_ptr = (void*)(((uint64_t)amt_msat) & ~1);
+ CHECK_ACCESS(amt_msat_ptr);
+ LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr);
amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)amt_msat) & ~1));
LDKStr description_conv = str_ref_to_owned_c(description);
LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
#define FREE(p) if ((unsigned long)(p) > 1024) { free(p); }
#define DO_ASSERT(a) (void)(a)
#define CHECK(a)
+#define CHECK_ACCESS(p)
// We assume that CVec_u8Z and u8slice are the same size and layout (and thus pointers to the two can be mixed)
_Static_assert(sizeof(LDKCVec_u8Z) == sizeof(LDKu8slice), "Vec<u8> and [u8] need to have been mapped identically");
uint32_t err_conv = LDKAccessError_to_js((*val->contents.err));
return err_conv;
}
-uint32_t __attribute__((visibility("default"))) TS_LDKC2Tuple_usizeTransactionZ_new(int64_t a, int8_tArray b) {
- LDKC2Tuple_usizeTransactionZ* ret = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ");
- ret->a = a;
- LDKTransaction b_ref;
- b_ref.datalen = *((uint32_t*)b);
- b_ref.data = MALLOC(b_ref.datalen, "LDKTransaction Bytes");
- memcpy(b_ref.data, (uint8_t*)(b + 4), b_ref.datalen);
- b_ref.data_is_owned = false;
- ret->b = b_ref;
- return (uint64_t)ret;
-}
static inline uintptr_t C2Tuple_usizeTransactionZ_get_a(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR tuple){
return tuple->a;
}
uint32_t *java_elems = (uint32_t*)(elems + 4);
for (size_t i = 0; i < ret->datalen; i++) {
uint32_t arr_elem = java_elems[i];
- LDKC2Tuple_usizeTransactionZ arr_elem_conv = *(LDKC2Tuple_usizeTransactionZ*)(((uint64_t)arr_elem) & ~1);
+ void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1);
+ CHECK_ACCESS(arr_elem_ptr);
+ LDKC2Tuple_usizeTransactionZ arr_elem_conv = *(LDKC2Tuple_usizeTransactionZ*)(arr_elem_ptr);
arr_elem_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)(((uint64_t)arr_elem) & ~1));
ret->data[i] = arr_elem_conv;
}
uint32_t *java_elems = (uint32_t*)(elems + 4);
for (size_t i = 0; i < ret->datalen; i++) {
uint32_t arr_elem = java_elems[i];
- LDKMonitorEvent arr_elem_conv = *(LDKMonitorEvent*)(((uint64_t)arr_elem) & ~1);
+ void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1);
+ CHECK_ACCESS(arr_elem_ptr);
+ LDKMonitorEvent arr_elem_conv = *(LDKMonitorEvent*)(arr_elem_ptr);
arr_elem_conv = MonitorEvent_clone((LDKMonitorEvent*)(((uint64_t)arr_elem) & ~1));
ret->data[i] = arr_elem_conv;
}
uint32_t *java_elems = (uint32_t*)(elems + 4);
for (size_t i = 0; i < ret->datalen; i++) {
uint32_t arr_elem = java_elems[i];
- LDKSpendableOutputDescriptor arr_elem_conv = *(LDKSpendableOutputDescriptor*)(((uint64_t)arr_elem) & ~1);
+ void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1);
+ CHECK_ACCESS(arr_elem_ptr);
+ LDKSpendableOutputDescriptor arr_elem_conv = *(LDKSpendableOutputDescriptor*)(arr_elem_ptr);
arr_elem_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)(((uint64_t)arr_elem) & ~1));
ret->data[i] = arr_elem_conv;
}
uint32_t *java_elems = (uint32_t*)(elems + 4);
for (size_t i = 0; i < ret->datalen; i++) {
uint32_t arr_elem = java_elems[i];
- LDKMessageSendEvent arr_elem_conv = *(LDKMessageSendEvent*)(((uint64_t)arr_elem) & ~1);
+ void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1);
+ CHECK_ACCESS(arr_elem_ptr);
+ LDKMessageSendEvent arr_elem_conv = *(LDKMessageSendEvent*)(arr_elem_ptr);
arr_elem_conv = MessageSendEvent_clone((LDKMessageSendEvent*)(((uint64_t)arr_elem) & ~1));
ret->data[i] = arr_elem_conv;
}
CHECK(!val->result_ok);
return *val->contents.err;
}
-uint32_t __attribute__((visibility("default"))) TS_LDKC2Tuple_SignatureCVec_SignatureZZ_new(int8_tArray a, ptrArray b) {
- LDKC2Tuple_SignatureCVec_SignatureZZ* ret = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ");
- LDKSignature a_ref;
- CHECK(*((uint32_t*)a) == 64);
- memcpy(a_ref.compact_form, (uint8_t*)(a + 4), 64);
- ret->a = a_ref;
- LDKCVec_SignatureZ b_constr;
- b_constr.datalen = *((uint32_t*)b);
- if (b_constr.datalen > 0)
- b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements");
- else
- b_constr.data = NULL;
- int8_tArray* b_vals = (int8_tArray*)(b + 4);
- for (size_t m = 0; m < b_constr.datalen; m++) {
- int8_tArray b_conv_12 = b_vals[m];
- LDKSignature b_conv_12_ref;
- CHECK(*((uint32_t*)b_conv_12) == 64);
- memcpy(b_conv_12_ref.compact_form, (uint8_t*)(b_conv_12 + 4), 64);
- b_constr.data[m] = b_conv_12_ref;
- }
- ret->b = b_constr;
- return (uint64_t)ret;
-}
static inline struct LDKSignature C2Tuple_SignatureCVec_SignatureZZ_get_a(LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR tuple){
return tuple->a;
}
holder_tx_ref |= 1;
}
uint32_t ret = js_invoke_function_1(j_calls->validate_holder_commitment_meth, holder_tx_ref);
- LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(ret_ptr);
ret_conv = CResult_NoneNoneZ_clone((LDKCResult_NoneNoneZ*)(((uint64_t)ret) & ~1));
return ret_conv;
}
commitment_tx_ref |= 1;
}
uint32_t ret = js_invoke_function_1(j_calls->sign_counterparty_commitment_meth, commitment_tx_ref);
- LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(ret_ptr);
ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone((LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(((uint64_t)ret) & ~1));
return ret_conv;
}
int8_tArray secret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(secret_arr + 4), *secret, 32);
uint32_t ret = js_invoke_function_2(j_calls->validate_counterparty_revocation_meth, idx, secret_arr);
- LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(ret_ptr);
ret_conv = CResult_NoneNoneZ_clone((LDKCResult_NoneNoneZ*)(((uint64_t)ret) & ~1));
return ret_conv;
}
commitment_tx_ref |= 1;
}
uint32_t ret = js_invoke_function_1(j_calls->sign_holder_commitment_and_htlcs_meth, commitment_tx_ref);
- LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(ret_ptr);
ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone((LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(((uint64_t)ret) & ~1));
return ret_conv;
}
int8_tArray per_commitment_key_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(per_commitment_key_arr + 4), *per_commitment_key, 32);
uint32_t ret = js_invoke_function_4(j_calls->sign_justice_revoked_output_meth, justice_tx_arr, input, amount, per_commitment_key_arr);
- LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr);
ret_conv = CResult_SignatureNoneZ_clone((LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1));
return ret_conv;
}
htlc_ref |= 1;
}
uint32_t ret = js_invoke_function_5(j_calls->sign_justice_revoked_htlc_meth, justice_tx_arr, input, amount, per_commitment_key_arr, htlc_ref);
- LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr);
ret_conv = CResult_SignatureNoneZ_clone((LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1));
return ret_conv;
}
htlc_ref |= 1;
}
uint32_t ret = js_invoke_function_5(j_calls->sign_counterparty_htlc_transaction_meth, htlc_tx_arr, input, amount, per_commitment_point_arr, htlc_ref);
- LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr);
ret_conv = CResult_SignatureNoneZ_clone((LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1));
return ret_conv;
}
LDKCResult_SignatureNoneZ sign_closing_transaction_LDKBaseSign_jcall(const void* this_arg, const LDKClosingTransaction * closing_tx) {
LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
LDKClosingTransaction closing_tx_var = *closing_tx;
- // Warning: we may need a move here but no clone is available for LDKClosingTransaction
+ closing_tx_var = ClosingTransaction_clone(closing_tx);
CHECK((((uint64_t)closing_tx_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&closing_tx_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
uint64_t closing_tx_ref = (uint64_t)closing_tx_var.inner;
closing_tx_ref |= 1;
}
uint32_t ret = js_invoke_function_1(j_calls->sign_closing_transaction_meth, closing_tx_ref);
- LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr);
ret_conv = CResult_SignatureNoneZ_clone((LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1));
return ret_conv;
}
msg_ref |= 1;
}
uint32_t ret = js_invoke_function_1(j_calls->sign_channel_announcement_meth, msg_ref);
- LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr);
ret_conv = CResult_SignatureNoneZ_clone((LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1));
return ret_conv;
}
return (long)res_ptr;
}
int8_tArray __attribute__((visibility("default"))) TS_BaseSign_get_per_commitment_point(uint32_t this_arg, int64_t idx) {
- LDKBaseSign* this_arg_conv = (LDKBaseSign*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(ret_arr + 4), (this_arg_conv->get_per_commitment_point)(this_arg_conv->this_arg, idx).compressed_form, 33);
return ret_arr;
}
int8_tArray __attribute__((visibility("default"))) TS_BaseSign_release_commitment_secret(uint32_t this_arg, int64_t idx) {
- LDKBaseSign* this_arg_conv = (LDKBaseSign*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(ret_arr + 4), (this_arg_conv->release_commitment_secret)(this_arg_conv->this_arg, idx).data, 32);
return ret_arr;
}
uint32_t __attribute__((visibility("default"))) TS_BaseSign_validate_holder_commitment(uint32_t this_arg, uint32_t holder_tx) {
- LDKBaseSign* this_arg_conv = (LDKBaseSign*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
LDKHolderCommitmentTransaction holder_tx_conv;
holder_tx_conv.inner = (void*)(holder_tx & (~1));
holder_tx_conv.is_owned = false;
}
int8_tArray __attribute__((visibility("default"))) TS_BaseSign_channel_keys_id(uint32_t this_arg) {
- LDKBaseSign* this_arg_conv = (LDKBaseSign*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(ret_arr + 4), (this_arg_conv->channel_keys_id)(this_arg_conv->this_arg).data, 32);
return ret_arr;
}
uint32_t __attribute__((visibility("default"))) TS_BaseSign_sign_counterparty_commitment(uint32_t this_arg, uint32_t commitment_tx) {
- LDKBaseSign* this_arg_conv = (LDKBaseSign*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
LDKCommitmentTransaction commitment_tx_conv;
commitment_tx_conv.inner = (void*)(commitment_tx & (~1));
commitment_tx_conv.is_owned = false;
}
uint32_t __attribute__((visibility("default"))) TS_BaseSign_validate_counterparty_revocation(uint32_t this_arg, int64_t idx, int8_tArray secret) {
- LDKBaseSign* this_arg_conv = (LDKBaseSign*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
unsigned char secret_arr[32];
CHECK(*((uint32_t*)secret) == 32);
memcpy(secret_arr, (uint8_t*)(secret + 4), 32);
}
uint32_t __attribute__((visibility("default"))) TS_BaseSign_sign_holder_commitment_and_htlcs(uint32_t this_arg, uint32_t commitment_tx) {
- LDKBaseSign* this_arg_conv = (LDKBaseSign*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
LDKHolderCommitmentTransaction commitment_tx_conv;
commitment_tx_conv.inner = (void*)(commitment_tx & (~1));
commitment_tx_conv.is_owned = false;
}
uint32_t __attribute__((visibility("default"))) TS_BaseSign_sign_justice_revoked_output(uint32_t this_arg, int8_tArray justice_tx, int64_t input, int64_t amount, int8_tArray per_commitment_key) {
- LDKBaseSign* this_arg_conv = (LDKBaseSign*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
LDKTransaction justice_tx_ref;
justice_tx_ref.datalen = *((uint32_t*)justice_tx);
justice_tx_ref.data = MALLOC(justice_tx_ref.datalen, "LDKTransaction Bytes");
}
uint32_t __attribute__((visibility("default"))) TS_BaseSign_sign_justice_revoked_htlc(uint32_t this_arg, int8_tArray justice_tx, int64_t input, int64_t amount, int8_tArray per_commitment_key, uint32_t htlc) {
- LDKBaseSign* this_arg_conv = (LDKBaseSign*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
LDKTransaction justice_tx_ref;
justice_tx_ref.datalen = *((uint32_t*)justice_tx);
justice_tx_ref.data = MALLOC(justice_tx_ref.datalen, "LDKTransaction Bytes");
}
uint32_t __attribute__((visibility("default"))) TS_BaseSign_sign_counterparty_htlc_transaction(uint32_t this_arg, int8_tArray htlc_tx, int64_t input, int64_t amount, int8_tArray per_commitment_point, uint32_t htlc) {
- LDKBaseSign* this_arg_conv = (LDKBaseSign*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
LDKTransaction htlc_tx_ref;
htlc_tx_ref.datalen = *((uint32_t*)htlc_tx);
htlc_tx_ref.data = MALLOC(htlc_tx_ref.datalen, "LDKTransaction Bytes");
}
uint32_t __attribute__((visibility("default"))) TS_BaseSign_sign_closing_transaction(uint32_t this_arg, uint32_t closing_tx) {
- LDKBaseSign* this_arg_conv = (LDKBaseSign*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
LDKClosingTransaction closing_tx_conv;
closing_tx_conv.inner = (void*)(closing_tx & (~1));
closing_tx_conv.is_owned = false;
}
uint32_t __attribute__((visibility("default"))) TS_BaseSign_sign_channel_announcement(uint32_t this_arg, uint32_t msg) {
- LDKBaseSign* this_arg_conv = (LDKBaseSign*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
LDKUnsignedChannelAnnouncement msg_conv;
msg_conv.inner = (void*)(msg & (~1));
msg_conv.is_owned = false;
}
void __attribute__((visibility("default"))) TS_BaseSign_ready_channel(uint32_t this_arg, uint32_t channel_parameters) {
- LDKBaseSign* this_arg_conv = (LDKBaseSign*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
LDKChannelTransactionParameters channel_parameters_conv;
channel_parameters_conv.inner = (void*)(channel_parameters & (~1));
channel_parameters_conv.is_owned = false;
return this_arg->pubkeys;
}
uint32_t __attribute__((visibility("default"))) TS_BaseSign_get_pubkeys(uint32_t this_arg) {
- LDKBaseSign* this_arg_conv = (LDKBaseSign*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
LDKChannelPublicKeys ret_var = LDKBaseSign_set_get_pubkeys(this_arg_conv);
CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
return (long)res_ptr;
}
int8_tArray __attribute__((visibility("default"))) TS_Sign_write(uint32_t this_arg) {
- LDKSign* this_arg_conv = (LDKSign*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKSign* this_arg_conv = (LDKSign*)this_arg_ptr;
LDKCVec_u8Z ret_var = (this_arg_conv->write)(this_arg_conv->this_arg);
int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
uint32_t *java_elems = (uint32_t*)(elems + 4);
for (size_t i = 0; i < ret->datalen; i++) {
uint32_t arr_elem = java_elems[i];
- LDKTxOut arr_elem_conv = *(LDKTxOut*)(((uint64_t)arr_elem) & ~1);
+ void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1);
+ CHECK_ACCESS(arr_elem_ptr);
+ LDKTxOut arr_elem_conv = *(LDKTxOut*)(arr_elem_ptr);
arr_elem_conv = TxOut_clone((LDKTxOut*)(((uint64_t)arr_elem) & ~1));
ret->data[i] = arr_elem_conv;
}
CHECK(!val->result_ok);
return *val->contents.err;
}
-uint32_t __attribute__((visibility("default"))) TS_LDKC2Tuple_BlockHashChannelMonitorZ_new(int8_tArray a, uint32_t b) {
- LDKC2Tuple_BlockHashChannelMonitorZ* ret = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKC2Tuple_BlockHashChannelMonitorZ");
- LDKThirtyTwoBytes a_ref;
- CHECK(*((uint32_t*)a) == 32);
- memcpy(a_ref.data, (uint8_t*)(a + 4), 32);
- ret->a = a_ref;
- LDKChannelMonitor b_conv;
- b_conv.inner = (void*)(b & (~1));
- b_conv.is_owned = (b & 1) || (b == 0);
- b_conv = ChannelMonitor_clone(&b_conv);
- ret->b = b_conv;
- return (uint64_t)ret;
-}
static inline struct LDKThirtyTwoBytes C2Tuple_BlockHashChannelMonitorZ_get_a(LDKC2Tuple_BlockHashChannelMonitorZ *NONNULL_PTR tuple){
return ThirtyTwoBytes_clone(&tuple->a);
}
uint32_t *java_elems = (uint32_t*)(elems + 4);
for (size_t i = 0; i < ret->datalen; i++) {
uint32_t arr_elem = java_elems[i];
- LDKC2Tuple_BlockHashChannelMonitorZ arr_elem_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(((uint64_t)arr_elem) & ~1);
+ void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1);
+ CHECK_ACCESS(arr_elem_ptr);
+ LDKC2Tuple_BlockHashChannelMonitorZ arr_elem_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(arr_elem_ptr);
arr_elem_conv = C2Tuple_BlockHashChannelMonitorZ_clone((LDKC2Tuple_BlockHashChannelMonitorZ*)(((uint64_t)arr_elem) & ~1));
ret->data[i] = arr_elem_conv;
}
uint32_t *java_elems = (uint32_t*)(elems + 4);
for (size_t i = 0; i < ret->datalen; i++) {
uint32_t arr_elem = java_elems[i];
- LDKCResult_NoneAPIErrorZ arr_elem_conv = *(LDKCResult_NoneAPIErrorZ*)(((uint64_t)arr_elem) & ~1);
+ void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1);
+ CHECK_ACCESS(arr_elem_ptr);
+ LDKCResult_NoneAPIErrorZ arr_elem_conv = *(LDKCResult_NoneAPIErrorZ*)(arr_elem_ptr);
arr_elem_conv = CResult_NoneAPIErrorZ_clone((LDKCResult_NoneAPIErrorZ*)(((uint64_t)arr_elem) & ~1));
ret->data[i] = arr_elem_conv;
}
uint32_t *java_elems = (uint32_t*)(elems + 4);
for (size_t i = 0; i < ret->datalen; i++) {
uint32_t arr_elem = java_elems[i];
- LDKAPIError arr_elem_conv = *(LDKAPIError*)(((uint64_t)arr_elem) & ~1);
+ void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1);
+ CHECK_ACCESS(arr_elem_ptr);
+ LDKAPIError arr_elem_conv = *(LDKAPIError*)(arr_elem_ptr);
arr_elem_conv = APIError_clone((LDKAPIError*)(((uint64_t)arr_elem) & ~1));
ret->data[i] = arr_elem_conv;
}
uint64_t err_ref = ((uint64_t)&(*val->contents.err)) | 1;
return err_ref;
}
-uint32_t __attribute__((visibility("default"))) TS_LDKC2Tuple_PaymentHashPaymentIdZ_new(int8_tArray a, uint32_t b) {
- LDKC2Tuple_PaymentHashPaymentIdZ* ret = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentIdZ), "LDKC2Tuple_PaymentHashPaymentIdZ");
- LDKThirtyTwoBytes a_ref;
- CHECK(*((uint32_t*)a) == 32);
- memcpy(a_ref.data, (uint8_t*)(a + 4), 32);
- ret->a = a_ref;
- LDKPaymentId b_conv;
- b_conv.inner = (void*)(b & (~1));
- b_conv.is_owned = (b & 1) || (b == 0);
- b_conv = PaymentId_clone(&b_conv);
- ret->b = b_conv;
- return (uint64_t)ret;
-}
static inline struct LDKThirtyTwoBytes C2Tuple_PaymentHashPaymentIdZ_get_a(LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR tuple){
return ThirtyTwoBytes_clone(&tuple->a);
}
uint32_t *java_elems = (uint32_t*)(elems + 4);
for (size_t i = 0; i < ret->datalen; i++) {
uint32_t arr_elem = java_elems[i];
- LDKNetAddress arr_elem_conv = *(LDKNetAddress*)(((uint64_t)arr_elem) & ~1);
+ void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1);
+ CHECK_ACCESS(arr_elem_ptr);
+ LDKNetAddress arr_elem_conv = *(LDKNetAddress*)(arr_elem_ptr);
arr_elem_conv = NetAddress_clone((LDKNetAddress*)(((uint64_t)arr_elem) & ~1));
ret->data[i] = arr_elem_conv;
}
}
return ret;
}
-uint32_t __attribute__((visibility("default"))) TS_LDKC2Tuple_PaymentHashPaymentSecretZ_new(int8_tArray a, int8_tArray b) {
- LDKC2Tuple_PaymentHashPaymentSecretZ* ret = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ");
- LDKThirtyTwoBytes a_ref;
- CHECK(*((uint32_t*)a) == 32);
- memcpy(a_ref.data, (uint8_t*)(a + 4), 32);
- ret->a = a_ref;
- LDKThirtyTwoBytes b_ref;
- CHECK(*((uint32_t*)b) == 32);
- memcpy(b_ref.data, (uint8_t*)(b + 4), 32);
- ret->b = b_ref;
- return (uint64_t)ret;
-}
static inline struct LDKThirtyTwoBytes C2Tuple_PaymentHashPaymentSecretZ_get_a(LDKC2Tuple_PaymentHashPaymentSecretZ *NONNULL_PTR tuple){
return ThirtyTwoBytes_clone(&tuple->a);
}
monitor_ref |= 1;
}
uint32_t ret = js_invoke_function_2(j_calls->watch_channel_meth, funding_txo_ref, monitor_ref);
- LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr);
ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone((LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)ret) & ~1));
return ret_conv;
}
update_ref |= 1;
}
uint32_t ret = js_invoke_function_2(j_calls->update_channel_meth, funding_txo_ref, update_ref);
- LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr);
ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone((LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)ret) & ~1));
return ret_conv;
}
uint32_t* ret_vals = (uint32_t*)(ret + 4);
for (size_t o = 0; o < ret_constr.datalen; o++) {
uint32_t ret_conv_14 = ret_vals[o];
- LDKMonitorEvent ret_conv_14_conv = *(LDKMonitorEvent*)(((uint64_t)ret_conv_14) & ~1);
+ void* ret_conv_14_ptr = (void*)(((uint64_t)ret_conv_14) & ~1);
+ CHECK_ACCESS(ret_conv_14_ptr);
+ LDKMonitorEvent ret_conv_14_conv = *(LDKMonitorEvent*)(ret_conv_14_ptr);
ret_conv_14_conv = MonitorEvent_clone((LDKMonitorEvent*)(((uint64_t)ret_conv_14) & ~1));
ret_constr.data[o] = ret_conv_14_conv;
}
return (long)res_ptr;
}
uint32_t __attribute__((visibility("default"))) TS_Watch_watch_channel(uint32_t this_arg, uint32_t funding_txo, uint32_t monitor) {
- LDKWatch* this_arg_conv = (LDKWatch*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKWatch* this_arg_conv = (LDKWatch*)this_arg_ptr;
LDKOutPoint funding_txo_conv;
funding_txo_conv.inner = (void*)(funding_txo & (~1));
funding_txo_conv.is_owned = (funding_txo & 1) || (funding_txo == 0);
}
uint32_t __attribute__((visibility("default"))) TS_Watch_update_channel(uint32_t this_arg, uint32_t funding_txo, uint32_t update) {
- LDKWatch* this_arg_conv = (LDKWatch*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKWatch* this_arg_conv = (LDKWatch*)this_arg_ptr;
LDKOutPoint funding_txo_conv;
funding_txo_conv.inner = (void*)(funding_txo & (~1));
funding_txo_conv.is_owned = (funding_txo & 1) || (funding_txo == 0);
}
uint32_tArray __attribute__((visibility("default"))) TS_Watch_release_pending_monitor_events(uint32_t this_arg) {
- LDKWatch* this_arg_conv = (LDKWatch*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKWatch* this_arg_conv = (LDKWatch*)this_arg_ptr;
LDKCVec_MonitorEventZ ret_var = (this_arg_conv->release_pending_monitor_events)(this_arg_conv->this_arg);
uint32_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4);
for (size_t o = 0; o < ret_var.datalen; o++) {
LDKMonitorEvent *ret_conv_14_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
- *ret_conv_14_copy = MonitorEvent_clone(&ret_var.data[o]);
+ *ret_conv_14_copy = ret_var.data[o];
uint64_t ret_conv_14_ref = (uint64_t)ret_conv_14_copy;
ret_arr_ptr[o] = ret_conv_14_ref;
}
return (long)res_ptr;
}
void __attribute__((visibility("default"))) TS_BroadcasterInterface_broadcast_transaction(uint32_t this_arg, int8_tArray tx) {
- LDKBroadcasterInterface* this_arg_conv = (LDKBroadcasterInterface*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKBroadcasterInterface* this_arg_conv = (LDKBroadcasterInterface*)this_arg_ptr;
LDKTransaction tx_ref;
tx_ref.datalen = *((uint32_t*)tx);
tx_ref.data = MALLOC(tx_ref.datalen, "LDKTransaction Bytes");
LDKSign get_channel_signer_LDKKeysInterface_jcall(const void* this_arg, bool inbound, uint64_t channel_value_satoshis) {
LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
uint32_t ret = js_invoke_function_2(j_calls->get_channel_signer_meth, inbound, channel_value_satoshis);
- LDKSign ret_conv = *(LDKSign*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKSign ret_conv = *(LDKSign*)(ret_ptr);
ret_conv = Sign_clone(&ret_conv);
return ret_conv;
}
int8_tArray reader_arr = init_arr(reader_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(reader_arr + 4), reader_var.data, reader_var.datalen);
uint32_t ret = js_invoke_function_1(j_calls->read_chan_signer_meth, reader_arr);
- LDKCResult_SignDecodeErrorZ ret_conv = *(LDKCResult_SignDecodeErrorZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_SignDecodeErrorZ ret_conv = *(LDKCResult_SignDecodeErrorZ*)(ret_ptr);
ret_conv = CResult_SignDecodeErrorZ_clone((LDKCResult_SignDecodeErrorZ*)(((uint64_t)ret) & ~1));
return ret_conv;
}
memcpy((uint8_t*)(invoice_preimage_arr + 4), invoice_preimage_var.data, invoice_preimage_var.datalen);
CVec_u8Z_free(invoice_preimage_var);
uint32_t ret = js_invoke_function_1(j_calls->sign_invoice_meth, invoice_preimage_arr);
- LDKCResult_RecoverableSignatureNoneZ ret_conv = *(LDKCResult_RecoverableSignatureNoneZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_RecoverableSignatureNoneZ ret_conv = *(LDKCResult_RecoverableSignatureNoneZ*)(ret_ptr);
ret_conv = CResult_RecoverableSignatureNoneZ_clone((LDKCResult_RecoverableSignatureNoneZ*)(((uint64_t)ret) & ~1));
return ret_conv;
}
return (long)res_ptr;
}
int8_tArray __attribute__((visibility("default"))) TS_KeysInterface_get_node_secret(uint32_t this_arg) {
- LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(ret_arr + 4), (this_arg_conv->get_node_secret)(this_arg_conv->this_arg).bytes, 32);
return ret_arr;
}
int8_tArray __attribute__((visibility("default"))) TS_KeysInterface_get_destination_script(uint32_t this_arg) {
- LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
LDKCVec_u8Z ret_var = (this_arg_conv->get_destination_script)(this_arg_conv->this_arg);
int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
}
uint32_t __attribute__((visibility("default"))) TS_KeysInterface_get_shutdown_scriptpubkey(uint32_t this_arg) {
- LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
LDKShutdownScript ret_var = (this_arg_conv->get_shutdown_scriptpubkey)(this_arg_conv->this_arg);
CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
}
uint32_t __attribute__((visibility("default"))) TS_KeysInterface_get_channel_signer(uint32_t this_arg, jboolean inbound, int64_t channel_value_satoshis) {
- LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
LDKSign* ret_ret =MALLOC(sizeof(LDKSign), "LDKSign");
*ret_ret = (this_arg_conv->get_channel_signer)(this_arg_conv->this_arg, inbound, channel_value_satoshis);
return (uint64_t)ret_ret;
}
int8_tArray __attribute__((visibility("default"))) TS_KeysInterface_get_secure_random_bytes(uint32_t this_arg) {
- LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(ret_arr + 4), (this_arg_conv->get_secure_random_bytes)(this_arg_conv->this_arg).data, 32);
return ret_arr;
}
uint32_t __attribute__((visibility("default"))) TS_KeysInterface_read_chan_signer(uint32_t this_arg, int8_tArray reader) {
- LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
LDKu8slice reader_ref;
reader_ref.datalen = *((uint32_t*)reader);
reader_ref.data = (int8_t*)(reader + 4);
}
uint32_t __attribute__((visibility("default"))) TS_KeysInterface_sign_invoice(uint32_t this_arg, int8_tArray invoice_preimage) {
- LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
LDKCVec_u8Z invoice_preimage_ref;
invoice_preimage_ref.datalen = *((uint32_t*)invoice_preimage);
invoice_preimage_ref.data = MALLOC(invoice_preimage_ref.datalen, "LDKCVec_u8Z Bytes");
return (long)res_ptr;
}
int32_t __attribute__((visibility("default"))) TS_FeeEstimator_get_est_sat_per_1000_weight(uint32_t this_arg, uint32_t confirmation_target) {
- LDKFeeEstimator* this_arg_conv = (LDKFeeEstimator*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKFeeEstimator* this_arg_conv = (LDKFeeEstimator*)this_arg_ptr;
LDKConfirmationTarget confirmation_target_conv = LDKConfirmationTarget_from_js(confirmation_target);
int32_t ret_val = (this_arg_conv->get_est_sat_per_1000_weight)(this_arg_conv->this_arg, confirmation_target_conv);
return ret_val;
*res_ptr = LDKLogger_init(o);
return (long)res_ptr;
}
-uint32_t __attribute__((visibility("default"))) TS_LDKC2Tuple_BlockHashChannelManagerZ_new(int8_tArray a, uint32_t b) {
- LDKC2Tuple_BlockHashChannelManagerZ* ret = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelManagerZ), "LDKC2Tuple_BlockHashChannelManagerZ");
- LDKThirtyTwoBytes a_ref;
- CHECK(*((uint32_t*)a) == 32);
- memcpy(a_ref.data, (uint8_t*)(a + 4), 32);
- ret->a = a_ref;
- LDKChannelManager b_conv;
- b_conv.inner = (void*)(b & (~1));
- b_conv.is_owned = (b & 1) || (b == 0);
- // Warning: we need a move here but no clone is available for LDKChannelManager
- ret->b = b_conv;
- return (uint64_t)ret;
-}
static inline struct LDKThirtyTwoBytes C2Tuple_BlockHashChannelManagerZ_get_a(LDKC2Tuple_BlockHashChannelManagerZ *NONNULL_PTR tuple){
return ThirtyTwoBytes_clone(&tuple->a);
}
uint32_t __attribute__((visibility("default"))) TS_LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_ok(uint32_t arg) {
LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ *val = (LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)(arg & ~1);
CHECK(val->result_ok);
- LDKC2Tuple_BlockHashChannelManagerZ* res_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelManagerZ), "LDKC2Tuple_BlockHashChannelManagerZ");
- *res_conv = (*val->contents.result);
+ LDKC2Tuple_BlockHashChannelManagerZ* res_conv = &(*val->contents.result);
// Warning: we really need to clone here, but no clone is available for LDKC2Tuple_BlockHashChannelManagerZ
return ((uint64_t)res_conv) | 1;
}
return (long)res_ptr;
}
int16_t __attribute__((visibility("default"))) TS_Type_type_id(uint32_t this_arg) {
- LDKType* this_arg_conv = (LDKType*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKType* this_arg_conv = (LDKType*)this_arg_ptr;
int16_t ret_val = (this_arg_conv->type_id)(this_arg_conv->this_arg);
return ret_val;
}
jstring __attribute__((visibility("default"))) TS_Type_debug_str(uint32_t this_arg) {
- LDKType* this_arg_conv = (LDKType*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKType* this_arg_conv = (LDKType*)this_arg_ptr;
LDKStr ret_str = (this_arg_conv->debug_str)(this_arg_conv->this_arg);
jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
Str_free(ret_str);
}
int8_tArray __attribute__((visibility("default"))) TS_Type_write(uint32_t this_arg) {
- LDKType* this_arg_conv = (LDKType*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKType* this_arg_conv = (LDKType*)this_arg_ptr;
LDKCVec_u8Z ret_var = (this_arg_conv->write)(this_arg_conv->this_arg);
int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
CHECK(!val->result_ok);
return *val->contents.err;
}
-uint32_t __attribute__((visibility("default"))) TS_LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ_new(uint32_t a, int8_tArray b, uint32_t c) {
- LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* ret = MALLOC(sizeof(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ), "LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ");
- LDKRawInvoice a_conv;
- a_conv.inner = (void*)(a & (~1));
- a_conv.is_owned = (a & 1) || (a == 0);
- a_conv = RawInvoice_clone(&a_conv);
- ret->a = a_conv;
- LDKThirtyTwoBytes b_ref;
- CHECK(*((uint32_t*)b) == 32);
- memcpy(b_ref.data, (uint8_t*)(b + 4), 32);
- ret->b = b_ref;
- LDKInvoiceSignature c_conv;
- c_conv.inner = (void*)(c & (~1));
- c_conv.is_owned = (c & 1) || (c == 0);
- c_conv = InvoiceSignature_clone(&c_conv);
- ret->c = c_conv;
- return (uint64_t)ret;
-}
static inline struct LDKRawInvoice C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_a(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR tuple){
return RawInvoice_clone(&tuple->a);
}
uint64_t err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
-uint32_t __attribute__((visibility("default"))) TS_LDKC2Tuple_OutPointScriptZ_new(uint32_t a, int8_tArray b) {
- LDKC2Tuple_OutPointScriptZ* ret = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ");
- LDKOutPoint a_conv;
- a_conv.inner = (void*)(a & (~1));
- a_conv.is_owned = (a & 1) || (a == 0);
- a_conv = OutPoint_clone(&a_conv);
- ret->a = a_conv;
- LDKCVec_u8Z b_ref;
- b_ref.datalen = *((uint32_t*)b);
- b_ref.data = MALLOC(b_ref.datalen, "LDKCVec_u8Z Bytes");
- memcpy(b_ref.data, (uint8_t*)(b + 4), b_ref.datalen);
- ret->b = b_ref;
- return (uint64_t)ret;
-}
static inline struct LDKOutPoint C2Tuple_OutPointScriptZ_get_a(LDKC2Tuple_OutPointScriptZ *NONNULL_PTR tuple){
return OutPoint_clone(&tuple->a);
}
return ret_arr;
}
-uint32_t __attribute__((visibility("default"))) TS_LDKC2Tuple_u32ScriptZ_new(int32_t a, int8_tArray b) {
- LDKC2Tuple_u32ScriptZ* ret = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ), "LDKC2Tuple_u32ScriptZ");
- ret->a = a;
- LDKCVec_u8Z b_ref;
- b_ref.datalen = *((uint32_t*)b);
- b_ref.data = MALLOC(b_ref.datalen, "LDKCVec_u8Z Bytes");
- memcpy(b_ref.data, (uint8_t*)(b + 4), b_ref.datalen);
- ret->b = b_ref;
- return (uint64_t)ret;
-}
static inline uint32_t C2Tuple_u32ScriptZ_get_a(LDKC2Tuple_u32ScriptZ *NONNULL_PTR tuple){
return tuple->a;
}
uint32_t *java_elems = (uint32_t*)(elems + 4);
for (size_t i = 0; i < ret->datalen; i++) {
uint32_t arr_elem = java_elems[i];
- LDKC2Tuple_u32ScriptZ arr_elem_conv = *(LDKC2Tuple_u32ScriptZ*)(((uint64_t)arr_elem) & ~1);
+ void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1);
+ CHECK_ACCESS(arr_elem_ptr);
+ LDKC2Tuple_u32ScriptZ arr_elem_conv = *(LDKC2Tuple_u32ScriptZ*)(arr_elem_ptr);
arr_elem_conv = C2Tuple_u32ScriptZ_clone((LDKC2Tuple_u32ScriptZ*)(((uint64_t)arr_elem) & ~1));
ret->data[i] = arr_elem_conv;
}
}
return ret;
}
-uint32_t __attribute__((visibility("default"))) TS_LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new(int8_tArray a, uint32_tArray b) {
- LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* ret = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ");
- LDKThirtyTwoBytes a_ref;
- CHECK(*((uint32_t*)a) == 32);
- memcpy(a_ref.data, (uint8_t*)(a + 4), 32);
- ret->a = a_ref;
- LDKCVec_C2Tuple_u32ScriptZZ b_constr;
- b_constr.datalen = *((uint32_t*)b);
- if (b_constr.datalen > 0)
- b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKC2Tuple_u32ScriptZ), "LDKCVec_C2Tuple_u32ScriptZZ Elements");
- else
- b_constr.data = NULL;
- uint32_t* b_vals = (uint32_t*)(b + 4);
- for (size_t v = 0; v < b_constr.datalen; v++) {
- uint32_t b_conv_21 = b_vals[v];
- LDKC2Tuple_u32ScriptZ b_conv_21_conv = *(LDKC2Tuple_u32ScriptZ*)(((uint64_t)b_conv_21) & ~1);
- b_conv_21_conv = C2Tuple_u32ScriptZ_clone((LDKC2Tuple_u32ScriptZ*)(((uint64_t)b_conv_21) & ~1));
- b_constr.data[v] = b_conv_21_conv;
- }
- ret->b = b_constr;
- return (uint64_t)ret;
-}
static inline struct LDKThirtyTwoBytes C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_a(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *NONNULL_PTR tuple){
return ThirtyTwoBytes_clone(&tuple->a);
}
uint32_t *java_elems = (uint32_t*)(elems + 4);
for (size_t i = 0; i < ret->datalen; i++) {
uint32_t arr_elem = java_elems[i];
- LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ arr_elem_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(((uint64_t)arr_elem) & ~1);
+ void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1);
+ CHECK_ACCESS(arr_elem_ptr);
+ LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ arr_elem_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(arr_elem_ptr);
arr_elem_conv = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone((LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(((uint64_t)arr_elem) & ~1));
ret->data[i] = arr_elem_conv;
}
uint32_t *java_elems = (uint32_t*)(elems + 4);
for (size_t i = 0; i < ret->datalen; i++) {
uint32_t arr_elem = java_elems[i];
- LDKEvent arr_elem_conv = *(LDKEvent*)(((uint64_t)arr_elem) & ~1);
+ void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1);
+ CHECK_ACCESS(arr_elem_ptr);
+ LDKEvent arr_elem_conv = *(LDKEvent*)(arr_elem_ptr);
arr_elem_conv = Event_clone((LDKEvent*)(((uint64_t)arr_elem) & ~1));
ret->data[i] = arr_elem_conv;
}
}
return ret;
}
-uint32_t __attribute__((visibility("default"))) TS_LDKC2Tuple_u32TxOutZ_new(int32_t a, uint32_t b) {
- LDKC2Tuple_u32TxOutZ* ret = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ), "LDKC2Tuple_u32TxOutZ");
- ret->a = a;
- LDKTxOut b_conv = *(LDKTxOut*)(((uint64_t)b) & ~1);
- b_conv = TxOut_clone((LDKTxOut*)(((uint64_t)b) & ~1));
- ret->b = b_conv;
- return (uint64_t)ret;
-}
static inline uint32_t C2Tuple_u32TxOutZ_get_a(LDKC2Tuple_u32TxOutZ *NONNULL_PTR tuple){
return tuple->a;
}
uint32_t *java_elems = (uint32_t*)(elems + 4);
for (size_t i = 0; i < ret->datalen; i++) {
uint32_t arr_elem = java_elems[i];
- LDKC2Tuple_u32TxOutZ arr_elem_conv = *(LDKC2Tuple_u32TxOutZ*)(((uint64_t)arr_elem) & ~1);
+ void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1);
+ CHECK_ACCESS(arr_elem_ptr);
+ LDKC2Tuple_u32TxOutZ arr_elem_conv = *(LDKC2Tuple_u32TxOutZ*)(arr_elem_ptr);
arr_elem_conv = C2Tuple_u32TxOutZ_clone((LDKC2Tuple_u32TxOutZ*)(((uint64_t)arr_elem) & ~1));
ret->data[i] = arr_elem_conv;
}
}
return ret;
}
-uint32_t __attribute__((visibility("default"))) TS_LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(int8_tArray a, uint32_tArray b) {
- LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ");
- LDKThirtyTwoBytes a_ref;
- CHECK(*((uint32_t*)a) == 32);
- memcpy(a_ref.data, (uint8_t*)(a + 4), 32);
- ret->a = a_ref;
- LDKCVec_C2Tuple_u32TxOutZZ b_constr;
- b_constr.datalen = *((uint32_t*)b);
- if (b_constr.datalen > 0)
- b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKC2Tuple_u32TxOutZ), "LDKCVec_C2Tuple_u32TxOutZZ Elements");
- else
- b_constr.data = NULL;
- uint32_t* b_vals = (uint32_t*)(b + 4);
- for (size_t u = 0; u < b_constr.datalen; u++) {
- uint32_t b_conv_20 = b_vals[u];
- LDKC2Tuple_u32TxOutZ b_conv_20_conv = *(LDKC2Tuple_u32TxOutZ*)(((uint64_t)b_conv_20) & ~1);
- b_conv_20_conv = C2Tuple_u32TxOutZ_clone((LDKC2Tuple_u32TxOutZ*)(((uint64_t)b_conv_20) & ~1));
- b_constr.data[u] = b_conv_20_conv;
- }
- ret->b = b_constr;
- return (uint64_t)ret;
-}
static inline struct LDKThirtyTwoBytes C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_a(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR tuple){
return ThirtyTwoBytes_clone(&tuple->a);
}
uint32_t *java_elems = (uint32_t*)(elems + 4);
for (size_t i = 0; i < ret->datalen; i++) {
uint32_t arr_elem = java_elems[i];
- LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ arr_elem_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(((uint64_t)arr_elem) & ~1);
+ void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1);
+ CHECK_ACCESS(arr_elem_ptr);
+ LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ arr_elem_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(arr_elem_ptr);
arr_elem_conv = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone((LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(((uint64_t)arr_elem) & ~1));
ret->data[i] = arr_elem_conv;
}
uint32_t *java_elems = (uint32_t*)(elems + 4);
for (size_t i = 0; i < ret->datalen; i++) {
uint32_t arr_elem = java_elems[i];
- LDKBalance arr_elem_conv = *(LDKBalance*)(((uint64_t)arr_elem) & ~1);
+ void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1);
+ CHECK_ACCESS(arr_elem_ptr);
+ LDKBalance arr_elem_conv = *(LDKBalance*)(arr_elem_ptr);
arr_elem_conv = Balance_clone((LDKBalance*)(((uint64_t)arr_elem) & ~1));
ret->data[i] = arr_elem_conv;
}
uint64_t err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
-uint32_t __attribute__((visibility("default"))) TS_LDKC2Tuple_PublicKeyTypeZ_new(int8_tArray a, uint32_t b) {
- LDKC2Tuple_PublicKeyTypeZ* ret = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKC2Tuple_PublicKeyTypeZ");
- LDKPublicKey a_ref;
- CHECK(*((uint32_t*)a) == 33);
- memcpy(a_ref.compressed_form, (uint8_t*)(a + 4), 33);
- ret->a = a_ref;
- LDKType b_conv = *(LDKType*)(((uint64_t)b) & ~1);
- b_conv = Type_clone(&b_conv);
- ret->b = b_conv;
- return (uint64_t)ret;
-}
static inline struct LDKPublicKey C2Tuple_PublicKeyTypeZ_get_a(LDKC2Tuple_PublicKeyTypeZ *NONNULL_PTR tuple){
return tuple->a;
}
uint32_t *java_elems = (uint32_t*)(elems + 4);
for (size_t i = 0; i < ret->datalen; i++) {
uint32_t arr_elem = java_elems[i];
- LDKC2Tuple_PublicKeyTypeZ arr_elem_conv = *(LDKC2Tuple_PublicKeyTypeZ*)(((uint64_t)arr_elem) & ~1);
+ void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1);
+ CHECK_ACCESS(arr_elem_ptr);
+ LDKC2Tuple_PublicKeyTypeZ arr_elem_conv = *(LDKC2Tuple_PublicKeyTypeZ*)(arr_elem_ptr);
arr_elem_conv = C2Tuple_PublicKeyTypeZ_clone((LDKC2Tuple_PublicKeyTypeZ*)(((uint64_t)arr_elem) & ~1));
ret->data[i] = arr_elem_conv;
}
uint64_t err_ref = (uint64_t)err_var.inner & ~1;
return err_ref;
}
-uint32_t __attribute__((visibility("default"))) TS_LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(uint32_t a, uint32_t b, uint32_t c) {
- LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ");
- LDKChannelAnnouncement a_conv;
- a_conv.inner = (void*)(a & (~1));
- a_conv.is_owned = (a & 1) || (a == 0);
- a_conv = ChannelAnnouncement_clone(&a_conv);
- ret->a = a_conv;
- LDKChannelUpdate b_conv;
- b_conv.inner = (void*)(b & (~1));
- b_conv.is_owned = (b & 1) || (b == 0);
- b_conv = ChannelUpdate_clone(&b_conv);
- ret->b = b_conv;
- LDKChannelUpdate c_conv;
- c_conv.inner = (void*)(c & (~1));
- c_conv.is_owned = (c & 1) || (c == 0);
- c_conv = ChannelUpdate_clone(&c_conv);
- ret->c = c_conv;
- return (uint64_t)ret;
-}
static inline struct LDKChannelAnnouncement C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR tuple){
return ChannelAnnouncement_clone(&tuple->a);
}
uint32_t *java_elems = (uint32_t*)(elems + 4);
for (size_t i = 0; i < ret->datalen; i++) {
uint32_t arr_elem = java_elems[i];
- LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ arr_elem_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(((uint64_t)arr_elem) & ~1);
+ void* arr_elem_ptr = (void*)(((uint64_t)arr_elem) & ~1);
+ CHECK_ACCESS(arr_elem_ptr);
+ LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ arr_elem_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(arr_elem_ptr);
arr_elem_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone((LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(((uint64_t)arr_elem) & ~1));
ret->data[i] = arr_elem_conv;
}
int8_tArray genesis_hash_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(genesis_hash_arr + 4), *genesis_hash, 32);
uint32_t ret = js_invoke_function_2(j_calls->get_utxo_meth, genesis_hash_arr, short_channel_id);
- LDKCResult_TxOutAccessErrorZ ret_conv = *(LDKCResult_TxOutAccessErrorZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_TxOutAccessErrorZ ret_conv = *(LDKCResult_TxOutAccessErrorZ*)(ret_ptr);
ret_conv = CResult_TxOutAccessErrorZ_clone((LDKCResult_TxOutAccessErrorZ*)(((uint64_t)ret) & ~1));
return ret_conv;
}
return (long)res_ptr;
}
uint32_t __attribute__((visibility("default"))) TS_Access_get_utxo(uint32_t this_arg, int8_tArray genesis_hash, int64_t short_channel_id) {
- LDKAccess* this_arg_conv = (LDKAccess*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKAccess* this_arg_conv = (LDKAccess*)this_arg_ptr;
unsigned char genesis_hash_arr[32];
CHECK(*((uint32_t*)genesis_hash) == 32);
memcpy(genesis_hash_arr, (uint8_t*)(genesis_hash + 4), 32);
output_ref |= 1;
}
uint32_t ret = js_invoke_function_1(j_calls->register_output_meth, output_ref);
- LDKCOption_C2Tuple_usizeTransactionZZ ret_conv = *(LDKCOption_C2Tuple_usizeTransactionZZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCOption_C2Tuple_usizeTransactionZZ ret_conv = *(LDKCOption_C2Tuple_usizeTransactionZZ*)(ret_ptr);
ret_conv = COption_C2Tuple_usizeTransactionZZ_clone((LDKCOption_C2Tuple_usizeTransactionZZ*)(((uint64_t)ret) & ~1));
return ret_conv;
}
return (long)res_ptr;
}
void __attribute__((visibility("default"))) TS_Filter_register_tx(uint32_t this_arg, int8_tArray txid, int8_tArray script_pubkey) {
- LDKFilter* this_arg_conv = (LDKFilter*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKFilter* this_arg_conv = (LDKFilter*)this_arg_ptr;
unsigned char txid_arr[32];
CHECK(*((uint32_t*)txid) == 32);
memcpy(txid_arr, (uint8_t*)(txid + 4), 32);
}
uint32_t __attribute__((visibility("default"))) TS_Filter_register_output(uint32_t this_arg, uint32_t output) {
- LDKFilter* this_arg_conv = (LDKFilter*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKFilter* this_arg_conv = (LDKFilter*)this_arg_ptr;
LDKWatchedOutput output_conv;
output_conv.inner = (void*)(output & (~1));
output_conv.is_owned = (output & 1) || (output == 0);
uint32_t* ret_vals = (uint32_t*)(ret + 4);
for (size_t s = 0; s < ret_constr.datalen; s++) {
uint32_t ret_conv_18 = ret_vals[s];
- LDKMessageSendEvent ret_conv_18_conv = *(LDKMessageSendEvent*)(((uint64_t)ret_conv_18) & ~1);
+ void* ret_conv_18_ptr = (void*)(((uint64_t)ret_conv_18) & ~1);
+ CHECK_ACCESS(ret_conv_18_ptr);
+ LDKMessageSendEvent ret_conv_18_conv = *(LDKMessageSendEvent*)(ret_conv_18_ptr);
ret_conv_18_conv = MessageSendEvent_clone((LDKMessageSendEvent*)(((uint64_t)ret_conv_18) & ~1));
ret_constr.data[s] = ret_conv_18_conv;
}
return (long)res_ptr;
}
uint32_tArray __attribute__((visibility("default"))) TS_MessageSendEventsProvider_get_and_clear_pending_msg_events(uint32_t this_arg) {
- LDKMessageSendEventsProvider* this_arg_conv = (LDKMessageSendEventsProvider*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKMessageSendEventsProvider* this_arg_conv = (LDKMessageSendEventsProvider*)this_arg_ptr;
LDKCVec_MessageSendEventZ ret_var = (this_arg_conv->get_and_clear_pending_msg_events)(this_arg_conv->this_arg);
uint32_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4);
for (size_t s = 0; s < ret_var.datalen; s++) {
LDKMessageSendEvent *ret_conv_18_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
- *ret_conv_18_copy = MessageSendEvent_clone(&ret_var.data[s]);
+ *ret_conv_18_copy = ret_var.data[s];
uint64_t ret_conv_18_ref = (uint64_t)ret_conv_18_copy;
ret_arr_ptr[s] = ret_conv_18_ref;
}
return (long)res_ptr;
}
void __attribute__((visibility("default"))) TS_EventHandler_handle_event(uint32_t this_arg, uint32_t event) {
- LDKEventHandler* this_arg_conv = (LDKEventHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKEventHandler* this_arg_conv = (LDKEventHandler*)this_arg_ptr;
LDKEvent* event_conv = (LDKEvent*)event;
(this_arg_conv->handle_event)(this_arg_conv->this_arg, event_conv);
}
return (long)res_ptr;
}
void __attribute__((visibility("default"))) TS_EventsProvider_process_pending_events(uint32_t this_arg, uint32_t handler) {
- LDKEventsProvider* this_arg_conv = (LDKEventsProvider*)(((uint64_t)this_arg) & ~1);
- LDKEventHandler handler_conv = *(LDKEventHandler*)(((uint64_t)handler) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKEventsProvider* this_arg_conv = (LDKEventsProvider*)this_arg_ptr;
+ void* handler_ptr = (void*)(((uint64_t)handler) & ~1);
+ CHECK_ACCESS(handler_ptr);
+ LDKEventHandler handler_conv = *(LDKEventHandler*)(handler_ptr);
(this_arg_conv->process_pending_events)(this_arg_conv->this_arg, handler_conv);
}
return (long)res_ptr;
}
void __attribute__((visibility("default"))) TS_Listen_block_connected(uint32_t this_arg, int8_tArray block, int32_t height) {
- LDKListen* this_arg_conv = (LDKListen*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKListen* this_arg_conv = (LDKListen*)this_arg_ptr;
LDKu8slice block_ref;
block_ref.datalen = *((uint32_t*)block);
block_ref.data = (int8_t*)(block + 4);
}
void __attribute__((visibility("default"))) TS_Listen_block_disconnected(uint32_t this_arg, int8_tArray header, int32_t height) {
- LDKListen* this_arg_conv = (LDKListen*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKListen* this_arg_conv = (LDKListen*)this_arg_ptr;
unsigned char header_arr[80];
CHECK(*((uint32_t*)header) == 80);
memcpy(header_arr, (uint8_t*)(header + 4), 80);
return (long)res_ptr;
}
void __attribute__((visibility("default"))) TS_Confirm_transactions_confirmed(uint32_t this_arg, int8_tArray header, uint32_tArray txdata, int32_t height) {
- LDKConfirm* this_arg_conv = (LDKConfirm*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKConfirm* this_arg_conv = (LDKConfirm*)this_arg_ptr;
unsigned char header_arr[80];
CHECK(*((uint32_t*)header) == 80);
memcpy(header_arr, (uint8_t*)(header + 4), 80);
uint32_t* txdata_vals = (uint32_t*)(txdata + 4);
for (size_t c = 0; c < txdata_constr.datalen; c++) {
uint32_t txdata_conv_28 = txdata_vals[c];
- LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(((uint64_t)txdata_conv_28) & ~1);
+ void* txdata_conv_28_ptr = (void*)(((uint64_t)txdata_conv_28) & ~1);
+ CHECK_ACCESS(txdata_conv_28_ptr);
+ LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(txdata_conv_28_ptr);
txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)(((uint64_t)txdata_conv_28) & ~1));
txdata_constr.data[c] = txdata_conv_28_conv;
}
}
void __attribute__((visibility("default"))) TS_Confirm_transaction_unconfirmed(uint32_t this_arg, int8_tArray txid) {
- LDKConfirm* this_arg_conv = (LDKConfirm*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKConfirm* this_arg_conv = (LDKConfirm*)this_arg_ptr;
unsigned char txid_arr[32];
CHECK(*((uint32_t*)txid) == 32);
memcpy(txid_arr, (uint8_t*)(txid + 4), 32);
}
void __attribute__((visibility("default"))) TS_Confirm_best_block_updated(uint32_t this_arg, int8_tArray header, int32_t height) {
- LDKConfirm* this_arg_conv = (LDKConfirm*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKConfirm* this_arg_conv = (LDKConfirm*)this_arg_ptr;
unsigned char header_arr[80];
CHECK(*((uint32_t*)header) == 80);
memcpy(header_arr, (uint8_t*)(header + 4), 80);
}
ptrArray __attribute__((visibility("default"))) TS_Confirm_get_relevant_txids(uint32_t this_arg) {
- LDKConfirm* this_arg_conv = (LDKConfirm*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKConfirm* this_arg_conv = (LDKConfirm*)this_arg_ptr;
LDKCVec_TxidZ ret_var = (this_arg_conv->get_relevant_txids)(this_arg_conv->this_arg);
ptrArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native ptrArray Bytes");
int8_tArray *ret_arr_ptr = (int8_tArray*)(ret_arr + 4);
data_ref |= 1;
}
uint32_t ret = js_invoke_function_2(j_calls->persist_new_channel_meth, id_ref, data_ref);
- LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr);
ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone((LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)ret) & ~1));
return ret_conv;
}
data_ref |= 1;
}
uint32_t ret = js_invoke_function_3(j_calls->update_persisted_channel_meth, id_ref, update_ref, data_ref);
- LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr);
ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone((LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)ret) & ~1));
return ret_conv;
}
return (long)res_ptr;
}
uint32_t __attribute__((visibility("default"))) TS_Persist_persist_new_channel(uint32_t this_arg, uint32_t id, uint32_t data) {
- LDKPersist* this_arg_conv = (LDKPersist*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKPersist* this_arg_conv = (LDKPersist*)this_arg_ptr;
LDKOutPoint id_conv;
id_conv.inner = (void*)(id & (~1));
id_conv.is_owned = (id & 1) || (id == 0);
}
uint32_t __attribute__((visibility("default"))) TS_Persist_update_persisted_channel(uint32_t this_arg, uint32_t id, uint32_t update, uint32_t data) {
- LDKPersist* this_arg_conv = (LDKPersist*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKPersist* this_arg_conv = (LDKPersist*)this_arg_ptr;
LDKOutPoint id_conv;
id_conv.inner = (void*)(id & (~1));
id_conv.is_owned = (id & 1) || (id == 0);
return (long)res_ptr;
}
void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_open_channel(uint32_t this_arg, int8_tArray their_node_id, uint32_t their_features, uint32_t msg) {
- LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK(*((uint32_t*)their_node_id) == 33);
memcpy(their_node_id_ref.compressed_form, (uint8_t*)(their_node_id + 4), 33);
}
void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_accept_channel(uint32_t this_arg, int8_tArray their_node_id, uint32_t their_features, uint32_t msg) {
- LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK(*((uint32_t*)their_node_id) == 33);
memcpy(their_node_id_ref.compressed_form, (uint8_t*)(their_node_id + 4), 33);
}
void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_funding_created(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) {
- LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK(*((uint32_t*)their_node_id) == 33);
memcpy(their_node_id_ref.compressed_form, (uint8_t*)(their_node_id + 4), 33);
}
void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_funding_signed(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) {
- LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK(*((uint32_t*)their_node_id) == 33);
memcpy(their_node_id_ref.compressed_form, (uint8_t*)(their_node_id + 4), 33);
}
void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_funding_locked(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) {
- LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK(*((uint32_t*)their_node_id) == 33);
memcpy(their_node_id_ref.compressed_form, (uint8_t*)(their_node_id + 4), 33);
}
void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_shutdown(uint32_t this_arg, int8_tArray their_node_id, uint32_t their_features, uint32_t msg) {
- LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK(*((uint32_t*)their_node_id) == 33);
memcpy(their_node_id_ref.compressed_form, (uint8_t*)(their_node_id + 4), 33);
}
void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_closing_signed(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) {
- LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK(*((uint32_t*)their_node_id) == 33);
memcpy(their_node_id_ref.compressed_form, (uint8_t*)(their_node_id + 4), 33);
}
void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_update_add_htlc(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) {
- LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK(*((uint32_t*)their_node_id) == 33);
memcpy(their_node_id_ref.compressed_form, (uint8_t*)(their_node_id + 4), 33);
}
void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_update_fulfill_htlc(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) {
- LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK(*((uint32_t*)their_node_id) == 33);
memcpy(their_node_id_ref.compressed_form, (uint8_t*)(their_node_id + 4), 33);
}
void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_update_fail_htlc(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) {
- LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK(*((uint32_t*)their_node_id) == 33);
memcpy(their_node_id_ref.compressed_form, (uint8_t*)(their_node_id + 4), 33);
}
void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_update_fail_malformed_htlc(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) {
- LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK(*((uint32_t*)their_node_id) == 33);
memcpy(their_node_id_ref.compressed_form, (uint8_t*)(their_node_id + 4), 33);
}
void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_commitment_signed(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) {
- LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK(*((uint32_t*)their_node_id) == 33);
memcpy(their_node_id_ref.compressed_form, (uint8_t*)(their_node_id + 4), 33);
}
void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_revoke_and_ack(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) {
- LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK(*((uint32_t*)their_node_id) == 33);
memcpy(their_node_id_ref.compressed_form, (uint8_t*)(their_node_id + 4), 33);
}
void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_update_fee(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) {
- LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK(*((uint32_t*)their_node_id) == 33);
memcpy(their_node_id_ref.compressed_form, (uint8_t*)(their_node_id + 4), 33);
}
void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_announcement_signatures(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) {
- LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK(*((uint32_t*)their_node_id) == 33);
memcpy(their_node_id_ref.compressed_form, (uint8_t*)(their_node_id + 4), 33);
}
void __attribute__((visibility("default"))) TS_ChannelMessageHandler_peer_disconnected(uint32_t this_arg, int8_tArray their_node_id, jboolean no_connection_possible) {
- LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK(*((uint32_t*)their_node_id) == 33);
memcpy(their_node_id_ref.compressed_form, (uint8_t*)(their_node_id + 4), 33);
}
void __attribute__((visibility("default"))) TS_ChannelMessageHandler_peer_connected(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) {
- LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK(*((uint32_t*)their_node_id) == 33);
memcpy(their_node_id_ref.compressed_form, (uint8_t*)(their_node_id + 4), 33);
}
void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_channel_reestablish(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) {
- LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK(*((uint32_t*)their_node_id) == 33);
memcpy(their_node_id_ref.compressed_form, (uint8_t*)(their_node_id + 4), 33);
}
void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_channel_update(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) {
- LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK(*((uint32_t*)their_node_id) == 33);
memcpy(their_node_id_ref.compressed_form, (uint8_t*)(their_node_id + 4), 33);
}
void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_error(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) {
- LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK(*((uint32_t*)their_node_id) == 33);
memcpy(their_node_id_ref.compressed_form, (uint8_t*)(their_node_id + 4), 33);
msg_ref |= 1;
}
uint32_t ret = js_invoke_function_1(j_calls->handle_node_announcement_meth, msg_ref);
- LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(ret_ptr);
ret_conv = CResult_boolLightningErrorZ_clone((LDKCResult_boolLightningErrorZ*)(((uint64_t)ret) & ~1));
return ret_conv;
}
msg_ref |= 1;
}
uint32_t ret = js_invoke_function_1(j_calls->handle_channel_announcement_meth, msg_ref);
- LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(ret_ptr);
ret_conv = CResult_boolLightningErrorZ_clone((LDKCResult_boolLightningErrorZ*)(((uint64_t)ret) & ~1));
return ret_conv;
}
msg_ref |= 1;
}
uint32_t ret = js_invoke_function_1(j_calls->handle_channel_update_meth, msg_ref);
- LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(ret_ptr);
ret_conv = CResult_boolLightningErrorZ_clone((LDKCResult_boolLightningErrorZ*)(((uint64_t)ret) & ~1));
return ret_conv;
}
uint32_t* ret_vals = (uint32_t*)(ret + 4);
for (size_t h = 0; h < ret_constr.datalen; h++) {
uint32_t ret_conv_59 = ret_vals[h];
- LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ ret_conv_59_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(((uint64_t)ret_conv_59) & ~1);
+ void* ret_conv_59_ptr = (void*)(((uint64_t)ret_conv_59) & ~1);
+ CHECK_ACCESS(ret_conv_59_ptr);
+ LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ ret_conv_59_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(ret_conv_59_ptr);
ret_conv_59_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone((LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(((uint64_t)ret_conv_59) & ~1));
ret_constr.data[h] = ret_conv_59_conv;
}
msg_ref |= 1;
}
uint32_t ret = js_invoke_function_2(j_calls->handle_reply_channel_range_meth, their_node_id_arr, msg_ref);
- LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr);
ret_conv = CResult_NoneLightningErrorZ_clone((LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1));
return ret_conv;
}
msg_ref |= 1;
}
uint32_t ret = js_invoke_function_2(j_calls->handle_reply_short_channel_ids_end_meth, their_node_id_arr, msg_ref);
- LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr);
ret_conv = CResult_NoneLightningErrorZ_clone((LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1));
return ret_conv;
}
msg_ref |= 1;
}
uint32_t ret = js_invoke_function_2(j_calls->handle_query_channel_range_meth, their_node_id_arr, msg_ref);
- LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr);
ret_conv = CResult_NoneLightningErrorZ_clone((LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1));
return ret_conv;
}
msg_ref |= 1;
}
uint32_t ret = js_invoke_function_2(j_calls->handle_query_short_channel_ids_meth, their_node_id_arr, msg_ref);
- LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr);
ret_conv = CResult_NoneLightningErrorZ_clone((LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1));
return ret_conv;
}
return (long)res_ptr;
}
uint32_t __attribute__((visibility("default"))) TS_RoutingMessageHandler_handle_node_announcement(uint32_t this_arg, uint32_t msg) {
- LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
LDKNodeAnnouncement msg_conv;
msg_conv.inner = (void*)(msg & (~1));
msg_conv.is_owned = false;
}
uint32_t __attribute__((visibility("default"))) TS_RoutingMessageHandler_handle_channel_announcement(uint32_t this_arg, uint32_t msg) {
- LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
LDKChannelAnnouncement msg_conv;
msg_conv.inner = (void*)(msg & (~1));
msg_conv.is_owned = false;
}
uint32_t __attribute__((visibility("default"))) TS_RoutingMessageHandler_handle_channel_update(uint32_t this_arg, uint32_t msg) {
- LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
LDKChannelUpdate msg_conv;
msg_conv.inner = (void*)(msg & (~1));
msg_conv.is_owned = false;
}
uint32_tArray __attribute__((visibility("default"))) TS_RoutingMessageHandler_get_next_channel_announcements(uint32_t this_arg, int64_t starting_point, int8_t batch_amount) {
- LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ ret_var = (this_arg_conv->get_next_channel_announcements)(this_arg_conv->this_arg, starting_point, batch_amount);
uint32_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4);
}
uint32_tArray __attribute__((visibility("default"))) TS_RoutingMessageHandler_get_next_node_announcements(uint32_t this_arg, int8_tArray starting_point, int8_t batch_amount) {
- LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
LDKPublicKey starting_point_ref;
CHECK(*((uint32_t*)starting_point) == 33);
memcpy(starting_point_ref.compressed_form, (uint8_t*)(starting_point + 4), 33);
}
void __attribute__((visibility("default"))) TS_RoutingMessageHandler_sync_routing_table(uint32_t this_arg, int8_tArray their_node_id, uint32_t init) {
- LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK(*((uint32_t*)their_node_id) == 33);
memcpy(their_node_id_ref.compressed_form, (uint8_t*)(their_node_id + 4), 33);
}
uint32_t __attribute__((visibility("default"))) TS_RoutingMessageHandler_handle_reply_channel_range(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) {
- LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK(*((uint32_t*)their_node_id) == 33);
memcpy(their_node_id_ref.compressed_form, (uint8_t*)(their_node_id + 4), 33);
}
uint32_t __attribute__((visibility("default"))) TS_RoutingMessageHandler_handle_reply_short_channel_ids_end(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) {
- LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK(*((uint32_t*)their_node_id) == 33);
memcpy(their_node_id_ref.compressed_form, (uint8_t*)(their_node_id + 4), 33);
}
uint32_t __attribute__((visibility("default"))) TS_RoutingMessageHandler_handle_query_channel_range(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) {
- LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK(*((uint32_t*)their_node_id) == 33);
memcpy(their_node_id_ref.compressed_form, (uint8_t*)(their_node_id + 4), 33);
}
uint32_t __attribute__((visibility("default"))) TS_RoutingMessageHandler_handle_query_short_channel_ids(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) {
- LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
LDKPublicKey their_node_id_ref;
CHECK(*((uint32_t*)their_node_id) == 33);
memcpy(their_node_id_ref.compressed_form, (uint8_t*)(their_node_id + 4), 33);
int8_tArray buffer_arr = init_arr(buffer_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(buffer_arr + 4), buffer_var.data, buffer_var.datalen);
uint32_t ret = js_invoke_function_2(j_calls->read_meth, message_type, buffer_arr);
- LDKCResult_COption_TypeZDecodeErrorZ ret_conv = *(LDKCResult_COption_TypeZDecodeErrorZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_COption_TypeZDecodeErrorZ ret_conv = *(LDKCResult_COption_TypeZDecodeErrorZ*)(ret_ptr);
ret_conv = CResult_COption_TypeZDecodeErrorZ_clone((LDKCResult_COption_TypeZDecodeErrorZ*)(((uint64_t)ret) & ~1));
return ret_conv;
}
return (long)res_ptr;
}
uint32_t __attribute__((visibility("default"))) TS_CustomMessageReader_read(uint32_t this_arg, int16_t message_type, int8_tArray buffer) {
- LDKCustomMessageReader* this_arg_conv = (LDKCustomMessageReader*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKCustomMessageReader* this_arg_conv = (LDKCustomMessageReader*)this_arg_ptr;
LDKu8slice buffer_ref;
buffer_ref.datalen = *((uint32_t*)buffer);
buffer_ref.data = (int8_t*)(buffer + 4);
int8_tArray sender_node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(sender_node_id_arr + 4), sender_node_id.compressed_form, 33);
uint32_t ret = js_invoke_function_2(j_calls->handle_custom_message_meth, (uint64_t)msg_ret, sender_node_id_arr);
- LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr);
ret_conv = CResult_NoneLightningErrorZ_clone((LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1));
return ret_conv;
}
uint32_t* ret_vals = (uint32_t*)(ret + 4);
for (size_t z = 0; z < ret_constr.datalen; z++) {
uint32_t ret_conv_25 = ret_vals[z];
- LDKC2Tuple_PublicKeyTypeZ ret_conv_25_conv = *(LDKC2Tuple_PublicKeyTypeZ*)(((uint64_t)ret_conv_25) & ~1);
+ void* ret_conv_25_ptr = (void*)(((uint64_t)ret_conv_25) & ~1);
+ CHECK_ACCESS(ret_conv_25_ptr);
+ LDKC2Tuple_PublicKeyTypeZ ret_conv_25_conv = *(LDKC2Tuple_PublicKeyTypeZ*)(ret_conv_25_ptr);
ret_conv_25_conv = C2Tuple_PublicKeyTypeZ_clone((LDKC2Tuple_PublicKeyTypeZ*)(((uint64_t)ret_conv_25) & ~1));
ret_constr.data[z] = ret_conv_25_conv;
}
return (long)res_ptr;
}
uint32_t __attribute__((visibility("default"))) TS_CustomMessageHandler_handle_custom_message(uint32_t this_arg, uint32_t msg, int8_tArray sender_node_id) {
- LDKCustomMessageHandler* this_arg_conv = (LDKCustomMessageHandler*)(((uint64_t)this_arg) & ~1);
- LDKType msg_conv = *(LDKType*)(((uint64_t)msg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKCustomMessageHandler* this_arg_conv = (LDKCustomMessageHandler*)this_arg_ptr;
+ void* msg_ptr = (void*)(((uint64_t)msg) & ~1);
+ CHECK_ACCESS(msg_ptr);
+ LDKType msg_conv = *(LDKType*)(msg_ptr);
LDKPublicKey sender_node_id_ref;
CHECK(*((uint32_t*)sender_node_id) == 33);
memcpy(sender_node_id_ref.compressed_form, (uint8_t*)(sender_node_id + 4), 33);
}
uint32_tArray __attribute__((visibility("default"))) TS_CustomMessageHandler_get_and_clear_pending_msg(uint32_t this_arg) {
- LDKCustomMessageHandler* this_arg_conv = (LDKCustomMessageHandler*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKCustomMessageHandler* this_arg_conv = (LDKCustomMessageHandler*)this_arg_ptr;
LDKCVec_C2Tuple_PublicKeyTypeZZ ret_var = (this_arg_conv->get_and_clear_pending_msg)(this_arg_conv->this_arg);
uint32_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4);
return (long)res_ptr;
}
int64_t __attribute__((visibility("default"))) TS_SocketDescriptor_send_data(uint32_t this_arg, int8_tArray data, jboolean resume_read) {
- LDKSocketDescriptor* this_arg_conv = (LDKSocketDescriptor*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKSocketDescriptor* this_arg_conv = (LDKSocketDescriptor*)this_arg_ptr;
LDKu8slice data_ref;
data_ref.datalen = *((uint32_t*)data);
data_ref.data = (int8_t*)(data + 4);
}
void __attribute__((visibility("default"))) TS_SocketDescriptor_disconnect_socket(uint32_t this_arg) {
- LDKSocketDescriptor* this_arg_conv = (LDKSocketDescriptor*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKSocketDescriptor* this_arg_conv = (LDKSocketDescriptor*)this_arg_ptr;
(this_arg_conv->disconnect_socket)(this_arg_conv->this_arg);
}
int64_t __attribute__((visibility("default"))) TS_SocketDescriptor_hash(uint32_t this_arg) {
- LDKSocketDescriptor* this_arg_conv = (LDKSocketDescriptor*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKSocketDescriptor* this_arg_conv = (LDKSocketDescriptor*)this_arg_ptr;
int64_t ret_val = (this_arg_conv->hash)(this_arg_conv->this_arg);
return ret_val;
}
return (long)res_ptr;
}
int64_t __attribute__((visibility("default"))) TS_Score_channel_penalty_msat(uint32_t this_arg, int64_t short_channel_id) {
- LDKScore* this_arg_conv = (LDKScore*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr;
int64_t ret_val = (this_arg_conv->channel_penalty_msat)(this_arg_conv->this_arg, short_channel_id);
return ret_val;
}
channel_manager_ref |= 1;
}
uint32_t ret = js_invoke_function_1(j_calls->persist_manager_meth, channel_manager_ref);
- LDKCResult_NoneErrorZ ret_conv = *(LDKCResult_NoneErrorZ*)(((uint64_t)ret) & ~1);
+ void* ret_ptr = (void*)(((uint64_t)ret) & ~1);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_NoneErrorZ ret_conv = *(LDKCResult_NoneErrorZ*)(ret_ptr);
ret_conv = CResult_NoneErrorZ_clone((LDKCResult_NoneErrorZ*)(((uint64_t)ret) & ~1));
return ret_conv;
}
return (long)res_ptr;
}
uint32_t __attribute__((visibility("default"))) TS_ChannelManagerPersister_persist_manager(uint32_t this_arg, uint32_t channel_manager) {
- LDKChannelManagerPersister* this_arg_conv = (LDKChannelManagerPersister*)(((uint64_t)this_arg) & ~1);
+ void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1);
+ if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKChannelManagerPersister* this_arg_conv = (LDKChannelManagerPersister*)this_arg_ptr;
LDKChannelManager channel_manager_conv;
channel_manager_conv.inner = (void*)(channel_manager & (~1));
channel_manager_conv.is_owned = false;
void __attribute__((visibility("default"))) TS_TxOut_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKTxOut _res_conv = *(LDKTxOut*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKTxOut _res_conv = *(LDKTxOut*)(_res_ptr);
FREE((void*)_res);
TxOut_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_SecretKeyErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_SecretKeyErrorZ _res_conv = *(LDKCResult_SecretKeyErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_SecretKeyErrorZ _res_conv = *(LDKCResult_SecretKeyErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_SecretKeyErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_PublicKeyErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_PublicKeyErrorZ _res_conv = *(LDKCResult_PublicKeyErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_PublicKeyErrorZ _res_conv = *(LDKCResult_PublicKeyErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_PublicKeyErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_TxCreationKeysDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_TxCreationKeysDecodeErrorZ _res_conv = *(LDKCResult_TxCreationKeysDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_TxCreationKeysDecodeErrorZ _res_conv = *(LDKCResult_TxCreationKeysDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_TxCreationKeysDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_ChannelPublicKeysDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_ChannelPublicKeysDecodeErrorZ _res_conv = *(LDKCResult_ChannelPublicKeysDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_ChannelPublicKeysDecodeErrorZ _res_conv = *(LDKCResult_ChannelPublicKeysDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_ChannelPublicKeysDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_TxCreationKeysErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_TxCreationKeysErrorZ _res_conv = *(LDKCResult_TxCreationKeysErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_TxCreationKeysErrorZ _res_conv = *(LDKCResult_TxCreationKeysErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_TxCreationKeysErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_COption_u32Z_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCOption_u32Z _res_conv = *(LDKCOption_u32Z*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCOption_u32Z _res_conv = *(LDKCOption_u32Z*)(_res_ptr);
FREE((void*)_res);
COption_u32Z_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_HTLCOutputInCommitmentDecodeErrorZ _res_conv = *(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_HTLCOutputInCommitmentDecodeErrorZ _res_conv = *(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_HTLCOutputInCommitmentDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ _res_conv = *(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ _res_conv = *(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_ChannelTransactionParametersDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_ChannelTransactionParametersDecodeErrorZ _res_conv = *(LDKCResult_ChannelTransactionParametersDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_ChannelTransactionParametersDecodeErrorZ _res_conv = *(LDKCResult_ChannelTransactionParametersDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_ChannelTransactionParametersDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_HolderCommitmentTransactionDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_HolderCommitmentTransactionDecodeErrorZ _res_conv = *(LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_HolderCommitmentTransactionDecodeErrorZ _res_conv = *(LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_HolderCommitmentTransactionDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_BuiltCommitmentTransactionDecodeErrorZ _res_conv = *(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_BuiltCommitmentTransactionDecodeErrorZ _res_conv = *(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_BuiltCommitmentTransactionDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_TrustedClosingTransactionNoneZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_TrustedClosingTransactionNoneZ _res_conv = *(LDKCResult_TrustedClosingTransactionNoneZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_TrustedClosingTransactionNoneZ _res_conv = *(LDKCResult_TrustedClosingTransactionNoneZ*)(_res_ptr);
FREE((void*)_res);
CResult_TrustedClosingTransactionNoneZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_CommitmentTransactionDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_CommitmentTransactionDecodeErrorZ _res_conv = *(LDKCResult_CommitmentTransactionDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_CommitmentTransactionDecodeErrorZ _res_conv = *(LDKCResult_CommitmentTransactionDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_CommitmentTransactionDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_TrustedCommitmentTransactionNoneZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_TrustedCommitmentTransactionNoneZ _res_conv = *(LDKCResult_TrustedCommitmentTransactionNoneZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_TrustedCommitmentTransactionNoneZ _res_conv = *(LDKCResult_TrustedCommitmentTransactionNoneZ*)(_res_ptr);
FREE((void*)_res);
CResult_TrustedCommitmentTransactionNoneZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_CVec_SignatureZNoneZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_CVec_SignatureZNoneZ _res_conv = *(LDKCResult_CVec_SignatureZNoneZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_CVec_SignatureZNoneZ _res_conv = *(LDKCResult_CVec_SignatureZNoneZ*)(_res_ptr);
FREE((void*)_res);
CResult_CVec_SignatureZNoneZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_ShutdownScriptDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_ShutdownScriptDecodeErrorZ _res_conv = *(LDKCResult_ShutdownScriptDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_ShutdownScriptDecodeErrorZ _res_conv = *(LDKCResult_ShutdownScriptDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_ShutdownScriptDecodeErrorZ_free(_res_conv);
}
LDKInvalidShutdownScript e_conv;
e_conv.inner = (void*)(e & (~1));
e_conv.is_owned = (e & 1) || (e == 0);
- // Warning: we need a move here but no clone is available for LDKInvalidShutdownScript
+ e_conv = InvalidShutdownScript_clone(&e_conv);
LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ");
*ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_err(e_conv);
return (uint64_t)ret_conv;
void __attribute__((visibility("default"))) TS_CResult_ShutdownScriptInvalidShutdownScriptZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_ShutdownScriptInvalidShutdownScriptZ _res_conv = *(LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_ShutdownScriptInvalidShutdownScriptZ _res_conv = *(LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)(_res_ptr);
FREE((void*)_res);
CResult_ShutdownScriptInvalidShutdownScriptZ_free(_res_conv);
}
+uint32_t __attribute__((visibility("default"))) TS_CResult_ShutdownScriptInvalidShutdownScriptZ_clone(uint32_t orig) {
+ LDKCResult_ShutdownScriptInvalidShutdownScriptZ* orig_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)(orig & ~1);
+ LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ");
+ *ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_clone(orig_conv);
+ return (uint64_t)ret_conv;
+}
+
uint32_t __attribute__((visibility("default"))) TS_CResult_NoneErrorZ_ok() {
LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ");
*ret_conv = CResult_NoneErrorZ_ok();
void __attribute__((visibility("default"))) TS_CResult_NoneErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_NoneErrorZ _res_conv = *(LDKCResult_NoneErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_NoneErrorZ _res_conv = *(LDKCResult_NoneErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_NoneErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_RouteHopDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_RouteHopDecodeErrorZ _res_conv = *(LDKCResult_RouteHopDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_RouteHopDecodeErrorZ _res_conv = *(LDKCResult_RouteHopDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_RouteHopDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_RouteDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_RouteDecodeErrorZ _res_conv = *(LDKCResult_RouteDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_RouteDecodeErrorZ _res_conv = *(LDKCResult_RouteDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_RouteDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_COption_u64Z_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCOption_u64Z _res_conv = *(LDKCOption_u64Z*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCOption_u64Z _res_conv = *(LDKCOption_u64Z*)(_res_ptr);
FREE((void*)_res);
COption_u64Z_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_RouteLightningErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_RouteLightningErrorZ _res_conv = *(LDKCResult_RouteLightningErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_RouteLightningErrorZ _res_conv = *(LDKCResult_RouteLightningErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_RouteLightningErrorZ_free(_res_conv);
}
}
uint32_t __attribute__((visibility("default"))) TS_CResult_TxOutAccessErrorZ_ok(uint32_t o) {
- LDKTxOut o_conv = *(LDKTxOut*)(((uint64_t)o) & ~1);
+ void* o_ptr = (void*)(((uint64_t)o) & ~1);
+ CHECK_ACCESS(o_ptr);
+ LDKTxOut o_conv = *(LDKTxOut*)(o_ptr);
o_conv = TxOut_clone((LDKTxOut*)(((uint64_t)o) & ~1));
LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ");
*ret_conv = CResult_TxOutAccessErrorZ_ok(o_conv);
void __attribute__((visibility("default"))) TS_CResult_TxOutAccessErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_TxOutAccessErrorZ _res_conv = *(LDKCResult_TxOutAccessErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_TxOutAccessErrorZ _res_conv = *(LDKCResult_TxOutAccessErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_TxOutAccessErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_C2Tuple_usizeTransactionZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKC2Tuple_usizeTransactionZ _res_conv = *(LDKC2Tuple_usizeTransactionZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKC2Tuple_usizeTransactionZ _res_conv = *(LDKC2Tuple_usizeTransactionZ*)(_res_ptr);
FREE((void*)_res);
C2Tuple_usizeTransactionZ_free(_res_conv);
}
uint32_t* _res_vals = (uint32_t*)(_res + 4);
for (size_t c = 0; c < _res_constr.datalen; c++) {
uint32_t _res_conv_28 = _res_vals[c];
- LDKC2Tuple_usizeTransactionZ _res_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(((uint64_t)_res_conv_28) & ~1);
+ void* _res_conv_28_ptr = (void*)(((uint64_t)_res_conv_28) & ~1);
+ CHECK_ACCESS(_res_conv_28_ptr);
+ LDKC2Tuple_usizeTransactionZ _res_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(_res_conv_28_ptr);
FREE((void*)_res_conv_28);
_res_constr.data[c] = _res_conv_28_conv;
}
void __attribute__((visibility("default"))) TS_CResult_NoneChannelMonitorUpdateErrZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_NoneChannelMonitorUpdateErrZ _res_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_NoneChannelMonitorUpdateErrZ _res_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(_res_ptr);
FREE((void*)_res);
CResult_NoneChannelMonitorUpdateErrZ_free(_res_conv);
}
uint32_t* _res_vals = (uint32_t*)(_res + 4);
for (size_t o = 0; o < _res_constr.datalen; o++) {
uint32_t _res_conv_14 = _res_vals[o];
- LDKMonitorEvent _res_conv_14_conv = *(LDKMonitorEvent*)(((uint64_t)_res_conv_14) & ~1);
+ void* _res_conv_14_ptr = (void*)(((uint64_t)_res_conv_14) & ~1);
+ CHECK_ACCESS(_res_conv_14_ptr);
+ LDKMonitorEvent _res_conv_14_conv = *(LDKMonitorEvent*)(_res_conv_14_ptr);
FREE((void*)_res_conv_14);
_res_constr.data[o] = _res_conv_14_conv;
}
}
uint32_t __attribute__((visibility("default"))) TS_COption_C2Tuple_usizeTransactionZZ_some(uint32_t o) {
- LDKC2Tuple_usizeTransactionZ o_conv = *(LDKC2Tuple_usizeTransactionZ*)(((uint64_t)o) & ~1);
+ void* o_ptr = (void*)(((uint64_t)o) & ~1);
+ CHECK_ACCESS(o_ptr);
+ LDKC2Tuple_usizeTransactionZ o_conv = *(LDKC2Tuple_usizeTransactionZ*)(o_ptr);
o_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)(((uint64_t)o) & ~1));
LDKCOption_C2Tuple_usizeTransactionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_usizeTransactionZZ), "LDKCOption_C2Tuple_usizeTransactionZZ");
*ret_copy = COption_C2Tuple_usizeTransactionZZ_some(o_conv);
void __attribute__((visibility("default"))) TS_COption_C2Tuple_usizeTransactionZZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCOption_C2Tuple_usizeTransactionZZ _res_conv = *(LDKCOption_C2Tuple_usizeTransactionZZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCOption_C2Tuple_usizeTransactionZZ _res_conv = *(LDKCOption_C2Tuple_usizeTransactionZZ*)(_res_ptr);
FREE((void*)_res);
COption_C2Tuple_usizeTransactionZZ_free(_res_conv);
}
}
uint32_t __attribute__((visibility("default"))) TS_COption_NetworkUpdateZ_some(uint32_t o) {
- LDKNetworkUpdate o_conv = *(LDKNetworkUpdate*)(((uint64_t)o) & ~1);
+ void* o_ptr = (void*)(((uint64_t)o) & ~1);
+ CHECK_ACCESS(o_ptr);
+ LDKNetworkUpdate o_conv = *(LDKNetworkUpdate*)(o_ptr);
o_conv = NetworkUpdate_clone((LDKNetworkUpdate*)(((uint64_t)o) & ~1));
LDKCOption_NetworkUpdateZ *ret_copy = MALLOC(sizeof(LDKCOption_NetworkUpdateZ), "LDKCOption_NetworkUpdateZ");
*ret_copy = COption_NetworkUpdateZ_some(o_conv);
void __attribute__((visibility("default"))) TS_COption_NetworkUpdateZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCOption_NetworkUpdateZ _res_conv = *(LDKCOption_NetworkUpdateZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCOption_NetworkUpdateZ _res_conv = *(LDKCOption_NetworkUpdateZ*)(_res_ptr);
FREE((void*)_res);
COption_NetworkUpdateZ_free(_res_conv);
}
uint32_t* _res_vals = (uint32_t*)(_res + 4);
for (size_t b = 0; b < _res_constr.datalen; b++) {
uint32_t _res_conv_27 = _res_vals[b];
- LDKSpendableOutputDescriptor _res_conv_27_conv = *(LDKSpendableOutputDescriptor*)(((uint64_t)_res_conv_27) & ~1);
+ void* _res_conv_27_ptr = (void*)(((uint64_t)_res_conv_27) & ~1);
+ CHECK_ACCESS(_res_conv_27_ptr);
+ LDKSpendableOutputDescriptor _res_conv_27_conv = *(LDKSpendableOutputDescriptor*)(_res_conv_27_ptr);
FREE((void*)_res_conv_27);
_res_constr.data[b] = _res_conv_27_conv;
}
uint32_t* _res_vals = (uint32_t*)(_res + 4);
for (size_t s = 0; s < _res_constr.datalen; s++) {
uint32_t _res_conv_18 = _res_vals[s];
- LDKMessageSendEvent _res_conv_18_conv = *(LDKMessageSendEvent*)(((uint64_t)_res_conv_18) & ~1);
+ void* _res_conv_18_ptr = (void*)(((uint64_t)_res_conv_18) & ~1);
+ CHECK_ACCESS(_res_conv_18_ptr);
+ LDKMessageSendEvent _res_conv_18_conv = *(LDKMessageSendEvent*)(_res_conv_18_ptr);
FREE((void*)_res_conv_18);
_res_constr.data[s] = _res_conv_18_conv;
}
void __attribute__((visibility("default"))) TS_CResult_InitFeaturesDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_InitFeaturesDecodeErrorZ _res_conv = *(LDKCResult_InitFeaturesDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_InitFeaturesDecodeErrorZ _res_conv = *(LDKCResult_InitFeaturesDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_InitFeaturesDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_NodeFeaturesDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_NodeFeaturesDecodeErrorZ _res_conv = *(LDKCResult_NodeFeaturesDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_NodeFeaturesDecodeErrorZ _res_conv = *(LDKCResult_NodeFeaturesDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_NodeFeaturesDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_ChannelFeaturesDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_ChannelFeaturesDecodeErrorZ _res_conv = *(LDKCResult_ChannelFeaturesDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_ChannelFeaturesDecodeErrorZ _res_conv = *(LDKCResult_ChannelFeaturesDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_ChannelFeaturesDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_InvoiceFeaturesDecodeErrorZ _res_conv = *(LDKCResult_InvoiceFeaturesDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_InvoiceFeaturesDecodeErrorZ _res_conv = *(LDKCResult_InvoiceFeaturesDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_InvoiceFeaturesDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ _res_conv = *(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ _res_conv = *(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ _res_conv = *(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ _res_conv = *(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free(_res_conv);
}
}
uint32_t __attribute__((visibility("default"))) TS_CResult_SpendableOutputDescriptorDecodeErrorZ_ok(uint32_t o) {
- LDKSpendableOutputDescriptor o_conv = *(LDKSpendableOutputDescriptor*)(((uint64_t)o) & ~1);
+ void* o_ptr = (void*)(((uint64_t)o) & ~1);
+ CHECK_ACCESS(o_ptr);
+ LDKSpendableOutputDescriptor o_conv = *(LDKSpendableOutputDescriptor*)(o_ptr);
o_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)(((uint64_t)o) & ~1));
LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ");
*ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_ok(o_conv);
void __attribute__((visibility("default"))) TS_CResult_SpendableOutputDescriptorDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_SpendableOutputDescriptorDecodeErrorZ _res_conv = *(LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_SpendableOutputDescriptorDecodeErrorZ _res_conv = *(LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_SpendableOutputDescriptorDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_NoneNoneZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_NoneNoneZ _res_conv = *(LDKCResult_NoneNoneZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_NoneNoneZ _res_conv = *(LDKCResult_NoneNoneZ*)(_res_ptr);
FREE((void*)_res);
CResult_NoneNoneZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_C2Tuple_SignatureCVec_SignatureZZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKC2Tuple_SignatureCVec_SignatureZZ _res_conv = *(LDKC2Tuple_SignatureCVec_SignatureZZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKC2Tuple_SignatureCVec_SignatureZZ _res_conv = *(LDKC2Tuple_SignatureCVec_SignatureZZ*)(_res_ptr);
FREE((void*)_res);
C2Tuple_SignatureCVec_SignatureZZ_free(_res_conv);
}
uint32_t __attribute__((visibility("default"))) TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(uint32_t o) {
- LDKC2Tuple_SignatureCVec_SignatureZZ o_conv = *(LDKC2Tuple_SignatureCVec_SignatureZZ*)(((uint64_t)o) & ~1);
+ void* o_ptr = (void*)(((uint64_t)o) & ~1);
+ CHECK_ACCESS(o_ptr);
+ LDKC2Tuple_SignatureCVec_SignatureZZ o_conv = *(LDKC2Tuple_SignatureCVec_SignatureZZ*)(o_ptr);
o_conv = C2Tuple_SignatureCVec_SignatureZZ_clone((LDKC2Tuple_SignatureCVec_SignatureZZ*)(((uint64_t)o) & ~1));
LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ");
*ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(o_conv);
void __attribute__((visibility("default"))) TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ _res_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ _res_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(_res_ptr);
FREE((void*)_res);
CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_SignatureNoneZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_SignatureNoneZ _res_conv = *(LDKCResult_SignatureNoneZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_SignatureNoneZ _res_conv = *(LDKCResult_SignatureNoneZ*)(_res_ptr);
FREE((void*)_res);
CResult_SignatureNoneZ_free(_res_conv);
}
}
uint32_t __attribute__((visibility("default"))) TS_CResult_SignDecodeErrorZ_ok(uint32_t o) {
- LDKSign o_conv = *(LDKSign*)(((uint64_t)o) & ~1);
+ void* o_ptr = (void*)(((uint64_t)o) & ~1);
+ CHECK_ACCESS(o_ptr);
+ LDKSign o_conv = *(LDKSign*)(o_ptr);
LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ");
*ret_conv = CResult_SignDecodeErrorZ_ok(o_conv);
return (uint64_t)ret_conv;
void __attribute__((visibility("default"))) TS_CResult_SignDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_SignDecodeErrorZ _res_conv = *(LDKCResult_SignDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_SignDecodeErrorZ _res_conv = *(LDKCResult_SignDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_SignDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_RecoverableSignatureNoneZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_RecoverableSignatureNoneZ _res_conv = *(LDKCResult_RecoverableSignatureNoneZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_RecoverableSignatureNoneZ _res_conv = *(LDKCResult_RecoverableSignatureNoneZ*)(_res_ptr);
FREE((void*)_res);
CResult_RecoverableSignatureNoneZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_CVec_CVec_u8ZZNoneZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_CVec_CVec_u8ZZNoneZ _res_conv = *(LDKCResult_CVec_CVec_u8ZZNoneZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_CVec_CVec_u8ZZNoneZ _res_conv = *(LDKCResult_CVec_CVec_u8ZZNoneZ*)(_res_ptr);
FREE((void*)_res);
CResult_CVec_CVec_u8ZZNoneZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_InMemorySignerDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_InMemorySignerDecodeErrorZ _res_conv = *(LDKCResult_InMemorySignerDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_InMemorySignerDecodeErrorZ _res_conv = *(LDKCResult_InMemorySignerDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_InMemorySignerDecodeErrorZ_free(_res_conv);
}
uint32_t* _res_vals = (uint32_t*)(_res + 4);
for (size_t h = 0; h < _res_constr.datalen; h++) {
uint32_t _res_conv_7 = _res_vals[h];
- LDKTxOut _res_conv_7_conv = *(LDKTxOut*)(((uint64_t)_res_conv_7) & ~1);
+ void* _res_conv_7_ptr = (void*)(((uint64_t)_res_conv_7) & ~1);
+ CHECK_ACCESS(_res_conv_7_ptr);
+ LDKTxOut _res_conv_7_conv = *(LDKTxOut*)(_res_conv_7_ptr);
FREE((void*)_res_conv_7);
_res_constr.data[h] = _res_conv_7_conv;
}
void __attribute__((visibility("default"))) TS_CResult_TransactionNoneZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_TransactionNoneZ _res_conv = *(LDKCResult_TransactionNoneZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_TransactionNoneZ _res_conv = *(LDKCResult_TransactionNoneZ*)(_res_ptr);
FREE((void*)_res);
CResult_TransactionNoneZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_C2Tuple_BlockHashChannelMonitorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKC2Tuple_BlockHashChannelMonitorZ _res_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKC2Tuple_BlockHashChannelMonitorZ _res_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(_res_ptr);
FREE((void*)_res);
C2Tuple_BlockHashChannelMonitorZ_free(_res_conv);
}
uint32_t* _res_vals = (uint32_t*)(_res + 4);
for (size_t j = 0; j < _res_constr.datalen; j++) {
uint32_t _res_conv_35 = _res_vals[j];
- LDKC2Tuple_BlockHashChannelMonitorZ _res_conv_35_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(((uint64_t)_res_conv_35) & ~1);
+ void* _res_conv_35_ptr = (void*)(((uint64_t)_res_conv_35) & ~1);
+ CHECK_ACCESS(_res_conv_35_ptr);
+ LDKC2Tuple_BlockHashChannelMonitorZ _res_conv_35_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(_res_conv_35_ptr);
FREE((void*)_res_conv_35);
_res_constr.data[j] = _res_conv_35_conv;
}
uint32_t* o_vals = (uint32_t*)(o + 4);
for (size_t j = 0; j < o_constr.datalen; j++) {
uint32_t o_conv_35 = o_vals[j];
- LDKC2Tuple_BlockHashChannelMonitorZ o_conv_35_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(((uint64_t)o_conv_35) & ~1);
+ void* o_conv_35_ptr = (void*)(((uint64_t)o_conv_35) & ~1);
+ CHECK_ACCESS(o_conv_35_ptr);
+ LDKC2Tuple_BlockHashChannelMonitorZ o_conv_35_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(o_conv_35_ptr);
o_conv_35_conv = C2Tuple_BlockHashChannelMonitorZ_clone((LDKC2Tuple_BlockHashChannelMonitorZ*)(((uint64_t)o_conv_35) & ~1));
o_constr.data[j] = o_conv_35_conv;
}
void __attribute__((visibility("default"))) TS_CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ _res_conv = *(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ _res_conv = *(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_PaymentIdDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_PaymentIdDecodeErrorZ _res_conv = *(LDKCResult_PaymentIdDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_PaymentIdDecodeErrorZ _res_conv = *(LDKCResult_PaymentIdDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_PaymentIdDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_COption_u16Z_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCOption_u16Z _res_conv = *(LDKCOption_u16Z*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCOption_u16Z _res_conv = *(LDKCOption_u16Z*)(_res_ptr);
FREE((void*)_res);
COption_u16Z_free(_res_conv);
}
}
uint32_t __attribute__((visibility("default"))) TS_CResult_NoneAPIErrorZ_err(uint32_t e) {
- LDKAPIError e_conv = *(LDKAPIError*)(((uint64_t)e) & ~1);
+ void* e_ptr = (void*)(((uint64_t)e) & ~1);
+ CHECK_ACCESS(e_ptr);
+ LDKAPIError e_conv = *(LDKAPIError*)(e_ptr);
e_conv = APIError_clone((LDKAPIError*)(((uint64_t)e) & ~1));
LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
*ret_conv = CResult_NoneAPIErrorZ_err(e_conv);
void __attribute__((visibility("default"))) TS_CResult_NoneAPIErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_NoneAPIErrorZ _res_conv = *(LDKCResult_NoneAPIErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_NoneAPIErrorZ _res_conv = *(LDKCResult_NoneAPIErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_NoneAPIErrorZ_free(_res_conv);
}
uint32_t* _res_vals = (uint32_t*)(_res + 4);
for (size_t w = 0; w < _res_constr.datalen; w++) {
uint32_t _res_conv_22 = _res_vals[w];
- LDKCResult_NoneAPIErrorZ _res_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(((uint64_t)_res_conv_22) & ~1);
+ void* _res_conv_22_ptr = (void*)(((uint64_t)_res_conv_22) & ~1);
+ CHECK_ACCESS(_res_conv_22_ptr);
+ LDKCResult_NoneAPIErrorZ _res_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(_res_conv_22_ptr);
FREE((void*)_res_conv_22);
_res_constr.data[w] = _res_conv_22_conv;
}
uint32_t* _res_vals = (uint32_t*)(_res + 4);
for (size_t k = 0; k < _res_constr.datalen; k++) {
uint32_t _res_conv_10 = _res_vals[k];
- LDKAPIError _res_conv_10_conv = *(LDKAPIError*)(((uint64_t)_res_conv_10) & ~1);
+ void* _res_conv_10_ptr = (void*)(((uint64_t)_res_conv_10) & ~1);
+ CHECK_ACCESS(_res_conv_10_ptr);
+ LDKAPIError _res_conv_10_conv = *(LDKAPIError*)(_res_conv_10_ptr);
FREE((void*)_res_conv_10);
_res_constr.data[k] = _res_conv_10_conv;
}
}
uint32_t __attribute__((visibility("default"))) TS_CResult__u832APIErrorZ_err(uint32_t e) {
- LDKAPIError e_conv = *(LDKAPIError*)(((uint64_t)e) & ~1);
+ void* e_ptr = (void*)(((uint64_t)e) & ~1);
+ CHECK_ACCESS(e_ptr);
+ LDKAPIError e_conv = *(LDKAPIError*)(e_ptr);
e_conv = APIError_clone((LDKAPIError*)(((uint64_t)e) & ~1));
LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ");
*ret_conv = CResult__u832APIErrorZ_err(e_conv);
void __attribute__((visibility("default"))) TS_CResult__u832APIErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult__u832APIErrorZ _res_conv = *(LDKCResult__u832APIErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult__u832APIErrorZ _res_conv = *(LDKCResult__u832APIErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult__u832APIErrorZ_free(_res_conv);
}
}
uint32_t __attribute__((visibility("default"))) TS_CResult_PaymentIdPaymentSendFailureZ_err(uint32_t e) {
- LDKPaymentSendFailure e_conv = *(LDKPaymentSendFailure*)(((uint64_t)e) & ~1);
+ void* e_ptr = (void*)(((uint64_t)e) & ~1);
+ CHECK_ACCESS(e_ptr);
+ LDKPaymentSendFailure e_conv = *(LDKPaymentSendFailure*)(e_ptr);
e_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)(((uint64_t)e) & ~1));
LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ");
*ret_conv = CResult_PaymentIdPaymentSendFailureZ_err(e_conv);
void __attribute__((visibility("default"))) TS_CResult_PaymentIdPaymentSendFailureZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_PaymentIdPaymentSendFailureZ _res_conv = *(LDKCResult_PaymentIdPaymentSendFailureZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_PaymentIdPaymentSendFailureZ _res_conv = *(LDKCResult_PaymentIdPaymentSendFailureZ*)(_res_ptr);
FREE((void*)_res);
CResult_PaymentIdPaymentSendFailureZ_free(_res_conv);
}
}
uint32_t __attribute__((visibility("default"))) TS_CResult_NonePaymentSendFailureZ_err(uint32_t e) {
- LDKPaymentSendFailure e_conv = *(LDKPaymentSendFailure*)(((uint64_t)e) & ~1);
+ void* e_ptr = (void*)(((uint64_t)e) & ~1);
+ CHECK_ACCESS(e_ptr);
+ LDKPaymentSendFailure e_conv = *(LDKPaymentSendFailure*)(e_ptr);
e_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)(((uint64_t)e) & ~1));
LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
*ret_conv = CResult_NonePaymentSendFailureZ_err(e_conv);
void __attribute__((visibility("default"))) TS_CResult_NonePaymentSendFailureZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_NonePaymentSendFailureZ _res_conv = *(LDKCResult_NonePaymentSendFailureZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_NonePaymentSendFailureZ _res_conv = *(LDKCResult_NonePaymentSendFailureZ*)(_res_ptr);
FREE((void*)_res);
CResult_NonePaymentSendFailureZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_C2Tuple_PaymentHashPaymentIdZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKC2Tuple_PaymentHashPaymentIdZ _res_conv = *(LDKC2Tuple_PaymentHashPaymentIdZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKC2Tuple_PaymentHashPaymentIdZ _res_conv = *(LDKC2Tuple_PaymentHashPaymentIdZ*)(_res_ptr);
FREE((void*)_res);
C2Tuple_PaymentHashPaymentIdZ_free(_res_conv);
}
uint32_t __attribute__((visibility("default"))) TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_ok(uint32_t o) {
- LDKC2Tuple_PaymentHashPaymentIdZ o_conv = *(LDKC2Tuple_PaymentHashPaymentIdZ*)(((uint64_t)o) & ~1);
+ void* o_ptr = (void*)(((uint64_t)o) & ~1);
+ CHECK_ACCESS(o_ptr);
+ LDKC2Tuple_PaymentHashPaymentIdZ o_conv = *(LDKC2Tuple_PaymentHashPaymentIdZ*)(o_ptr);
o_conv = C2Tuple_PaymentHashPaymentIdZ_clone((LDKC2Tuple_PaymentHashPaymentIdZ*)(((uint64_t)o) & ~1));
LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ");
*ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_ok(o_conv);
}
uint32_t __attribute__((visibility("default"))) TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_err(uint32_t e) {
- LDKPaymentSendFailure e_conv = *(LDKPaymentSendFailure*)(((uint64_t)e) & ~1);
+ void* e_ptr = (void*)(((uint64_t)e) & ~1);
+ CHECK_ACCESS(e_ptr);
+ LDKPaymentSendFailure e_conv = *(LDKPaymentSendFailure*)(e_ptr);
e_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)(((uint64_t)e) & ~1));
LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ");
*ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_err(e_conv);
void __attribute__((visibility("default"))) TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ _res_conv = *(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ _res_conv = *(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)(_res_ptr);
FREE((void*)_res);
CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_free(_res_conv);
}
uint32_t* _res_vals = (uint32_t*)(_res + 4);
for (size_t m = 0; m < _res_constr.datalen; m++) {
uint32_t _res_conv_12 = _res_vals[m];
- LDKNetAddress _res_conv_12_conv = *(LDKNetAddress*)(((uint64_t)_res_conv_12) & ~1);
+ void* _res_conv_12_ptr = (void*)(((uint64_t)_res_conv_12) & ~1);
+ CHECK_ACCESS(_res_conv_12_ptr);
+ LDKNetAddress _res_conv_12_conv = *(LDKNetAddress*)(_res_conv_12_ptr);
FREE((void*)_res_conv_12);
_res_constr.data[m] = _res_conv_12_conv;
}
void __attribute__((visibility("default"))) TS_C2Tuple_PaymentHashPaymentSecretZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKC2Tuple_PaymentHashPaymentSecretZ _res_conv = *(LDKC2Tuple_PaymentHashPaymentSecretZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKC2Tuple_PaymentHashPaymentSecretZ _res_conv = *(LDKC2Tuple_PaymentHashPaymentSecretZ*)(_res_ptr);
FREE((void*)_res);
C2Tuple_PaymentHashPaymentSecretZ_free(_res_conv);
}
}
uint32_t __attribute__((visibility("default"))) TS_CResult_PaymentSecretAPIErrorZ_err(uint32_t e) {
- LDKAPIError e_conv = *(LDKAPIError*)(((uint64_t)e) & ~1);
+ void* e_ptr = (void*)(((uint64_t)e) & ~1);
+ CHECK_ACCESS(e_ptr);
+ LDKAPIError e_conv = *(LDKAPIError*)(e_ptr);
e_conv = APIError_clone((LDKAPIError*)(((uint64_t)e) & ~1));
LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ");
*ret_conv = CResult_PaymentSecretAPIErrorZ_err(e_conv);
void __attribute__((visibility("default"))) TS_CResult_PaymentSecretAPIErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_PaymentSecretAPIErrorZ _res_conv = *(LDKCResult_PaymentSecretAPIErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_PaymentSecretAPIErrorZ _res_conv = *(LDKCResult_PaymentSecretAPIErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_PaymentSecretAPIErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_C2Tuple_BlockHashChannelManagerZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKC2Tuple_BlockHashChannelManagerZ _res_conv = *(LDKC2Tuple_BlockHashChannelManagerZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKC2Tuple_BlockHashChannelManagerZ _res_conv = *(LDKC2Tuple_BlockHashChannelManagerZ*)(_res_ptr);
FREE((void*)_res);
C2Tuple_BlockHashChannelManagerZ_free(_res_conv);
}
uint32_t __attribute__((visibility("default"))) TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(uint32_t o) {
- LDKC2Tuple_BlockHashChannelManagerZ o_conv = *(LDKC2Tuple_BlockHashChannelManagerZ*)(((uint64_t)o) & ~1);
+ void* o_ptr = (void*)(((uint64_t)o) & ~1);
+ CHECK_ACCESS(o_ptr);
+ LDKC2Tuple_BlockHashChannelManagerZ o_conv = *(LDKC2Tuple_BlockHashChannelManagerZ*)(o_ptr);
// Warning: we may need a move here but no clone is available for LDKC2Tuple_BlockHashChannelManagerZ
LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ");
*ret_conv = CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(o_conv);
void __attribute__((visibility("default"))) TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ _res_conv = *(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ _res_conv = *(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_ChannelConfigDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_ChannelConfigDecodeErrorZ _res_conv = *(LDKCResult_ChannelConfigDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_ChannelConfigDecodeErrorZ _res_conv = *(LDKCResult_ChannelConfigDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_ChannelConfigDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_OutPointDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_OutPointDecodeErrorZ _res_conv = *(LDKCResult_OutPointDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_OutPointDecodeErrorZ _res_conv = *(LDKCResult_OutPointDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_OutPointDecodeErrorZ_free(_res_conv);
}
}
uint32_t __attribute__((visibility("default"))) TS_COption_TypeZ_some(uint32_t o) {
- LDKType o_conv = *(LDKType*)(((uint64_t)o) & ~1);
+ void* o_ptr = (void*)(((uint64_t)o) & ~1);
+ CHECK_ACCESS(o_ptr);
+ LDKType o_conv = *(LDKType*)(o_ptr);
LDKCOption_TypeZ *ret_copy = MALLOC(sizeof(LDKCOption_TypeZ), "LDKCOption_TypeZ");
*ret_copy = COption_TypeZ_some(o_conv);
uint64_t ret_ref = (uint64_t)ret_copy;
void __attribute__((visibility("default"))) TS_COption_TypeZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCOption_TypeZ _res_conv = *(LDKCOption_TypeZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCOption_TypeZ _res_conv = *(LDKCOption_TypeZ*)(_res_ptr);
FREE((void*)_res);
COption_TypeZ_free(_res_conv);
}
}
uint32_t __attribute__((visibility("default"))) TS_CResult_COption_TypeZDecodeErrorZ_ok(uint32_t o) {
- LDKCOption_TypeZ o_conv = *(LDKCOption_TypeZ*)(((uint64_t)o) & ~1);
+ void* o_ptr = (void*)(((uint64_t)o) & ~1);
+ CHECK_ACCESS(o_ptr);
+ LDKCOption_TypeZ o_conv = *(LDKCOption_TypeZ*)(o_ptr);
o_conv = COption_TypeZ_clone((LDKCOption_TypeZ*)(((uint64_t)o) & ~1));
LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ");
*ret_conv = CResult_COption_TypeZDecodeErrorZ_ok(o_conv);
void __attribute__((visibility("default"))) TS_CResult_COption_TypeZDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_COption_TypeZDecodeErrorZ _res_conv = *(LDKCResult_COption_TypeZDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_COption_TypeZDecodeErrorZ _res_conv = *(LDKCResult_COption_TypeZDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_COption_TypeZDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_SiPrefixNoneZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_SiPrefixNoneZ _res_conv = *(LDKCResult_SiPrefixNoneZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_SiPrefixNoneZ _res_conv = *(LDKCResult_SiPrefixNoneZ*)(_res_ptr);
FREE((void*)_res);
CResult_SiPrefixNoneZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_InvoiceNoneZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_InvoiceNoneZ _res_conv = *(LDKCResult_InvoiceNoneZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_InvoiceNoneZ _res_conv = *(LDKCResult_InvoiceNoneZ*)(_res_ptr);
FREE((void*)_res);
CResult_InvoiceNoneZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_SignedRawInvoiceNoneZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_SignedRawInvoiceNoneZ _res_conv = *(LDKCResult_SignedRawInvoiceNoneZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_SignedRawInvoiceNoneZ _res_conv = *(LDKCResult_SignedRawInvoiceNoneZ*)(_res_ptr);
FREE((void*)_res);
CResult_SignedRawInvoiceNoneZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ _res_conv = *(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ _res_conv = *(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)(_res_ptr);
FREE((void*)_res);
C3Tuple_RawInvoice_u832InvoiceSignatureZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_PayeePubKeyErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_PayeePubKeyErrorZ _res_conv = *(LDKCResult_PayeePubKeyErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_PayeePubKeyErrorZ _res_conv = *(LDKCResult_PayeePubKeyErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_PayeePubKeyErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_PositiveTimestampCreationErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_PositiveTimestampCreationErrorZ _res_conv = *(LDKCResult_PositiveTimestampCreationErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_PositiveTimestampCreationErrorZ _res_conv = *(LDKCResult_PositiveTimestampCreationErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_PositiveTimestampCreationErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_NoneSemanticErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_NoneSemanticErrorZ _res_conv = *(LDKCResult_NoneSemanticErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_NoneSemanticErrorZ _res_conv = *(LDKCResult_NoneSemanticErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_NoneSemanticErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_InvoiceSemanticErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_InvoiceSemanticErrorZ _res_conv = *(LDKCResult_InvoiceSemanticErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_InvoiceSemanticErrorZ _res_conv = *(LDKCResult_InvoiceSemanticErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_InvoiceSemanticErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_DescriptionCreationErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_DescriptionCreationErrorZ _res_conv = *(LDKCResult_DescriptionCreationErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_DescriptionCreationErrorZ _res_conv = *(LDKCResult_DescriptionCreationErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_DescriptionCreationErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_ExpiryTimeCreationErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_ExpiryTimeCreationErrorZ _res_conv = *(LDKCResult_ExpiryTimeCreationErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_ExpiryTimeCreationErrorZ _res_conv = *(LDKCResult_ExpiryTimeCreationErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_ExpiryTimeCreationErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_PrivateRouteCreationErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_PrivateRouteCreationErrorZ _res_conv = *(LDKCResult_PrivateRouteCreationErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_PrivateRouteCreationErrorZ _res_conv = *(LDKCResult_PrivateRouteCreationErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_PrivateRouteCreationErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_StringErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_StringErrorZ _res_conv = *(LDKCResult_StringErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_StringErrorZ _res_conv = *(LDKCResult_StringErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_StringErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_ChannelMonitorUpdateDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_ChannelMonitorUpdateDecodeErrorZ _res_conv = *(LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_ChannelMonitorUpdateDecodeErrorZ _res_conv = *(LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_ChannelMonitorUpdateDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_HTLCUpdateDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_HTLCUpdateDecodeErrorZ _res_conv = *(LDKCResult_HTLCUpdateDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_HTLCUpdateDecodeErrorZ _res_conv = *(LDKCResult_HTLCUpdateDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_HTLCUpdateDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_NoneMonitorUpdateErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_NoneMonitorUpdateErrorZ _res_conv = *(LDKCResult_NoneMonitorUpdateErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_NoneMonitorUpdateErrorZ _res_conv = *(LDKCResult_NoneMonitorUpdateErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_NoneMonitorUpdateErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_C2Tuple_OutPointScriptZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKC2Tuple_OutPointScriptZ _res_conv = *(LDKC2Tuple_OutPointScriptZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKC2Tuple_OutPointScriptZ _res_conv = *(LDKC2Tuple_OutPointScriptZ*)(_res_ptr);
FREE((void*)_res);
C2Tuple_OutPointScriptZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_C2Tuple_u32ScriptZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKC2Tuple_u32ScriptZ _res_conv = *(LDKC2Tuple_u32ScriptZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKC2Tuple_u32ScriptZ _res_conv = *(LDKC2Tuple_u32ScriptZ*)(_res_ptr);
FREE((void*)_res);
C2Tuple_u32ScriptZ_free(_res_conv);
}
uint32_t* _res_vals = (uint32_t*)(_res + 4);
for (size_t v = 0; v < _res_constr.datalen; v++) {
uint32_t _res_conv_21 = _res_vals[v];
- LDKC2Tuple_u32ScriptZ _res_conv_21_conv = *(LDKC2Tuple_u32ScriptZ*)(((uint64_t)_res_conv_21) & ~1);
+ void* _res_conv_21_ptr = (void*)(((uint64_t)_res_conv_21) & ~1);
+ CHECK_ACCESS(_res_conv_21_ptr);
+ LDKC2Tuple_u32ScriptZ _res_conv_21_conv = *(LDKC2Tuple_u32ScriptZ*)(_res_conv_21_ptr);
FREE((void*)_res_conv_21);
_res_constr.data[v] = _res_conv_21_conv;
}
uint32_t* b_vals = (uint32_t*)(b + 4);
for (size_t v = 0; v < b_constr.datalen; v++) {
uint32_t b_conv_21 = b_vals[v];
- LDKC2Tuple_u32ScriptZ b_conv_21_conv = *(LDKC2Tuple_u32ScriptZ*)(((uint64_t)b_conv_21) & ~1);
+ void* b_conv_21_ptr = (void*)(((uint64_t)b_conv_21) & ~1);
+ CHECK_ACCESS(b_conv_21_ptr);
+ LDKC2Tuple_u32ScriptZ b_conv_21_conv = *(LDKC2Tuple_u32ScriptZ*)(b_conv_21_ptr);
b_conv_21_conv = C2Tuple_u32ScriptZ_clone((LDKC2Tuple_u32ScriptZ*)(((uint64_t)b_conv_21) & ~1));
b_constr.data[v] = b_conv_21_conv;
}
void __attribute__((visibility("default"))) TS_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ _res_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ _res_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(_res_ptr);
FREE((void*)_res);
C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_free(_res_conv);
}
uint32_t* _res_vals = (uint32_t*)(_res + 4);
for (size_t o = 0; o < _res_constr.datalen; o++) {
uint32_t _res_conv_40 = _res_vals[o];
- LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ _res_conv_40_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(((uint64_t)_res_conv_40) & ~1);
+ void* _res_conv_40_ptr = (void*)(((uint64_t)_res_conv_40) & ~1);
+ CHECK_ACCESS(_res_conv_40_ptr);
+ LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ _res_conv_40_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(_res_conv_40_ptr);
FREE((void*)_res_conv_40);
_res_constr.data[o] = _res_conv_40_conv;
}
uint32_t* _res_vals = (uint32_t*)(_res + 4);
for (size_t h = 0; h < _res_constr.datalen; h++) {
uint32_t _res_conv_7 = _res_vals[h];
- LDKEvent _res_conv_7_conv = *(LDKEvent*)(((uint64_t)_res_conv_7) & ~1);
+ void* _res_conv_7_ptr = (void*)(((uint64_t)_res_conv_7) & ~1);
+ CHECK_ACCESS(_res_conv_7_ptr);
+ LDKEvent _res_conv_7_conv = *(LDKEvent*)(_res_conv_7_ptr);
FREE((void*)_res_conv_7);
_res_constr.data[h] = _res_conv_7_conv;
}
}
uint32_t __attribute__((visibility("default"))) TS_C2Tuple_u32TxOutZ_new(int32_t a, uint32_t b) {
- LDKTxOut b_conv = *(LDKTxOut*)(((uint64_t)b) & ~1);
+ void* b_ptr = (void*)(((uint64_t)b) & ~1);
+ CHECK_ACCESS(b_ptr);
+ LDKTxOut b_conv = *(LDKTxOut*)(b_ptr);
b_conv = TxOut_clone((LDKTxOut*)(((uint64_t)b) & ~1));
LDKC2Tuple_u32TxOutZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ), "LDKC2Tuple_u32TxOutZ");
*ret_conv = C2Tuple_u32TxOutZ_new(a, b_conv);
void __attribute__((visibility("default"))) TS_C2Tuple_u32TxOutZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKC2Tuple_u32TxOutZ _res_conv = *(LDKC2Tuple_u32TxOutZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKC2Tuple_u32TxOutZ _res_conv = *(LDKC2Tuple_u32TxOutZ*)(_res_ptr);
FREE((void*)_res);
C2Tuple_u32TxOutZ_free(_res_conv);
}
uint32_t* _res_vals = (uint32_t*)(_res + 4);
for (size_t u = 0; u < _res_constr.datalen; u++) {
uint32_t _res_conv_20 = _res_vals[u];
- LDKC2Tuple_u32TxOutZ _res_conv_20_conv = *(LDKC2Tuple_u32TxOutZ*)(((uint64_t)_res_conv_20) & ~1);
+ void* _res_conv_20_ptr = (void*)(((uint64_t)_res_conv_20) & ~1);
+ CHECK_ACCESS(_res_conv_20_ptr);
+ LDKC2Tuple_u32TxOutZ _res_conv_20_conv = *(LDKC2Tuple_u32TxOutZ*)(_res_conv_20_ptr);
FREE((void*)_res_conv_20);
_res_constr.data[u] = _res_conv_20_conv;
}
uint32_t* b_vals = (uint32_t*)(b + 4);
for (size_t u = 0; u < b_constr.datalen; u++) {
uint32_t b_conv_20 = b_vals[u];
- LDKC2Tuple_u32TxOutZ b_conv_20_conv = *(LDKC2Tuple_u32TxOutZ*)(((uint64_t)b_conv_20) & ~1);
+ void* b_conv_20_ptr = (void*)(((uint64_t)b_conv_20) & ~1);
+ CHECK_ACCESS(b_conv_20_ptr);
+ LDKC2Tuple_u32TxOutZ b_conv_20_conv = *(LDKC2Tuple_u32TxOutZ*)(b_conv_20_ptr);
b_conv_20_conv = C2Tuple_u32TxOutZ_clone((LDKC2Tuple_u32TxOutZ*)(((uint64_t)b_conv_20) & ~1));
b_constr.data[u] = b_conv_20_conv;
}
void __attribute__((visibility("default"))) TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ _res_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ _res_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(_res_ptr);
FREE((void*)_res);
C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free(_res_conv);
}
uint32_t* _res_vals = (uint32_t*)(_res + 4);
for (size_t n = 0; n < _res_constr.datalen; n++) {
uint32_t _res_conv_39 = _res_vals[n];
- LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ _res_conv_39_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(((uint64_t)_res_conv_39) & ~1);
+ void* _res_conv_39_ptr = (void*)(((uint64_t)_res_conv_39) & ~1);
+ CHECK_ACCESS(_res_conv_39_ptr);
+ LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ _res_conv_39_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(_res_conv_39_ptr);
FREE((void*)_res_conv_39);
_res_constr.data[n] = _res_conv_39_conv;
}
uint32_t* _res_vals = (uint32_t*)(_res + 4);
for (size_t j = 0; j < _res_constr.datalen; j++) {
uint32_t _res_conv_9 = _res_vals[j];
- LDKBalance _res_conv_9_conv = *(LDKBalance*)(((uint64_t)_res_conv_9) & ~1);
+ void* _res_conv_9_ptr = (void*)(((uint64_t)_res_conv_9) & ~1);
+ CHECK_ACCESS(_res_conv_9_ptr);
+ LDKBalance _res_conv_9_conv = *(LDKBalance*)(_res_conv_9_ptr);
FREE((void*)_res_conv_9);
_res_constr.data[j] = _res_conv_9_conv;
}
}
uint32_t __attribute__((visibility("default"))) TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(uint32_t o) {
- LDKC2Tuple_BlockHashChannelMonitorZ o_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(((uint64_t)o) & ~1);
+ void* o_ptr = (void*)(((uint64_t)o) & ~1);
+ CHECK_ACCESS(o_ptr);
+ LDKC2Tuple_BlockHashChannelMonitorZ o_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(o_ptr);
o_conv = C2Tuple_BlockHashChannelMonitorZ_clone((LDKC2Tuple_BlockHashChannelMonitorZ*)(((uint64_t)o) & ~1));
LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ");
*ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(o_conv);
void __attribute__((visibility("default"))) TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ _res_conv = *(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ _res_conv = *(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_NoneLightningErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_NoneLightningErrorZ _res_conv = *(LDKCResult_NoneLightningErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_NoneLightningErrorZ _res_conv = *(LDKCResult_NoneLightningErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_NoneLightningErrorZ_free(_res_conv);
}
LDKPublicKey a_ref;
CHECK(*((uint32_t*)a) == 33);
memcpy(a_ref.compressed_form, (uint8_t*)(a + 4), 33);
- LDKType b_conv = *(LDKType*)(((uint64_t)b) & ~1);
+ void* b_ptr = (void*)(((uint64_t)b) & ~1);
+ CHECK_ACCESS(b_ptr);
+ LDKType b_conv = *(LDKType*)(b_ptr);
LDKC2Tuple_PublicKeyTypeZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKC2Tuple_PublicKeyTypeZ");
*ret_conv = C2Tuple_PublicKeyTypeZ_new(a_ref, b_conv);
return ((uint64_t)ret_conv);
void __attribute__((visibility("default"))) TS_C2Tuple_PublicKeyTypeZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKC2Tuple_PublicKeyTypeZ _res_conv = *(LDKC2Tuple_PublicKeyTypeZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKC2Tuple_PublicKeyTypeZ _res_conv = *(LDKC2Tuple_PublicKeyTypeZ*)(_res_ptr);
FREE((void*)_res);
C2Tuple_PublicKeyTypeZ_free(_res_conv);
}
uint32_t* _res_vals = (uint32_t*)(_res + 4);
for (size_t z = 0; z < _res_constr.datalen; z++) {
uint32_t _res_conv_25 = _res_vals[z];
- LDKC2Tuple_PublicKeyTypeZ _res_conv_25_conv = *(LDKC2Tuple_PublicKeyTypeZ*)(((uint64_t)_res_conv_25) & ~1);
+ void* _res_conv_25_ptr = (void*)(((uint64_t)_res_conv_25) & ~1);
+ CHECK_ACCESS(_res_conv_25_ptr);
+ LDKC2Tuple_PublicKeyTypeZ _res_conv_25_conv = *(LDKC2Tuple_PublicKeyTypeZ*)(_res_conv_25_ptr);
FREE((void*)_res_conv_25);
_res_constr.data[z] = _res_conv_25_conv;
}
void __attribute__((visibility("default"))) TS_CResult_boolLightningErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_boolLightningErrorZ _res_conv = *(LDKCResult_boolLightningErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_boolLightningErrorZ _res_conv = *(LDKCResult_boolLightningErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_boolLightningErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(_res_ptr);
FREE((void*)_res);
C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(_res_conv);
}
uint32_t* _res_vals = (uint32_t*)(_res + 4);
for (size_t h = 0; h < _res_constr.datalen; h++) {
uint32_t _res_conv_59 = _res_vals[h];
- LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res_conv_59_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(((uint64_t)_res_conv_59) & ~1);
+ void* _res_conv_59_ptr = (void*)(((uint64_t)_res_conv_59) & ~1);
+ CHECK_ACCESS(_res_conv_59_ptr);
+ LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res_conv_59_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(_res_conv_59_ptr);
FREE((void*)_res_conv_59);
_res_constr.data[h] = _res_conv_59_conv;
}
void __attribute__((visibility("default"))) TS_CResult_CVec_u8ZPeerHandleErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_CVec_u8ZPeerHandleErrorZ _res_conv = *(LDKCResult_CVec_u8ZPeerHandleErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_CVec_u8ZPeerHandleErrorZ _res_conv = *(LDKCResult_CVec_u8ZPeerHandleErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_CVec_u8ZPeerHandleErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_NonePeerHandleErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_NonePeerHandleErrorZ _res_conv = *(LDKCResult_NonePeerHandleErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_NonePeerHandleErrorZ _res_conv = *(LDKCResult_NonePeerHandleErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_NonePeerHandleErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_boolPeerHandleErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_boolPeerHandleErrorZ _res_conv = *(LDKCResult_boolPeerHandleErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_boolPeerHandleErrorZ _res_conv = *(LDKCResult_boolPeerHandleErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_boolPeerHandleErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_NodeIdDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_NodeIdDecodeErrorZ _res_conv = *(LDKCResult_NodeIdDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_NodeIdDecodeErrorZ _res_conv = *(LDKCResult_NodeIdDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_NodeIdDecodeErrorZ_free(_res_conv);
}
}
uint32_t __attribute__((visibility("default"))) TS_COption_AccessZ_some(uint32_t o) {
- LDKAccess o_conv = *(LDKAccess*)(((uint64_t)o) & ~1);
+ void* o_ptr = (void*)(((uint64_t)o) & ~1);
+ CHECK_ACCESS(o_ptr);
+ LDKAccess o_conv = *(LDKAccess*)(o_ptr);
LDKCOption_AccessZ *ret_copy = MALLOC(sizeof(LDKCOption_AccessZ), "LDKCOption_AccessZ");
*ret_copy = COption_AccessZ_some(o_conv);
uint64_t ret_ref = (uint64_t)ret_copy;
void __attribute__((visibility("default"))) TS_COption_AccessZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCOption_AccessZ _res_conv = *(LDKCOption_AccessZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCOption_AccessZ _res_conv = *(LDKCOption_AccessZ*)(_res_ptr);
FREE((void*)_res);
COption_AccessZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_DirectionalChannelInfoDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_DirectionalChannelInfoDecodeErrorZ _res_conv = *(LDKCResult_DirectionalChannelInfoDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_DirectionalChannelInfoDecodeErrorZ _res_conv = *(LDKCResult_DirectionalChannelInfoDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_DirectionalChannelInfoDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_ChannelInfoDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_ChannelInfoDecodeErrorZ _res_conv = *(LDKCResult_ChannelInfoDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_ChannelInfoDecodeErrorZ _res_conv = *(LDKCResult_ChannelInfoDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_ChannelInfoDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_RoutingFeesDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_RoutingFeesDecodeErrorZ _res_conv = *(LDKCResult_RoutingFeesDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_RoutingFeesDecodeErrorZ _res_conv = *(LDKCResult_RoutingFeesDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_RoutingFeesDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_NodeAnnouncementInfoDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_NodeAnnouncementInfoDecodeErrorZ _res_conv = *(LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_NodeAnnouncementInfoDecodeErrorZ _res_conv = *(LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_NodeAnnouncementInfoDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_NodeInfoDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_NodeInfoDecodeErrorZ _res_conv = *(LDKCResult_NodeInfoDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_NodeInfoDecodeErrorZ _res_conv = *(LDKCResult_NodeInfoDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_NodeInfoDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_NetworkGraphDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_NetworkGraphDecodeErrorZ _res_conv = *(LDKCResult_NetworkGraphDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_NetworkGraphDecodeErrorZ _res_conv = *(LDKCResult_NetworkGraphDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_NetworkGraphDecodeErrorZ_free(_res_conv);
}
uint32_t* o_vals = (uint32_t*)(o + 4);
for (size_t m = 0; m < o_constr.datalen; m++) {
uint32_t o_conv_12 = o_vals[m];
- LDKNetAddress o_conv_12_conv = *(LDKNetAddress*)(((uint64_t)o_conv_12) & ~1);
+ void* o_conv_12_ptr = (void*)(((uint64_t)o_conv_12) & ~1);
+ CHECK_ACCESS(o_conv_12_ptr);
+ LDKNetAddress o_conv_12_conv = *(LDKNetAddress*)(o_conv_12_ptr);
o_conv_12_conv = NetAddress_clone((LDKNetAddress*)(((uint64_t)o_conv_12) & ~1));
o_constr.data[m] = o_conv_12_conv;
}
void __attribute__((visibility("default"))) TS_COption_CVec_NetAddressZZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCOption_CVec_NetAddressZZ _res_conv = *(LDKCOption_CVec_NetAddressZZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCOption_CVec_NetAddressZZ _res_conv = *(LDKCOption_CVec_NetAddressZZ*)(_res_ptr);
FREE((void*)_res);
COption_CVec_NetAddressZZ_free(_res_conv);
}
}
uint32_t __attribute__((visibility("default"))) TS_CResult_NetAddressu8Z_ok(uint32_t o) {
- LDKNetAddress o_conv = *(LDKNetAddress*)(((uint64_t)o) & ~1);
+ void* o_ptr = (void*)(((uint64_t)o) & ~1);
+ CHECK_ACCESS(o_ptr);
+ LDKNetAddress o_conv = *(LDKNetAddress*)(o_ptr);
o_conv = NetAddress_clone((LDKNetAddress*)(((uint64_t)o) & ~1));
LDKCResult_NetAddressu8Z* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressu8Z), "LDKCResult_NetAddressu8Z");
*ret_conv = CResult_NetAddressu8Z_ok(o_conv);
void __attribute__((visibility("default"))) TS_CResult_NetAddressu8Z_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_NetAddressu8Z _res_conv = *(LDKCResult_NetAddressu8Z*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_NetAddressu8Z _res_conv = *(LDKCResult_NetAddressu8Z*)(_res_ptr);
FREE((void*)_res);
CResult_NetAddressu8Z_free(_res_conv);
}
}
uint32_t __attribute__((visibility("default"))) TS_CResult_CResult_NetAddressu8ZDecodeErrorZ_ok(uint32_t o) {
- LDKCResult_NetAddressu8Z o_conv = *(LDKCResult_NetAddressu8Z*)(((uint64_t)o) & ~1);
+ void* o_ptr = (void*)(((uint64_t)o) & ~1);
+ CHECK_ACCESS(o_ptr);
+ LDKCResult_NetAddressu8Z o_conv = *(LDKCResult_NetAddressu8Z*)(o_ptr);
o_conv = CResult_NetAddressu8Z_clone((LDKCResult_NetAddressu8Z*)(((uint64_t)o) & ~1));
LDKCResult_CResult_NetAddressu8ZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CResult_NetAddressu8ZDecodeErrorZ), "LDKCResult_CResult_NetAddressu8ZDecodeErrorZ");
*ret_conv = CResult_CResult_NetAddressu8ZDecodeErrorZ_ok(o_conv);
void __attribute__((visibility("default"))) TS_CResult_CResult_NetAddressu8ZDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_CResult_NetAddressu8ZDecodeErrorZ _res_conv = *(LDKCResult_CResult_NetAddressu8ZDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_CResult_NetAddressu8ZDecodeErrorZ _res_conv = *(LDKCResult_CResult_NetAddressu8ZDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_CResult_NetAddressu8ZDecodeErrorZ_free(_res_conv);
}
}
uint32_t __attribute__((visibility("default"))) TS_CResult_NetAddressDecodeErrorZ_ok(uint32_t o) {
- LDKNetAddress o_conv = *(LDKNetAddress*)(((uint64_t)o) & ~1);
+ void* o_ptr = (void*)(((uint64_t)o) & ~1);
+ CHECK_ACCESS(o_ptr);
+ LDKNetAddress o_conv = *(LDKNetAddress*)(o_ptr);
o_conv = NetAddress_clone((LDKNetAddress*)(((uint64_t)o) & ~1));
LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ");
*ret_conv = CResult_NetAddressDecodeErrorZ_ok(o_conv);
void __attribute__((visibility("default"))) TS_CResult_NetAddressDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_NetAddressDecodeErrorZ _res_conv = *(LDKCResult_NetAddressDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_NetAddressDecodeErrorZ _res_conv = *(LDKCResult_NetAddressDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_NetAddressDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_AcceptChannelDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_AcceptChannelDecodeErrorZ _res_conv = *(LDKCResult_AcceptChannelDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_AcceptChannelDecodeErrorZ _res_conv = *(LDKCResult_AcceptChannelDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_AcceptChannelDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_AnnouncementSignaturesDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_AnnouncementSignaturesDecodeErrorZ _res_conv = *(LDKCResult_AnnouncementSignaturesDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_AnnouncementSignaturesDecodeErrorZ _res_conv = *(LDKCResult_AnnouncementSignaturesDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_AnnouncementSignaturesDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_ChannelReestablishDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_ChannelReestablishDecodeErrorZ _res_conv = *(LDKCResult_ChannelReestablishDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_ChannelReestablishDecodeErrorZ _res_conv = *(LDKCResult_ChannelReestablishDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_ChannelReestablishDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_ClosingSignedDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_ClosingSignedDecodeErrorZ _res_conv = *(LDKCResult_ClosingSignedDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_ClosingSignedDecodeErrorZ _res_conv = *(LDKCResult_ClosingSignedDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_ClosingSignedDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_ClosingSignedFeeRangeDecodeErrorZ _res_conv = *(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_ClosingSignedFeeRangeDecodeErrorZ _res_conv = *(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_ClosingSignedFeeRangeDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_CommitmentSignedDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_CommitmentSignedDecodeErrorZ _res_conv = *(LDKCResult_CommitmentSignedDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_CommitmentSignedDecodeErrorZ _res_conv = *(LDKCResult_CommitmentSignedDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_CommitmentSignedDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_FundingCreatedDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_FundingCreatedDecodeErrorZ _res_conv = *(LDKCResult_FundingCreatedDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_FundingCreatedDecodeErrorZ _res_conv = *(LDKCResult_FundingCreatedDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_FundingCreatedDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_FundingSignedDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_FundingSignedDecodeErrorZ _res_conv = *(LDKCResult_FundingSignedDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_FundingSignedDecodeErrorZ _res_conv = *(LDKCResult_FundingSignedDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_FundingSignedDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_FundingLockedDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_FundingLockedDecodeErrorZ _res_conv = *(LDKCResult_FundingLockedDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_FundingLockedDecodeErrorZ _res_conv = *(LDKCResult_FundingLockedDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_FundingLockedDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_InitDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_InitDecodeErrorZ _res_conv = *(LDKCResult_InitDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_InitDecodeErrorZ _res_conv = *(LDKCResult_InitDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_InitDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_OpenChannelDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_OpenChannelDecodeErrorZ _res_conv = *(LDKCResult_OpenChannelDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_OpenChannelDecodeErrorZ _res_conv = *(LDKCResult_OpenChannelDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_OpenChannelDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_RevokeAndACKDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_RevokeAndACKDecodeErrorZ _res_conv = *(LDKCResult_RevokeAndACKDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_RevokeAndACKDecodeErrorZ _res_conv = *(LDKCResult_RevokeAndACKDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_RevokeAndACKDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_ShutdownDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_ShutdownDecodeErrorZ _res_conv = *(LDKCResult_ShutdownDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_ShutdownDecodeErrorZ _res_conv = *(LDKCResult_ShutdownDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_ShutdownDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_UpdateFailHTLCDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_UpdateFailHTLCDecodeErrorZ _res_conv = *(LDKCResult_UpdateFailHTLCDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_UpdateFailHTLCDecodeErrorZ _res_conv = *(LDKCResult_UpdateFailHTLCDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_UpdateFailHTLCDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ _res_conv = *(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ _res_conv = *(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_UpdateFeeDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_UpdateFeeDecodeErrorZ _res_conv = *(LDKCResult_UpdateFeeDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_UpdateFeeDecodeErrorZ _res_conv = *(LDKCResult_UpdateFeeDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_UpdateFeeDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_UpdateFulfillHTLCDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_UpdateFulfillHTLCDecodeErrorZ _res_conv = *(LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_UpdateFulfillHTLCDecodeErrorZ _res_conv = *(LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_UpdateFulfillHTLCDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_UpdateAddHTLCDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_UpdateAddHTLCDecodeErrorZ _res_conv = *(LDKCResult_UpdateAddHTLCDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_UpdateAddHTLCDecodeErrorZ _res_conv = *(LDKCResult_UpdateAddHTLCDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_UpdateAddHTLCDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_PingDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_PingDecodeErrorZ _res_conv = *(LDKCResult_PingDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_PingDecodeErrorZ _res_conv = *(LDKCResult_PingDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_PingDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_PongDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_PongDecodeErrorZ _res_conv = *(LDKCResult_PongDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_PongDecodeErrorZ _res_conv = *(LDKCResult_PongDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_PongDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ _res_conv = *(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ _res_conv = *(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_ChannelAnnouncementDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_ChannelAnnouncementDecodeErrorZ _res_conv = *(LDKCResult_ChannelAnnouncementDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_ChannelAnnouncementDecodeErrorZ _res_conv = *(LDKCResult_ChannelAnnouncementDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_ChannelAnnouncementDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_UnsignedChannelUpdateDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_UnsignedChannelUpdateDecodeErrorZ _res_conv = *(LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_UnsignedChannelUpdateDecodeErrorZ _res_conv = *(LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_UnsignedChannelUpdateDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_ChannelUpdateDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_ChannelUpdateDecodeErrorZ _res_conv = *(LDKCResult_ChannelUpdateDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_ChannelUpdateDecodeErrorZ _res_conv = *(LDKCResult_ChannelUpdateDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_ChannelUpdateDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_ErrorMessageDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_ErrorMessageDecodeErrorZ _res_conv = *(LDKCResult_ErrorMessageDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_ErrorMessageDecodeErrorZ _res_conv = *(LDKCResult_ErrorMessageDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_ErrorMessageDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ _res_conv = *(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ _res_conv = *(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_NodeAnnouncementDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_NodeAnnouncementDecodeErrorZ _res_conv = *(LDKCResult_NodeAnnouncementDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_NodeAnnouncementDecodeErrorZ _res_conv = *(LDKCResult_NodeAnnouncementDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_NodeAnnouncementDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_QueryShortChannelIdsDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_QueryShortChannelIdsDecodeErrorZ _res_conv = *(LDKCResult_QueryShortChannelIdsDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_QueryShortChannelIdsDecodeErrorZ _res_conv = *(LDKCResult_QueryShortChannelIdsDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_QueryShortChannelIdsDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ _res_conv = *(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ _res_conv = *(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_QueryChannelRangeDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_QueryChannelRangeDecodeErrorZ _res_conv = *(LDKCResult_QueryChannelRangeDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_QueryChannelRangeDecodeErrorZ _res_conv = *(LDKCResult_QueryChannelRangeDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_QueryChannelRangeDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_ReplyChannelRangeDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_ReplyChannelRangeDecodeErrorZ _res_conv = *(LDKCResult_ReplyChannelRangeDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_ReplyChannelRangeDecodeErrorZ _res_conv = *(LDKCResult_ReplyChannelRangeDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_ReplyChannelRangeDecodeErrorZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_GossipTimestampFilterDecodeErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_GossipTimestampFilterDecodeErrorZ _res_conv = *(LDKCResult_GossipTimestampFilterDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_GossipTimestampFilterDecodeErrorZ _res_conv = *(LDKCResult_GossipTimestampFilterDecodeErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_GossipTimestampFilterDecodeErrorZ_free(_res_conv);
}
}
uint32_t __attribute__((visibility("default"))) TS_CResult_InvoiceSignOrCreationErrorZ_err(uint32_t e) {
- LDKSignOrCreationError e_conv = *(LDKSignOrCreationError*)(((uint64_t)e) & ~1);
+ void* e_ptr = (void*)(((uint64_t)e) & ~1);
+ CHECK_ACCESS(e_ptr);
+ LDKSignOrCreationError e_conv = *(LDKSignOrCreationError*)(e_ptr);
e_conv = SignOrCreationError_clone((LDKSignOrCreationError*)(((uint64_t)e) & ~1));
LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
*ret_conv = CResult_InvoiceSignOrCreationErrorZ_err(e_conv);
void __attribute__((visibility("default"))) TS_CResult_InvoiceSignOrCreationErrorZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_InvoiceSignOrCreationErrorZ _res_conv = *(LDKCResult_InvoiceSignOrCreationErrorZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_InvoiceSignOrCreationErrorZ _res_conv = *(LDKCResult_InvoiceSignOrCreationErrorZ*)(_res_ptr);
FREE((void*)_res);
CResult_InvoiceSignOrCreationErrorZ_free(_res_conv);
}
}
uint32_t __attribute__((visibility("default"))) TS_COption_FilterZ_some(uint32_t o) {
- LDKFilter o_conv = *(LDKFilter*)(((uint64_t)o) & ~1);
+ void* o_ptr = (void*)(((uint64_t)o) & ~1);
+ CHECK_ACCESS(o_ptr);
+ LDKFilter o_conv = *(LDKFilter*)(o_ptr);
LDKCOption_FilterZ *ret_copy = MALLOC(sizeof(LDKCOption_FilterZ), "LDKCOption_FilterZ");
*ret_copy = COption_FilterZ_some(o_conv);
uint64_t ret_ref = (uint64_t)ret_copy;
void __attribute__((visibility("default"))) TS_COption_FilterZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCOption_FilterZ _res_conv = *(LDKCOption_FilterZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCOption_FilterZ _res_conv = *(LDKCOption_FilterZ*)(_res_ptr);
FREE((void*)_res);
COption_FilterZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_CResult_LockedChannelMonitorNoneZ_free(uint32_t _res) {
if ((_res & 1) != 0) return;
- LDKCResult_LockedChannelMonitorNoneZ _res_conv = *(LDKCResult_LockedChannelMonitorNoneZ*)(((uint64_t)_res) & ~1);
+ void* _res_ptr = (void*)(((uint64_t)_res) & ~1);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_LockedChannelMonitorNoneZ _res_conv = *(LDKCResult_LockedChannelMonitorNoneZ*)(_res_ptr);
FREE((void*)_res);
CResult_LockedChannelMonitorNoneZ_free(_res_conv);
}
void __attribute__((visibility("default"))) TS_PaymentPurpose_free(uint32_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKPaymentPurpose this_ptr_conv = *(LDKPaymentPurpose*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKPaymentPurpose this_ptr_conv = *(LDKPaymentPurpose*)(this_ptr_ptr);
FREE((void*)this_ptr);
PaymentPurpose_free(this_ptr_conv);
}
void __attribute__((visibility("default"))) TS_ClosureReason_free(uint32_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKClosureReason this_ptr_conv = *(LDKClosureReason*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKClosureReason this_ptr_conv = *(LDKClosureReason*)(this_ptr_ptr);
FREE((void*)this_ptr);
ClosureReason_free(this_ptr_conv);
}
void __attribute__((visibility("default"))) TS_Event_free(uint32_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKEvent this_ptr_conv = *(LDKEvent*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKEvent this_ptr_conv = *(LDKEvent*)(this_ptr_ptr);
FREE((void*)this_ptr);
Event_free(this_ptr_conv);
}
LDKThirtyTwoBytes payment_hash_ref;
CHECK(*((uint32_t*)payment_hash) == 32);
memcpy(payment_hash_ref.data, (uint8_t*)(payment_hash + 4), 32);
- LDKPaymentPurpose purpose_conv = *(LDKPaymentPurpose*)(((uint64_t)purpose) & ~1);
+ void* purpose_ptr = (void*)(((uint64_t)purpose) & ~1);
+ CHECK_ACCESS(purpose_ptr);
+ LDKPaymentPurpose purpose_conv = *(LDKPaymentPurpose*)(purpose_ptr);
purpose_conv = PaymentPurpose_clone((LDKPaymentPurpose*)(((uint64_t)purpose) & ~1));
LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
*ret_copy = Event_payment_received(payment_hash_ref, amt, purpose_conv);
LDKThirtyTwoBytes payment_hash_ref;
CHECK(*((uint32_t*)payment_hash) == 32);
memcpy(payment_hash_ref.data, (uint8_t*)(payment_hash + 4), 32);
- LDKCOption_NetworkUpdateZ network_update_conv = *(LDKCOption_NetworkUpdateZ*)(((uint64_t)network_update) & ~1);
+ void* network_update_ptr = (void*)(((uint64_t)network_update) & ~1);
+ CHECK_ACCESS(network_update_ptr);
+ LDKCOption_NetworkUpdateZ network_update_conv = *(LDKCOption_NetworkUpdateZ*)(network_update_ptr);
network_update_conv = COption_NetworkUpdateZ_clone((LDKCOption_NetworkUpdateZ*)(((uint64_t)network_update) & ~1));
LDKCVec_RouteHopZ path_constr;
path_constr.datalen = *((uint32_t*)path);
path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
path_constr.data[k] = path_conv_10_conv;
}
- LDKCOption_u64Z short_channel_id_conv = *(LDKCOption_u64Z*)(((uint64_t)short_channel_id) & ~1);
+ void* short_channel_id_ptr = (void*)(((uint64_t)short_channel_id) & ~1);
+ CHECK_ACCESS(short_channel_id_ptr);
+ LDKCOption_u64Z short_channel_id_conv = *(LDKCOption_u64Z*)(short_channel_id_ptr);
short_channel_id_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)short_channel_id) & ~1));
LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
*ret_copy = Event_payment_path_failed(payment_hash_ref, rejected_by_dest, network_update_conv, all_paths_failed, path_constr, short_channel_id_conv);
uint32_t* outputs_vals = (uint32_t*)(outputs + 4);
for (size_t b = 0; b < outputs_constr.datalen; b++) {
uint32_t outputs_conv_27 = outputs_vals[b];
- LDKSpendableOutputDescriptor outputs_conv_27_conv = *(LDKSpendableOutputDescriptor*)(((uint64_t)outputs_conv_27) & ~1);
+ void* outputs_conv_27_ptr = (void*)(((uint64_t)outputs_conv_27) & ~1);
+ CHECK_ACCESS(outputs_conv_27_ptr);
+ LDKSpendableOutputDescriptor outputs_conv_27_conv = *(LDKSpendableOutputDescriptor*)(outputs_conv_27_ptr);
outputs_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)(((uint64_t)outputs_conv_27) & ~1));
outputs_constr.data[b] = outputs_conv_27_conv;
}
}
uint32_t __attribute__((visibility("default"))) TS_Event_payment_forwarded(uint32_t fee_earned_msat, jboolean claim_from_onchain_tx) {
- LDKCOption_u64Z fee_earned_msat_conv = *(LDKCOption_u64Z*)(((uint64_t)fee_earned_msat) & ~1);
+ void* fee_earned_msat_ptr = (void*)(((uint64_t)fee_earned_msat) & ~1);
+ CHECK_ACCESS(fee_earned_msat_ptr);
+ LDKCOption_u64Z fee_earned_msat_conv = *(LDKCOption_u64Z*)(fee_earned_msat_ptr);
fee_earned_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)fee_earned_msat) & ~1));
LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
*ret_copy = Event_payment_forwarded(fee_earned_msat_conv, claim_from_onchain_tx);
LDKThirtyTwoBytes channel_id_ref;
CHECK(*((uint32_t*)channel_id) == 32);
memcpy(channel_id_ref.data, (uint8_t*)(channel_id + 4), 32);
- LDKClosureReason reason_conv = *(LDKClosureReason*)(((uint64_t)reason) & ~1);
+ void* reason_ptr = (void*)(((uint64_t)reason) & ~1);
+ CHECK_ACCESS(reason_ptr);
+ LDKClosureReason reason_conv = *(LDKClosureReason*)(reason_ptr);
reason_conv = ClosureReason_clone((LDKClosureReason*)(((uint64_t)reason) & ~1));
LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
*ret_copy = Event_channel_closed(channel_id_ref, user_channel_id, reason_conv);
void __attribute__((visibility("default"))) TS_MessageSendEvent_free(uint32_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKMessageSendEvent this_ptr_conv = *(LDKMessageSendEvent*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKMessageSendEvent this_ptr_conv = *(LDKMessageSendEvent*)(this_ptr_ptr);
FREE((void*)this_ptr);
MessageSendEvent_free(this_ptr_conv);
}
LDKPublicKey node_id_ref;
CHECK(*((uint32_t*)node_id) == 33);
memcpy(node_id_ref.compressed_form, (uint8_t*)(node_id + 4), 33);
- LDKErrorAction action_conv = *(LDKErrorAction*)(((uint64_t)action) & ~1);
+ void* action_ptr = (void*)(((uint64_t)action) & ~1);
+ CHECK_ACCESS(action_ptr);
+ LDKErrorAction action_conv = *(LDKErrorAction*)(action_ptr);
action_conv = ErrorAction_clone((LDKErrorAction*)(((uint64_t)action) & ~1));
LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
*ret_copy = MessageSendEvent_handle_error(node_id_ref, action_conv);
void __attribute__((visibility("default"))) TS_MessageSendEventsProvider_free(uint32_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKMessageSendEventsProvider this_ptr_conv = *(LDKMessageSendEventsProvider*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKMessageSendEventsProvider this_ptr_conv = *(LDKMessageSendEventsProvider*)(this_ptr_ptr);
FREE((void*)this_ptr);
MessageSendEventsProvider_free(this_ptr_conv);
}
void __attribute__((visibility("default"))) TS_EventsProvider_free(uint32_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKEventsProvider this_ptr_conv = *(LDKEventsProvider*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKEventsProvider this_ptr_conv = *(LDKEventsProvider*)(this_ptr_ptr);
FREE((void*)this_ptr);
EventsProvider_free(this_ptr_conv);
}
void __attribute__((visibility("default"))) TS_EventHandler_free(uint32_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKEventHandler this_ptr_conv = *(LDKEventHandler*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKEventHandler this_ptr_conv = *(LDKEventHandler*)(this_ptr_ptr);
FREE((void*)this_ptr);
EventHandler_free(this_ptr_conv);
}
void __attribute__((visibility("default"))) TS_APIError_free(uint32_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKAPIError this_ptr_conv = *(LDKAPIError*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKAPIError this_ptr_conv = *(LDKAPIError*)(this_ptr_ptr);
FREE((void*)this_ptr);
APIError_free(this_ptr_conv);
}
void __attribute__((visibility("default"))) TS_Logger_free(uint32_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKLogger this_ptr_conv = *(LDKLogger*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKLogger this_ptr_conv = *(LDKLogger*)(this_ptr_ptr);
FREE((void*)this_ptr);
Logger_free(this_ptr_conv);
}
void __attribute__((visibility("default"))) TS_Access_free(uint32_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKAccess this_ptr_conv = *(LDKAccess*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKAccess this_ptr_conv = *(LDKAccess*)(this_ptr_ptr);
FREE((void*)this_ptr);
Access_free(this_ptr_conv);
}
void __attribute__((visibility("default"))) TS_Listen_free(uint32_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKListen this_ptr_conv = *(LDKListen*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKListen this_ptr_conv = *(LDKListen*)(this_ptr_ptr);
FREE((void*)this_ptr);
Listen_free(this_ptr_conv);
}
void __attribute__((visibility("default"))) TS_Confirm_free(uint32_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKConfirm this_ptr_conv = *(LDKConfirm*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKConfirm this_ptr_conv = *(LDKConfirm*)(this_ptr_ptr);
FREE((void*)this_ptr);
Confirm_free(this_ptr_conv);
}
void __attribute__((visibility("default"))) TS_Watch_free(uint32_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKWatch this_ptr_conv = *(LDKWatch*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKWatch this_ptr_conv = *(LDKWatch*)(this_ptr_ptr);
FREE((void*)this_ptr);
Watch_free(this_ptr_conv);
}
void __attribute__((visibility("default"))) TS_Filter_free(uint32_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKFilter this_ptr_conv = *(LDKFilter*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKFilter this_ptr_conv = *(LDKFilter*)(this_ptr_ptr);
FREE((void*)this_ptr);
Filter_free(this_ptr_conv);
}
void __attribute__((visibility("default"))) TS_BroadcasterInterface_free(uint32_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKBroadcasterInterface this_ptr_conv = *(LDKBroadcasterInterface*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKBroadcasterInterface this_ptr_conv = *(LDKBroadcasterInterface*)(this_ptr_ptr);
FREE((void*)this_ptr);
BroadcasterInterface_free(this_ptr_conv);
}
void __attribute__((visibility("default"))) TS_FeeEstimator_free(uint32_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKFeeEstimator this_ptr_conv = *(LDKFeeEstimator*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKFeeEstimator this_ptr_conv = *(LDKFeeEstimator*)(this_ptr_ptr);
FREE((void*)this_ptr);
FeeEstimator_free(this_ptr_conv);
}
void __attribute__((visibility("default"))) TS_Persist_free(uint32_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKPersist this_ptr_conv = *(LDKPersist*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKPersist this_ptr_conv = *(LDKPersist*)(this_ptr_ptr);
FREE((void*)this_ptr);
Persist_free(this_ptr_conv);
}
}
uint32_t __attribute__((visibility("default"))) TS_ChainMonitor_new(uint32_t chain_source, uint32_t broadcaster, uint32_t logger, uint32_t feeest, uint32_t persister) {
- LDKCOption_FilterZ chain_source_conv = *(LDKCOption_FilterZ*)(((uint64_t)chain_source) & ~1);
+ void* chain_source_ptr = (void*)(((uint64_t)chain_source) & ~1);
+ CHECK_ACCESS(chain_source_ptr);
+ LDKCOption_FilterZ chain_source_conv = *(LDKCOption_FilterZ*)(chain_source_ptr);
// Warning: we may need a move here but no clone is available for LDKCOption_FilterZ
if (chain_source_conv.tag == LDKCOption_FilterZ_Some) {
// Manually implement clone for Java trait instances
}
- LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(((uint64_t)broadcaster) & ~1);
- LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1);
- LDKFeeEstimator feeest_conv = *(LDKFeeEstimator*)(((uint64_t)feeest) & ~1);
- LDKPersist persister_conv = *(LDKPersist*)(((uint64_t)persister) & ~1);
+ void* broadcaster_ptr = (void*)(((uint64_t)broadcaster) & ~1);
+ CHECK_ACCESS(broadcaster_ptr);
+ LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr);
+ void* logger_ptr = (void*)(((uint64_t)logger) & ~1);
+ CHECK_ACCESS(logger_ptr);
+ LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
+ void* feeest_ptr = (void*)(((uint64_t)feeest) & ~1);
+ CHECK_ACCESS(feeest_ptr);
+ LDKFeeEstimator feeest_conv = *(LDKFeeEstimator*)(feeest_ptr);
+ void* persister_ptr = (void*)(((uint64_t)persister) & ~1);
+ CHECK_ACCESS(persister_ptr);
+ LDKPersist persister_conv = *(LDKPersist*)(persister_ptr);
LDKChainMonitor ret_var = ChainMonitor_new(chain_source_conv, broadcaster_conv, logger_conv, feeest_conv, persister_conv);
CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4);
for (size_t j = 0; j < ret_var.datalen; j++) {
LDKBalance *ret_conv_9_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
- *ret_conv_9_copy = Balance_clone(&ret_var.data[j]);
+ *ret_conv_9_copy = ret_var.data[j];
uint64_t ret_conv_9_ref = (uint64_t)ret_conv_9_copy;
ret_arr_ptr[j] = ret_conv_9_ref;
}
void __attribute__((visibility("default"))) TS_MonitorEvent_free(uint32_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKMonitorEvent this_ptr_conv = *(LDKMonitorEvent*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKMonitorEvent this_ptr_conv = *(LDKMonitorEvent*)(this_ptr_ptr);
FREE((void*)this_ptr);
MonitorEvent_free(this_ptr_conv);
}
void __attribute__((visibility("default"))) TS_Balance_free(uint32_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKBalance this_ptr_conv = *(LDKBalance*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKBalance this_ptr_conv = *(LDKBalance*)(this_ptr_ptr);
FREE((void*)this_ptr);
Balance_free(this_ptr_conv);
}
LDKChannelMonitorUpdate updates_conv;
updates_conv.inner = (void*)(updates & (~1));
updates_conv.is_owned = false;
- LDKBroadcasterInterface* broadcaster_conv = (LDKBroadcasterInterface*)(((uint64_t)broadcaster) & ~1);
- LDKFeeEstimator* fee_estimator_conv = (LDKFeeEstimator*)(((uint64_t)fee_estimator) & ~1);
- LDKLogger* logger_conv = (LDKLogger*)(((uint64_t)logger) & ~1);
+ void* broadcaster_ptr = (void*)(((uint64_t)broadcaster) & ~1);
+ if (!(broadcaster & 1)) { CHECK_ACCESS(broadcaster_ptr); }
+ LDKBroadcasterInterface* broadcaster_conv = (LDKBroadcasterInterface*)broadcaster_ptr;
+ void* fee_estimator_ptr = (void*)(((uint64_t)fee_estimator) & ~1);
+ if (!(fee_estimator & 1)) { CHECK_ACCESS(fee_estimator_ptr); }
+ LDKFeeEstimator* fee_estimator_conv = (LDKFeeEstimator*)fee_estimator_ptr;
+ void* logger_ptr = (void*)(((uint64_t)logger) & ~1);
+ if (!(logger & 1)) { CHECK_ACCESS(logger_ptr); }
+ LDKLogger* logger_conv = (LDKLogger*)logger_ptr;
LDKCResult_NoneMonitorUpdateErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneMonitorUpdateErrorZ), "LDKCResult_NoneMonitorUpdateErrorZ");
*ret_conv = ChannelMonitor_update_monitor(&this_arg_conv, &updates_conv, broadcaster_conv, fee_estimator_conv, logger_conv);
return (uint64_t)ret_conv;
LDKChannelMonitor this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKFilter* filter_conv = (LDKFilter*)(((uint64_t)filter) & ~1);
+ void* filter_ptr = (void*)(((uint64_t)filter) & ~1);
+ if (!(filter & 1)) { CHECK_ACCESS(filter_ptr); }
+ LDKFilter* filter_conv = (LDKFilter*)filter_ptr;
ChannelMonitor_load_outputs_to_watch(&this_arg_conv, filter_conv);
}
uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4);
for (size_t o = 0; o < ret_var.datalen; o++) {
LDKMonitorEvent *ret_conv_14_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
- *ret_conv_14_copy = MonitorEvent_clone(&ret_var.data[o]);
+ *ret_conv_14_copy = ret_var.data[o];
uint64_t ret_conv_14_ref = (uint64_t)ret_conv_14_copy;
ret_arr_ptr[o] = ret_conv_14_ref;
}
uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4);
for (size_t h = 0; h < ret_var.datalen; h++) {
LDKEvent *ret_conv_7_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
- *ret_conv_7_copy = Event_clone(&ret_var.data[h]);
+ *ret_conv_7_copy = ret_var.data[h];
uint64_t ret_conv_7_ref = (uint64_t)ret_conv_7_copy;
ret_arr_ptr[h] = ret_conv_7_ref;
}
LDKChannelMonitor this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKLogger* logger_conv = (LDKLogger*)(((uint64_t)logger) & ~1);
+ void* logger_ptr = (void*)(((uint64_t)logger) & ~1);
+ if (!(logger & 1)) { CHECK_ACCESS(logger_ptr); }
+ LDKLogger* logger_conv = (LDKLogger*)logger_ptr;
LDKCVec_TransactionZ ret_var = ChannelMonitor_get_latest_holder_commitment_txn(&this_arg_conv, logger_conv);
ptrArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native ptrArray Bytes");
int8_tArray *ret_arr_ptr = (int8_tArray*)(ret_arr + 4);
uint32_t* txdata_vals = (uint32_t*)(txdata + 4);
for (size_t c = 0; c < txdata_constr.datalen; c++) {
uint32_t txdata_conv_28 = txdata_vals[c];
- LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(((uint64_t)txdata_conv_28) & ~1);
+ void* txdata_conv_28_ptr = (void*)(((uint64_t)txdata_conv_28) & ~1);
+ CHECK_ACCESS(txdata_conv_28_ptr);
+ LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(txdata_conv_28_ptr);
txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)(((uint64_t)txdata_conv_28) & ~1));
txdata_constr.data[c] = txdata_conv_28_conv;
}
- LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(((uint64_t)broadcaster) & ~1);
- LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(((uint64_t)fee_estimator) & ~1);
- LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1);
+ void* broadcaster_ptr = (void*)(((uint64_t)broadcaster) & ~1);
+ CHECK_ACCESS(broadcaster_ptr);
+ LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr);
+ void* fee_estimator_ptr = (void*)(((uint64_t)fee_estimator) & ~1);
+ CHECK_ACCESS(fee_estimator_ptr);
+ LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr);
+ void* logger_ptr = (void*)(((uint64_t)logger) & ~1);
+ CHECK_ACCESS(logger_ptr);
+ LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ ret_var = ChannelMonitor_block_connected(&this_arg_conv, header_ref, txdata_constr, height, broadcaster_conv, fee_estimator_conv, logger_conv);
uint32_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4);
CHECK(*((uint32_t*)header) == 80);
memcpy(header_arr, (uint8_t*)(header + 4), 80);
unsigned char (*header_ref)[80] = &header_arr;
- LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(((uint64_t)broadcaster) & ~1);
- LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(((uint64_t)fee_estimator) & ~1);
- LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1);
+ void* broadcaster_ptr = (void*)(((uint64_t)broadcaster) & ~1);
+ CHECK_ACCESS(broadcaster_ptr);
+ LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr);
+ void* fee_estimator_ptr = (void*)(((uint64_t)fee_estimator) & ~1);
+ CHECK_ACCESS(fee_estimator_ptr);
+ LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr);
+ void* logger_ptr = (void*)(((uint64_t)logger) & ~1);
+ CHECK_ACCESS(logger_ptr);
+ LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
ChannelMonitor_block_disconnected(&this_arg_conv, header_ref, height, broadcaster_conv, fee_estimator_conv, logger_conv);
}
uint32_t* txdata_vals = (uint32_t*)(txdata + 4);
for (size_t c = 0; c < txdata_constr.datalen; c++) {
uint32_t txdata_conv_28 = txdata_vals[c];
- LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(((uint64_t)txdata_conv_28) & ~1);
+ void* txdata_conv_28_ptr = (void*)(((uint64_t)txdata_conv_28) & ~1);
+ CHECK_ACCESS(txdata_conv_28_ptr);
+ LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(txdata_conv_28_ptr);
txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)(((uint64_t)txdata_conv_28) & ~1));
txdata_constr.data[c] = txdata_conv_28_conv;
}
- LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(((uint64_t)broadcaster) & ~1);
- LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(((uint64_t)fee_estimator) & ~1);
- LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1);
+ void* broadcaster_ptr = (void*)(((uint64_t)broadcaster) & ~1);
+ CHECK_ACCESS(broadcaster_ptr);
+ LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr);
+ void* fee_estimator_ptr = (void*)(((uint64_t)fee_estimator) & ~1);
+ CHECK_ACCESS(fee_estimator_ptr);
+ LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr);
+ void* logger_ptr = (void*)(((uint64_t)logger) & ~1);
+ CHECK_ACCESS(logger_ptr);
+ LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ ret_var = ChannelMonitor_transactions_confirmed(&this_arg_conv, header_ref, txdata_constr, height, broadcaster_conv, fee_estimator_conv, logger_conv);
uint32_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4);
CHECK(*((uint32_t*)txid) == 32);
memcpy(txid_arr, (uint8_t*)(txid + 4), 32);
unsigned char (*txid_ref)[32] = &txid_arr;
- LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(((uint64_t)broadcaster) & ~1);
- LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(((uint64_t)fee_estimator) & ~1);
- LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1);
+ void* broadcaster_ptr = (void*)(((uint64_t)broadcaster) & ~1);
+ CHECK_ACCESS(broadcaster_ptr);
+ LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr);
+ void* fee_estimator_ptr = (void*)(((uint64_t)fee_estimator) & ~1);
+ CHECK_ACCESS(fee_estimator_ptr);
+ LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr);
+ void* logger_ptr = (void*)(((uint64_t)logger) & ~1);
+ CHECK_ACCESS(logger_ptr);
+ LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
ChannelMonitor_transaction_unconfirmed(&this_arg_conv, txid_ref, broadcaster_conv, fee_estimator_conv, logger_conv);
}
CHECK(*((uint32_t*)header) == 80);
memcpy(header_arr, (uint8_t*)(header + 4), 80);
unsigned char (*header_ref)[80] = &header_arr;
- LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(((uint64_t)broadcaster) & ~1);
- LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(((uint64_t)fee_estimator) & ~1);
- LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1);
+ void* broadcaster_ptr = (void*)(((uint64_t)broadcaster) & ~1);
+ CHECK_ACCESS(broadcaster_ptr);
+ LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr);
+ void* fee_estimator_ptr = (void*)(((uint64_t)fee_estimator) & ~1);
+ CHECK_ACCESS(fee_estimator_ptr);
+ LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr);
+ void* logger_ptr = (void*)(((uint64_t)logger) & ~1);
+ CHECK_ACCESS(logger_ptr);
+ LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ ret_var = ChannelMonitor_best_block_updated(&this_arg_conv, header_ref, height, broadcaster_conv, fee_estimator_conv, logger_conv);
uint32_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint32_t), "Native uint32_tArray Bytes");
uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4);
uint32_t *ret_arr_ptr = (uint32_t*)(ret_arr + 4);
for (size_t j = 0; j < ret_var.datalen; j++) {
LDKBalance *ret_conv_9_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
- *ret_conv_9_copy = Balance_clone(&ret_var.data[j]);
+ *ret_conv_9_copy = ret_var.data[j];
uint64_t ret_conv_9_ref = (uint64_t)ret_conv_9_copy;
ret_arr_ptr[j] = ret_conv_9_ref;
}
LDKu8slice ser_ref;
ser_ref.datalen = *((uint32_t*)ser);
ser_ref.data = (int8_t*)(ser + 4);
- LDKKeysInterface* arg_conv = (LDKKeysInterface*)(((uint64_t)arg) & ~1);
+ void* arg_ptr = (void*)(((uint64_t)arg) & ~1);
+ if (!(arg & 1)) { CHECK_ACCESS(arg_ptr); }
+ LDKKeysInterface* arg_conv = (LDKKeysInterface*)arg_ptr;
LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ");
*ret_conv = C2Tuple_BlockHashChannelMonitorZ_read(ser_ref, arg_conv);
return (uint64_t)ret_conv;
LDKDelayedPaymentOutputDescriptor this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- LDKTxOut val_conv = *(LDKTxOut*)(((uint64_t)val) & ~1);
+ void* val_ptr = (void*)(((uint64_t)val) & ~1);
+ CHECK_ACCESS(val_ptr);
+ LDKTxOut val_conv = *(LDKTxOut*)(val_ptr);
val_conv = TxOut_clone((LDKTxOut*)(((uint64_t)val) & ~1));
DelayedPaymentOutputDescriptor_set_output(&this_ptr_conv, val_conv);
}
LDKPublicKey per_commitment_point_arg_ref;
CHECK(*((uint32_t*)per_commitment_point_arg) == 33);
memcpy(per_commitment_point_arg_ref.compressed_form, (uint8_t*)(per_commitment_point_arg + 4), 33);
- LDKTxOut output_arg_conv = *(LDKTxOut*)(((uint64_t)output_arg) & ~1);
+ void* output_arg_ptr = (void*)(((uint64_t)output_arg) & ~1);
+ CHECK_ACCESS(output_arg_ptr);
+ LDKTxOut output_arg_conv = *(LDKTxOut*)(output_arg_ptr);
output_arg_conv = TxOut_clone((LDKTxOut*)(((uint64_t)output_arg) & ~1));
LDKPublicKey revocation_pubkey_arg_ref;
CHECK(*((uint32_t*)revocation_pubkey_arg) == 33);
LDKStaticPaymentOutputDescriptor this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- LDKTxOut val_conv = *(LDKTxOut*)(((uint64_t)val) & ~1);
+ void* val_ptr = (void*)(((uint64_t)val) & ~1);
+ CHECK_ACCESS(val_ptr);
+ LDKTxOut val_conv = *(LDKTxOut*)(val_ptr);
val_conv = TxOut_clone((LDKTxOut*)(((uint64_t)val) & ~1));
StaticPaymentOutputDescriptor_set_output(&this_ptr_conv, val_conv);
}
outpoint_arg_conv.inner = (void*)(outpoint_arg & (~1));
outpoint_arg_conv.is_owned = (outpoint_arg & 1) || (outpoint_arg == 0);
outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv);
- LDKTxOut output_arg_conv = *(LDKTxOut*)(((uint64_t)output_arg) & ~1);
+ void* output_arg_ptr = (void*)(((uint64_t)output_arg) & ~1);
+ CHECK_ACCESS(output_arg_ptr);
+ LDKTxOut output_arg_conv = *(LDKTxOut*)(output_arg_ptr);
output_arg_conv = TxOut_clone((LDKTxOut*)(((uint64_t)output_arg) & ~1));
LDKThirtyTwoBytes channel_keys_id_arg_ref;
CHECK(*((uint32_t*)channel_keys_id_arg) == 32);
void __attribute__((visibility("default"))) TS_SpendableOutputDescriptor_free(uint32_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKSpendableOutputDescriptor this_ptr_conv = *(LDKSpendableOutputDescriptor*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKSpendableOutputDescriptor this_ptr_conv = *(LDKSpendableOutputDescriptor*)(this_ptr_ptr);
FREE((void*)this_ptr);
SpendableOutputDescriptor_free(this_ptr_conv);
}
outpoint_conv.inner = (void*)(outpoint & (~1));
outpoint_conv.is_owned = (outpoint & 1) || (outpoint == 0);
outpoint_conv = OutPoint_clone(&outpoint_conv);
- LDKTxOut output_conv = *(LDKTxOut*)(((uint64_t)output) & ~1);
+ void* output_ptr = (void*)(((uint64_t)output) & ~1);
+ CHECK_ACCESS(output_ptr);
+ LDKTxOut output_conv = *(LDKTxOut*)(output_ptr);
output_conv = TxOut_clone((LDKTxOut*)(((uint64_t)output) & ~1));
LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor");
*ret_copy = SpendableOutputDescriptor_static_output(outpoint_conv, output_conv);
void __attribute__((visibility("default"))) TS_BaseSign_free(uint32_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKBaseSign this_ptr_conv = *(LDKBaseSign*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKBaseSign this_ptr_conv = *(LDKBaseSign*)(this_ptr_ptr);
FREE((void*)this_ptr);
BaseSign_free(this_ptr_conv);
}
uint32_t __attribute__((visibility("default"))) TS_Sign_clone(uint32_t orig) {
- LDKSign* orig_conv = (LDKSign*)(((uint64_t)orig) & ~1);
+ void* orig_ptr = (void*)(((uint64_t)orig) & ~1);
+ if (!(orig & 1)) { CHECK_ACCESS(orig_ptr); }
+ LDKSign* orig_conv = (LDKSign*)orig_ptr;
LDKSign* ret_ret =MALLOC(sizeof(LDKSign), "LDKSign");
*ret_ret = Sign_clone(orig_conv);
return (uint64_t)ret_ret;
void __attribute__((visibility("default"))) TS_Sign_free(uint32_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKSign this_ptr_conv = *(LDKSign*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKSign this_ptr_conv = *(LDKSign*)(this_ptr_ptr);
FREE((void*)this_ptr);
Sign_free(this_ptr_conv);
}
void __attribute__((visibility("default"))) TS_KeysInterface_free(uint32_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKKeysInterface this_ptr_conv = *(LDKKeysInterface*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKKeysInterface this_ptr_conv = *(LDKKeysInterface*)(this_ptr_ptr);
FREE((void*)this_ptr);
KeysInterface_free(this_ptr_conv);
}
uint32_t* descriptors_vals = (uint32_t*)(descriptors + 4);
for (size_t b = 0; b < descriptors_constr.datalen; b++) {
uint32_t descriptors_conv_27 = descriptors_vals[b];
- LDKSpendableOutputDescriptor descriptors_conv_27_conv = *(LDKSpendableOutputDescriptor*)(((uint64_t)descriptors_conv_27) & ~1);
+ void* descriptors_conv_27_ptr = (void*)(((uint64_t)descriptors_conv_27) & ~1);
+ CHECK_ACCESS(descriptors_conv_27_ptr);
+ LDKSpendableOutputDescriptor descriptors_conv_27_conv = *(LDKSpendableOutputDescriptor*)(descriptors_conv_27_ptr);
descriptors_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)(((uint64_t)descriptors_conv_27) & ~1));
descriptors_constr.data[b] = descriptors_conv_27_conv;
}
uint32_t* outputs_vals = (uint32_t*)(outputs + 4);
for (size_t h = 0; h < outputs_constr.datalen; h++) {
uint32_t outputs_conv_7 = outputs_vals[h];
- LDKTxOut outputs_conv_7_conv = *(LDKTxOut*)(((uint64_t)outputs_conv_7) & ~1);
+ void* outputs_conv_7_ptr = (void*)(((uint64_t)outputs_conv_7) & ~1);
+ CHECK_ACCESS(outputs_conv_7_ptr);
+ LDKTxOut outputs_conv_7_conv = *(LDKTxOut*)(outputs_conv_7_ptr);
outputs_conv_7_conv = TxOut_clone((LDKTxOut*)(((uint64_t)outputs_conv_7) & ~1));
outputs_constr.data[h] = outputs_conv_7_conv;
}
LDKChannelDetails this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(((uint64_t)val) & ~1);
+ void* val_ptr = (void*)(((uint64_t)val) & ~1);
+ CHECK_ACCESS(val_ptr);
+ LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
val_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)val) & ~1));
ChannelDetails_set_short_channel_id(&this_ptr_conv, val_conv);
}
LDKChannelDetails this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(((uint64_t)val) & ~1);
+ void* val_ptr = (void*)(((uint64_t)val) & ~1);
+ CHECK_ACCESS(val_ptr);
+ LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
val_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)val) & ~1));
ChannelDetails_set_unspendable_punishment_reserve(&this_ptr_conv, val_conv);
}
LDKChannelDetails this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(((uint64_t)val) & ~1);
+ void* val_ptr = (void*)(((uint64_t)val) & ~1);
+ CHECK_ACCESS(val_ptr);
+ LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(val_ptr);
val_conv = COption_u32Z_clone((LDKCOption_u32Z*)(((uint64_t)val) & ~1));
ChannelDetails_set_confirmations_required(&this_ptr_conv, val_conv);
}
LDKChannelDetails this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- LDKCOption_u16Z val_conv = *(LDKCOption_u16Z*)(((uint64_t)val) & ~1);
+ void* val_ptr = (void*)(((uint64_t)val) & ~1);
+ CHECK_ACCESS(val_ptr);
+ LDKCOption_u16Z val_conv = *(LDKCOption_u16Z*)(val_ptr);
val_conv = COption_u16Z_clone((LDKCOption_u16Z*)(((uint64_t)val) & ~1));
ChannelDetails_set_force_close_spend_delay(&this_ptr_conv, val_conv);
}
funding_txo_arg_conv.inner = (void*)(funding_txo_arg & (~1));
funding_txo_arg_conv.is_owned = (funding_txo_arg & 1) || (funding_txo_arg == 0);
funding_txo_arg_conv = OutPoint_clone(&funding_txo_arg_conv);
- LDKCOption_u64Z short_channel_id_arg_conv = *(LDKCOption_u64Z*)(((uint64_t)short_channel_id_arg) & ~1);
+ void* short_channel_id_arg_ptr = (void*)(((uint64_t)short_channel_id_arg) & ~1);
+ CHECK_ACCESS(short_channel_id_arg_ptr);
+ LDKCOption_u64Z short_channel_id_arg_conv = *(LDKCOption_u64Z*)(short_channel_id_arg_ptr);
short_channel_id_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)short_channel_id_arg) & ~1));
- LDKCOption_u64Z unspendable_punishment_reserve_arg_conv = *(LDKCOption_u64Z*)(((uint64_t)unspendable_punishment_reserve_arg) & ~1);
- LDKCOption_u32Z confirmations_required_arg_conv = *(LDKCOption_u32Z*)(((uint64_t)confirmations_required_arg) & ~1);
+ void* unspendable_punishment_reserve_arg_ptr = (void*)(((uint64_t)unspendable_punishment_reserve_arg) & ~1);
+ CHECK_ACCESS(unspendable_punishment_reserve_arg_ptr);
+ LDKCOption_u64Z unspendable_punishment_reserve_arg_conv = *(LDKCOption_u64Z*)(unspendable_punishment_reserve_arg_ptr);
+ void* confirmations_required_arg_ptr = (void*)(((uint64_t)confirmations_required_arg) & ~1);
+ CHECK_ACCESS(confirmations_required_arg_ptr);
+ LDKCOption_u32Z confirmations_required_arg_conv = *(LDKCOption_u32Z*)(confirmations_required_arg_ptr);
confirmations_required_arg_conv = COption_u32Z_clone((LDKCOption_u32Z*)(((uint64_t)confirmations_required_arg) & ~1));
- LDKCOption_u16Z force_close_spend_delay_arg_conv = *(LDKCOption_u16Z*)(((uint64_t)force_close_spend_delay_arg) & ~1);
+ void* force_close_spend_delay_arg_ptr = (void*)(((uint64_t)force_close_spend_delay_arg) & ~1);
+ CHECK_ACCESS(force_close_spend_delay_arg_ptr);
+ LDKCOption_u16Z force_close_spend_delay_arg_conv = *(LDKCOption_u16Z*)(force_close_spend_delay_arg_ptr);
force_close_spend_delay_arg_conv = COption_u16Z_clone((LDKCOption_u16Z*)(((uint64_t)force_close_spend_delay_arg) & ~1));
LDKChannelDetails ret_var = ChannelDetails_new(channel_id_arg_ref, counterparty_arg_conv, funding_txo_arg_conv, short_channel_id_arg_conv, channel_value_satoshis_arg, unspendable_punishment_reserve_arg_conv, user_channel_id_arg, outbound_capacity_msat_arg, inbound_capacity_msat_arg, confirmations_required_arg_conv, force_close_spend_delay_arg_conv, is_outbound_arg, is_funding_locked_arg, is_usable_arg, is_public_arg);
CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
void __attribute__((visibility("default"))) TS_PaymentSendFailure_free(uint32_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKPaymentSendFailure this_ptr_conv = *(LDKPaymentSendFailure*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKPaymentSendFailure this_ptr_conv = *(LDKPaymentSendFailure*)(this_ptr_ptr);
FREE((void*)this_ptr);
PaymentSendFailure_free(this_ptr_conv);
}
}
uint32_t __attribute__((visibility("default"))) TS_PaymentSendFailure_parameter_error(uint32_t a) {
- LDKAPIError a_conv = *(LDKAPIError*)(((uint64_t)a) & ~1);
+ void* a_ptr = (void*)(((uint64_t)a) & ~1);
+ CHECK_ACCESS(a_ptr);
+ LDKAPIError a_conv = *(LDKAPIError*)(a_ptr);
a_conv = APIError_clone((LDKAPIError*)(((uint64_t)a) & ~1));
LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
*ret_copy = PaymentSendFailure_parameter_error(a_conv);
uint32_t* a_vals = (uint32_t*)(a + 4);
for (size_t w = 0; w < a_constr.datalen; w++) {
uint32_t a_conv_22 = a_vals[w];
- LDKCResult_NoneAPIErrorZ a_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(((uint64_t)a_conv_22) & ~1);
+ void* a_conv_22_ptr = (void*)(((uint64_t)a_conv_22) & ~1);
+ CHECK_ACCESS(a_conv_22_ptr);
+ LDKCResult_NoneAPIErrorZ a_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(a_conv_22_ptr);
a_conv_22_conv = CResult_NoneAPIErrorZ_clone((LDKCResult_NoneAPIErrorZ*)(((uint64_t)a_conv_22) & ~1));
a_constr.data[w] = a_conv_22_conv;
}
uint32_t* a_vals = (uint32_t*)(a + 4);
for (size_t k = 0; k < a_constr.datalen; k++) {
uint32_t a_conv_10 = a_vals[k];
- LDKAPIError a_conv_10_conv = *(LDKAPIError*)(((uint64_t)a_conv_10) & ~1);
+ void* a_conv_10_ptr = (void*)(((uint64_t)a_conv_10) & ~1);
+ CHECK_ACCESS(a_conv_10_ptr);
+ LDKAPIError a_conv_10_conv = *(LDKAPIError*)(a_conv_10_ptr);
a_conv_10_conv = APIError_clone((LDKAPIError*)(((uint64_t)a_conv_10) & ~1));
a_constr.data[k] = a_conv_10_conv;
}
uint32_t* a_vals = (uint32_t*)(a + 4);
for (size_t w = 0; w < a_constr.datalen; w++) {
uint32_t a_conv_22 = a_vals[w];
- LDKCResult_NoneAPIErrorZ a_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(((uint64_t)a_conv_22) & ~1);
+ void* a_conv_22_ptr = (void*)(((uint64_t)a_conv_22) & ~1);
+ CHECK_ACCESS(a_conv_22_ptr);
+ LDKCResult_NoneAPIErrorZ a_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(a_conv_22_ptr);
a_conv_22_conv = CResult_NoneAPIErrorZ_clone((LDKCResult_NoneAPIErrorZ*)(((uint64_t)a_conv_22) & ~1));
a_constr.data[w] = a_conv_22_conv;
}
}
uint32_t __attribute__((visibility("default"))) TS_ChannelManager_new(uint32_t fee_est, uint32_t chain_monitor, uint32_t tx_broadcaster, uint32_t logger, uint32_t keys_manager, uint32_t config, uint32_t params) {
- LDKFeeEstimator fee_est_conv = *(LDKFeeEstimator*)(((uint64_t)fee_est) & ~1);
- LDKWatch chain_monitor_conv = *(LDKWatch*)(((uint64_t)chain_monitor) & ~1);
- LDKBroadcasterInterface tx_broadcaster_conv = *(LDKBroadcasterInterface*)(((uint64_t)tx_broadcaster) & ~1);
- LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1);
- LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(((uint64_t)keys_manager) & ~1);
+ void* fee_est_ptr = (void*)(((uint64_t)fee_est) & ~1);
+ CHECK_ACCESS(fee_est_ptr);
+ LDKFeeEstimator fee_est_conv = *(LDKFeeEstimator*)(fee_est_ptr);
+ void* chain_monitor_ptr = (void*)(((uint64_t)chain_monitor) & ~1);
+ CHECK_ACCESS(chain_monitor_ptr);
+ LDKWatch chain_monitor_conv = *(LDKWatch*)(chain_monitor_ptr);
+ void* tx_broadcaster_ptr = (void*)(((uint64_t)tx_broadcaster) & ~1);
+ CHECK_ACCESS(tx_broadcaster_ptr);
+ LDKBroadcasterInterface tx_broadcaster_conv = *(LDKBroadcasterInterface*)(tx_broadcaster_ptr);
+ void* logger_ptr = (void*)(((uint64_t)logger) & ~1);
+ CHECK_ACCESS(logger_ptr);
+ LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
+ void* keys_manager_ptr = (void*)(((uint64_t)keys_manager) & ~1);
+ CHECK_ACCESS(keys_manager_ptr);
+ LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(keys_manager_ptr);
LDKUserConfig config_conv;
config_conv.inner = (void*)(config & (~1));
config_conv.is_owned = (config & 1) || (config == 0);
uint32_t* addresses_vals = (uint32_t*)(addresses + 4);
for (size_t m = 0; m < addresses_constr.datalen; m++) {
uint32_t addresses_conv_12 = addresses_vals[m];
- LDKNetAddress addresses_conv_12_conv = *(LDKNetAddress*)(((uint64_t)addresses_conv_12) & ~1);
+ void* addresses_conv_12_ptr = (void*)(((uint64_t)addresses_conv_12) & ~1);
+ CHECK_ACCESS(addresses_conv_12_ptr);
+ LDKNetAddress addresses_conv_12_conv = *(LDKNetAddress*)(addresses_conv_12_ptr);
addresses_constr.data[m] = addresses_conv_12_conv;
}
ChannelManager_broadcast_node_announcement(&this_arg_conv, rgb_ref, alias_ref, addresses_constr);
LDKChannelManager this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(((uint64_t)min_value_msat) & ~1);
+ void* min_value_msat_ptr = (void*)(((uint64_t)min_value_msat) & ~1);
+ CHECK_ACCESS(min_value_msat_ptr);
+ LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr);
min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)min_value_msat) & ~1));
LDKC2Tuple_PaymentHashPaymentSecretZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ");
*ret_conv = ChannelManager_create_inbound_payment(&this_arg_conv, min_value_msat_conv, invoice_expiry_delta_secs, user_payment_id);
LDKThirtyTwoBytes payment_hash_ref;
CHECK(*((uint32_t*)payment_hash) == 32);
memcpy(payment_hash_ref.data, (uint8_t*)(payment_hash + 4), 32);
- LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(((uint64_t)min_value_msat) & ~1);
+ void* min_value_msat_ptr = (void*)(((uint64_t)min_value_msat) & ~1);
+ CHECK_ACCESS(min_value_msat_ptr);
+ LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr);
min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)min_value_msat) & ~1));
LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ");
*ret_conv = ChannelManager_create_inbound_payment_for_hash(&this_arg_conv, payment_hash_ref, min_value_msat_conv, invoice_expiry_delta_secs, user_payment_id);
LDKChannelManagerReadArgs this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- LDKKeysInterface val_conv = *(LDKKeysInterface*)(((uint64_t)val) & ~1);
+ void* val_ptr = (void*)(((uint64_t)val) & ~1);
+ CHECK_ACCESS(val_ptr);
+ LDKKeysInterface val_conv = *(LDKKeysInterface*)(val_ptr);
ChannelManagerReadArgs_set_keys_manager(&this_ptr_conv, val_conv);
}
LDKChannelManagerReadArgs this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- LDKFeeEstimator val_conv = *(LDKFeeEstimator*)(((uint64_t)val) & ~1);
+ void* val_ptr = (void*)(((uint64_t)val) & ~1);
+ CHECK_ACCESS(val_ptr);
+ LDKFeeEstimator val_conv = *(LDKFeeEstimator*)(val_ptr);
ChannelManagerReadArgs_set_fee_estimator(&this_ptr_conv, val_conv);
}
LDKChannelManagerReadArgs this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- LDKWatch val_conv = *(LDKWatch*)(((uint64_t)val) & ~1);
+ void* val_ptr = (void*)(((uint64_t)val) & ~1);
+ CHECK_ACCESS(val_ptr);
+ LDKWatch val_conv = *(LDKWatch*)(val_ptr);
ChannelManagerReadArgs_set_chain_monitor(&this_ptr_conv, val_conv);
}
LDKChannelManagerReadArgs this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- LDKBroadcasterInterface val_conv = *(LDKBroadcasterInterface*)(((uint64_t)val) & ~1);
+ void* val_ptr = (void*)(((uint64_t)val) & ~1);
+ CHECK_ACCESS(val_ptr);
+ LDKBroadcasterInterface val_conv = *(LDKBroadcasterInterface*)(val_ptr);
ChannelManagerReadArgs_set_tx_broadcaster(&this_ptr_conv, val_conv);
}
LDKChannelManagerReadArgs this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- LDKLogger val_conv = *(LDKLogger*)(((uint64_t)val) & ~1);
+ void* val_ptr = (void*)(((uint64_t)val) & ~1);
+ CHECK_ACCESS(val_ptr);
+ LDKLogger val_conv = *(LDKLogger*)(val_ptr);
ChannelManagerReadArgs_set_logger(&this_ptr_conv, val_conv);
}
}
uint32_t __attribute__((visibility("default"))) TS_ChannelManagerReadArgs_new(uint32_t keys_manager, uint32_t fee_estimator, uint32_t chain_monitor, uint32_t tx_broadcaster, uint32_t logger, uint32_t default_config, uint32_tArray channel_monitors) {
- LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(((uint64_t)keys_manager) & ~1);
- LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(((uint64_t)fee_estimator) & ~1);
- LDKWatch chain_monitor_conv = *(LDKWatch*)(((uint64_t)chain_monitor) & ~1);
- LDKBroadcasterInterface tx_broadcaster_conv = *(LDKBroadcasterInterface*)(((uint64_t)tx_broadcaster) & ~1);
- LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1);
+ void* keys_manager_ptr = (void*)(((uint64_t)keys_manager) & ~1);
+ CHECK_ACCESS(keys_manager_ptr);
+ LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(keys_manager_ptr);
+ void* fee_estimator_ptr = (void*)(((uint64_t)fee_estimator) & ~1);
+ CHECK_ACCESS(fee_estimator_ptr);
+ LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr);
+ void* chain_monitor_ptr = (void*)(((uint64_t)chain_monitor) & ~1);
+ CHECK_ACCESS(chain_monitor_ptr);
+ LDKWatch chain_monitor_conv = *(LDKWatch*)(chain_monitor_ptr);
+ void* tx_broadcaster_ptr = (void*)(((uint64_t)tx_broadcaster) & ~1);
+ CHECK_ACCESS(tx_broadcaster_ptr);
+ LDKBroadcasterInterface tx_broadcaster_conv = *(LDKBroadcasterInterface*)(tx_broadcaster_ptr);
+ void* logger_ptr = (void*)(((uint64_t)logger) & ~1);
+ CHECK_ACCESS(logger_ptr);
+ LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
LDKUserConfig default_config_conv;
default_config_conv.inner = (void*)(default_config & (~1));
default_config_conv.is_owned = (default_config & 1) || (default_config == 0);
void __attribute__((visibility("default"))) TS_NetAddress_free(uint32_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKNetAddress this_ptr_conv = *(LDKNetAddress*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKNetAddress this_ptr_conv = *(LDKNetAddress*)(this_ptr_ptr);
FREE((void*)this_ptr);
NetAddress_free(this_ptr_conv);
}
uint32_t* val_vals = (uint32_t*)(val + 4);
for (size_t m = 0; m < val_constr.datalen; m++) {
uint32_t val_conv_12 = val_vals[m];
- LDKNetAddress val_conv_12_conv = *(LDKNetAddress*)(((uint64_t)val_conv_12) & ~1);
+ void* val_conv_12_ptr = (void*)(((uint64_t)val_conv_12) & ~1);
+ CHECK_ACCESS(val_conv_12_ptr);
+ LDKNetAddress val_conv_12_conv = *(LDKNetAddress*)(val_conv_12_ptr);
val_conv_12_conv = NetAddress_clone((LDKNetAddress*)(((uint64_t)val_conv_12) & ~1));
val_constr.data[m] = val_conv_12_conv;
}
void __attribute__((visibility("default"))) TS_ErrorAction_free(uint32_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKErrorAction this_ptr_conv = *(LDKErrorAction*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKErrorAction this_ptr_conv = *(LDKErrorAction*)(this_ptr_ptr);
FREE((void*)this_ptr);
ErrorAction_free(this_ptr_conv);
}
LDKLightningError this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- LDKErrorAction val_conv = *(LDKErrorAction*)(((uint64_t)val) & ~1);
+ void* val_ptr = (void*)(((uint64_t)val) & ~1);
+ CHECK_ACCESS(val_ptr);
+ LDKErrorAction val_conv = *(LDKErrorAction*)(val_ptr);
val_conv = ErrorAction_clone((LDKErrorAction*)(((uint64_t)val) & ~1));
LightningError_set_action(&this_ptr_conv, val_conv);
}
uint32_t __attribute__((visibility("default"))) TS_LightningError_new(jstring err_arg, uint32_t action_arg) {
LDKStr err_arg_conv = str_ref_to_owned_c(err_arg);
- LDKErrorAction action_arg_conv = *(LDKErrorAction*)(((uint64_t)action_arg) & ~1);
+ void* action_arg_ptr = (void*)(((uint64_t)action_arg) & ~1);
+ CHECK_ACCESS(action_arg_ptr);
+ LDKErrorAction action_arg_conv = *(LDKErrorAction*)(action_arg_ptr);
action_arg_conv = ErrorAction_clone((LDKErrorAction*)(((uint64_t)action_arg) & ~1));
LDKLightningError ret_var = LightningError_new(err_arg_conv, action_arg_conv);
CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
void __attribute__((visibility("default"))) TS_ChannelMessageHandler_free(uint32_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKChannelMessageHandler this_ptr_conv = *(LDKChannelMessageHandler*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKChannelMessageHandler this_ptr_conv = *(LDKChannelMessageHandler*)(this_ptr_ptr);
FREE((void*)this_ptr);
ChannelMessageHandler_free(this_ptr_conv);
}
void __attribute__((visibility("default"))) TS_RoutingMessageHandler_free(uint32_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKRoutingMessageHandler this_ptr_conv = *(LDKRoutingMessageHandler*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKRoutingMessageHandler this_ptr_conv = *(LDKRoutingMessageHandler*)(this_ptr_ptr);
FREE((void*)this_ptr);
RoutingMessageHandler_free(this_ptr_conv);
}
void __attribute__((visibility("default"))) TS_CustomMessageHandler_free(uint32_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKCustomMessageHandler this_ptr_conv = *(LDKCustomMessageHandler*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKCustomMessageHandler this_ptr_conv = *(LDKCustomMessageHandler*)(this_ptr_ptr);
FREE((void*)this_ptr);
CustomMessageHandler_free(this_ptr_conv);
}
LDKMessageHandler this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- LDKChannelMessageHandler val_conv = *(LDKChannelMessageHandler*)(((uint64_t)val) & ~1);
+ void* val_ptr = (void*)(((uint64_t)val) & ~1);
+ CHECK_ACCESS(val_ptr);
+ LDKChannelMessageHandler val_conv = *(LDKChannelMessageHandler*)(val_ptr);
MessageHandler_set_chan_handler(&this_ptr_conv, val_conv);
}
LDKMessageHandler this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- LDKRoutingMessageHandler val_conv = *(LDKRoutingMessageHandler*)(((uint64_t)val) & ~1);
+ void* val_ptr = (void*)(((uint64_t)val) & ~1);
+ CHECK_ACCESS(val_ptr);
+ LDKRoutingMessageHandler val_conv = *(LDKRoutingMessageHandler*)(val_ptr);
MessageHandler_set_route_handler(&this_ptr_conv, val_conv);
}
uint32_t __attribute__((visibility("default"))) TS_MessageHandler_new(uint32_t chan_handler_arg, uint32_t route_handler_arg) {
- LDKChannelMessageHandler chan_handler_arg_conv = *(LDKChannelMessageHandler*)(((uint64_t)chan_handler_arg) & ~1);
- LDKRoutingMessageHandler route_handler_arg_conv = *(LDKRoutingMessageHandler*)(((uint64_t)route_handler_arg) & ~1);
+ void* chan_handler_arg_ptr = (void*)(((uint64_t)chan_handler_arg) & ~1);
+ CHECK_ACCESS(chan_handler_arg_ptr);
+ LDKChannelMessageHandler chan_handler_arg_conv = *(LDKChannelMessageHandler*)(chan_handler_arg_ptr);
+ void* route_handler_arg_ptr = (void*)(((uint64_t)route_handler_arg) & ~1);
+ CHECK_ACCESS(route_handler_arg_ptr);
+ LDKRoutingMessageHandler route_handler_arg_conv = *(LDKRoutingMessageHandler*)(route_handler_arg_ptr);
LDKMessageHandler ret_var = MessageHandler_new(chan_handler_arg_conv, route_handler_arg_conv);
CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
}
uint32_t __attribute__((visibility("default"))) TS_SocketDescriptor_clone(uint32_t orig) {
- LDKSocketDescriptor* orig_conv = (LDKSocketDescriptor*)(((uint64_t)orig) & ~1);
+ void* orig_ptr = (void*)(((uint64_t)orig) & ~1);
+ if (!(orig & 1)) { CHECK_ACCESS(orig_ptr); }
+ LDKSocketDescriptor* orig_conv = (LDKSocketDescriptor*)orig_ptr;
LDKSocketDescriptor* ret_ret =MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor");
*ret_ret = SocketDescriptor_clone(orig_conv);
return (uint64_t)ret_ret;
void __attribute__((visibility("default"))) TS_SocketDescriptor_free(uint32_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKSocketDescriptor this_ptr_conv = *(LDKSocketDescriptor*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKSocketDescriptor this_ptr_conv = *(LDKSocketDescriptor*)(this_ptr_ptr);
FREE((void*)this_ptr);
SocketDescriptor_free(this_ptr_conv);
}
CHECK(*((uint32_t*)ephemeral_random_data) == 32);
memcpy(ephemeral_random_data_arr, (uint8_t*)(ephemeral_random_data + 4), 32);
unsigned char (*ephemeral_random_data_ref)[32] = &ephemeral_random_data_arr;
- LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1);
- LDKCustomMessageHandler custom_message_handler_conv = *(LDKCustomMessageHandler*)(((uint64_t)custom_message_handler) & ~1);
+ void* logger_ptr = (void*)(((uint64_t)logger) & ~1);
+ CHECK_ACCESS(logger_ptr);
+ LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
+ void* custom_message_handler_ptr = (void*)(((uint64_t)custom_message_handler) & ~1);
+ CHECK_ACCESS(custom_message_handler_ptr);
+ LDKCustomMessageHandler custom_message_handler_conv = *(LDKCustomMessageHandler*)(custom_message_handler_ptr);
LDKPeerManager ret_var = PeerManager_new(message_handler_conv, our_node_secret_ref, ephemeral_random_data_ref, logger_conv, custom_message_handler_conv);
CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
LDKPublicKey their_node_id_ref;
CHECK(*((uint32_t*)their_node_id) == 33);
memcpy(their_node_id_ref.compressed_form, (uint8_t*)(their_node_id + 4), 33);
- LDKSocketDescriptor descriptor_conv = *(LDKSocketDescriptor*)(((uint64_t)descriptor) & ~1);
+ void* descriptor_ptr = (void*)(((uint64_t)descriptor) & ~1);
+ CHECK_ACCESS(descriptor_ptr);
+ LDKSocketDescriptor descriptor_conv = *(LDKSocketDescriptor*)(descriptor_ptr);
LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ");
*ret_conv = PeerManager_new_outbound_connection(&this_arg_conv, their_node_id_ref, descriptor_conv);
return (uint64_t)ret_conv;
LDKPeerManager this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKSocketDescriptor descriptor_conv = *(LDKSocketDescriptor*)(((uint64_t)descriptor) & ~1);
+ void* descriptor_ptr = (void*)(((uint64_t)descriptor) & ~1);
+ CHECK_ACCESS(descriptor_ptr);
+ LDKSocketDescriptor descriptor_conv = *(LDKSocketDescriptor*)(descriptor_ptr);
LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
*ret_conv = PeerManager_new_inbound_connection(&this_arg_conv, descriptor_conv);
return (uint64_t)ret_conv;
LDKPeerManager this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)(((uint64_t)descriptor) & ~1);
+ void* descriptor_ptr = (void*)(((uint64_t)descriptor) & ~1);
+ if (!(descriptor & 1)) { CHECK_ACCESS(descriptor_ptr); }
+ LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)descriptor_ptr;
LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
*ret_conv = PeerManager_write_buffer_space_avail(&this_arg_conv, descriptor_conv);
return (uint64_t)ret_conv;
LDKPeerManager this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKSocketDescriptor* peer_descriptor_conv = (LDKSocketDescriptor*)(((uint64_t)peer_descriptor) & ~1);
+ void* peer_descriptor_ptr = (void*)(((uint64_t)peer_descriptor) & ~1);
+ if (!(peer_descriptor & 1)) { CHECK_ACCESS(peer_descriptor_ptr); }
+ LDKSocketDescriptor* peer_descriptor_conv = (LDKSocketDescriptor*)peer_descriptor_ptr;
LDKu8slice data_ref;
data_ref.datalen = *((uint32_t*)data);
data_ref.data = (int8_t*)(data + 4);
LDKPeerManager this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)(((uint64_t)descriptor) & ~1);
+ void* descriptor_ptr = (void*)(((uint64_t)descriptor) & ~1);
+ if (!(descriptor & 1)) { CHECK_ACCESS(descriptor_ptr); }
+ LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)descriptor_ptr;
PeerManager_socket_disconnected(&this_arg_conv, descriptor_conv);
}
LDKHTLCOutputInCommitment this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(((uint64_t)val) & ~1);
+ void* val_ptr = (void*)(((uint64_t)val) & ~1);
+ CHECK_ACCESS(val_ptr);
+ LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(val_ptr);
val_conv = COption_u32Z_clone((LDKCOption_u32Z*)(((uint64_t)val) & ~1));
HTLCOutputInCommitment_set_transaction_output_index(&this_ptr_conv, val_conv);
}
LDKThirtyTwoBytes payment_hash_arg_ref;
CHECK(*((uint32_t*)payment_hash_arg) == 32);
memcpy(payment_hash_arg_ref.data, (uint8_t*)(payment_hash_arg + 4), 32);
- LDKCOption_u32Z transaction_output_index_arg_conv = *(LDKCOption_u32Z*)(((uint64_t)transaction_output_index_arg) & ~1);
+ void* transaction_output_index_arg_ptr = (void*)(((uint64_t)transaction_output_index_arg) & ~1);
+ CHECK_ACCESS(transaction_output_index_arg_ptr);
+ LDKCOption_u32Z transaction_output_index_arg_conv = *(LDKCOption_u32Z*)(transaction_output_index_arg_ptr);
transaction_output_index_arg_conv = COption_u32Z_clone((LDKCOption_u32Z*)(((uint64_t)transaction_output_index_arg) & ~1));
LDKHTLCOutputInCommitment ret_var = HTLCOutputInCommitment_new(offered_arg, amount_msat_arg, cltv_expiry_arg, payment_hash_arg_ref, transaction_output_index_arg_conv);
CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
ClosingTransaction_free(this_obj_conv);
}
+uint32_t __attribute__((visibility("default"))) TS_ClosingTransaction_clone(uint32_t orig) {
+ LDKClosingTransaction orig_conv;
+ orig_conv.inner = (void*)(orig & (~1));
+ orig_conv.is_owned = false;
+ LDKClosingTransaction ret_var = ClosingTransaction_clone(&orig_conv);
+ CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ uint64_t ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ return ret_ref;
+}
+
+int64_t __attribute__((visibility("default"))) TS_ClosingTransaction_hash(uint32_t o) {
+ LDKClosingTransaction o_conv;
+ o_conv.inner = (void*)(o & (~1));
+ o_conv.is_owned = false;
+ int64_t ret_val = ClosingTransaction_hash(&o_conv);
+ return ret_val;
+}
+
uint32_t __attribute__((visibility("default"))) TS_ClosingTransaction_new(int64_t to_holder_value_sat, int64_t to_counterparty_value_sat, int8_tArray to_holder_script, int8_tArray to_counterparty_script, uint32_t funding_outpoint) {
LDKCVec_u8Z to_holder_script_ref;
to_holder_script_ref.datalen = *((uint32_t*)to_holder_script);
return ret_ref;
}
+uint32_t __attribute__((visibility("default"))) TS_InvalidShutdownScript_clone(uint32_t orig) {
+ LDKInvalidShutdownScript orig_conv;
+ orig_conv.inner = (void*)(orig & (~1));
+ orig_conv.is_owned = false;
+ LDKInvalidShutdownScript ret_var = InvalidShutdownScript_clone(&orig_conv);
+ CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ uint64_t ret_ref = (uint64_t)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ return ret_ref;
+}
+
int8_tArray __attribute__((visibility("default"))) TS_ShutdownScript_write(uint32_t obj) {
LDKShutdownScript obj_conv;
obj_conv.inner = (void*)(obj & (~1));
void __attribute__((visibility("default"))) TS_CustomMessageReader_free(uint32_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKCustomMessageReader this_ptr_conv = *(LDKCustomMessageReader*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKCustomMessageReader this_ptr_conv = *(LDKCustomMessageReader*)(this_ptr_ptr);
FREE((void*)this_ptr);
CustomMessageReader_free(this_ptr_conv);
}
uint32_t __attribute__((visibility("default"))) TS_Type_clone(uint32_t orig) {
- LDKType* orig_conv = (LDKType*)(((uint64_t)orig) & ~1);
+ void* orig_ptr = (void*)(((uint64_t)orig) & ~1);
+ if (!(orig & 1)) { CHECK_ACCESS(orig_ptr); }
+ LDKType* orig_conv = (LDKType*)orig_ptr;
LDKType* ret_ret =MALLOC(sizeof(LDKType), "LDKType");
*ret_ret = Type_clone(orig_conv);
return (uint64_t)ret_ret;
void __attribute__((visibility("default"))) TS_Type_free(uint32_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKType this_ptr_conv = *(LDKType*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKType this_ptr_conv = *(LDKType*)(this_ptr_ptr);
FREE((void*)this_ptr);
Type_free(this_ptr_conv);
}
void __attribute__((visibility("default"))) TS_Score_free(uint32_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKScore this_ptr_conv = *(LDKScore*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKScore this_ptr_conv = *(LDKScore*)(this_ptr_ptr);
FREE((void*)this_ptr);
Score_free(this_ptr_conv);
}
void __attribute__((visibility("default"))) TS_NetworkUpdate_free(uint32_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKNetworkUpdate this_ptr_conv = *(LDKNetworkUpdate*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKNetworkUpdate this_ptr_conv = *(LDKNetworkUpdate*)(this_ptr_ptr);
FREE((void*)this_ptr);
NetworkUpdate_free(this_ptr_conv);
}
network_graph_conv.inner = (void*)(network_graph & (~1));
network_graph_conv.is_owned = (network_graph & 1) || (network_graph == 0);
network_graph_conv = NetworkGraph_clone(&network_graph_conv);
- LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(((uint64_t)chain_access) & ~1);
+ void* chain_access_ptr = (void*)(((uint64_t)chain_access) & ~1);
+ CHECK_ACCESS(chain_access_ptr);
+ LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(chain_access_ptr);
// Warning: we may need a move here but no clone is available for LDKCOption_AccessZ
if (chain_access_conv.tag == LDKCOption_AccessZ_Some) {
// Manually implement clone for Java trait instances
}
- LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1);
+ void* logger_ptr = (void*)(((uint64_t)logger) & ~1);
+ CHECK_ACCESS(logger_ptr);
+ LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
LDKNetGraphMsgHandler ret_var = NetGraphMsgHandler_new(network_graph_conv, chain_access_conv, logger_conv);
CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
LDKNetGraphMsgHandler this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(((uint64_t)chain_access) & ~1);
+ void* chain_access_ptr = (void*)(((uint64_t)chain_access) & ~1);
+ CHECK_ACCESS(chain_access_ptr);
+ LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(chain_access_ptr);
// Warning: we may need a move here but no clone is available for LDKCOption_AccessZ
if (chain_access_conv.tag == LDKCOption_AccessZ_Some) {
// Manually implement clone for Java trait instances
LDKDirectionalChannelInfo this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(((uint64_t)val) & ~1);
+ void* val_ptr = (void*)(((uint64_t)val) & ~1);
+ CHECK_ACCESS(val_ptr);
+ LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
val_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)val) & ~1));
DirectionalChannelInfo_set_htlc_maximum_msat(&this_ptr_conv, val_conv);
}
}
uint32_t __attribute__((visibility("default"))) TS_DirectionalChannelInfo_new(int32_t last_update_arg, jboolean enabled_arg, int16_t cltv_expiry_delta_arg, int64_t htlc_minimum_msat_arg, uint32_t htlc_maximum_msat_arg, uint32_t fees_arg, uint32_t last_update_message_arg) {
- LDKCOption_u64Z htlc_maximum_msat_arg_conv = *(LDKCOption_u64Z*)(((uint64_t)htlc_maximum_msat_arg) & ~1);
+ void* htlc_maximum_msat_arg_ptr = (void*)(((uint64_t)htlc_maximum_msat_arg) & ~1);
+ CHECK_ACCESS(htlc_maximum_msat_arg_ptr);
+ LDKCOption_u64Z htlc_maximum_msat_arg_conv = *(LDKCOption_u64Z*)(htlc_maximum_msat_arg_ptr);
htlc_maximum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)htlc_maximum_msat_arg) & ~1));
LDKRoutingFees fees_arg_conv;
fees_arg_conv.inner = (void*)(fees_arg & (~1));
LDKChannelInfo this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(((uint64_t)val) & ~1);
+ void* val_ptr = (void*)(((uint64_t)val) & ~1);
+ CHECK_ACCESS(val_ptr);
+ LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
val_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)val) & ~1));
ChannelInfo_set_capacity_sats(&this_ptr_conv, val_conv);
}
two_to_one_arg_conv.inner = (void*)(two_to_one_arg & (~1));
two_to_one_arg_conv.is_owned = (two_to_one_arg & 1) || (two_to_one_arg == 0);
two_to_one_arg_conv = DirectionalChannelInfo_clone(&two_to_one_arg_conv);
- LDKCOption_u64Z capacity_sats_arg_conv = *(LDKCOption_u64Z*)(((uint64_t)capacity_sats_arg) & ~1);
+ void* capacity_sats_arg_ptr = (void*)(((uint64_t)capacity_sats_arg) & ~1);
+ CHECK_ACCESS(capacity_sats_arg_ptr);
+ LDKCOption_u64Z capacity_sats_arg_conv = *(LDKCOption_u64Z*)(capacity_sats_arg_ptr);
capacity_sats_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)capacity_sats_arg) & ~1));
LDKChannelAnnouncement announcement_message_arg_conv;
announcement_message_arg_conv.inner = (void*)(announcement_message_arg & (~1));
uint32_t* val_vals = (uint32_t*)(val + 4);
for (size_t m = 0; m < val_constr.datalen; m++) {
uint32_t val_conv_12 = val_vals[m];
- LDKNetAddress val_conv_12_conv = *(LDKNetAddress*)(((uint64_t)val_conv_12) & ~1);
+ void* val_conv_12_ptr = (void*)(((uint64_t)val_conv_12) & ~1);
+ CHECK_ACCESS(val_conv_12_ptr);
+ LDKNetAddress val_conv_12_conv = *(LDKNetAddress*)(val_conv_12_ptr);
val_conv_12_conv = NetAddress_clone((LDKNetAddress*)(((uint64_t)val_conv_12) & ~1));
val_constr.data[m] = val_conv_12_conv;
}
uint32_t* addresses_arg_vals = (uint32_t*)(addresses_arg + 4);
for (size_t m = 0; m < addresses_arg_constr.datalen; m++) {
uint32_t addresses_arg_conv_12 = addresses_arg_vals[m];
- LDKNetAddress addresses_arg_conv_12_conv = *(LDKNetAddress*)(((uint64_t)addresses_arg_conv_12) & ~1);
+ void* addresses_arg_conv_12_ptr = (void*)(((uint64_t)addresses_arg_conv_12) & ~1);
+ CHECK_ACCESS(addresses_arg_conv_12_ptr);
+ LDKNetAddress addresses_arg_conv_12_conv = *(LDKNetAddress*)(addresses_arg_conv_12_ptr);
addresses_arg_constr.data[m] = addresses_arg_conv_12_conv;
}
LDKNodeAnnouncement announcement_message_arg_conv;
LDKChannelAnnouncement msg_conv;
msg_conv.inner = (void*)(msg & (~1));
msg_conv.is_owned = false;
- LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(((uint64_t)chain_access) & ~1);
+ void* chain_access_ptr = (void*)(((uint64_t)chain_access) & ~1);
+ CHECK_ACCESS(chain_access_ptr);
+ LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(chain_access_ptr);
// Warning: we may need a move here but no clone is available for LDKCOption_AccessZ
if (chain_access_conv.tag == LDKCOption_AccessZ_Some) {
// Manually implement clone for Java trait instances
LDKUnsignedChannelAnnouncement msg_conv;
msg_conv.inner = (void*)(msg & (~1));
msg_conv.is_owned = false;
- LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(((uint64_t)chain_access) & ~1);
+ void* chain_access_ptr = (void*)(((uint64_t)chain_access) & ~1);
+ CHECK_ACCESS(chain_access_ptr);
+ LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(chain_access_ptr);
// Warning: we may need a move here but no clone is available for LDKCOption_AccessZ
if (chain_access_conv.tag == LDKCOption_AccessZ_Some) {
// Manually implement clone for Java trait instances
LDKRouteHintHop this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(((uint64_t)val) & ~1);
+ void* val_ptr = (void*)(((uint64_t)val) & ~1);
+ CHECK_ACCESS(val_ptr);
+ LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
val_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)val) & ~1));
RouteHintHop_set_htlc_minimum_msat(&this_ptr_conv, val_conv);
}
LDKRouteHintHop this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
this_ptr_conv.is_owned = false;
- LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(((uint64_t)val) & ~1);
+ void* val_ptr = (void*)(((uint64_t)val) & ~1);
+ CHECK_ACCESS(val_ptr);
+ LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
val_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)val) & ~1));
RouteHintHop_set_htlc_maximum_msat(&this_ptr_conv, val_conv);
}
fees_arg_conv.inner = (void*)(fees_arg & (~1));
fees_arg_conv.is_owned = (fees_arg & 1) || (fees_arg == 0);
fees_arg_conv = RoutingFees_clone(&fees_arg_conv);
- LDKCOption_u64Z htlc_minimum_msat_arg_conv = *(LDKCOption_u64Z*)(((uint64_t)htlc_minimum_msat_arg) & ~1);
+ void* htlc_minimum_msat_arg_ptr = (void*)(((uint64_t)htlc_minimum_msat_arg) & ~1);
+ CHECK_ACCESS(htlc_minimum_msat_arg_ptr);
+ LDKCOption_u64Z htlc_minimum_msat_arg_conv = *(LDKCOption_u64Z*)(htlc_minimum_msat_arg_ptr);
htlc_minimum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)htlc_minimum_msat_arg) & ~1));
- LDKCOption_u64Z htlc_maximum_msat_arg_conv = *(LDKCOption_u64Z*)(((uint64_t)htlc_maximum_msat_arg) & ~1);
+ void* htlc_maximum_msat_arg_ptr = (void*)(((uint64_t)htlc_maximum_msat_arg) & ~1);
+ CHECK_ACCESS(htlc_maximum_msat_arg_ptr);
+ LDKCOption_u64Z htlc_maximum_msat_arg_conv = *(LDKCOption_u64Z*)(htlc_maximum_msat_arg_ptr);
htlc_maximum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)htlc_maximum_msat_arg) & ~1));
LDKRouteHintHop ret_var = RouteHintHop_new(src_node_id_arg_ref, short_channel_id_arg, fees_arg_conv, cltv_expiry_delta_arg, htlc_minimum_msat_arg_conv, htlc_maximum_msat_arg_conv);
CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
last_hops_conv_11_conv = RouteHint_clone(&last_hops_conv_11_conv);
last_hops_constr.data[l] = last_hops_conv_11_conv;
}
- LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1);
- LDKScore* scorer_conv = (LDKScore*)(((uint64_t)scorer) & ~1);
+ void* logger_ptr = (void*)(((uint64_t)logger) & ~1);
+ CHECK_ACCESS(logger_ptr);
+ LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
+ void* scorer_ptr = (void*)(((uint64_t)scorer) & ~1);
+ if (!(scorer & 1)) { CHECK_ACCESS(scorer_ptr); }
+ LDKScore* scorer_conv = (LDKScore*)scorer_ptr;
LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
*ret_conv = get_keysend_route(our_node_pubkey_ref, &network_conv, payee_ref, first_hops_ptr, last_hops_constr, final_value_msat, final_cltv, logger_conv, scorer_conv);
if (first_hops_ptr != NULL) { FREE(first_hops_constr.data); }
last_hops_conv_11_conv = RouteHint_clone(&last_hops_conv_11_conv);
last_hops_constr.data[l] = last_hops_conv_11_conv;
}
- LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1);
- LDKScore* scorer_conv = (LDKScore*)(((uint64_t)scorer) & ~1);
+ void* logger_ptr = (void*)(((uint64_t)logger) & ~1);
+ CHECK_ACCESS(logger_ptr);
+ LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
+ void* scorer_ptr = (void*)(((uint64_t)scorer) & ~1);
+ if (!(scorer & 1)) { CHECK_ACCESS(scorer_ptr); }
+ LDKScore* scorer_conv = (LDKScore*)scorer_ptr;
LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
*ret_conv = get_route(our_node_pubkey_ref, &network_conv, payee_ref, payee_features_conv, first_hops_ptr, last_hops_constr, final_value_msat, final_cltv, logger_conv, scorer_conv);
if (first_hops_ptr != NULL) { FREE(first_hops_constr.data); }
LDKFilesystemPersister this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(((uint64_t)keys_manager) & ~1);
+ void* keys_manager_ptr = (void*)(((uint64_t)keys_manager) & ~1);
+ CHECK_ACCESS(keys_manager_ptr);
+ LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(keys_manager_ptr);
LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ), "LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ");
*ret_conv = FilesystemPersister_read_channelmonitors(&this_arg_conv, keys_manager_conv);
return (uint64_t)ret_conv;
void __attribute__((visibility("default"))) TS_ChannelManagerPersister_free(uint32_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKChannelManagerPersister this_ptr_conv = *(LDKChannelManagerPersister*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKChannelManagerPersister this_ptr_conv = *(LDKChannelManagerPersister*)(this_ptr_ptr);
FREE((void*)this_ptr);
ChannelManagerPersister_free(this_ptr_conv);
}
uint32_t __attribute__((visibility("default"))) TS_BackgroundProcessor_start(uint32_t persister, uint32_t event_handler, uint32_t chain_monitor, uint32_t channel_manager, uint32_t net_graph_msg_handler, uint32_t peer_manager, uint32_t logger) {
- LDKChannelManagerPersister persister_conv = *(LDKChannelManagerPersister*)(((uint64_t)persister) & ~1);
- LDKEventHandler event_handler_conv = *(LDKEventHandler*)(((uint64_t)event_handler) & ~1);
+ void* persister_ptr = (void*)(((uint64_t)persister) & ~1);
+ CHECK_ACCESS(persister_ptr);
+ LDKChannelManagerPersister persister_conv = *(LDKChannelManagerPersister*)(persister_ptr);
+ void* event_handler_ptr = (void*)(((uint64_t)event_handler) & ~1);
+ CHECK_ACCESS(event_handler_ptr);
+ LDKEventHandler event_handler_conv = *(LDKEventHandler*)(event_handler_ptr);
LDKChainMonitor chain_monitor_conv;
chain_monitor_conv.inner = (void*)(chain_monitor & (~1));
chain_monitor_conv.is_owned = false;
LDKPeerManager peer_manager_conv;
peer_manager_conv.inner = (void*)(peer_manager & (~1));
peer_manager_conv.is_owned = false;
- LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1);
+ void* logger_ptr = (void*)(((uint64_t)logger) & ~1);
+ CHECK_ACCESS(logger_ptr);
+ LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
LDKBackgroundProcessor ret_var = BackgroundProcessor_start(persister_conv, event_handler_conv, &chain_monitor_conv, &channel_manager_conv, net_graph_msg_handler_conv, &peer_manager_conv, logger_conv);
CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
void __attribute__((visibility("default"))) TS_Fallback_free(uint32_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKFallback this_ptr_conv = *(LDKFallback*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKFallback this_ptr_conv = *(LDKFallback*)(this_ptr_ptr);
FREE((void*)this_ptr);
Fallback_free(this_ptr_conv);
}
void __attribute__((visibility("default"))) TS_SignOrCreationError_free(uint32_t this_ptr) {
if ((this_ptr & 1) != 0) return;
- LDKSignOrCreationError this_ptr_conv = *(LDKSignOrCreationError*)(((uint64_t)this_ptr) & ~1);
+ void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKSignOrCreationError this_ptr_conv = *(LDKSignOrCreationError*)(this_ptr_ptr);
FREE((void*)this_ptr);
SignOrCreationError_free(this_ptr_conv);
}
LDKChannelManager channelmanager_conv;
channelmanager_conv.inner = (void*)(channelmanager & (~1));
channelmanager_conv.is_owned = false;
- LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(((uint64_t)keys_manager) & ~1);
+ void* keys_manager_ptr = (void*)(((uint64_t)keys_manager) & ~1);
+ CHECK_ACCESS(keys_manager_ptr);
+ LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(keys_manager_ptr);
LDKCurrency network_conv = LDKCurrency_from_js(network);
- LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(((uint64_t)amt_msat) & ~1);
+ void* amt_msat_ptr = (void*)(((uint64_t)amt_msat) & ~1);
+ CHECK_ACCESS(amt_msat_ptr);
+ LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr);
amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)amt_msat) & ~1));
LDKStr description_conv = str_ref_to_owned_c(description);
LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
public static native boolean LDKCResult_TxOutAccessErrorZ_result_ok(long arg);
public static native number LDKCResult_TxOutAccessErrorZ_get_ok(long arg);
public static native AccessError LDKCResult_TxOutAccessErrorZ_get_err(long arg);
- public static native long LDKC2Tuple_usizeTransactionZ_new(number a, Uint8Array b);
// uintptr_t C2Tuple_usizeTransactionZ_get_a(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR tuple);
export function C2Tuple_usizeTransactionZ_get_a(tuple: number): number {
if(!isWasmInitialized) {
public static native boolean LDKCResult_NoneNoneZ_result_ok(long arg);
public static native void LDKCResult_NoneNoneZ_get_ok(long arg);
public static native void LDKCResult_NoneNoneZ_get_err(long arg);
- public static native long LDKC2Tuple_SignatureCVec_SignatureZZ_new(Uint8Array a, Uint8Array[] b);
// struct LDKSignature C2Tuple_SignatureCVec_SignatureZZ_get_a(LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR tuple);
export function C2Tuple_SignatureCVec_SignatureZZ_get_a(tuple: number): Uint8Array {
if(!isWasmInitialized) {
public static native boolean LDKCResult_TransactionNoneZ_result_ok(long arg);
public static native Uint8Array LDKCResult_TransactionNoneZ_get_ok(long arg);
public static native void LDKCResult_TransactionNoneZ_get_err(long arg);
- public static native long LDKC2Tuple_BlockHashChannelMonitorZ_new(Uint8Array a, number b);
// struct LDKThirtyTwoBytes C2Tuple_BlockHashChannelMonitorZ_get_a(LDKC2Tuple_BlockHashChannelMonitorZ *NONNULL_PTR tuple);
export function C2Tuple_BlockHashChannelMonitorZ_get_a(tuple: number): Uint8Array {
if(!isWasmInitialized) {
public static native boolean LDKCResult_NonePaymentSendFailureZ_result_ok(long arg);
public static native void LDKCResult_NonePaymentSendFailureZ_get_ok(long arg);
public static native number LDKCResult_NonePaymentSendFailureZ_get_err(long arg);
- public static native long LDKC2Tuple_PaymentHashPaymentIdZ_new(Uint8Array a, number b);
// struct LDKThirtyTwoBytes C2Tuple_PaymentHashPaymentIdZ_get_a(LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR tuple);
export function C2Tuple_PaymentHashPaymentIdZ_get_a(tuple: number): Uint8Array {
if(!isWasmInitialized) {
static { LDKNetAddress.init(); }
public static native LDKNetAddress LDKNetAddress_ref_from_ptr(long ptr);
public static native long LDKCVec_NetAddressZ_new(number[] elems);
- public static native long LDKC2Tuple_PaymentHashPaymentSecretZ_new(Uint8Array a, Uint8Array b);
// struct LDKThirtyTwoBytes C2Tuple_PaymentHashPaymentSecretZ_get_a(LDKC2Tuple_PaymentHashPaymentSecretZ *NONNULL_PTR tuple);
export function C2Tuple_PaymentHashPaymentSecretZ_get_a(tuple: number): Uint8Array {
if(!isWasmInitialized) {
// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: END
- public static native long LDKC2Tuple_BlockHashChannelManagerZ_new(Uint8Array a, number b);
// struct LDKThirtyTwoBytes C2Tuple_BlockHashChannelManagerZ_get_a(LDKC2Tuple_BlockHashChannelManagerZ *NONNULL_PTR tuple);
export function C2Tuple_BlockHashChannelManagerZ_get_a(tuple: number): Uint8Array {
if(!isWasmInitialized) {
public static native boolean LDKCResult_SignedRawInvoiceNoneZ_result_ok(long arg);
public static native number LDKCResult_SignedRawInvoiceNoneZ_get_ok(long arg);
public static native void LDKCResult_SignedRawInvoiceNoneZ_get_err(long arg);
- public static native long LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ_new(number a, Uint8Array b, number c);
// struct LDKRawInvoice C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_a(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR tuple);
export function C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_a(tuple: number): number {
if(!isWasmInitialized) {
public static native boolean LDKCResult_NoneMonitorUpdateErrorZ_result_ok(long arg);
public static native void LDKCResult_NoneMonitorUpdateErrorZ_get_ok(long arg);
public static native number LDKCResult_NoneMonitorUpdateErrorZ_get_err(long arg);
- public static native long LDKC2Tuple_OutPointScriptZ_new(number a, Uint8Array b);
// struct LDKOutPoint C2Tuple_OutPointScriptZ_get_a(LDKC2Tuple_OutPointScriptZ *NONNULL_PTR tuple);
export function C2Tuple_OutPointScriptZ_get_a(tuple: number): number {
if(!isWasmInitialized) {
const nativeResponseValue = wasm.C2Tuple_OutPointScriptZ_get_b(tuple);
return decodeArray(nativeResponseValue);
}
- public static native long LDKC2Tuple_u32ScriptZ_new(number a, Uint8Array b);
// uint32_t C2Tuple_u32ScriptZ_get_a(LDKC2Tuple_u32ScriptZ *NONNULL_PTR tuple);
export function C2Tuple_u32ScriptZ_get_a(tuple: number): number {
if(!isWasmInitialized) {
return decodeArray(nativeResponseValue);
}
public static native long LDKCVec_C2Tuple_u32ScriptZZ_new(number[] elems);
- public static native long LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new(Uint8Array a, number[] b);
// struct LDKThirtyTwoBytes C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_a(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *NONNULL_PTR tuple);
export function C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_a(tuple: number): Uint8Array {
if(!isWasmInitialized) {
static { LDKEvent.init(); }
public static native LDKEvent LDKEvent_ref_from_ptr(long ptr);
public static native long LDKCVec_EventZ_new(number[] elems);
- public static native long LDKC2Tuple_u32TxOutZ_new(number a, number b);
// uint32_t C2Tuple_u32TxOutZ_get_a(LDKC2Tuple_u32TxOutZ *NONNULL_PTR tuple);
export function C2Tuple_u32TxOutZ_get_a(tuple: number): number {
if(!isWasmInitialized) {
return nativeResponseValue;
}
public static native long LDKCVec_C2Tuple_u32TxOutZZ_new(number[] elems);
- public static native long LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(Uint8Array a, number[] b);
// struct LDKThirtyTwoBytes C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_a(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR tuple);
export function C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_a(tuple: number): Uint8Array {
if(!isWasmInitialized) {
public static native boolean LDKCResult_NoneLightningErrorZ_result_ok(long arg);
public static native void LDKCResult_NoneLightningErrorZ_get_ok(long arg);
public static native number LDKCResult_NoneLightningErrorZ_get_err(long arg);
- public static native long LDKC2Tuple_PublicKeyTypeZ_new(Uint8Array a, number b);
// struct LDKPublicKey C2Tuple_PublicKeyTypeZ_get_a(LDKC2Tuple_PublicKeyTypeZ *NONNULL_PTR tuple);
export function C2Tuple_PublicKeyTypeZ_get_a(tuple: number): Uint8Array {
if(!isWasmInitialized) {
public static native boolean LDKCResult_boolLightningErrorZ_result_ok(long arg);
public static native boolean LDKCResult_boolLightningErrorZ_get_ok(long arg);
public static native number LDKCResult_boolLightningErrorZ_get_err(long arg);
- public static native long LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(number a, number b, number c);
// struct LDKChannelAnnouncement C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR tuple);
export function C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a(tuple: number): number {
if(!isWasmInitialized) {
const nativeResponseValue = wasm.CResult_ShutdownScriptInvalidShutdownScriptZ_free(_res);
// debug statements here
}
+ // struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_clone(const struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR orig);
+ export function CResult_ShutdownScriptInvalidShutdownScriptZ_clone(orig: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.CResult_ShutdownScriptInvalidShutdownScriptZ_clone(orig);
+ return nativeResponseValue;
+ }
// struct LDKCResult_NoneErrorZ CResult_NoneErrorZ_ok(void);
export function CResult_NoneErrorZ_ok(): number {
if(!isWasmInitialized) {
const nativeResponseValue = wasm.ClosingTransaction_free(this_obj);
// debug statements here
}
+ // struct LDKClosingTransaction ClosingTransaction_clone(const struct LDKClosingTransaction *NONNULL_PTR orig);
+ export function ClosingTransaction_clone(orig: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.ClosingTransaction_clone(orig);
+ return nativeResponseValue;
+ }
+ // uint64_t ClosingTransaction_hash(const struct LDKClosingTransaction *NONNULL_PTR o);
+ export function ClosingTransaction_hash(o: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.ClosingTransaction_hash(o);
+ return nativeResponseValue;
+ }
// MUST_USE_RES struct LDKClosingTransaction ClosingTransaction_new(uint64_t to_holder_value_sat, uint64_t to_counterparty_value_sat, struct LDKCVec_u8Z to_holder_script, struct LDKCVec_u8Z to_counterparty_script, struct LDKOutPoint funding_outpoint);
export function ClosingTransaction_new(to_holder_value_sat: number, to_counterparty_value_sat: number, to_holder_script: Uint8Array, to_counterparty_script: Uint8Array, funding_outpoint: number): number {
if(!isWasmInitialized) {
const nativeResponseValue = wasm.InvalidShutdownScript_new(encodeArray(script_arg));
return nativeResponseValue;
}
+ // struct LDKInvalidShutdownScript InvalidShutdownScript_clone(const struct LDKInvalidShutdownScript *NONNULL_PTR orig);
+ export function InvalidShutdownScript_clone(orig: number): number {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.InvalidShutdownScript_clone(orig);
+ return nativeResponseValue;
+ }
// struct LDKCVec_u8Z ShutdownScript_write(const struct LDKShutdownScript *NONNULL_PTR obj);
export function ShutdownScript_write(obj: number): Uint8Array {
if(!isWasmInitialized) {
bindings.ClosingTransaction_free(this.ptr);
}
}
+ public ClosingTransaction clone() {
+ number ret = bindings.ClosingTransaction_clone(this.ptr);
+ const ret_hu_conv: ClosingTransaction = new ClosingTransaction(null, ret);
+ ret_hu_conv.ptrs_to.add(this);
+ return ret_hu_conv;
+ }
+
+ public number hash() {
+ number ret = bindings.ClosingTransaction_hash(this.ptr);
+ return ret;
+ }
+
public static ClosingTransaction constructor_new(number to_holder_value_sat, number to_counterparty_value_sat, Uint8Array to_holder_script, Uint8Array to_counterparty_script, OutPoint funding_outpoint) {
number ret = bindings.ClosingTransaction_new(to_holder_value_sat, to_counterparty_value_sat, to_holder_script, to_counterparty_script, funding_outpoint == null ? 0 : funding_outpoint.ptr & ~1);
const ret_hu_conv: ClosingTransaction = new ClosingTransaction(null, ret);
return ret_hu_conv;
}
+ public InvalidShutdownScript clone() {
+ number ret = bindings.InvalidShutdownScript_clone(this.ptr);
+ const ret_hu_conv: InvalidShutdownScript = new InvalidShutdownScript(null, ret);
+ ret_hu_conv.ptrs_to.add(this);
+ return ret_hu_conv;
+ }
+
}
return ret_hu_conv;
}
- public static Result_ShutdownScriptInvalidShutdownScriptZ constructor_err(Uint8Array e_script_arg) {
- number ret = bindings.CResult_ShutdownScriptInvalidShutdownScriptZ_err(bindings.InvalidShutdownScript_new(e_script_arg));
+ public static Result_ShutdownScriptInvalidShutdownScriptZ constructor_err(InvalidShutdownScript e) {
+ number ret = bindings.CResult_ShutdownScriptInvalidShutdownScriptZ_err(e == null ? 0 : e.ptr & ~1);
+ Result_ShutdownScriptInvalidShutdownScriptZ ret_hu_conv = Result_ShutdownScriptInvalidShutdownScriptZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
+ public Result_ShutdownScriptInvalidShutdownScriptZ clone() {
+ number ret = bindings.CResult_ShutdownScriptInvalidShutdownScriptZ_clone(this.ptr);
Result_ShutdownScriptInvalidShutdownScriptZ ret_hu_conv = Result_ShutdownScriptInvalidShutdownScriptZ.constr_from_ptr(ret);
return ret_hu_conv;
}