X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fmain%2Fjni%2Fbindings.c.body;h=869ef719420dedcab0c7fe1db16313edd9866cc1;hb=f3e670e9341decac613d33fc52febf19cea32f20;hp=3b19333747edec288430e7ca49ccb86aff6705c4;hpb=e30b350e325e7d517ea744578876d473839ad495;p=ldk-java diff --git a/src/main/jni/bindings.c.body b/src/main/jni/bindings.c.body index 3b193337..869ef719 100644 --- a/src/main/jni/bindings.c.body +++ b/src/main/jni/bindings.c.body @@ -11,6 +11,7 @@ #define MALLOC(a, _) malloc(a) #define FREE(p) if ((uint64_t)(p) > 4096) { free(p); } #define CHECK_ACCESS(p) +#define CHECK_INNER_FIELD_ACCESS_OR_NULL(v) #define DO_ASSERT(a) (void)(a) #define CHECK(a) @@ -721,21 +722,6 @@ static inline jclass LDKSiPrefix_to_java(JNIEnv *env, LDKSiPrefix val) { } } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1u8Z_1new(JNIEnv *env, jclass clz, int8_tArray elems) { - LDKCVec_u8Z *ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(uint8_t) * ret->datalen, "LDKCVec_u8Z Data"); - int8_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); - for (size_t i = 0; i < ret->datalen; i++) { - ret->data[i] = java_elems[i]; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_u8Z CVec_u8Z_clone(const LDKCVec_u8Z *orig) { LDKCVec_u8Z ret = { .data = MALLOC(sizeof(int8_t) * orig->datalen, "LDKCVec_u8Z clone bytes"), .datalen = orig->datalen }; memcpy(ret.data, orig->data, sizeof(int8_t) * ret.datalen); @@ -756,9 +742,6 @@ uint64_t TxOut_get_value (struct LDKTxOut* thing) { return thing->value;}JNIEXPO return ret_val; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SecretKeyErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_SecretKeyErrorZ*)arg)->result_ok; -} JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SecretKeyErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_SecretKeyErrorZ *val = (LDKCResult_SecretKeyErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -772,9 +755,6 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SecretKeyErrorZ_ jclass err_conv = LDKSecp256k1Error_to_java(env, (*val->contents.err)); return err_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PublicKeyErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_PublicKeyErrorZ*)arg)->result_ok; -} JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PublicKeyErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_PublicKeyErrorZ *val = (LDKCResult_PublicKeyErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -788,9 +768,6 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PublicKeyErrorZ_ jclass err_conv = LDKSecp256k1Error_to_java(env, (*val->contents.err)); return err_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxCreationKeysDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_TxCreationKeysDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxCreationKeysDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_TxCreationKeysDecodeErrorZ *val = (LDKCResult_TxCreationKeysDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -798,6 +775,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxCreationKeysD uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -808,12 +786,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxCreationKeysD uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelPublicKeysDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_ChannelPublicKeysDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelPublicKeysDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_ChannelPublicKeysDecodeErrorZ *val = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -821,6 +797,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelPublicKe uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -831,12 +808,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelPublicKe uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxCreationKeysErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_TxCreationKeysErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxCreationKeysErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_TxCreationKeysErrorZ *val = (LDKCResult_TxCreationKeysErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -844,6 +819,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxCreationKeysE uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -881,9 +857,6 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1u32Z_1ref_1from default: abort(); } } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1HTLCOutputInCommitmentDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1HTLCOutputInCommitmentDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *val = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -891,6 +864,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1HTLCOutputInCom uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -901,12 +875,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1HTLCOutputInCom uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CounterpartyChannelTransactionParametersDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CounterpartyChannelTransactionParametersDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *val = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -914,6 +886,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CounterpartyCha uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -924,12 +897,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CounterpartyCha uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelTransactionParametersDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_ChannelTransactionParametersDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelTransactionParametersDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_ChannelTransactionParametersDecodeErrorZ *val = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -937,6 +908,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelTransact uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -947,12 +919,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelTransact uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1HolderCommitmentTransactionDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1HolderCommitmentTransactionDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_HolderCommitmentTransactionDecodeErrorZ *val = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -960,6 +930,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1HolderCommitmen uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -970,12 +941,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1HolderCommitmen uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1BuiltCommitmentTransactionDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1BuiltCommitmentTransactionDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *val = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -983,6 +952,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1BuiltCommitment uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -993,12 +963,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1BuiltCommitment uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TrustedClosingTransactionNoneZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_TrustedClosingTransactionNoneZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TrustedClosingTransactionNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_TrustedClosingTransactionNoneZ *val = (LDKCResult_TrustedClosingTransactionNoneZ*)(arg & ~1); CHECK(val->result_ok); @@ -1006,6 +974,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TrustedClosingT uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -1014,9 +983,6 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TrustedClosingTran CHECK(!val->result_ok); return *val->contents.err; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CommitmentTransactionDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_CommitmentTransactionDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CommitmentTransactionDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_CommitmentTransactionDecodeErrorZ *val = (LDKCResult_CommitmentTransactionDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -1024,6 +990,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CommitmentTrans uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -1034,12 +1001,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CommitmentTrans uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TrustedCommitmentTransactionNoneZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_TrustedCommitmentTransactionNoneZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TrustedCommitmentTransactionNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_TrustedCommitmentTransactionNoneZ *val = (LDKCResult_TrustedCommitmentTransactionNoneZ*)(arg & ~1); CHECK(val->result_ok); @@ -1047,6 +1012,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TrustedCommitme uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -1055,9 +1021,6 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TrustedCommitmentT CHECK(!val->result_ok); return *val->contents.err; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1SignatureZNoneZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_CVec_SignatureZNoneZ*)arg)->result_ok; -} JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1SignatureZNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_CVec_SignatureZNoneZ *val = (LDKCResult_CVec_SignatureZNoneZ*)(arg & ~1); CHECK(val->result_ok); @@ -1078,9 +1041,6 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1SignatureZNo CHECK(!val->result_ok); return *val->contents.err; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ShutdownScriptDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_ShutdownScriptDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ShutdownScriptDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_ShutdownScriptDecodeErrorZ *val = (LDKCResult_ShutdownScriptDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -1088,6 +1048,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ShutdownScriptD uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -1098,12 +1059,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ShutdownScriptD uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ShutdownScriptInvalidShutdownScriptZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ShutdownScriptInvalidShutdownScriptZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_ShutdownScriptInvalidShutdownScriptZ *val = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)(arg & ~1); CHECK(val->result_ok); @@ -1111,6 +1070,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ShutdownScriptI uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -1121,12 +1081,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ShutdownScriptI uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_NoneErrorZ*)arg)->result_ok; -} JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_NoneErrorZ *val = (LDKCResult_NoneErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -1138,9 +1096,6 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneErrorZ_1get_ jclass err_conv = LDKIOError_to_java(env, (*val->contents.err)); return err_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteHopDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_RouteHopDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteHopDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_RouteHopDecodeErrorZ *val = (LDKCResult_RouteHopDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -1148,6 +1103,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteHopDecodeE uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -1158,29 +1114,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteHopDecodeE uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1RouteHopZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) { - LDKCVec_RouteHopZ *ret = MALLOC(sizeof(LDKCVec_RouteHopZ), "LDKCVec_RouteHopZ"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKRouteHop) * ret->datalen, "LDKCVec_RouteHopZ 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]; - LDKRouteHop arr_elem_conv; - arr_elem_conv.inner = (void*)(arr_elem & (~1)); - arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0); - arr_elem_conv = RouteHop_clone(&arr_elem_conv); - ret->data[i] = arr_elem_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_RouteHopZ CVec_RouteHopZ_clone(const LDKCVec_RouteHopZ *orig) { LDKCVec_RouteHopZ ret = { .data = MALLOC(sizeof(LDKRouteHop) * orig->datalen, "LDKCVec_RouteHopZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -1195,9 +1132,6 @@ static inline LDKCVec_CVec_RouteHopZZ CVec_CVec_RouteHopZZ_clone(const LDKCVec_C } return ret; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_RouteDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_RouteDecodeErrorZ *val = (LDKCResult_RouteDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -1205,6 +1139,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteDecodeErro uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -1215,12 +1150,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteDecodeErro uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteParametersDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_RouteParametersDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteParametersDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_RouteParametersDecodeErrorZ *val = (LDKCResult_RouteParametersDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -1228,6 +1161,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteParameters uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -1238,29 +1172,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteParameters uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1RouteHintZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) { - LDKCVec_RouteHintZ *ret = MALLOC(sizeof(LDKCVec_RouteHintZ), "LDKCVec_RouteHintZ"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKRouteHint) * ret->datalen, "LDKCVec_RouteHintZ 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]; - LDKRouteHint arr_elem_conv; - arr_elem_conv.inner = (void*)(arr_elem & (~1)); - arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0); - arr_elem_conv = RouteHint_clone(&arr_elem_conv); - ret->data[i] = arr_elem_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_RouteHintZ CVec_RouteHintZ_clone(const LDKCVec_RouteHintZ *orig) { LDKCVec_RouteHintZ ret = { .data = MALLOC(sizeof(LDKRouteHint) * orig->datalen, "LDKCVec_RouteHintZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -1296,9 +1211,6 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1u64Z_1ref_1from default: abort(); } } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PayeeDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_PayeeDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PayeeDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_PayeeDecodeErrorZ *val = (LDKCResult_PayeeDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -1306,6 +1218,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PayeeDecodeErro uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -1316,29 +1229,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PayeeDecodeErro uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1RouteHintHopZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) { - LDKCVec_RouteHintHopZ *ret = MALLOC(sizeof(LDKCVec_RouteHintHopZ), "LDKCVec_RouteHintHopZ"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKRouteHintHop) * ret->datalen, "LDKCVec_RouteHintHopZ 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]; - LDKRouteHintHop arr_elem_conv; - arr_elem_conv.inner = (void*)(arr_elem & (~1)); - arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0); - arr_elem_conv = RouteHintHop_clone(&arr_elem_conv); - ret->data[i] = arr_elem_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_RouteHintHopZ CVec_RouteHintHopZ_clone(const LDKCVec_RouteHintHopZ *orig) { LDKCVec_RouteHintHopZ ret = { .data = MALLOC(sizeof(LDKRouteHintHop) * orig->datalen, "LDKCVec_RouteHintHopZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -1346,9 +1240,6 @@ static inline LDKCVec_RouteHintHopZ CVec_RouteHintHopZ_clone(const LDKCVec_Route } return ret; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteHintDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_RouteHintDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteHintDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_RouteHintDecodeErrorZ *val = (LDKCResult_RouteHintDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -1356,6 +1247,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteHintDecode uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -1366,12 +1258,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteHintDecode uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteHintHopDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_RouteHintHopDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteHintHopDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_RouteHintHopDecodeErrorZ *val = (LDKCResult_RouteHintHopDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -1379,6 +1269,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteHintHopDec uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -1389,29 +1280,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteHintHopDec uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1ChannelDetailsZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) { - LDKCVec_ChannelDetailsZ *ret = MALLOC(sizeof(LDKCVec_ChannelDetailsZ), "LDKCVec_ChannelDetailsZ"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKChannelDetails) * ret->datalen, "LDKCVec_ChannelDetailsZ 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]; - LDKChannelDetails arr_elem_conv; - arr_elem_conv.inner = (void*)(arr_elem & (~1)); - arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0); - arr_elem_conv = ChannelDetails_clone(&arr_elem_conv); - ret->data[i] = arr_elem_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_ChannelDetailsZ CVec_ChannelDetailsZ_clone(const LDKCVec_ChannelDetailsZ *orig) { LDKCVec_ChannelDetailsZ ret = { .data = MALLOC(sizeof(LDKChannelDetails) * orig->datalen, "LDKCVec_ChannelDetailsZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -1419,9 +1291,6 @@ static inline LDKCVec_ChannelDetailsZ CVec_ChannelDetailsZ_clone(const LDKCVec_C } return ret; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteLightningErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_RouteLightningErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteLightningErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_RouteLightningErrorZ *val = (LDKCResult_RouteLightningErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -1429,6 +1298,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteLightningE uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -1439,12 +1309,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteLightningE uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxOutAccessErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_TxOutAccessErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxOutAccessErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_TxOutAccessErrorZ *val = (LDKCResult_TxOutAccessErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -1478,26 +1346,6 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransacti return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1C2Tuple_1usizeTransactionZZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) { - LDKCVec_C2Tuple_usizeTransactionZZ *ret = MALLOC(sizeof(LDKCVec_C2Tuple_usizeTransactionZZ), "LDKCVec_C2Tuple_usizeTransactionZZ"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ) * ret->datalen, "LDKCVec_C2Tuple_usizeTransactionZZ 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]; - 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; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_C2Tuple_usizeTransactionZZ CVec_C2Tuple_usizeTransactionZZ_clone(const LDKCVec_C2Tuple_usizeTransactionZZ *orig) { LDKCVec_C2Tuple_usizeTransactionZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ) * orig->datalen, "LDKCVec_C2Tuple_usizeTransactionZZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -1512,9 +1360,6 @@ static inline LDKCVec_TxidZ CVec_ThirtyTwoBytesZ_clone(const LDKCVec_TxidZ *orig } return ret; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneChannelMonitorUpdateErrZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_NoneChannelMonitorUpdateErrZ*)arg)->result_ok; -} JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneChannelMonitorUpdateErrZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_NoneChannelMonitorUpdateErrZ *val = (LDKCResult_NoneChannelMonitorUpdateErrZ*)(arg & ~1); CHECK(val->result_ok); @@ -1564,6 +1409,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMonitorEvent_1ref_1from_ uint64_t htlc_event_ref = 0; CHECK((((uint64_t)htlc_event_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&htlc_event_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_event_var); htlc_event_ref = (uint64_t)htlc_event_var.inner & ~1; return (*env)->NewObject(env, LDKMonitorEvent_HTLCEvent_class, LDKMonitorEvent_HTLCEvent_meth, htlc_event_ref); } @@ -1572,6 +1418,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMonitorEvent_1ref_1from_ uint64_t commitment_tx_confirmed_ref = 0; CHECK((((uint64_t)commitment_tx_confirmed_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&commitment_tx_confirmed_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_confirmed_var); commitment_tx_confirmed_ref = (uint64_t)commitment_tx_confirmed_var.inner & ~1; return (*env)->NewObject(env, LDKMonitorEvent_CommitmentTxConfirmed_class, LDKMonitorEvent_CommitmentTxConfirmed_meth, commitment_tx_confirmed_ref); } @@ -1580,6 +1427,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMonitorEvent_1ref_1from_ uint64_t funding_txo_ref = 0; CHECK((((uint64_t)funding_txo_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&funding_txo_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_var); funding_txo_ref = (uint64_t)funding_txo_var.inner & ~1; return (*env)->NewObject(env, LDKMonitorEvent_UpdateCompleted_class, LDKMonitorEvent_UpdateCompleted_meth, funding_txo_ref, obj->update_completed.monitor_update_id); } @@ -1588,32 +1436,13 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMonitorEvent_1ref_1from_ uint64_t update_failed_ref = 0; CHECK((((uint64_t)update_failed_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&update_failed_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_failed_var); update_failed_ref = (uint64_t)update_failed_var.inner & ~1; return (*env)->NewObject(env, LDKMonitorEvent_UpdateFailed_class, LDKMonitorEvent_UpdateFailed_meth, update_failed_ref); } default: abort(); } } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1MonitorEventZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) { - LDKCVec_MonitorEventZ *ret = MALLOC(sizeof(LDKCVec_MonitorEventZ), "LDKCVec_MonitorEventZ"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKMonitorEvent) * ret->datalen, "LDKCVec_MonitorEventZ 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]; - 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; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_MonitorEventZ CVec_MonitorEventZ_clone(const LDKCVec_MonitorEventZ *orig) { LDKCVec_MonitorEventZ ret = { .data = MALLOC(sizeof(LDKMonitorEvent) * orig->datalen, "LDKCVec_MonitorEventZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -1652,6 +1481,134 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1C2Tuple_1usizeT default: abort(); } } +static jclass LDKClosureReason_CounterpartyForceClosed_class = NULL; +static jmethodID LDKClosureReason_CounterpartyForceClosed_meth = NULL; +static jclass LDKClosureReason_HolderForceClosed_class = NULL; +static jmethodID LDKClosureReason_HolderForceClosed_meth = NULL; +static jclass LDKClosureReason_CooperativeClosure_class = NULL; +static jmethodID LDKClosureReason_CooperativeClosure_meth = NULL; +static jclass LDKClosureReason_CommitmentTxConfirmed_class = NULL; +static jmethodID LDKClosureReason_CommitmentTxConfirmed_meth = NULL; +static jclass LDKClosureReason_ProcessingError_class = NULL; +static jmethodID LDKClosureReason_ProcessingError_meth = NULL; +static jclass LDKClosureReason_DisconnectedPeer_class = NULL; +static jmethodID LDKClosureReason_DisconnectedPeer_meth = NULL; +static jclass LDKClosureReason_OutdatedChannelManager_class = NULL; +static jmethodID LDKClosureReason_OutdatedChannelManager_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKClosureReason_init (JNIEnv *env, jclass clz) { + LDKClosureReason_CounterpartyForceClosed_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKClosureReason$CounterpartyForceClosed;")); + CHECK(LDKClosureReason_CounterpartyForceClosed_class != NULL); + LDKClosureReason_CounterpartyForceClosed_meth = (*env)->GetMethodID(env, LDKClosureReason_CounterpartyForceClosed_class, "", "(Ljava/lang/String;)V"); + CHECK(LDKClosureReason_CounterpartyForceClosed_meth != NULL); + LDKClosureReason_HolderForceClosed_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKClosureReason$HolderForceClosed;")); + CHECK(LDKClosureReason_HolderForceClosed_class != NULL); + LDKClosureReason_HolderForceClosed_meth = (*env)->GetMethodID(env, LDKClosureReason_HolderForceClosed_class, "", "()V"); + CHECK(LDKClosureReason_HolderForceClosed_meth != NULL); + LDKClosureReason_CooperativeClosure_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKClosureReason$CooperativeClosure;")); + CHECK(LDKClosureReason_CooperativeClosure_class != NULL); + LDKClosureReason_CooperativeClosure_meth = (*env)->GetMethodID(env, LDKClosureReason_CooperativeClosure_class, "", "()V"); + CHECK(LDKClosureReason_CooperativeClosure_meth != NULL); + LDKClosureReason_CommitmentTxConfirmed_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKClosureReason$CommitmentTxConfirmed;")); + CHECK(LDKClosureReason_CommitmentTxConfirmed_class != NULL); + LDKClosureReason_CommitmentTxConfirmed_meth = (*env)->GetMethodID(env, LDKClosureReason_CommitmentTxConfirmed_class, "", "()V"); + CHECK(LDKClosureReason_CommitmentTxConfirmed_meth != NULL); + LDKClosureReason_ProcessingError_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKClosureReason$ProcessingError;")); + CHECK(LDKClosureReason_ProcessingError_class != NULL); + LDKClosureReason_ProcessingError_meth = (*env)->GetMethodID(env, LDKClosureReason_ProcessingError_class, "", "(Ljava/lang/String;)V"); + CHECK(LDKClosureReason_ProcessingError_meth != NULL); + LDKClosureReason_DisconnectedPeer_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKClosureReason$DisconnectedPeer;")); + CHECK(LDKClosureReason_DisconnectedPeer_class != NULL); + LDKClosureReason_DisconnectedPeer_meth = (*env)->GetMethodID(env, LDKClosureReason_DisconnectedPeer_class, "", "()V"); + CHECK(LDKClosureReason_DisconnectedPeer_meth != NULL); + LDKClosureReason_OutdatedChannelManager_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKClosureReason$OutdatedChannelManager;")); + CHECK(LDKClosureReason_OutdatedChannelManager_class != NULL); + LDKClosureReason_OutdatedChannelManager_meth = (*env)->GetMethodID(env, LDKClosureReason_OutdatedChannelManager_class, "", "()V"); + CHECK(LDKClosureReason_OutdatedChannelManager_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKClosureReason_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKClosureReason *obj = (LDKClosureReason*)(ptr & ~1); + switch(obj->tag) { + case LDKClosureReason_CounterpartyForceClosed: { + LDKStr peer_msg_str = obj->counterparty_force_closed.peer_msg; + jstring peer_msg_conv = str_ref_to_java(env, peer_msg_str.chars, peer_msg_str.len); + return (*env)->NewObject(env, LDKClosureReason_CounterpartyForceClosed_class, LDKClosureReason_CounterpartyForceClosed_meth, peer_msg_conv); + } + case LDKClosureReason_HolderForceClosed: { + return (*env)->NewObject(env, LDKClosureReason_HolderForceClosed_class, LDKClosureReason_HolderForceClosed_meth); + } + case LDKClosureReason_CooperativeClosure: { + return (*env)->NewObject(env, LDKClosureReason_CooperativeClosure_class, LDKClosureReason_CooperativeClosure_meth); + } + case LDKClosureReason_CommitmentTxConfirmed: { + return (*env)->NewObject(env, LDKClosureReason_CommitmentTxConfirmed_class, LDKClosureReason_CommitmentTxConfirmed_meth); + } + case LDKClosureReason_ProcessingError: { + LDKStr err_str = obj->processing_error.err; + jstring err_conv = str_ref_to_java(env, err_str.chars, err_str.len); + return (*env)->NewObject(env, LDKClosureReason_ProcessingError_class, LDKClosureReason_ProcessingError_meth, err_conv); + } + case LDKClosureReason_DisconnectedPeer: { + return (*env)->NewObject(env, LDKClosureReason_DisconnectedPeer_class, LDKClosureReason_DisconnectedPeer_meth); + } + case LDKClosureReason_OutdatedChannelManager: { + return (*env)->NewObject(env, LDKClosureReason_OutdatedChannelManager_class, LDKClosureReason_OutdatedChannelManager_meth); + } + default: abort(); + } +} +static jclass LDKCOption_ClosureReasonZ_Some_class = NULL; +static jmethodID LDKCOption_ClosureReasonZ_Some_meth = NULL; +static jclass LDKCOption_ClosureReasonZ_None_class = NULL; +static jmethodID LDKCOption_ClosureReasonZ_None_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1ClosureReasonZ_init (JNIEnv *env, jclass clz) { + LDKCOption_ClosureReasonZ_Some_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKCOption_ClosureReasonZ$Some;")); + CHECK(LDKCOption_ClosureReasonZ_Some_class != NULL); + LDKCOption_ClosureReasonZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_ClosureReasonZ_Some_class, "", "(J)V"); + CHECK(LDKCOption_ClosureReasonZ_Some_meth != NULL); + LDKCOption_ClosureReasonZ_None_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKCOption_ClosureReasonZ$None;")); + CHECK(LDKCOption_ClosureReasonZ_None_class != NULL); + LDKCOption_ClosureReasonZ_None_meth = (*env)->GetMethodID(env, LDKCOption_ClosureReasonZ_None_class, "", "()V"); + CHECK(LDKCOption_ClosureReasonZ_None_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1ClosureReasonZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKCOption_ClosureReasonZ *obj = (LDKCOption_ClosureReasonZ*)(ptr & ~1); + switch(obj->tag) { + case LDKCOption_ClosureReasonZ_Some: { + uint64_t some_ref = ((uint64_t)&obj->some) | 1; + return (*env)->NewObject(env, LDKCOption_ClosureReasonZ_Some_class, LDKCOption_ClosureReasonZ_Some_meth, some_ref); + } + case LDKCOption_ClosureReasonZ_None: { + return (*env)->NewObject(env, LDKCOption_ClosureReasonZ_None_class, LDKCOption_ClosureReasonZ_None_meth); + } + default: abort(); + } +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1COption_1ClosureReasonZDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_COption_ClosureReasonZDecodeErrorZ *val = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)(arg & ~1); + CHECK(val->result_ok); + uint64_t res_ref = ((uint64_t)&(*val->contents.result)) | 1; + return res_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1COption_1ClosureReasonZDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_COption_ClosureReasonZDecodeErrorZ *val = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)(arg & ~1); + CHECK(!val->result_ok); + LDKDecodeError err_var = (*val->contents.err); + uint64_t err_ref = 0; + CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); + err_ref = (uint64_t)err_var.inner & ~1; + return err_ref; +} static jclass LDKNetworkUpdate_ChannelUpdateMessage_class = NULL; static jmethodID LDKNetworkUpdate_ChannelUpdateMessage_meth = NULL; static jclass LDKNetworkUpdate_ChannelClosed_class = NULL; @@ -1683,6 +1640,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKNetworkUpdate_1ref_1from uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; return (*env)->NewObject(env, LDKNetworkUpdate_ChannelUpdateMessage_class, LDKNetworkUpdate_ChannelUpdateMessage_meth, msg_ref); } @@ -1757,6 +1715,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKSpendableOutputDescripto uint64_t outpoint_ref = 0; CHECK((((uint64_t)outpoint_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&outpoint_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_var); outpoint_ref = (uint64_t)outpoint_var.inner & ~1; uint64_t output_ref = ((uint64_t)&obj->static_output.output) | 1; return (*env)->NewObject(env, LDKSpendableOutputDescriptor_StaticOutput_class, LDKSpendableOutputDescriptor_StaticOutput_meth, outpoint_ref, (uint64_t)output_ref); @@ -1766,6 +1725,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKSpendableOutputDescripto uint64_t delayed_payment_output_ref = 0; CHECK((((uint64_t)delayed_payment_output_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&delayed_payment_output_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(delayed_payment_output_var); delayed_payment_output_ref = (uint64_t)delayed_payment_output_var.inner & ~1; return (*env)->NewObject(env, LDKSpendableOutputDescriptor_DelayedPaymentOutput_class, LDKSpendableOutputDescriptor_DelayedPaymentOutput_meth, delayed_payment_output_ref); } @@ -1774,32 +1734,13 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKSpendableOutputDescripto uint64_t static_payment_output_ref = 0; CHECK((((uint64_t)static_payment_output_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&static_payment_output_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(static_payment_output_var); static_payment_output_ref = (uint64_t)static_payment_output_var.inner & ~1; return (*env)->NewObject(env, LDKSpendableOutputDescriptor_StaticPaymentOutput_class, LDKSpendableOutputDescriptor_StaticPaymentOutput_meth, static_payment_output_ref); } default: abort(); } } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1SpendableOutputDescriptorZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) { - LDKCVec_SpendableOutputDescriptorZ *ret = MALLOC(sizeof(LDKCVec_SpendableOutputDescriptorZ), "LDKCVec_SpendableOutputDescriptorZ"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKSpendableOutputDescriptor) * ret->datalen, "LDKCVec_SpendableOutputDescriptorZ 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]; - 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; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_SpendableOutputDescriptorZ CVec_SpendableOutputDescriptorZ_clone(const LDKCVec_SpendableOutputDescriptorZ *orig) { LDKCVec_SpendableOutputDescriptorZ ret = { .data = MALLOC(sizeof(LDKSpendableOutputDescriptor) * orig->datalen, "LDKCVec_SpendableOutputDescriptorZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -1807,6 +1748,245 @@ static inline LDKCVec_SpendableOutputDescriptorZ CVec_SpendableOutputDescriptorZ } return ret; } +static jclass LDKPaymentPurpose_InvoicePayment_class = NULL; +static jmethodID LDKPaymentPurpose_InvoicePayment_meth = NULL; +static jclass LDKPaymentPurpose_SpontaneousPayment_class = NULL; +static jmethodID LDKPaymentPurpose_SpontaneousPayment_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKPaymentPurpose_init (JNIEnv *env, jclass clz) { + LDKPaymentPurpose_InvoicePayment_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKPaymentPurpose$InvoicePayment;")); + CHECK(LDKPaymentPurpose_InvoicePayment_class != NULL); + LDKPaymentPurpose_InvoicePayment_meth = (*env)->GetMethodID(env, LDKPaymentPurpose_InvoicePayment_class, "", "([B[BJ)V"); + CHECK(LDKPaymentPurpose_InvoicePayment_meth != NULL); + LDKPaymentPurpose_SpontaneousPayment_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKPaymentPurpose$SpontaneousPayment;")); + CHECK(LDKPaymentPurpose_SpontaneousPayment_class != NULL); + LDKPaymentPurpose_SpontaneousPayment_meth = (*env)->GetMethodID(env, LDKPaymentPurpose_SpontaneousPayment_class, "", "([B)V"); + CHECK(LDKPaymentPurpose_SpontaneousPayment_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKPaymentPurpose_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKPaymentPurpose *obj = (LDKPaymentPurpose*)(ptr & ~1); + switch(obj->tag) { + case LDKPaymentPurpose_InvoicePayment: { + int8_tArray payment_preimage_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, payment_preimage_arr, 0, 32, obj->invoice_payment.payment_preimage.data); + int8_tArray payment_secret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, payment_secret_arr, 0, 32, obj->invoice_payment.payment_secret.data); + return (*env)->NewObject(env, LDKPaymentPurpose_InvoicePayment_class, LDKPaymentPurpose_InvoicePayment_meth, payment_preimage_arr, payment_secret_arr, obj->invoice_payment.user_payment_id); + } + case LDKPaymentPurpose_SpontaneousPayment: { + int8_tArray spontaneous_payment_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, spontaneous_payment_arr, 0, 32, obj->spontaneous_payment.data); + return (*env)->NewObject(env, LDKPaymentPurpose_SpontaneousPayment_class, LDKPaymentPurpose_SpontaneousPayment_meth, spontaneous_payment_arr); + } + default: abort(); + } +} +static jclass LDKEvent_FundingGenerationReady_class = NULL; +static jmethodID LDKEvent_FundingGenerationReady_meth = NULL; +static jclass LDKEvent_PaymentReceived_class = NULL; +static jmethodID LDKEvent_PaymentReceived_meth = NULL; +static jclass LDKEvent_PaymentSent_class = NULL; +static jmethodID LDKEvent_PaymentSent_meth = NULL; +static jclass LDKEvent_PaymentPathFailed_class = NULL; +static jmethodID LDKEvent_PaymentPathFailed_meth = NULL; +static jclass LDKEvent_PendingHTLCsForwardable_class = NULL; +static jmethodID LDKEvent_PendingHTLCsForwardable_meth = NULL; +static jclass LDKEvent_SpendableOutputs_class = NULL; +static jmethodID LDKEvent_SpendableOutputs_meth = NULL; +static jclass LDKEvent_PaymentForwarded_class = NULL; +static jmethodID LDKEvent_PaymentForwarded_meth = NULL; +static jclass LDKEvent_ChannelClosed_class = NULL; +static jmethodID LDKEvent_ChannelClosed_meth = NULL; +static jclass LDKEvent_DiscardFunding_class = NULL; +static jmethodID LDKEvent_DiscardFunding_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKEvent_init (JNIEnv *env, jclass clz) { + LDKEvent_FundingGenerationReady_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$FundingGenerationReady;")); + CHECK(LDKEvent_FundingGenerationReady_class != NULL); + LDKEvent_FundingGenerationReady_meth = (*env)->GetMethodID(env, LDKEvent_FundingGenerationReady_class, "", "([BJ[BJ)V"); + CHECK(LDKEvent_FundingGenerationReady_meth != NULL); + LDKEvent_PaymentReceived_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$PaymentReceived;")); + CHECK(LDKEvent_PaymentReceived_class != NULL); + LDKEvent_PaymentReceived_meth = (*env)->GetMethodID(env, LDKEvent_PaymentReceived_class, "", "([BJJ)V"); + CHECK(LDKEvent_PaymentReceived_meth != NULL); + LDKEvent_PaymentSent_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$PaymentSent;")); + CHECK(LDKEvent_PaymentSent_class != NULL); + LDKEvent_PaymentSent_meth = (*env)->GetMethodID(env, LDKEvent_PaymentSent_class, "", "([B[B[BJ)V"); + CHECK(LDKEvent_PaymentSent_meth != NULL); + LDKEvent_PaymentPathFailed_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$PaymentPathFailed;")); + CHECK(LDKEvent_PaymentPathFailed_class != NULL); + LDKEvent_PaymentPathFailed_meth = (*env)->GetMethodID(env, LDKEvent_PaymentPathFailed_class, "", "([B[BZJZ[JJJ)V"); + CHECK(LDKEvent_PaymentPathFailed_meth != NULL); + LDKEvent_PendingHTLCsForwardable_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$PendingHTLCsForwardable;")); + CHECK(LDKEvent_PendingHTLCsForwardable_class != NULL); + LDKEvent_PendingHTLCsForwardable_meth = (*env)->GetMethodID(env, LDKEvent_PendingHTLCsForwardable_class, "", "(J)V"); + CHECK(LDKEvent_PendingHTLCsForwardable_meth != NULL); + LDKEvent_SpendableOutputs_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$SpendableOutputs;")); + CHECK(LDKEvent_SpendableOutputs_class != NULL); + LDKEvent_SpendableOutputs_meth = (*env)->GetMethodID(env, LDKEvent_SpendableOutputs_class, "", "([J)V"); + CHECK(LDKEvent_SpendableOutputs_meth != NULL); + LDKEvent_PaymentForwarded_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$PaymentForwarded;")); + CHECK(LDKEvent_PaymentForwarded_class != NULL); + LDKEvent_PaymentForwarded_meth = (*env)->GetMethodID(env, LDKEvent_PaymentForwarded_class, "", "(JZ)V"); + CHECK(LDKEvent_PaymentForwarded_meth != NULL); + LDKEvent_ChannelClosed_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$ChannelClosed;")); + CHECK(LDKEvent_ChannelClosed_class != NULL); + LDKEvent_ChannelClosed_meth = (*env)->GetMethodID(env, LDKEvent_ChannelClosed_class, "", "([BJJ)V"); + CHECK(LDKEvent_ChannelClosed_meth != NULL); + LDKEvent_DiscardFunding_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$DiscardFunding;")); + CHECK(LDKEvent_DiscardFunding_class != NULL); + LDKEvent_DiscardFunding_meth = (*env)->GetMethodID(env, LDKEvent_DiscardFunding_class, "", "([B[B)V"); + CHECK(LDKEvent_DiscardFunding_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEvent_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKEvent *obj = (LDKEvent*)(ptr & ~1); + switch(obj->tag) { + case LDKEvent_FundingGenerationReady: { + int8_tArray temporary_channel_id_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, temporary_channel_id_arr, 0, 32, obj->funding_generation_ready.temporary_channel_id.data); + LDKCVec_u8Z output_script_var = obj->funding_generation_ready.output_script; + int8_tArray output_script_arr = (*env)->NewByteArray(env, output_script_var.datalen); + (*env)->SetByteArrayRegion(env, output_script_arr, 0, output_script_var.datalen, output_script_var.data); + return (*env)->NewObject(env, LDKEvent_FundingGenerationReady_class, LDKEvent_FundingGenerationReady_meth, temporary_channel_id_arr, obj->funding_generation_ready.channel_value_satoshis, output_script_arr, obj->funding_generation_ready.user_channel_id); + } + case LDKEvent_PaymentReceived: { + int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->payment_received.payment_hash.data); + uint64_t purpose_ref = ((uint64_t)&obj->payment_received.purpose) | 1; + return (*env)->NewObject(env, LDKEvent_PaymentReceived_class, LDKEvent_PaymentReceived_meth, payment_hash_arr, obj->payment_received.amt, purpose_ref); + } + case LDKEvent_PaymentSent: { + int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, obj->payment_sent.payment_id.data); + int8_tArray payment_preimage_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, payment_preimage_arr, 0, 32, obj->payment_sent.payment_preimage.data); + int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->payment_sent.payment_hash.data); + uint64_t fee_paid_msat_ref = ((uint64_t)&obj->payment_sent.fee_paid_msat) | 1; + return (*env)->NewObject(env, LDKEvent_PaymentSent_class, LDKEvent_PaymentSent_meth, payment_id_arr, payment_preimage_arr, payment_hash_arr, fee_paid_msat_ref); + } + case LDKEvent_PaymentPathFailed: { + int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, obj->payment_path_failed.payment_id.data); + int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->payment_path_failed.payment_hash.data); + uint64_t network_update_ref = ((uint64_t)&obj->payment_path_failed.network_update) | 1; + LDKCVec_RouteHopZ path_var = obj->payment_path_failed.path; + int64_tArray path_arr = NULL; + path_arr = (*env)->NewLongArray(env, path_var.datalen); + int64_t *path_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, path_arr, NULL); + for (size_t k = 0; k < path_var.datalen; k++) { + LDKRouteHop path_conv_10_var = path_var.data[k]; + uint64_t path_conv_10_ref = 0; + CHECK((((uint64_t)path_conv_10_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uint64_t)&path_conv_10_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var); + path_conv_10_ref = (uint64_t)path_conv_10_var.inner & ~1; + path_arr_ptr[k] = path_conv_10_ref; + } + (*env)->ReleasePrimitiveArrayCritical(env, path_arr, path_arr_ptr, 0); + uint64_t short_channel_id_ref = ((uint64_t)&obj->payment_path_failed.short_channel_id) | 1; + LDKRouteParameters retry_var = obj->payment_path_failed.retry; + uint64_t retry_ref = 0; + if ((uint64_t)retry_var.inner > 4096) { + CHECK((((uint64_t)retry_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uint64_t)&retry_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(retry_var); + retry_ref = (uint64_t)retry_var.inner & ~1; + } + return (*env)->NewObject(env, LDKEvent_PaymentPathFailed_class, LDKEvent_PaymentPathFailed_meth, payment_id_arr, payment_hash_arr, obj->payment_path_failed.rejected_by_dest, network_update_ref, obj->payment_path_failed.all_paths_failed, path_arr, short_channel_id_ref, retry_ref); + } + case LDKEvent_PendingHTLCsForwardable: { + return (*env)->NewObject(env, LDKEvent_PendingHTLCsForwardable_class, LDKEvent_PendingHTLCsForwardable_meth, obj->pending_htl_cs_forwardable.time_forwardable); + } + case LDKEvent_SpendableOutputs: { + LDKCVec_SpendableOutputDescriptorZ outputs_var = obj->spendable_outputs.outputs; + int64_tArray outputs_arr = NULL; + outputs_arr = (*env)->NewLongArray(env, outputs_var.datalen); + int64_t *outputs_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, outputs_arr, NULL); + for (size_t b = 0; b < outputs_var.datalen; b++) { + uint64_t outputs_conv_27_ref = ((uint64_t)&outputs_var.data[b]) | 1; + outputs_arr_ptr[b] = outputs_conv_27_ref; + } + (*env)->ReleasePrimitiveArrayCritical(env, outputs_arr, outputs_arr_ptr, 0); + return (*env)->NewObject(env, LDKEvent_SpendableOutputs_class, LDKEvent_SpendableOutputs_meth, outputs_arr); + } + case LDKEvent_PaymentForwarded: { + uint64_t fee_earned_msat_ref = ((uint64_t)&obj->payment_forwarded.fee_earned_msat) | 1; + return (*env)->NewObject(env, LDKEvent_PaymentForwarded_class, LDKEvent_PaymentForwarded_meth, fee_earned_msat_ref, obj->payment_forwarded.claim_from_onchain_tx); + } + case LDKEvent_ChannelClosed: { + int8_tArray channel_id_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, channel_id_arr, 0, 32, obj->channel_closed.channel_id.data); + uint64_t reason_ref = ((uint64_t)&obj->channel_closed.reason) | 1; + return (*env)->NewObject(env, LDKEvent_ChannelClosed_class, LDKEvent_ChannelClosed_meth, channel_id_arr, obj->channel_closed.user_channel_id, reason_ref); + } + case LDKEvent_DiscardFunding: { + int8_tArray channel_id_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, channel_id_arr, 0, 32, obj->discard_funding.channel_id.data); + LDKTransaction transaction_var = obj->discard_funding.transaction; + int8_tArray transaction_arr = (*env)->NewByteArray(env, transaction_var.datalen); + (*env)->SetByteArrayRegion(env, transaction_arr, 0, transaction_var.datalen, transaction_var.data); + return (*env)->NewObject(env, LDKEvent_DiscardFunding_class, LDKEvent_DiscardFunding_meth, channel_id_arr, transaction_arr); + } + default: abort(); + } +} +static jclass LDKCOption_EventZ_Some_class = NULL; +static jmethodID LDKCOption_EventZ_Some_meth = NULL; +static jclass LDKCOption_EventZ_None_class = NULL; +static jmethodID LDKCOption_EventZ_None_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1EventZ_init (JNIEnv *env, jclass clz) { + LDKCOption_EventZ_Some_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKCOption_EventZ$Some;")); + CHECK(LDKCOption_EventZ_Some_class != NULL); + LDKCOption_EventZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_EventZ_Some_class, "", "(J)V"); + CHECK(LDKCOption_EventZ_Some_meth != NULL); + LDKCOption_EventZ_None_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKCOption_EventZ$None;")); + CHECK(LDKCOption_EventZ_None_class != NULL); + LDKCOption_EventZ_None_meth = (*env)->GetMethodID(env, LDKCOption_EventZ_None_class, "", "()V"); + CHECK(LDKCOption_EventZ_None_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1EventZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKCOption_EventZ *obj = (LDKCOption_EventZ*)(ptr & ~1); + switch(obj->tag) { + case LDKCOption_EventZ_Some: { + uint64_t some_ref = ((uint64_t)&obj->some) | 1; + return (*env)->NewObject(env, LDKCOption_EventZ_Some_class, LDKCOption_EventZ_Some_meth, some_ref); + } + case LDKCOption_EventZ_None: { + return (*env)->NewObject(env, LDKCOption_EventZ_None_class, LDKCOption_EventZ_None_meth); + } + default: abort(); + } +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1COption_1EventZDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_COption_EventZDecodeErrorZ *val = (LDKCResult_COption_EventZDecodeErrorZ*)(arg & ~1); + CHECK(val->result_ok); + uint64_t res_ref = ((uint64_t)&(*val->contents.result)) | 1; + return res_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1COption_1EventZDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_COption_EventZDecodeErrorZ *val = (LDKCResult_COption_EventZDecodeErrorZ*)(arg & ~1); + CHECK(!val->result_ok); + LDKDecodeError err_var = (*val->contents.err); + uint64_t err_ref = 0; + CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); + err_ref = (uint64_t)err_var.inner & ~1; + return err_ref; +} static jclass LDKErrorAction_DisconnectPeer_class = NULL; static jmethodID LDKErrorAction_DisconnectPeer_meth = NULL; static jclass LDKErrorAction_IgnoreError_class = NULL; @@ -1846,6 +2026,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKErrorAction_1ref_1from_1 if ((uint64_t)msg_var.inner > 4096) { CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; } return (*env)->NewObject(env, LDKErrorAction_DisconnectPeer_class, LDKErrorAction_DisconnectPeer_meth, msg_ref); @@ -1862,6 +2043,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKErrorAction_1ref_1from_1 uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; return (*env)->NewObject(env, LDKErrorAction_SendErrorMessage_class, LDKErrorAction_SendErrorMessage_meth, msg_ref); } @@ -2013,6 +2195,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1f uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; return (*env)->NewObject(env, LDKMessageSendEvent_SendAcceptChannel_class, LDKMessageSendEvent_SendAcceptChannel_meth, node_id_arr, msg_ref); } @@ -2023,6 +2206,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1f uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; return (*env)->NewObject(env, LDKMessageSendEvent_SendOpenChannel_class, LDKMessageSendEvent_SendOpenChannel_meth, node_id_arr, msg_ref); } @@ -2033,6 +2217,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1f uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; return (*env)->NewObject(env, LDKMessageSendEvent_SendFundingCreated_class, LDKMessageSendEvent_SendFundingCreated_meth, node_id_arr, msg_ref); } @@ -2043,6 +2228,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1f uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; return (*env)->NewObject(env, LDKMessageSendEvent_SendFundingSigned_class, LDKMessageSendEvent_SendFundingSigned_meth, node_id_arr, msg_ref); } @@ -2053,6 +2239,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1f uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; return (*env)->NewObject(env, LDKMessageSendEvent_SendFundingLocked_class, LDKMessageSendEvent_SendFundingLocked_meth, node_id_arr, msg_ref); } @@ -2063,6 +2250,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1f uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; return (*env)->NewObject(env, LDKMessageSendEvent_SendAnnouncementSignatures_class, LDKMessageSendEvent_SendAnnouncementSignatures_meth, node_id_arr, msg_ref); } @@ -2073,6 +2261,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1f uint64_t updates_ref = 0; CHECK((((uint64_t)updates_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&updates_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(updates_var); updates_ref = (uint64_t)updates_var.inner & ~1; return (*env)->NewObject(env, LDKMessageSendEvent_UpdateHTLCs_class, LDKMessageSendEvent_UpdateHTLCs_meth, node_id_arr, updates_ref); } @@ -2083,6 +2272,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1f uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; return (*env)->NewObject(env, LDKMessageSendEvent_SendRevokeAndACK_class, LDKMessageSendEvent_SendRevokeAndACK_meth, node_id_arr, msg_ref); } @@ -2093,6 +2283,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1f uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; return (*env)->NewObject(env, LDKMessageSendEvent_SendClosingSigned_class, LDKMessageSendEvent_SendClosingSigned_meth, node_id_arr, msg_ref); } @@ -2103,6 +2294,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1f uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; return (*env)->NewObject(env, LDKMessageSendEvent_SendShutdown_class, LDKMessageSendEvent_SendShutdown_meth, node_id_arr, msg_ref); } @@ -2113,6 +2305,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1f uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; return (*env)->NewObject(env, LDKMessageSendEvent_SendChannelReestablish_class, LDKMessageSendEvent_SendChannelReestablish_meth, node_id_arr, msg_ref); } @@ -2121,11 +2314,13 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1f uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; LDKChannelUpdate update_msg_var = obj->broadcast_channel_announcement.update_msg; uint64_t update_msg_ref = 0; CHECK((((uint64_t)update_msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&update_msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_msg_var); update_msg_ref = (uint64_t)update_msg_var.inner & ~1; return (*env)->NewObject(env, LDKMessageSendEvent_BroadcastChannelAnnouncement_class, LDKMessageSendEvent_BroadcastChannelAnnouncement_meth, msg_ref, update_msg_ref); } @@ -2134,6 +2329,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1f uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; return (*env)->NewObject(env, LDKMessageSendEvent_BroadcastNodeAnnouncement_class, LDKMessageSendEvent_BroadcastNodeAnnouncement_meth, msg_ref); } @@ -2142,6 +2338,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1f uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; return (*env)->NewObject(env, LDKMessageSendEvent_BroadcastChannelUpdate_class, LDKMessageSendEvent_BroadcastChannelUpdate_meth, msg_ref); } @@ -2152,6 +2349,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1f uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; return (*env)->NewObject(env, LDKMessageSendEvent_SendChannelUpdate_class, LDKMessageSendEvent_SendChannelUpdate_meth, node_id_arr, msg_ref); } @@ -2168,6 +2366,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1f uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; return (*env)->NewObject(env, LDKMessageSendEvent_SendChannelRangeQuery_class, LDKMessageSendEvent_SendChannelRangeQuery_meth, node_id_arr, msg_ref); } @@ -2178,6 +2377,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1f uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; return (*env)->NewObject(env, LDKMessageSendEvent_SendShortIdsQuery_class, LDKMessageSendEvent_SendShortIdsQuery_meth, node_id_arr, msg_ref); } @@ -2188,32 +2388,13 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1f uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner & ~1; return (*env)->NewObject(env, LDKMessageSendEvent_SendReplyChannelRange_class, LDKMessageSendEvent_SendReplyChannelRange_meth, node_id_arr, msg_ref); } default: abort(); } } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1MessageSendEventZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) { - LDKCVec_MessageSendEventZ *ret = MALLOC(sizeof(LDKCVec_MessageSendEventZ), "LDKCVec_MessageSendEventZ"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKMessageSendEvent) * ret->datalen, "LDKCVec_MessageSendEventZ 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]; - 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; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_MessageSendEventZ CVec_MessageSendEventZ_clone(const LDKCVec_MessageSendEventZ *orig) { LDKCVec_MessageSendEventZ ret = { .data = MALLOC(sizeof(LDKMessageSendEvent) * orig->datalen, "LDKCVec_MessageSendEventZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -2221,9 +2402,6 @@ static inline LDKCVec_MessageSendEventZ CVec_MessageSendEventZ_clone(const LDKCV } return ret; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InitFeaturesDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_InitFeaturesDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InitFeaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_InitFeaturesDecodeErrorZ *val = (LDKCResult_InitFeaturesDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -2231,6 +2409,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InitFeaturesDec uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -2241,12 +2420,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InitFeaturesDec uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeFeaturesDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_NodeFeaturesDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeFeaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_NodeFeaturesDecodeErrorZ *val = (LDKCResult_NodeFeaturesDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -2254,6 +2431,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeFeaturesDec uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -2264,12 +2442,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeFeaturesDec uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelFeaturesDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_ChannelFeaturesDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelFeaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_ChannelFeaturesDecodeErrorZ *val = (LDKCResult_ChannelFeaturesDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -2277,6 +2453,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelFeatures uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -2287,12 +2464,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelFeatures uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceFeaturesDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_InvoiceFeaturesDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceFeaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_InvoiceFeaturesDecodeErrorZ *val = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -2300,6 +2475,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceFeatures uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -2310,12 +2486,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceFeatures uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ScoringParametersDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_ScoringParametersDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ScoringParametersDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_ScoringParametersDecodeErrorZ *val = (LDKCResult_ScoringParametersDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -2323,6 +2497,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ScoringParamete uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -2333,12 +2508,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ScoringParamete uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ScorerDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_ScorerDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ScorerDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_ScorerDecodeErrorZ *val = (LDKCResult_ScorerDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -2346,6 +2519,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ScorerDecodeErr uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -2356,12 +2530,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ScorerDecodeErr uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *val = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -2369,6 +2541,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1DelayedPaymentO uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -2379,12 +2552,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1DelayedPaymentO uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *val = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -2392,6 +2563,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1StaticPaymentOu uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -2402,12 +2574,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1StaticPaymentOu uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SpendableOutputDescriptorDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SpendableOutputDescriptorDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_SpendableOutputDescriptorDecodeErrorZ *val = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -2421,12 +2591,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SpendableOutput uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneNoneZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_NoneNoneZ*)arg)->result_ok; -} JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_NoneNoneZ *val = (LDKCResult_NoneNoneZ*)(arg & ~1); CHECK(val->result_ok); @@ -2466,9 +2634,6 @@ JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec return ret_arr; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *val = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(arg & ~1); CHECK(val->result_ok); @@ -2482,9 +2647,6 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1Signature CHECK(!val->result_ok); return *val->contents.err; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SignatureNoneZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_SignatureNoneZ*)arg)->result_ok; -} JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SignatureNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_SignatureNoneZ *val = (LDKCResult_SignatureNoneZ*)(arg & ~1); CHECK(val->result_ok); @@ -2594,6 +2756,7 @@ LDKCResult_NoneNoneZ validate_holder_commitment_LDKBaseSign_jcall(const void* th holder_tx_var = HolderCommitmentTransaction_clone(holder_tx); CHECK((((uint64_t)holder_tx_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&holder_tx_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(holder_tx_var); holder_tx_ref = (uint64_t)holder_tx_var.inner; if (holder_tx_var.is_owned) { holder_tx_ref |= 1; @@ -2608,7 +2771,7 @@ LDKCResult_NoneNoneZ validate_holder_commitment_LDKBaseSign_jcall(const void* th 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)); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -2652,6 +2815,7 @@ LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_counterparty_commitment_L commitment_tx_var = CommitmentTransaction_clone(commitment_tx); CHECK((((uint64_t)commitment_tx_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&commitment_tx_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_var); commitment_tx_ref = (uint64_t)commitment_tx_var.inner; if (commitment_tx_var.is_owned) { commitment_tx_ref |= 1; @@ -2666,7 +2830,7 @@ LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_counterparty_commitment_L 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)); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -2693,7 +2857,7 @@ LDKCResult_NoneNoneZ validate_counterparty_revocation_LDKBaseSign_jcall(const vo 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)); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -2713,6 +2877,7 @@ LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_holder_commitment_and_htl commitment_tx_var = HolderCommitmentTransaction_clone(commitment_tx); CHECK((((uint64_t)commitment_tx_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&commitment_tx_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_var); commitment_tx_ref = (uint64_t)commitment_tx_var.inner; if (commitment_tx_var.is_owned) { commitment_tx_ref |= 1; @@ -2727,7 +2892,7 @@ LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_holder_commitment_and_htl 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)); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -2758,7 +2923,7 @@ LDKCResult_SignatureNoneZ sign_justice_revoked_output_LDKBaseSign_jcall(const vo 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)); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -2784,6 +2949,7 @@ LDKCResult_SignatureNoneZ sign_justice_revoked_htlc_LDKBaseSign_jcall(const void htlc_var = HTLCOutputInCommitment_clone(htlc); CHECK((((uint64_t)htlc_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&htlc_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_var); htlc_ref = (uint64_t)htlc_var.inner; if (htlc_var.is_owned) { htlc_ref |= 1; @@ -2798,7 +2964,7 @@ LDKCResult_SignatureNoneZ sign_justice_revoked_htlc_LDKBaseSign_jcall(const void 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)); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -2824,6 +2990,7 @@ LDKCResult_SignatureNoneZ sign_counterparty_htlc_transaction_LDKBaseSign_jcall(c htlc_var = HTLCOutputInCommitment_clone(htlc); CHECK((((uint64_t)htlc_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&htlc_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_var); htlc_ref = (uint64_t)htlc_var.inner; if (htlc_var.is_owned) { htlc_ref |= 1; @@ -2838,7 +3005,7 @@ LDKCResult_SignatureNoneZ sign_counterparty_htlc_transaction_LDKBaseSign_jcall(c 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)); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -2858,6 +3025,7 @@ LDKCResult_SignatureNoneZ sign_closing_transaction_LDKBaseSign_jcall(const void* 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(closing_tx_var); closing_tx_ref = (uint64_t)closing_tx_var.inner; if (closing_tx_var.is_owned) { closing_tx_ref |= 1; @@ -2872,7 +3040,7 @@ LDKCResult_SignatureNoneZ sign_closing_transaction_LDKBaseSign_jcall(const void* 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)); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -2892,6 +3060,7 @@ LDKCResult_SignatureNoneZ sign_channel_announcement_LDKBaseSign_jcall(const void msg_var = UnsignedChannelAnnouncement_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -2906,7 +3075,7 @@ LDKCResult_SignatureNoneZ sign_channel_announcement_LDKBaseSign_jcall(const void 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)); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -2926,6 +3095,7 @@ void ready_channel_LDKBaseSign_jcall(void* this_arg, const LDKChannelTransaction channel_parameters_var = ChannelTransactionParameters_clone(channel_parameters); CHECK((((uint64_t)channel_parameters_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&channel_parameters_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_parameters_var); channel_parameters_ref = (uint64_t)channel_parameters_var.inner; if (channel_parameters_var.is_owned) { channel_parameters_ref |= 1; @@ -2978,7 +3148,7 @@ static inline LDKBaseSign LDKBaseSign_init (JNIEnv *env, jclass clz, jobject o, LDKChannelPublicKeys pubkeys_conv; pubkeys_conv.inner = (void*)(pubkeys & (~1)); pubkeys_conv.is_owned = (pubkeys & 1) || (pubkeys == 0); - pubkeys_conv = ChannelPublicKeys_clone(&pubkeys_conv); + CHECK_INNER_FIELD_ACCESS_OR_NULL(pubkeys_conv); LDKBaseSign ret = { .this_arg = (void*) calls, @@ -3031,6 +3201,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BaseSign_1validate_1holder_ LDKHolderCommitmentTransaction holder_tx_conv; holder_tx_conv.inner = (void*)(holder_tx & (~1)); holder_tx_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(holder_tx_conv); LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); *ret_conv = (this_arg_conv->validate_holder_commitment)(this_arg_conv->this_arg, &holder_tx_conv); return (uint64_t)ret_conv; @@ -3052,6 +3223,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BaseSign_1sign_1counterpart LDKCommitmentTransaction commitment_tx_conv; commitment_tx_conv.inner = (void*)(commitment_tx & (~1)); commitment_tx_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_conv); LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ"); *ret_conv = (this_arg_conv->sign_counterparty_commitment)(this_arg_conv->this_arg, &commitment_tx_conv); return (uint64_t)ret_conv; @@ -3077,6 +3249,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BaseSign_1sign_1holder_1com LDKHolderCommitmentTransaction commitment_tx_conv; commitment_tx_conv.inner = (void*)(commitment_tx & (~1)); commitment_tx_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_conv); LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ"); *ret_conv = (this_arg_conv->sign_holder_commitment_and_htlcs)(this_arg_conv->this_arg, &commitment_tx_conv); return (uint64_t)ret_conv; @@ -3116,6 +3289,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BaseSign_1sign_1justice_1re LDKHTLCOutputInCommitment htlc_conv; htlc_conv.inner = (void*)(htlc & (~1)); htlc_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_conv); LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ"); *ret_conv = (this_arg_conv->sign_justice_revoked_htlc)(this_arg_conv->this_arg, justice_tx_ref, input, amount, per_commitment_key_ref, &htlc_conv); return (uint64_t)ret_conv; @@ -3136,6 +3310,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BaseSign_1sign_1counterpart LDKHTLCOutputInCommitment htlc_conv; htlc_conv.inner = (void*)(htlc & (~1)); htlc_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_conv); LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ"); *ret_conv = (this_arg_conv->sign_counterparty_htlc_transaction)(this_arg_conv->this_arg, htlc_tx_ref, input, amount, per_commitment_point_ref, &htlc_conv); return (uint64_t)ret_conv; @@ -3148,6 +3323,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BaseSign_1sign_1closing_1tr LDKClosingTransaction closing_tx_conv; closing_tx_conv.inner = (void*)(closing_tx & (~1)); closing_tx_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(closing_tx_conv); LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ"); *ret_conv = (this_arg_conv->sign_closing_transaction)(this_arg_conv->this_arg, &closing_tx_conv); return (uint64_t)ret_conv; @@ -3160,6 +3336,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BaseSign_1sign_1channel_1an LDKUnsignedChannelAnnouncement msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ"); *ret_conv = (this_arg_conv->sign_channel_announcement)(this_arg_conv->this_arg, &msg_conv); return (uint64_t)ret_conv; @@ -3172,6 +3349,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BaseSign_1ready_1channel(JNIEn LDKChannelTransactionParameters channel_parameters_conv; channel_parameters_conv.inner = (void*)(channel_parameters & (~1)); channel_parameters_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_parameters_conv); (this_arg_conv->ready_channel)(this_arg_conv->this_arg, &channel_parameters_conv); } @@ -3188,6 +3366,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BaseSign_1get_1pubkeys(JNIE uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -3262,7 +3441,7 @@ static inline LDKSign LDKSign_init (JNIEnv *env, jclass clz, jobject o, jobject LDKChannelPublicKeys pubkeys_conv; pubkeys_conv.inner = (void*)(pubkeys & (~1)); pubkeys_conv.is_owned = (pubkeys & 1) || (pubkeys == 0); - pubkeys_conv = ChannelPublicKeys_clone(&pubkeys_conv); + CHECK_INNER_FIELD_ACCESS_OR_NULL(pubkeys_conv); LDKSign ret = { .this_arg = (void*) calls, @@ -3296,9 +3475,6 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Sign_1write(JNIEnv *env return ret_arr; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SignDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_SignDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SignDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_SignDecodeErrorZ *val = (LDKCResult_SignDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -3313,12 +3489,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SignDecodeError uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RecoverableSignatureNoneZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_RecoverableSignatureNoneZ*)arg)->result_ok; -} JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RecoverableSignatureNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_RecoverableSignatureNoneZ *val = (LDKCResult_RecoverableSignatureNoneZ*)(arg & ~1); CHECK(val->result_ok); @@ -3338,9 +3512,6 @@ static inline LDKCVec_CVec_u8ZZ CVec_CVec_u8ZZ_clone(const LDKCVec_CVec_u8ZZ *or } return ret; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1CVec_1u8ZZNoneZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_CVec_CVec_u8ZZNoneZ*)arg)->result_ok; -} JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1CVec_1u8ZZNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_CVec_CVec_u8ZZNoneZ *val = (LDKCResult_CVec_CVec_u8ZZNoneZ*)(arg & ~1); CHECK(val->result_ok); @@ -3362,9 +3533,6 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1CVec_1u8ZZNo CHECK(!val->result_ok); return *val->contents.err; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InMemorySignerDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_InMemorySignerDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InMemorySignerDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_InMemorySignerDecodeErrorZ *val = (LDKCResult_InMemorySignerDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -3372,6 +3540,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InMemorySignerD uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -3382,29 +3551,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InMemorySignerD uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1TxOutZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) { - LDKCVec_TxOutZ *ret = MALLOC(sizeof(LDKCVec_TxOutZ), "LDKCVec_TxOutZ"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKTxOut) * ret->datalen, "LDKCVec_TxOutZ 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]; - 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; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_TxOutZ CVec_TxOutZ_clone(const LDKCVec_TxOutZ *orig) { LDKCVec_TxOutZ ret = { .data = MALLOC(sizeof(LDKTxOut) * orig->datalen, "LDKCVec_TxOutZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -3412,9 +3562,6 @@ static inline LDKCVec_TxOutZ CVec_TxOutZ_clone(const LDKCVec_TxOutZ *orig) { } return ret; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TransactionNoneZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_TransactionNoneZ*)arg)->result_ok; -} JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TransactionNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_TransactionNoneZ *val = (LDKCResult_TransactionNoneZ*)(arg & ~1); CHECK(val->result_ok); @@ -3447,6 +3594,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMo uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -3454,26 +3602,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMo return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1C2Tuple_1BlockHashChannelMonitorZZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) { - LDKCVec_C2Tuple_BlockHashChannelMonitorZZ *ret = MALLOC(sizeof(LDKCVec_C2Tuple_BlockHashChannelMonitorZZ), "LDKCVec_C2Tuple_BlockHashChannelMonitorZZ"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ) * ret->datalen, "LDKCVec_C2Tuple_BlockHashChannelMonitorZZ 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]; - 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; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_C2Tuple_BlockHashChannelMonitorZZ CVec_C2Tuple_BlockHashChannelMonitorZZ_clone(const LDKCVec_C2Tuple_BlockHashChannelMonitorZZ *orig) { LDKCVec_C2Tuple_BlockHashChannelMonitorZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ) * orig->datalen, "LDKCVec_C2Tuple_BlockHashChannelMonitorZZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -3481,9 +3609,6 @@ static inline LDKCVec_C2Tuple_BlockHashChannelMonitorZZ CVec_C2Tuple_BlockHashCh } return ret; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ*)arg)->result_ok; -} JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ *val = (LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -3609,15 +3734,13 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKAPIError_1ref_1from_1ptr uint64_t script_ref = 0; CHECK((((uint64_t)script_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&script_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(script_var); script_ref = (uint64_t)script_var.inner & ~1; return (*env)->NewObject(env, LDKAPIError_IncompatibleShutdownScript_class, LDKAPIError_IncompatibleShutdownScript_meth, script_ref); } default: abort(); } } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneAPIErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_NoneAPIErrorZ*)arg)->result_ok; -} JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneAPIErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_NoneAPIErrorZ *val = (LDKCResult_NoneAPIErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -3629,26 +3752,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneAPIErrorZ_1 uint64_t err_ref = ((uint64_t)&(*val->contents.err)) | 1; return err_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1CResult_1NoneAPIErrorZZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) { - LDKCVec_CResult_NoneAPIErrorZZ *ret = MALLOC(sizeof(LDKCVec_CResult_NoneAPIErrorZZ), "LDKCVec_CResult_NoneAPIErrorZZ"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ) * ret->datalen, "LDKCVec_CResult_NoneAPIErrorZZ 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]; - 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; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_CResult_NoneAPIErrorZZ CVec_CResult_NoneAPIErrorZZ_clone(const LDKCVec_CResult_NoneAPIErrorZZ *orig) { LDKCVec_CResult_NoneAPIErrorZZ ret = { .data = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ) * orig->datalen, "LDKCVec_CResult_NoneAPIErrorZZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -3656,26 +3759,6 @@ static inline LDKCVec_CResult_NoneAPIErrorZZ CVec_CResult_NoneAPIErrorZZ_clone(c } return ret; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1APIErrorZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) { - LDKCVec_APIErrorZ *ret = MALLOC(sizeof(LDKCVec_APIErrorZ), "LDKCVec_APIErrorZ"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKAPIError) * ret->datalen, "LDKCVec_APIErrorZ 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]; - 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; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_APIErrorZ CVec_APIErrorZ_clone(const LDKCVec_APIErrorZ *orig) { LDKCVec_APIErrorZ ret = { .data = MALLOC(sizeof(LDKAPIError) * orig->datalen, "LDKCVec_APIErrorZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -3683,9 +3766,6 @@ static inline LDKCVec_APIErrorZ CVec_APIErrorZ_clone(const LDKCVec_APIErrorZ *or } return ret; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1_1u832APIErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult__u832APIErrorZ*)arg)->result_ok; -} JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1_1u832APIErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult__u832APIErrorZ *val = (LDKCResult__u832APIErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -3779,6 +3859,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKPaymentSendFailure_1ref_ if ((uint64_t)failed_paths_retry_var.inner > 4096) { CHECK((((uint64_t)failed_paths_retry_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&failed_paths_retry_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(failed_paths_retry_var); failed_paths_retry_ref = (uint64_t)failed_paths_retry_var.inner & ~1; } int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32); @@ -3788,9 +3869,6 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKPaymentSendFailure_1ref_ default: abort(); } } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentIdPaymentSendFailureZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_PaymentIdPaymentSendFailureZ*)arg)->result_ok; -} JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentIdPaymentSendFailureZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_PaymentIdPaymentSendFailureZ *val = (LDKCResult_PaymentIdPaymentSendFailureZ*)(arg & ~1); CHECK(val->result_ok); @@ -3804,9 +3882,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentIdPaymen uint64_t err_ref = ((uint64_t)&(*val->contents.err)) | 1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NonePaymentSendFailureZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_NonePaymentSendFailureZ*)arg)->result_ok; -} JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NonePaymentSendFailureZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_NonePaymentSendFailureZ *val = (LDKCResult_NonePaymentSendFailureZ*)(arg & ~1); CHECK(val->result_ok); @@ -3838,9 +3913,6 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPay return ret_arr; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *val = (LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)(arg & ~1); CHECK(val->result_ok); @@ -3911,26 +3983,6 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKNetAddress_1ref_1from_1p default: abort(); } } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1NetAddressZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) { - LDKCVec_NetAddressZ *ret = MALLOC(sizeof(LDKCVec_NetAddressZ), "LDKCVec_NetAddressZ"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKNetAddress) * ret->datalen, "LDKCVec_NetAddressZ 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]; - 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; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_NetAddressZ CVec_NetAddressZ_clone(const LDKCVec_NetAddressZ *orig) { LDKCVec_NetAddressZ ret = { .data = MALLOC(sizeof(LDKNetAddress) * orig->datalen, "LDKCVec_NetAddressZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -3958,9 +4010,6 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPay return ret_arr; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentSecretAPIErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_PaymentSecretAPIErrorZ*)arg)->result_ok; -} JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentSecretAPIErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_PaymentSecretAPIErrorZ *val = (LDKCResult_PaymentSecretAPIErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -3974,26 +4023,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentSecretAP uint64_t err_ref = ((uint64_t)&(*val->contents.err)) | 1; return err_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1ChannelMonitorZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) { - LDKCVec_ChannelMonitorZ *ret = MALLOC(sizeof(LDKCVec_ChannelMonitorZ), "LDKCVec_ChannelMonitorZ"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKChannelMonitor) * ret->datalen, "LDKCVec_ChannelMonitorZ 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]; - LDKChannelMonitor arr_elem_conv; - arr_elem_conv.inner = (void*)(arr_elem & (~1)); - arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0); - arr_elem_conv = ChannelMonitor_clone(&arr_elem_conv); - ret->data[i] = arr_elem_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_ChannelMonitorZ CVec_ChannelMonitorZ_clone(const LDKCVec_ChannelMonitorZ *orig) { LDKCVec_ChannelMonitorZ ret = { .data = MALLOC(sizeof(LDKChannelMonitor) * orig->datalen, "LDKCVec_ChannelMonitorZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -4039,6 +4068,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ watch_channel_LDKWatch_jcall(const void* uint64_t funding_txo_ref = 0; CHECK((((uint64_t)funding_txo_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&funding_txo_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_var); funding_txo_ref = (uint64_t)funding_txo_var.inner; if (funding_txo_var.is_owned) { funding_txo_ref |= 1; @@ -4047,6 +4077,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ watch_channel_LDKWatch_jcall(const void* uint64_t monitor_ref = 0; CHECK((((uint64_t)monitor_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&monitor_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(monitor_var); monitor_ref = (uint64_t)monitor_var.inner; if (monitor_var.is_owned) { monitor_ref |= 1; @@ -4061,7 +4092,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ watch_channel_LDKWatch_jcall(const void* 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)); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -4080,6 +4111,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ update_channel_LDKWatch_jcall(const void uint64_t funding_txo_ref = 0; CHECK((((uint64_t)funding_txo_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&funding_txo_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_var); funding_txo_ref = (uint64_t)funding_txo_var.inner; if (funding_txo_var.is_owned) { funding_txo_ref |= 1; @@ -4088,6 +4120,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ update_channel_LDKWatch_jcall(const void uint64_t update_ref = 0; CHECK((((uint64_t)update_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&update_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_var); update_ref = (uint64_t)update_var.inner; if (update_var.is_owned) { update_ref |= 1; @@ -4102,7 +4135,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ update_channel_LDKWatch_jcall(const void 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)); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -4136,7 +4169,7 @@ LDKCVec_MonitorEventZ release_pending_monitor_events_LDKWatch_jcall(const void* 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)); + FREE((void*)ret_conv_14); ret_constr.data[o] = ret_conv_14_conv; } (*env)->ReleaseLongArrayElements(env, ret, ret_vals, 0); @@ -4184,10 +4217,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Watch_1watch_1channel(JNIEn LDKOutPoint funding_txo_conv; funding_txo_conv.inner = (void*)(funding_txo & (~1)); funding_txo_conv.is_owned = (funding_txo & 1) || (funding_txo == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv); funding_txo_conv = OutPoint_clone(&funding_txo_conv); LDKChannelMonitor monitor_conv; monitor_conv.inner = (void*)(monitor & (~1)); monitor_conv.is_owned = (monitor & 1) || (monitor == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(monitor_conv); monitor_conv = ChannelMonitor_clone(&monitor_conv); LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ"); *ret_conv = (this_arg_conv->watch_channel)(this_arg_conv->this_arg, funding_txo_conv, monitor_conv); @@ -4201,10 +4236,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Watch_1update_1channel(JNIE LDKOutPoint funding_txo_conv; funding_txo_conv.inner = (void*)(funding_txo & (~1)); funding_txo_conv.is_owned = (funding_txo & 1) || (funding_txo == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv); funding_txo_conv = OutPoint_clone(&funding_txo_conv); LDKChannelMonitorUpdate update_conv; update_conv.inner = (void*)(update & (~1)); update_conv.is_owned = (update & 1) || (update == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_conv); update_conv = ChannelMonitorUpdate_clone(&update_conv); LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ"); *ret_conv = (this_arg_conv->update_channel)(this_arg_conv->this_arg, funding_txo_conv, update_conv); @@ -4412,7 +4449,7 @@ LDKShutdownScript get_shutdown_scriptpubkey_LDKKeysInterface_jcall(const void* t LDKShutdownScript ret_conv; ret_conv.inner = (void*)(ret & (~1)); ret_conv.is_owned = (ret & 1) || (ret == 0); - ret_conv = ShutdownScript_clone(&ret_conv); + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -4437,7 +4474,7 @@ LDKSign get_channel_signer_LDKKeysInterface_jcall(const void* this_arg, bool inb void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKSign ret_conv = *(LDKSign*)(ret_ptr); - ret_conv = Sign_clone(&ret_conv); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -4489,7 +4526,7 @@ LDKCResult_SignDecodeErrorZ read_chan_signer_LDKKeysInterface_jcall(const void* 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)); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -4518,7 +4555,7 @@ LDKCResult_RecoverableSignatureNoneZ sign_invoice_LDKKeysInterface_jcall(const v 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)); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -4596,6 +4633,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysInterface_1get_1shutdow uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -4750,7 +4788,7 @@ static void LDKLogger_JCalls_free(void* this_arg) { FREE(j_calls); } } -void log_LDKLogger_jcall(const void* this_arg, const char* record) { +void log_LDKLogger_jcall(const void* this_arg, const LDKRecord * record) { LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) this_arg; JNIEnv *env; jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6); @@ -4759,11 +4797,19 @@ void log_LDKLogger_jcall(const void* this_arg, const char* record) { } else { DO_ASSERT(get_jenv_res == JNI_OK); } - const char* record_str = record; - jstring record_conv = str_ref_to_java(env, record_str, strlen(record_str)); + LDKRecord record_var = *record; + uint64_t record_ref = 0; + record_var = Record_clone(record); + CHECK((((uint64_t)record_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uint64_t)&record_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(record_var); + record_ref = (uint64_t)record_var.inner; + if (record_var.is_owned) { + record_ref |= 1; + } jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); - (*env)->CallVoidMethod(env, obj, j_calls->log_meth, record_conv); + (*env)->CallVoidMethod(env, obj, j_calls->log_meth, record_ref); if ((*env)->ExceptionCheck(env)) { (*env)->ExceptionDescribe(env); (*env)->FatalError(env, "A call to log in LDKLogger from rust threw an exception."); @@ -4783,7 +4829,7 @@ static inline LDKLogger LDKLogger_init (JNIEnv *env, jclass clz, jobject o) { atomic_init(&calls->refcnt, 1); DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0); calls->o = (*env)->NewWeakGlobalRef(env, o); - calls->log_meth = (*env)->GetMethodID(env, c, "log", "(Ljava/lang/String;)V"); + calls->log_meth = (*env)->GetMethodID(env, c, "log", "(J)V"); CHECK(calls->log_meth != NULL); LDKLogger ret = { @@ -4817,13 +4863,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMa uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner & ~1; return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1BlockHashChannelManagerZDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)arg)->result_ok; -} 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); @@ -4838,12 +4882,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1BlockH uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelConfigDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_ChannelConfigDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelConfigDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_ChannelConfigDecodeErrorZ *val = (LDKCResult_ChannelConfigDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -4851,6 +4893,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelConfigDe uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -4861,12 +4904,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelConfigDe uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1OutPointDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_OutPointDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1OutPointDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_OutPointDecodeErrorZ *val = (LDKCResult_OutPointDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -4874,6 +4915,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1OutPointDecodeE uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -4884,6 +4926,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1OutPointDecodeE uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } @@ -5072,9 +5115,6 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1TypeZ_1ref_1fro default: abort(); } } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1COption_1TypeZDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_COption_TypeZDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1COption_1TypeZDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_COption_TypeZDecodeErrorZ *val = (LDKCResult_COption_TypeZDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5088,6 +5128,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1COption_1TypeZD uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } @@ -5127,6 +5168,7 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKPaymentError_1ref_1from_ uint64_t routing_ref = 0; CHECK((((uint64_t)routing_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&routing_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(routing_var); routing_ref = (uint64_t)routing_var.inner & ~1; return (*env)->NewObject(env, LDKPaymentError_Routing_class, LDKPaymentError_Routing_meth, routing_ref); } @@ -5137,9 +5179,6 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKPaymentError_1ref_1from_ default: abort(); } } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentIdPaymentErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_PaymentIdPaymentErrorZ*)arg)->result_ok; -} JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentIdPaymentErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_PaymentIdPaymentErrorZ *val = (LDKCResult_PaymentIdPaymentErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5153,9 +5192,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentIdPaymen uint64_t err_ref = ((uint64_t)&(*val->contents.err)) | 1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SiPrefixNoneZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_SiPrefixNoneZ*)arg)->result_ok; -} JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SiPrefixNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_SiPrefixNoneZ *val = (LDKCResult_SiPrefixNoneZ*)(arg & ~1); CHECK(val->result_ok); @@ -5167,9 +5203,6 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SiPrefixNoneZ_1get CHECK(!val->result_ok); return *val->contents.err; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceNoneZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_InvoiceNoneZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_InvoiceNoneZ *val = (LDKCResult_InvoiceNoneZ*)(arg & ~1); CHECK(val->result_ok); @@ -5177,6 +5210,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceNoneZ_1g uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5185,9 +5219,6 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceNoneZ_1get_ CHECK(!val->result_ok); return *val->contents.err; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SignedRawInvoiceNoneZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_SignedRawInvoiceNoneZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SignedRawInvoiceNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_SignedRawInvoiceNoneZ *val = (LDKCResult_SignedRawInvoiceNoneZ*)(arg & ~1); CHECK(val->result_ok); @@ -5195,6 +5226,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SignedRawInvoic uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5212,6 +5244,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832In uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -5238,6 +5271,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832In uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -5245,9 +5279,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832In return ret_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PayeePubKeyErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_PayeePubKeyErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PayeePubKeyErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_PayeePubKeyErrorZ *val = (LDKCResult_PayeePubKeyErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5255,6 +5286,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PayeePubKeyErro uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5264,26 +5296,6 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PayeePubKeyError jclass err_conv = LDKSecp256k1Error_to_java(env, (*val->contents.err)); return err_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1PrivateRouteZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) { - LDKCVec_PrivateRouteZ *ret = MALLOC(sizeof(LDKCVec_PrivateRouteZ), "LDKCVec_PrivateRouteZ"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKPrivateRoute) * ret->datalen, "LDKCVec_PrivateRouteZ 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]; - LDKPrivateRoute arr_elem_conv; - arr_elem_conv.inner = (void*)(arr_elem & (~1)); - arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0); - arr_elem_conv = PrivateRoute_clone(&arr_elem_conv); - ret->data[i] = arr_elem_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_PrivateRouteZ CVec_PrivateRouteZ_clone(const LDKCVec_PrivateRouteZ *orig) { LDKCVec_PrivateRouteZ ret = { .data = MALLOC(sizeof(LDKPrivateRoute) * orig->datalen, "LDKCVec_PrivateRouteZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -5291,9 +5303,6 @@ static inline LDKCVec_PrivateRouteZ CVec_PrivateRouteZ_clone(const LDKCVec_Priva } return ret; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PositiveTimestampCreationErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_PositiveTimestampCreationErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PositiveTimestampCreationErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_PositiveTimestampCreationErrorZ *val = (LDKCResult_PositiveTimestampCreationErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5301,6 +5310,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PositiveTimesta uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5310,9 +5320,6 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PositiveTimestam jclass err_conv = LDKCreationError_to_java(env, (*val->contents.err)); return err_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneSemanticErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_NoneSemanticErrorZ*)arg)->result_ok; -} JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneSemanticErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_NoneSemanticErrorZ *val = (LDKCResult_NoneSemanticErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5324,9 +5331,6 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneSemanticErro jclass err_conv = LDKSemanticError_to_java(env, (*val->contents.err)); return err_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceSemanticErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_InvoiceSemanticErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceSemanticErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_InvoiceSemanticErrorZ *val = (LDKCResult_InvoiceSemanticErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5334,6 +5338,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceSemantic uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5343,9 +5348,6 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceSemanticE jclass err_conv = LDKSemanticError_to_java(env, (*val->contents.err)); return err_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1DescriptionCreationErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_DescriptionCreationErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1DescriptionCreationErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_DescriptionCreationErrorZ *val = (LDKCResult_DescriptionCreationErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5353,6 +5355,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1DescriptionCrea uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5362,9 +5365,6 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_LDKCResult_1DescriptionCreat jclass err_conv = LDKCreationError_to_java(env, (*val->contents.err)); return err_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ExpiryTimeCreationErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_ExpiryTimeCreationErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ExpiryTimeCreationErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_ExpiryTimeCreationErrorZ *val = (LDKCResult_ExpiryTimeCreationErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5372,6 +5372,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ExpiryTimeCreat uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5381,9 +5382,6 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ExpiryTimeCreati jclass err_conv = LDKCreationError_to_java(env, (*val->contents.err)); return err_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PrivateRouteCreationErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_PrivateRouteCreationErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PrivateRouteCreationErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_PrivateRouteCreationErrorZ *val = (LDKCResult_PrivateRouteCreationErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5391,6 +5389,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PrivateRouteCre uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5400,9 +5399,6 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PrivateRouteCrea jclass err_conv = LDKCreationError_to_java(env, (*val->contents.err)); return err_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1StringErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_StringErrorZ*)arg)->result_ok; -} JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_LDKCResult_1StringErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_StringErrorZ *val = (LDKCResult_StringErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5416,9 +5412,6 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_LDKCResult_1StringErrorZ_1ge jclass err_conv = LDKSecp256k1Error_to_java(env, (*val->contents.err)); return err_conv; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelMonitorUpdateDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelMonitorUpdateDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_ChannelMonitorUpdateDecodeErrorZ *val = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5426,6 +5419,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelMonitorU uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5436,11 +5430,55 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelMonitorU uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1HTLCUpdateDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_HTLCUpdateDecodeErrorZ*)arg)->result_ok; +static jclass LDKCOption_MonitorEventZ_Some_class = NULL; +static jmethodID LDKCOption_MonitorEventZ_Some_meth = NULL; +static jclass LDKCOption_MonitorEventZ_None_class = NULL; +static jmethodID LDKCOption_MonitorEventZ_None_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1MonitorEventZ_init (JNIEnv *env, jclass clz) { + LDKCOption_MonitorEventZ_Some_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKCOption_MonitorEventZ$Some;")); + CHECK(LDKCOption_MonitorEventZ_Some_class != NULL); + LDKCOption_MonitorEventZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_MonitorEventZ_Some_class, "", "(J)V"); + CHECK(LDKCOption_MonitorEventZ_Some_meth != NULL); + LDKCOption_MonitorEventZ_None_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKCOption_MonitorEventZ$None;")); + CHECK(LDKCOption_MonitorEventZ_None_class != NULL); + LDKCOption_MonitorEventZ_None_meth = (*env)->GetMethodID(env, LDKCOption_MonitorEventZ_None_class, "", "()V"); + CHECK(LDKCOption_MonitorEventZ_None_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1MonitorEventZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKCOption_MonitorEventZ *obj = (LDKCOption_MonitorEventZ*)(ptr & ~1); + switch(obj->tag) { + case LDKCOption_MonitorEventZ_Some: { + uint64_t some_ref = ((uint64_t)&obj->some) | 1; + return (*env)->NewObject(env, LDKCOption_MonitorEventZ_Some_class, LDKCOption_MonitorEventZ_Some_meth, some_ref); + } + case LDKCOption_MonitorEventZ_None: { + return (*env)->NewObject(env, LDKCOption_MonitorEventZ_None_class, LDKCOption_MonitorEventZ_None_meth); + } + default: abort(); + } +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1COption_1MonitorEventZDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_COption_MonitorEventZDecodeErrorZ *val = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)(arg & ~1); + CHECK(val->result_ok); + uint64_t res_ref = ((uint64_t)&(*val->contents.result)) | 1; + return res_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1COption_1MonitorEventZDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_COption_MonitorEventZDecodeErrorZ *val = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)(arg & ~1); + CHECK(!val->result_ok); + LDKDecodeError err_var = (*val->contents.err); + uint64_t err_ref = 0; + CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); + err_ref = (uint64_t)err_var.inner & ~1; + return err_ref; } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1HTLCUpdateDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_HTLCUpdateDecodeErrorZ *val = (LDKCResult_HTLCUpdateDecodeErrorZ*)(arg & ~1); @@ -5449,6 +5487,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1HTLCUpdateDecod uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -5459,12 +5498,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1HTLCUpdateDecod uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneMonitorUpdateErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_NoneMonitorUpdateErrorZ*)arg)->result_ok; -} JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneMonitorUpdateErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_NoneMonitorUpdateErrorZ *val = (LDKCResult_NoneMonitorUpdateErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -5477,6 +5514,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneMonitorUpda uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } @@ -5489,6 +5527,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1g uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -5529,26 +5568,6 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32ScriptZ_1ge return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1C2Tuple_1u32ScriptZZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) { - LDKCVec_C2Tuple_u32ScriptZZ *ret = MALLOC(sizeof(LDKCVec_C2Tuple_u32ScriptZZ), "LDKCVec_C2Tuple_u32ScriptZZ"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ) * ret->datalen, "LDKCVec_C2Tuple_u32ScriptZZ 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]; - 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; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_C2Tuple_u32ScriptZZ CVec_C2Tuple_u32ScriptZZ_clone(const LDKCVec_C2Tuple_u32ScriptZZ *orig) { LDKCVec_C2Tuple_u32ScriptZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ) * orig->datalen, "LDKCVec_C2Tuple_u32ScriptZZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -5585,26 +5604,6 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2T return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) { - LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ *ret = MALLOC(sizeof(LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ), "LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ) * ret->datalen, "LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ 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]; - 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; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_clone(const LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ *orig) { LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ) * orig->datalen, "LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -5612,299 +5611,6 @@ static inline LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ CVec_C2Tuple_TxidCV } return ret; } -static jclass LDKPaymentPurpose_InvoicePayment_class = NULL; -static jmethodID LDKPaymentPurpose_InvoicePayment_meth = NULL; -static jclass LDKPaymentPurpose_SpontaneousPayment_class = NULL; -static jmethodID LDKPaymentPurpose_SpontaneousPayment_meth = NULL; -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKPaymentPurpose_init (JNIEnv *env, jclass clz) { - LDKPaymentPurpose_InvoicePayment_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKPaymentPurpose$InvoicePayment;")); - CHECK(LDKPaymentPurpose_InvoicePayment_class != NULL); - LDKPaymentPurpose_InvoicePayment_meth = (*env)->GetMethodID(env, LDKPaymentPurpose_InvoicePayment_class, "", "([B[BJ)V"); - CHECK(LDKPaymentPurpose_InvoicePayment_meth != NULL); - LDKPaymentPurpose_SpontaneousPayment_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKPaymentPurpose$SpontaneousPayment;")); - CHECK(LDKPaymentPurpose_SpontaneousPayment_class != NULL); - LDKPaymentPurpose_SpontaneousPayment_meth = (*env)->GetMethodID(env, LDKPaymentPurpose_SpontaneousPayment_class, "", "([B)V"); - CHECK(LDKPaymentPurpose_SpontaneousPayment_meth != NULL); -} -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKPaymentPurpose_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { - LDKPaymentPurpose *obj = (LDKPaymentPurpose*)(ptr & ~1); - switch(obj->tag) { - case LDKPaymentPurpose_InvoicePayment: { - int8_tArray payment_preimage_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, payment_preimage_arr, 0, 32, obj->invoice_payment.payment_preimage.data); - int8_tArray payment_secret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, payment_secret_arr, 0, 32, obj->invoice_payment.payment_secret.data); - return (*env)->NewObject(env, LDKPaymentPurpose_InvoicePayment_class, LDKPaymentPurpose_InvoicePayment_meth, payment_preimage_arr, payment_secret_arr, obj->invoice_payment.user_payment_id); - } - case LDKPaymentPurpose_SpontaneousPayment: { - int8_tArray spontaneous_payment_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, spontaneous_payment_arr, 0, 32, obj->spontaneous_payment.data); - return (*env)->NewObject(env, LDKPaymentPurpose_SpontaneousPayment_class, LDKPaymentPurpose_SpontaneousPayment_meth, spontaneous_payment_arr); - } - default: abort(); - } -} -static jclass LDKClosureReason_CounterpartyForceClosed_class = NULL; -static jmethodID LDKClosureReason_CounterpartyForceClosed_meth = NULL; -static jclass LDKClosureReason_HolderForceClosed_class = NULL; -static jmethodID LDKClosureReason_HolderForceClosed_meth = NULL; -static jclass LDKClosureReason_CooperativeClosure_class = NULL; -static jmethodID LDKClosureReason_CooperativeClosure_meth = NULL; -static jclass LDKClosureReason_CommitmentTxConfirmed_class = NULL; -static jmethodID LDKClosureReason_CommitmentTxConfirmed_meth = NULL; -static jclass LDKClosureReason_ProcessingError_class = NULL; -static jmethodID LDKClosureReason_ProcessingError_meth = NULL; -static jclass LDKClosureReason_DisconnectedPeer_class = NULL; -static jmethodID LDKClosureReason_DisconnectedPeer_meth = NULL; -static jclass LDKClosureReason_OutdatedChannelManager_class = NULL; -static jmethodID LDKClosureReason_OutdatedChannelManager_meth = NULL; -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKClosureReason_init (JNIEnv *env, jclass clz) { - LDKClosureReason_CounterpartyForceClosed_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKClosureReason$CounterpartyForceClosed;")); - CHECK(LDKClosureReason_CounterpartyForceClosed_class != NULL); - LDKClosureReason_CounterpartyForceClosed_meth = (*env)->GetMethodID(env, LDKClosureReason_CounterpartyForceClosed_class, "", "(Ljava/lang/String;)V"); - CHECK(LDKClosureReason_CounterpartyForceClosed_meth != NULL); - LDKClosureReason_HolderForceClosed_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKClosureReason$HolderForceClosed;")); - CHECK(LDKClosureReason_HolderForceClosed_class != NULL); - LDKClosureReason_HolderForceClosed_meth = (*env)->GetMethodID(env, LDKClosureReason_HolderForceClosed_class, "", "()V"); - CHECK(LDKClosureReason_HolderForceClosed_meth != NULL); - LDKClosureReason_CooperativeClosure_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKClosureReason$CooperativeClosure;")); - CHECK(LDKClosureReason_CooperativeClosure_class != NULL); - LDKClosureReason_CooperativeClosure_meth = (*env)->GetMethodID(env, LDKClosureReason_CooperativeClosure_class, "", "()V"); - CHECK(LDKClosureReason_CooperativeClosure_meth != NULL); - LDKClosureReason_CommitmentTxConfirmed_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKClosureReason$CommitmentTxConfirmed;")); - CHECK(LDKClosureReason_CommitmentTxConfirmed_class != NULL); - LDKClosureReason_CommitmentTxConfirmed_meth = (*env)->GetMethodID(env, LDKClosureReason_CommitmentTxConfirmed_class, "", "()V"); - CHECK(LDKClosureReason_CommitmentTxConfirmed_meth != NULL); - LDKClosureReason_ProcessingError_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKClosureReason$ProcessingError;")); - CHECK(LDKClosureReason_ProcessingError_class != NULL); - LDKClosureReason_ProcessingError_meth = (*env)->GetMethodID(env, LDKClosureReason_ProcessingError_class, "", "(Ljava/lang/String;)V"); - CHECK(LDKClosureReason_ProcessingError_meth != NULL); - LDKClosureReason_DisconnectedPeer_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKClosureReason$DisconnectedPeer;")); - CHECK(LDKClosureReason_DisconnectedPeer_class != NULL); - LDKClosureReason_DisconnectedPeer_meth = (*env)->GetMethodID(env, LDKClosureReason_DisconnectedPeer_class, "", "()V"); - CHECK(LDKClosureReason_DisconnectedPeer_meth != NULL); - LDKClosureReason_OutdatedChannelManager_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKClosureReason$OutdatedChannelManager;")); - CHECK(LDKClosureReason_OutdatedChannelManager_class != NULL); - LDKClosureReason_OutdatedChannelManager_meth = (*env)->GetMethodID(env, LDKClosureReason_OutdatedChannelManager_class, "", "()V"); - CHECK(LDKClosureReason_OutdatedChannelManager_meth != NULL); -} -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKClosureReason_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { - LDKClosureReason *obj = (LDKClosureReason*)(ptr & ~1); - switch(obj->tag) { - case LDKClosureReason_CounterpartyForceClosed: { - LDKStr peer_msg_str = obj->counterparty_force_closed.peer_msg; - jstring peer_msg_conv = str_ref_to_java(env, peer_msg_str.chars, peer_msg_str.len); - return (*env)->NewObject(env, LDKClosureReason_CounterpartyForceClosed_class, LDKClosureReason_CounterpartyForceClosed_meth, peer_msg_conv); - } - case LDKClosureReason_HolderForceClosed: { - return (*env)->NewObject(env, LDKClosureReason_HolderForceClosed_class, LDKClosureReason_HolderForceClosed_meth); - } - case LDKClosureReason_CooperativeClosure: { - return (*env)->NewObject(env, LDKClosureReason_CooperativeClosure_class, LDKClosureReason_CooperativeClosure_meth); - } - case LDKClosureReason_CommitmentTxConfirmed: { - return (*env)->NewObject(env, LDKClosureReason_CommitmentTxConfirmed_class, LDKClosureReason_CommitmentTxConfirmed_meth); - } - case LDKClosureReason_ProcessingError: { - LDKStr err_str = obj->processing_error.err; - jstring err_conv = str_ref_to_java(env, err_str.chars, err_str.len); - return (*env)->NewObject(env, LDKClosureReason_ProcessingError_class, LDKClosureReason_ProcessingError_meth, err_conv); - } - case LDKClosureReason_DisconnectedPeer: { - return (*env)->NewObject(env, LDKClosureReason_DisconnectedPeer_class, LDKClosureReason_DisconnectedPeer_meth); - } - case LDKClosureReason_OutdatedChannelManager: { - return (*env)->NewObject(env, LDKClosureReason_OutdatedChannelManager_class, LDKClosureReason_OutdatedChannelManager_meth); - } - default: abort(); - } -} -static jclass LDKEvent_FundingGenerationReady_class = NULL; -static jmethodID LDKEvent_FundingGenerationReady_meth = NULL; -static jclass LDKEvent_PaymentReceived_class = NULL; -static jmethodID LDKEvent_PaymentReceived_meth = NULL; -static jclass LDKEvent_PaymentSent_class = NULL; -static jmethodID LDKEvent_PaymentSent_meth = NULL; -static jclass LDKEvent_PaymentPathFailed_class = NULL; -static jmethodID LDKEvent_PaymentPathFailed_meth = NULL; -static jclass LDKEvent_PendingHTLCsForwardable_class = NULL; -static jmethodID LDKEvent_PendingHTLCsForwardable_meth = NULL; -static jclass LDKEvent_SpendableOutputs_class = NULL; -static jmethodID LDKEvent_SpendableOutputs_meth = NULL; -static jclass LDKEvent_PaymentForwarded_class = NULL; -static jmethodID LDKEvent_PaymentForwarded_meth = NULL; -static jclass LDKEvent_ChannelClosed_class = NULL; -static jmethodID LDKEvent_ChannelClosed_meth = NULL; -static jclass LDKEvent_DiscardFunding_class = NULL; -static jmethodID LDKEvent_DiscardFunding_meth = NULL; -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKEvent_init (JNIEnv *env, jclass clz) { - LDKEvent_FundingGenerationReady_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$FundingGenerationReady;")); - CHECK(LDKEvent_FundingGenerationReady_class != NULL); - LDKEvent_FundingGenerationReady_meth = (*env)->GetMethodID(env, LDKEvent_FundingGenerationReady_class, "", "([BJ[BJ)V"); - CHECK(LDKEvent_FundingGenerationReady_meth != NULL); - LDKEvent_PaymentReceived_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$PaymentReceived;")); - CHECK(LDKEvent_PaymentReceived_class != NULL); - LDKEvent_PaymentReceived_meth = (*env)->GetMethodID(env, LDKEvent_PaymentReceived_class, "", "([BJJ)V"); - CHECK(LDKEvent_PaymentReceived_meth != NULL); - LDKEvent_PaymentSent_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$PaymentSent;")); - CHECK(LDKEvent_PaymentSent_class != NULL); - LDKEvent_PaymentSent_meth = (*env)->GetMethodID(env, LDKEvent_PaymentSent_class, "", "([B[B[BJ)V"); - CHECK(LDKEvent_PaymentSent_meth != NULL); - LDKEvent_PaymentPathFailed_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$PaymentPathFailed;")); - CHECK(LDKEvent_PaymentPathFailed_class != NULL); - LDKEvent_PaymentPathFailed_meth = (*env)->GetMethodID(env, LDKEvent_PaymentPathFailed_class, "", "([B[BZJZ[JJJ)V"); - CHECK(LDKEvent_PaymentPathFailed_meth != NULL); - LDKEvent_PendingHTLCsForwardable_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$PendingHTLCsForwardable;")); - CHECK(LDKEvent_PendingHTLCsForwardable_class != NULL); - LDKEvent_PendingHTLCsForwardable_meth = (*env)->GetMethodID(env, LDKEvent_PendingHTLCsForwardable_class, "", "(J)V"); - CHECK(LDKEvent_PendingHTLCsForwardable_meth != NULL); - LDKEvent_SpendableOutputs_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$SpendableOutputs;")); - CHECK(LDKEvent_SpendableOutputs_class != NULL); - LDKEvent_SpendableOutputs_meth = (*env)->GetMethodID(env, LDKEvent_SpendableOutputs_class, "", "([J)V"); - CHECK(LDKEvent_SpendableOutputs_meth != NULL); - LDKEvent_PaymentForwarded_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$PaymentForwarded;")); - CHECK(LDKEvent_PaymentForwarded_class != NULL); - LDKEvent_PaymentForwarded_meth = (*env)->GetMethodID(env, LDKEvent_PaymentForwarded_class, "", "(JZ)V"); - CHECK(LDKEvent_PaymentForwarded_meth != NULL); - LDKEvent_ChannelClosed_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$ChannelClosed;")); - CHECK(LDKEvent_ChannelClosed_class != NULL); - LDKEvent_ChannelClosed_meth = (*env)->GetMethodID(env, LDKEvent_ChannelClosed_class, "", "([BJJ)V"); - CHECK(LDKEvent_ChannelClosed_meth != NULL); - LDKEvent_DiscardFunding_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$DiscardFunding;")); - CHECK(LDKEvent_DiscardFunding_class != NULL); - LDKEvent_DiscardFunding_meth = (*env)->GetMethodID(env, LDKEvent_DiscardFunding_class, "", "([B[B)V"); - CHECK(LDKEvent_DiscardFunding_meth != NULL); -} -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEvent_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { - LDKEvent *obj = (LDKEvent*)(ptr & ~1); - switch(obj->tag) { - case LDKEvent_FundingGenerationReady: { - int8_tArray temporary_channel_id_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, temporary_channel_id_arr, 0, 32, obj->funding_generation_ready.temporary_channel_id.data); - LDKCVec_u8Z output_script_var = obj->funding_generation_ready.output_script; - int8_tArray output_script_arr = (*env)->NewByteArray(env, output_script_var.datalen); - (*env)->SetByteArrayRegion(env, output_script_arr, 0, output_script_var.datalen, output_script_var.data); - return (*env)->NewObject(env, LDKEvent_FundingGenerationReady_class, LDKEvent_FundingGenerationReady_meth, temporary_channel_id_arr, obj->funding_generation_ready.channel_value_satoshis, output_script_arr, obj->funding_generation_ready.user_channel_id); - } - case LDKEvent_PaymentReceived: { - int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->payment_received.payment_hash.data); - uint64_t purpose_ref = ((uint64_t)&obj->payment_received.purpose) | 1; - return (*env)->NewObject(env, LDKEvent_PaymentReceived_class, LDKEvent_PaymentReceived_meth, payment_hash_arr, obj->payment_received.amt, purpose_ref); - } - case LDKEvent_PaymentSent: { - int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, obj->payment_sent.payment_id.data); - int8_tArray payment_preimage_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, payment_preimage_arr, 0, 32, obj->payment_sent.payment_preimage.data); - int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->payment_sent.payment_hash.data); - uint64_t fee_paid_msat_ref = ((uint64_t)&obj->payment_sent.fee_paid_msat) | 1; - return (*env)->NewObject(env, LDKEvent_PaymentSent_class, LDKEvent_PaymentSent_meth, payment_id_arr, payment_preimage_arr, payment_hash_arr, fee_paid_msat_ref); - } - case LDKEvent_PaymentPathFailed: { - int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, obj->payment_path_failed.payment_id.data); - int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->payment_path_failed.payment_hash.data); - uint64_t network_update_ref = ((uint64_t)&obj->payment_path_failed.network_update) | 1; - LDKCVec_RouteHopZ path_var = obj->payment_path_failed.path; - int64_tArray path_arr = NULL; - path_arr = (*env)->NewLongArray(env, path_var.datalen); - int64_t *path_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, path_arr, NULL); - for (size_t k = 0; k < path_var.datalen; k++) { - LDKRouteHop path_conv_10_var = path_var.data[k]; - uint64_t path_conv_10_ref = 0; - CHECK((((uint64_t)path_conv_10_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&path_conv_10_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - path_conv_10_ref = (uint64_t)path_conv_10_var.inner & ~1; - path_arr_ptr[k] = path_conv_10_ref; - } - (*env)->ReleasePrimitiveArrayCritical(env, path_arr, path_arr_ptr, 0); - uint64_t short_channel_id_ref = ((uint64_t)&obj->payment_path_failed.short_channel_id) | 1; - LDKRouteParameters retry_var = obj->payment_path_failed.retry; - uint64_t retry_ref = 0; - if ((uint64_t)retry_var.inner > 4096) { - CHECK((((uint64_t)retry_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&retry_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. - retry_ref = (uint64_t)retry_var.inner & ~1; - } - return (*env)->NewObject(env, LDKEvent_PaymentPathFailed_class, LDKEvent_PaymentPathFailed_meth, payment_id_arr, payment_hash_arr, obj->payment_path_failed.rejected_by_dest, network_update_ref, obj->payment_path_failed.all_paths_failed, path_arr, short_channel_id_ref, retry_ref); - } - case LDKEvent_PendingHTLCsForwardable: { - return (*env)->NewObject(env, LDKEvent_PendingHTLCsForwardable_class, LDKEvent_PendingHTLCsForwardable_meth, obj->pending_htl_cs_forwardable.time_forwardable); - } - case LDKEvent_SpendableOutputs: { - LDKCVec_SpendableOutputDescriptorZ outputs_var = obj->spendable_outputs.outputs; - int64_tArray outputs_arr = NULL; - outputs_arr = (*env)->NewLongArray(env, outputs_var.datalen); - int64_t *outputs_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, outputs_arr, NULL); - for (size_t b = 0; b < outputs_var.datalen; b++) { - uint64_t outputs_conv_27_ref = ((uint64_t)&outputs_var.data[b]) | 1; - outputs_arr_ptr[b] = outputs_conv_27_ref; - } - (*env)->ReleasePrimitiveArrayCritical(env, outputs_arr, outputs_arr_ptr, 0); - return (*env)->NewObject(env, LDKEvent_SpendableOutputs_class, LDKEvent_SpendableOutputs_meth, outputs_arr); - } - case LDKEvent_PaymentForwarded: { - uint64_t fee_earned_msat_ref = ((uint64_t)&obj->payment_forwarded.fee_earned_msat) | 1; - return (*env)->NewObject(env, LDKEvent_PaymentForwarded_class, LDKEvent_PaymentForwarded_meth, fee_earned_msat_ref, obj->payment_forwarded.claim_from_onchain_tx); - } - case LDKEvent_ChannelClosed: { - int8_tArray channel_id_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, channel_id_arr, 0, 32, obj->channel_closed.channel_id.data); - uint64_t reason_ref = ((uint64_t)&obj->channel_closed.reason) | 1; - return (*env)->NewObject(env, LDKEvent_ChannelClosed_class, LDKEvent_ChannelClosed_meth, channel_id_arr, obj->channel_closed.user_channel_id, reason_ref); - } - case LDKEvent_DiscardFunding: { - int8_tArray channel_id_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, channel_id_arr, 0, 32, obj->discard_funding.channel_id.data); - LDKTransaction transaction_var = obj->discard_funding.transaction; - int8_tArray transaction_arr = (*env)->NewByteArray(env, transaction_var.datalen); - (*env)->SetByteArrayRegion(env, transaction_arr, 0, transaction_var.datalen, transaction_var.data); - return (*env)->NewObject(env, LDKEvent_DiscardFunding_class, LDKEvent_DiscardFunding_meth, channel_id_arr, transaction_arr); - } - default: abort(); - } -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1EventZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) { - LDKCVec_EventZ *ret = MALLOC(sizeof(LDKCVec_EventZ), "LDKCVec_EventZ"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKEvent) * ret->datalen, "LDKCVec_EventZ 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]; - 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; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_EventZ CVec_EventZ_clone(const LDKCVec_EventZ *orig) { LDKCVec_EventZ ret = { .data = MALLOC(sizeof(LDKEvent) * orig->datalen, "LDKCVec_EventZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -5931,26 +5637,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32TxOutZ_1get_1b( return (uint64_t)ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1C2Tuple_1u32TxOutZZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) { - LDKCVec_C2Tuple_u32TxOutZZ *ret = MALLOC(sizeof(LDKCVec_C2Tuple_u32TxOutZZ), "LDKCVec_C2Tuple_u32TxOutZZ"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ) * ret->datalen, "LDKCVec_C2Tuple_u32TxOutZZ 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]; - 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; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_C2Tuple_u32TxOutZZ CVec_C2Tuple_u32TxOutZZ_clone(const LDKCVec_C2Tuple_u32TxOutZZ *orig) { LDKCVec_C2Tuple_u32TxOutZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ) * orig->datalen, "LDKCVec_C2Tuple_u32TxOutZZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -5987,26 +5673,6 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2T return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) { - LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ *ret = MALLOC(sizeof(LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ), "LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ) * ret->datalen, "LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ 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]; - 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; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_clone(const LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ *orig) { LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ) * orig->datalen, "LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -6062,26 +5728,6 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKBalance_1ref_1from_1ptr( default: abort(); } } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1BalanceZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) { - LDKCVec_BalanceZ *ret = MALLOC(sizeof(LDKCVec_BalanceZ), "LDKCVec_BalanceZ"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKBalance) * ret->datalen, "LDKCVec_BalanceZ 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]; - 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; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_BalanceZ CVec_BalanceZ_clone(const LDKCVec_BalanceZ *orig) { LDKCVec_BalanceZ ret = { .data = MALLOC(sizeof(LDKBalance) * orig->datalen, "LDKCVec_BalanceZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -6089,9 +5735,6 @@ static inline LDKCVec_BalanceZ CVec_BalanceZ_clone(const LDKCVec_BalanceZ *orig) } return ret; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ *val = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -6107,12 +5750,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1BlockH uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneLightningErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_NoneLightningErrorZ*)arg)->result_ok; -} JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneLightningErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_NoneLightningErrorZ *val = (LDKCResult_NoneLightningErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -6125,6 +5766,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneLightningEr uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } @@ -6148,26 +5790,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyTypeZ_1ge return (uint64_t)ret_ret; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1C2Tuple_1PublicKeyTypeZZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) { - LDKCVec_C2Tuple_PublicKeyTypeZZ *ret = MALLOC(sizeof(LDKCVec_C2Tuple_PublicKeyTypeZZ), "LDKCVec_C2Tuple_PublicKeyTypeZZ"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ) * ret->datalen, "LDKCVec_C2Tuple_PublicKeyTypeZZ 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]; - 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; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_C2Tuple_PublicKeyTypeZZ CVec_C2Tuple_PublicKeyTypeZZ_clone(const LDKCVec_C2Tuple_PublicKeyTypeZZ *orig) { LDKCVec_C2Tuple_PublicKeyTypeZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ) * orig->datalen, "LDKCVec_C2Tuple_PublicKeyTypeZZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -6175,9 +5797,6 @@ static inline LDKCVec_C2Tuple_PublicKeyTypeZZ CVec_C2Tuple_PublicKeyTypeZZ_clone } return ret; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1boolLightningErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_boolLightningErrorZ*)arg)->result_ok; -} JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1boolLightningErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_boolLightningErrorZ *val = (LDKCResult_boolLightningErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -6190,6 +5809,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1boolLightningEr uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } @@ -6202,6 +5822,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncemen uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -6218,6 +5839,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncemen uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -6234,6 +5856,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncemen uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -6241,26 +5864,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncemen return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) { - LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ *ret = MALLOC(sizeof(LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ), "LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ) * ret->datalen, "LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ 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]; - 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)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_clone(const LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ *orig) { LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ ret = { .data = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ) * orig->datalen, "LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -6268,26 +5871,6 @@ static inline LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ CV } return ret; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1NodeAnnouncementZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) { - LDKCVec_NodeAnnouncementZ *ret = MALLOC(sizeof(LDKCVec_NodeAnnouncementZ), "LDKCVec_NodeAnnouncementZ"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKNodeAnnouncement) * ret->datalen, "LDKCVec_NodeAnnouncementZ 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]; - LDKNodeAnnouncement arr_elem_conv; - arr_elem_conv.inner = (void*)(arr_elem & (~1)); - arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0); - arr_elem_conv = NodeAnnouncement_clone(&arr_elem_conv); - ret->data[i] = arr_elem_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_NodeAnnouncementZ CVec_NodeAnnouncementZ_clone(const LDKCVec_NodeAnnouncementZ *orig) { LDKCVec_NodeAnnouncementZ ret = { .data = MALLOC(sizeof(LDKNodeAnnouncement) * orig->datalen, "LDKCVec_NodeAnnouncementZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -6295,9 +5878,6 @@ static inline LDKCVec_NodeAnnouncementZ CVec_NodeAnnouncementZ_clone(const LDKCV } return ret; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1u8ZPeerHandleErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_CVec_u8ZPeerHandleErrorZ*)arg)->result_ok; -} JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1u8ZPeerHandleErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_CVec_u8ZPeerHandleErrorZ *val = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -6313,12 +5893,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1u8ZPeerHa uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NonePeerHandleErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_NonePeerHandleErrorZ*)arg)->result_ok; -} JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NonePeerHandleErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_NonePeerHandleErrorZ *val = (LDKCResult_NonePeerHandleErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -6331,12 +5909,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NonePeerHandleE uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1boolPeerHandleErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_boolPeerHandleErrorZ*)arg)->result_ok; -} JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1boolPeerHandleErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_boolPeerHandleErrorZ *val = (LDKCResult_boolPeerHandleErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -6349,12 +5925,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1boolPeerHandleE uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeIdDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_NodeIdDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeIdDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_NodeIdDecodeErrorZ *val = (LDKCResult_NodeIdDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -6362,6 +5936,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeIdDecodeErr uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -6372,6 +5947,24 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeIdDecodeErr uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); + err_ref = (uint64_t)err_var.inner & ~1; + return err_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1COption_1NetworkUpdateZDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_COption_NetworkUpdateZDecodeErrorZ *val = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)(arg & ~1); + CHECK(val->result_ok); + uint64_t res_ref = ((uint64_t)&(*val->contents.result)) | 1; + return res_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1COption_1NetworkUpdateZDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_COption_NetworkUpdateZDecodeErrorZ *val = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)(arg & ~1); + CHECK(!val->result_ok); + LDKDecodeError err_var = (*val->contents.err); + uint64_t err_ref = 0; + CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } @@ -6419,7 +6012,7 @@ LDKCResult_TxOutAccessErrorZ get_utxo_LDKAccess_jcall(const void* this_arg, cons 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)); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -6499,9 +6092,6 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1AccessZ_1ref_1f default: abort(); } } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1DirectionalChannelInfoDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_DirectionalChannelInfoDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1DirectionalChannelInfoDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_DirectionalChannelInfoDecodeErrorZ *val = (LDKCResult_DirectionalChannelInfoDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -6509,6 +6099,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1DirectionalChan uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -6519,12 +6110,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1DirectionalChan uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelInfoDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_ChannelInfoDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelInfoDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_ChannelInfoDecodeErrorZ *val = (LDKCResult_ChannelInfoDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -6532,6 +6121,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelInfoDeco uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -6542,12 +6132,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelInfoDeco uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RoutingFeesDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_RoutingFeesDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RoutingFeesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_RoutingFeesDecodeErrorZ *val = (LDKCResult_RoutingFeesDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -6555,6 +6143,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RoutingFeesDeco uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -6565,12 +6154,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RoutingFeesDeco uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeAnnouncementInfoDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeAnnouncementInfoDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_NodeAnnouncementInfoDecodeErrorZ *val = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -6578,6 +6165,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeAnnouncemen uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -6588,32 +6176,15 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeAnnouncemen uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1u64Z_1new(JNIEnv *env, jclass clz, int64_tArray elems) { - LDKCVec_u64Z *ret = MALLOC(sizeof(LDKCVec_u64Z), "LDKCVec_u64Z"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(uint64_t) * ret->datalen, "LDKCVec_u64Z Data"); - int64_t *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); - for (size_t i = 0; i < ret->datalen; i++) { - ret->data[i] = java_elems[i]; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_u64Z CVec_u64Z_clone(const LDKCVec_u64Z *orig) { LDKCVec_u64Z ret = { .data = MALLOC(sizeof(int64_t) * orig->datalen, "LDKCVec_u64Z clone bytes"), .datalen = orig->datalen }; memcpy(ret.data, orig->data, sizeof(int64_t) * ret.datalen); return ret; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeInfoDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_NodeInfoDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeInfoDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_NodeInfoDecodeErrorZ *val = (LDKCResult_NodeInfoDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -6621,6 +6192,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeInfoDecodeE uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -6631,12 +6203,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeInfoDecodeE uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NetworkGraphDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_NetworkGraphDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NetworkGraphDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_NetworkGraphDecodeErrorZ *val = (LDKCResult_NetworkGraphDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -6644,6 +6214,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NetworkGraphDec uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -6654,6 +6225,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NetworkGraphDec uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } @@ -6694,9 +6266,6 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1CVec_1NetAddres default: abort(); } } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NetAddressDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_NetAddressDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NetAddressDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_NetAddressDecodeErrorZ *val = (LDKCResult_NetAddressDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -6710,29 +6279,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NetAddressDecod uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1UpdateAddHTLCZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) { - LDKCVec_UpdateAddHTLCZ *ret = MALLOC(sizeof(LDKCVec_UpdateAddHTLCZ), "LDKCVec_UpdateAddHTLCZ"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKUpdateAddHTLC) * ret->datalen, "LDKCVec_UpdateAddHTLCZ 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]; - LDKUpdateAddHTLC arr_elem_conv; - arr_elem_conv.inner = (void*)(arr_elem & (~1)); - arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0); - arr_elem_conv = UpdateAddHTLC_clone(&arr_elem_conv); - ret->data[i] = arr_elem_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_UpdateAddHTLCZ CVec_UpdateAddHTLCZ_clone(const LDKCVec_UpdateAddHTLCZ *orig) { LDKCVec_UpdateAddHTLCZ ret = { .data = MALLOC(sizeof(LDKUpdateAddHTLC) * orig->datalen, "LDKCVec_UpdateAddHTLCZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -6740,26 +6290,6 @@ static inline LDKCVec_UpdateAddHTLCZ CVec_UpdateAddHTLCZ_clone(const LDKCVec_Upd } return ret; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1UpdateFulfillHTLCZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) { - LDKCVec_UpdateFulfillHTLCZ *ret = MALLOC(sizeof(LDKCVec_UpdateFulfillHTLCZ), "LDKCVec_UpdateFulfillHTLCZ"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKUpdateFulfillHTLC) * ret->datalen, "LDKCVec_UpdateFulfillHTLCZ 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]; - LDKUpdateFulfillHTLC arr_elem_conv; - arr_elem_conv.inner = (void*)(arr_elem & (~1)); - arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0); - arr_elem_conv = UpdateFulfillHTLC_clone(&arr_elem_conv); - ret->data[i] = arr_elem_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_UpdateFulfillHTLCZ CVec_UpdateFulfillHTLCZ_clone(const LDKCVec_UpdateFulfillHTLCZ *orig) { LDKCVec_UpdateFulfillHTLCZ ret = { .data = MALLOC(sizeof(LDKUpdateFulfillHTLC) * orig->datalen, "LDKCVec_UpdateFulfillHTLCZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -6767,26 +6297,6 @@ static inline LDKCVec_UpdateFulfillHTLCZ CVec_UpdateFulfillHTLCZ_clone(const LDK } return ret; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1UpdateFailHTLCZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) { - LDKCVec_UpdateFailHTLCZ *ret = MALLOC(sizeof(LDKCVec_UpdateFailHTLCZ), "LDKCVec_UpdateFailHTLCZ"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKUpdateFailHTLC) * ret->datalen, "LDKCVec_UpdateFailHTLCZ 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]; - LDKUpdateFailHTLC arr_elem_conv; - arr_elem_conv.inner = (void*)(arr_elem & (~1)); - arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0); - arr_elem_conv = UpdateFailHTLC_clone(&arr_elem_conv); - ret->data[i] = arr_elem_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_UpdateFailHTLCZ CVec_UpdateFailHTLCZ_clone(const LDKCVec_UpdateFailHTLCZ *orig) { LDKCVec_UpdateFailHTLCZ ret = { .data = MALLOC(sizeof(LDKUpdateFailHTLC) * orig->datalen, "LDKCVec_UpdateFailHTLCZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -6794,26 +6304,6 @@ static inline LDKCVec_UpdateFailHTLCZ CVec_UpdateFailHTLCZ_clone(const LDKCVec_U } return ret; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1UpdateFailMalformedHTLCZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) { - LDKCVec_UpdateFailMalformedHTLCZ *ret = MALLOC(sizeof(LDKCVec_UpdateFailMalformedHTLCZ), "LDKCVec_UpdateFailMalformedHTLCZ"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKUpdateFailMalformedHTLC) * ret->datalen, "LDKCVec_UpdateFailMalformedHTLCZ 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]; - LDKUpdateFailMalformedHTLC arr_elem_conv; - arr_elem_conv.inner = (void*)(arr_elem & (~1)); - arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0); - arr_elem_conv = UpdateFailMalformedHTLC_clone(&arr_elem_conv); - ret->data[i] = arr_elem_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_UpdateFailMalformedHTLCZ CVec_UpdateFailMalformedHTLCZ_clone(const LDKCVec_UpdateFailMalformedHTLCZ *orig) { LDKCVec_UpdateFailMalformedHTLCZ ret = { .data = MALLOC(sizeof(LDKUpdateFailMalformedHTLC) * orig->datalen, "LDKCVec_UpdateFailMalformedHTLCZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -6821,9 +6311,6 @@ static inline LDKCVec_UpdateFailMalformedHTLCZ CVec_UpdateFailMalformedHTLCZ_clo } return ret; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1AcceptChannelDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_AcceptChannelDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1AcceptChannelDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_AcceptChannelDecodeErrorZ *val = (LDKCResult_AcceptChannelDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -6831,6 +6318,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1AcceptChannelDe uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -6841,12 +6329,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1AcceptChannelDe uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1AnnouncementSignaturesDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_AnnouncementSignaturesDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1AnnouncementSignaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_AnnouncementSignaturesDecodeErrorZ *val = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -6854,6 +6340,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1AnnouncementSig uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -6864,12 +6351,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1AnnouncementSig uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelReestablishDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_ChannelReestablishDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelReestablishDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_ChannelReestablishDecodeErrorZ *val = (LDKCResult_ChannelReestablishDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -6877,6 +6362,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelReestabl uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -6887,12 +6373,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelReestabl uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ClosingSignedDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_ClosingSignedDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ClosingSignedDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_ClosingSignedDecodeErrorZ *val = (LDKCResult_ClosingSignedDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -6900,6 +6384,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ClosingSignedDe uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -6910,12 +6395,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ClosingSignedDe uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ClosingSignedFeeRangeDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ClosingSignedFeeRangeDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *val = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -6923,6 +6406,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ClosingSignedFe uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -6933,12 +6417,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ClosingSignedFe uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CommitmentSignedDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_CommitmentSignedDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CommitmentSignedDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_CommitmentSignedDecodeErrorZ *val = (LDKCResult_CommitmentSignedDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -6946,6 +6428,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CommitmentSigne uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -6956,12 +6439,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CommitmentSigne uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1FundingCreatedDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_FundingCreatedDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1FundingCreatedDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_FundingCreatedDecodeErrorZ *val = (LDKCResult_FundingCreatedDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -6969,6 +6450,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1FundingCreatedD uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -6979,12 +6461,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1FundingCreatedD uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1FundingSignedDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_FundingSignedDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1FundingSignedDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_FundingSignedDecodeErrorZ *val = (LDKCResult_FundingSignedDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -6992,6 +6472,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1FundingSignedDe uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -7002,12 +6483,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1FundingSignedDe uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1FundingLockedDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_FundingLockedDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1FundingLockedDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_FundingLockedDecodeErrorZ *val = (LDKCResult_FundingLockedDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -7015,6 +6494,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1FundingLockedDe uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -7025,12 +6505,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1FundingLockedDe uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InitDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_InitDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InitDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_InitDecodeErrorZ *val = (LDKCResult_InitDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -7038,6 +6516,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InitDecodeError uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -7048,12 +6527,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InitDecodeError uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1OpenChannelDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_OpenChannelDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1OpenChannelDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_OpenChannelDecodeErrorZ *val = (LDKCResult_OpenChannelDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -7061,6 +6538,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1OpenChannelDeco uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -7071,12 +6549,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1OpenChannelDeco uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RevokeAndACKDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_RevokeAndACKDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RevokeAndACKDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_RevokeAndACKDecodeErrorZ *val = (LDKCResult_RevokeAndACKDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -7084,6 +6560,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RevokeAndACKDec uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -7094,12 +6571,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RevokeAndACKDec uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ShutdownDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_ShutdownDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ShutdownDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_ShutdownDecodeErrorZ *val = (LDKCResult_ShutdownDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -7107,6 +6582,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ShutdownDecodeE uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -7117,12 +6593,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ShutdownDecodeE uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFailHTLCDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_UpdateFailHTLCDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFailHTLCDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_UpdateFailHTLCDecodeErrorZ *val = (LDKCResult_UpdateFailHTLCDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -7130,6 +6604,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFailHTLCD uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -7140,12 +6615,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFailHTLCD uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFailMalformedHTLCDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFailMalformedHTLCDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *val = (LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -7153,6 +6626,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFailMalfo uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -7163,12 +6637,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFailMalfo uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFeeDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_UpdateFeeDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFeeDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_UpdateFeeDecodeErrorZ *val = (LDKCResult_UpdateFeeDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -7176,6 +6648,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFeeDecode uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -7186,12 +6659,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFeeDecode uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFulfillHTLCDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFulfillHTLCDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_UpdateFulfillHTLCDecodeErrorZ *val = (LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -7199,6 +6670,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFulfillHT uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -7209,12 +6681,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateFulfillHT uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateAddHTLCDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_UpdateAddHTLCDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateAddHTLCDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_UpdateAddHTLCDecodeErrorZ *val = (LDKCResult_UpdateAddHTLCDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -7222,6 +6692,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateAddHTLCDe uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -7232,12 +6703,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UpdateAddHTLCDe uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PingDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_PingDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PingDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_PingDecodeErrorZ *val = (LDKCResult_PingDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -7245,6 +6714,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PingDecodeError uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -7255,12 +6725,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PingDecodeError uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PongDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_PongDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PongDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_PongDecodeErrorZ *val = (LDKCResult_PongDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -7268,6 +6736,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PongDecodeError uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -7278,12 +6747,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PongDecodeError uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UnsignedChannelAnnouncementDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UnsignedChannelAnnouncementDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *val = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -7291,6 +6758,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UnsignedChannel uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -7301,12 +6769,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UnsignedChannel uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelAnnouncementDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_ChannelAnnouncementDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelAnnouncementDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_ChannelAnnouncementDecodeErrorZ *val = (LDKCResult_ChannelAnnouncementDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -7314,6 +6780,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelAnnounce uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -7324,12 +6791,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelAnnounce uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UnsignedChannelUpdateDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UnsignedChannelUpdateDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_UnsignedChannelUpdateDecodeErrorZ *val = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -7337,6 +6802,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UnsignedChannel uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -7347,12 +6813,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UnsignedChannel uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelUpdateDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_ChannelUpdateDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelUpdateDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_ChannelUpdateDecodeErrorZ *val = (LDKCResult_ChannelUpdateDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -7360,6 +6824,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelUpdateDe uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -7370,12 +6835,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ChannelUpdateDe uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ErrorMessageDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_ErrorMessageDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ErrorMessageDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_ErrorMessageDecodeErrorZ *val = (LDKCResult_ErrorMessageDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -7383,6 +6846,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ErrorMessageDec uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -7393,12 +6857,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ErrorMessageDec uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UnsignedNodeAnnouncementDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UnsignedNodeAnnouncementDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *val = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -7406,6 +6868,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UnsignedNodeAnn uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -7416,12 +6879,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1UnsignedNodeAnn uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeAnnouncementDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_NodeAnnouncementDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeAnnouncementDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_NodeAnnouncementDecodeErrorZ *val = (LDKCResult_NodeAnnouncementDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -7429,6 +6890,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeAnnouncemen uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -7439,12 +6901,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NodeAnnouncemen uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1QueryShortChannelIdsDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_QueryShortChannelIdsDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1QueryShortChannelIdsDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_QueryShortChannelIdsDecodeErrorZ *val = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -7452,6 +6912,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1QueryShortChann uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -7462,12 +6923,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1QueryShortChann uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ReplyShortChannelIdsEndDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ReplyShortChannelIdsEndDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *val = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -7475,6 +6934,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ReplyShortChann uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -7485,12 +6945,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ReplyShortChann uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1QueryChannelRangeDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_QueryChannelRangeDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1QueryChannelRangeDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_QueryChannelRangeDecodeErrorZ *val = (LDKCResult_QueryChannelRangeDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -7498,6 +6956,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1QueryChannelRan uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -7508,12 +6967,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1QueryChannelRan uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ReplyChannelRangeDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_ReplyChannelRangeDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ReplyChannelRangeDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_ReplyChannelRangeDecodeErrorZ *val = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -7521,6 +6978,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ReplyChannelRan uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -7531,12 +6989,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1ReplyChannelRan uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1GossipTimestampFilterDecodeErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_GossipTimestampFilterDecodeErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1GossipTimestampFilterDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_GossipTimestampFilterDecodeErrorZ *val = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -7544,6 +7000,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1GossipTimestamp uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -7554,6 +7011,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1GossipTimestamp uint64_t err_ref = 0; CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(err_var); err_ref = (uint64_t)err_var.inner & ~1; return err_ref; } @@ -7586,9 +7044,6 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKSignOrCreationError_1ref default: abort(); } } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceSignOrCreationErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_InvoiceSignOrCreationErrorZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceSignOrCreationErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_InvoiceSignOrCreationErrorZ *val = (LDKCResult_InvoiceSignOrCreationErrorZ*)(arg & ~1); CHECK(val->result_ok); @@ -7596,6 +7051,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1InvoiceSignOrCr uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -7667,6 +7123,7 @@ LDKCOption_C2Tuple_usizeTransactionZZ register_output_LDKFilter_jcall(const void uint64_t output_ref = 0; CHECK((((uint64_t)output_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&output_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(output_var); output_ref = (uint64_t)output_var.inner; if (output_var.is_owned) { output_ref |= 1; @@ -7681,7 +7138,7 @@ LDKCOption_C2Tuple_usizeTransactionZZ register_output_LDKFilter_jcall(const void 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)); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -7738,6 +7195,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Filter_1register_1output(JN LDKWatchedOutput output_conv; output_conv.inner = (void*)(output & (~1)); output_conv.is_owned = (output & 1) || (output == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(output_conv); output_conv = WatchedOutput_clone(&output_conv); LDKCOption_C2Tuple_usizeTransactionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_usizeTransactionZZ), "LDKCOption_C2Tuple_usizeTransactionZZ"); *ret_copy = (this_arg_conv->register_output)(this_arg_conv->this_arg, output_conv); @@ -7780,9 +7238,6 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1FilterZ_1ref_1f default: abort(); } } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1LockedChannelMonitorNoneZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) { - return ((LDKCResult_LockedChannelMonitorNoneZ*)arg)->result_ok; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1LockedChannelMonitorNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) { LDKCResult_LockedChannelMonitorNoneZ *val = (LDKCResult_LockedChannelMonitorNoneZ*)(arg & ~1); CHECK(val->result_ok); @@ -7790,6 +7245,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1LockedChannelMo uint64_t res_ref = 0; CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(res_var); res_ref = (uint64_t)res_var.inner & ~1; return res_ref; } @@ -7798,26 +7254,6 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1LockedChannelMonit CHECK(!val->result_ok); return *val->contents.err; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCVec_1OutPointZ_1new(JNIEnv *env, jclass clz, int64_tArray elems) { - LDKCVec_OutPointZ *ret = MALLOC(sizeof(LDKCVec_OutPointZ), "LDKCVec_OutPointZ"); - ret->datalen = (*env)->GetArrayLength(env, elems); - if (ret->datalen == 0) { - ret->data = NULL; - } else { - ret->data = MALLOC(sizeof(LDKOutPoint) * ret->datalen, "LDKCVec_OutPointZ 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]; - LDKOutPoint arr_elem_conv; - arr_elem_conv.inner = (void*)(arr_elem & (~1)); - arr_elem_conv.is_owned = (arr_elem & 1) || (arr_elem == 0); - arr_elem_conv = OutPoint_clone(&arr_elem_conv); - ret->data[i] = arr_elem_conv; - } - (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); - } - return (uint64_t)ret; -} static inline LDKCVec_OutPointZ CVec_OutPointZ_clone(const LDKCVec_OutPointZ *orig) { LDKCVec_OutPointZ ret = { .data = MALLOC(sizeof(LDKOutPoint) * orig->datalen, "LDKCVec_OutPointZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -7876,7 +7312,7 @@ LDKCVec_MessageSendEventZ get_and_clear_pending_msg_events_LDKMessageSendEventsP 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)); + FREE((void*)ret_conv_18); ret_constr.data[s] = ret_conv_18_conv; } (*env)->ReleaseLongArrayElements(env, ret, ret_vals, 0); @@ -8490,6 +7926,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ persist_new_channel_LDKPersist_jcall(con uint64_t channel_id_ref = 0; CHECK((((uint64_t)channel_id_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&channel_id_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_var); channel_id_ref = (uint64_t)channel_id_var.inner; if (channel_id_var.is_owned) { channel_id_ref |= 1; @@ -8499,6 +7936,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ persist_new_channel_LDKPersist_jcall(con data_var = ChannelMonitor_clone(data); CHECK((((uint64_t)data_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&data_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(data_var); data_ref = (uint64_t)data_var.inner; if (data_var.is_owned) { data_ref |= 1; @@ -8507,6 +7945,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ persist_new_channel_LDKPersist_jcall(con uint64_t update_id_ref = 0; CHECK((((uint64_t)update_id_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&update_id_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_id_var); update_id_ref = (uint64_t)update_id_var.inner; if (update_id_var.is_owned) { update_id_ref |= 1; @@ -8521,7 +7960,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ persist_new_channel_LDKPersist_jcall(con 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)); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -8540,6 +7979,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ update_persisted_channel_LDKPersist_jcal uint64_t channel_id_ref = 0; CHECK((((uint64_t)channel_id_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&channel_id_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_var); channel_id_ref = (uint64_t)channel_id_var.inner; if (channel_id_var.is_owned) { channel_id_ref |= 1; @@ -8550,6 +7990,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ update_persisted_channel_LDKPersist_jcal update_var = ChannelMonitorUpdate_clone(update); CHECK((((uint64_t)update_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&update_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_var); update_ref = (uint64_t)update_var.inner; if (update_var.is_owned) { update_ref |= 1; @@ -8560,6 +8001,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ update_persisted_channel_LDKPersist_jcal data_var = ChannelMonitor_clone(data); CHECK((((uint64_t)data_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&data_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(data_var); data_ref = (uint64_t)data_var.inner; if (data_var.is_owned) { data_ref |= 1; @@ -8568,6 +8010,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ update_persisted_channel_LDKPersist_jcal uint64_t update_id_ref = 0; CHECK((((uint64_t)update_id_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&update_id_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_id_var); update_id_ref = (uint64_t)update_id_var.inner; if (update_id_var.is_owned) { update_id_ref |= 1; @@ -8582,7 +8025,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ update_persisted_channel_LDKPersist_jcal 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)); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -8624,13 +8067,16 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Persist_1persist_1new_1chan LDKOutPoint channel_id_conv; channel_id_conv.inner = (void*)(channel_id & (~1)); channel_id_conv.is_owned = (channel_id & 1) || (channel_id == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); channel_id_conv = OutPoint_clone(&channel_id_conv); LDKChannelMonitor data_conv; data_conv.inner = (void*)(data & (~1)); data_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(data_conv); LDKMonitorUpdateId update_id_conv; update_id_conv.inner = (void*)(update_id & (~1)); update_id_conv.is_owned = (update_id & 1) || (update_id == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_id_conv); update_id_conv = MonitorUpdateId_clone(&update_id_conv); LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ"); *ret_conv = (this_arg_conv->persist_new_channel)(this_arg_conv->this_arg, channel_id_conv, &data_conv, update_id_conv); @@ -8644,16 +8090,20 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Persist_1update_1persisted_ LDKOutPoint channel_id_conv; channel_id_conv.inner = (void*)(channel_id & (~1)); channel_id_conv.is_owned = (channel_id & 1) || (channel_id == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); channel_id_conv = OutPoint_clone(&channel_id_conv); LDKChannelMonitorUpdate update_conv; update_conv.inner = (void*)(update & (~1)); update_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_conv); LDKChannelMonitor data_conv; data_conv.inner = (void*)(data & (~1)); data_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(data_conv); LDKMonitorUpdateId update_id_conv; update_id_conv.inner = (void*)(update_id & (~1)); update_id_conv.is_owned = (update_id & 1) || (update_id == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_id_conv); update_id_conv = MonitorUpdateId_clone(&update_id_conv); LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ"); *ret_conv = (this_arg_conv->update_persisted_channel)(this_arg_conv->this_arg, channel_id_conv, &update_conv, &data_conv, update_id_conv); @@ -8718,6 +8168,7 @@ void handle_open_channel_LDKChannelMessageHandler_jcall(const void* this_arg, LD uint64_t their_features_ref = 0; CHECK((((uint64_t)their_features_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&their_features_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(their_features_var); their_features_ref = (uint64_t)their_features_var.inner; if (their_features_var.is_owned) { their_features_ref |= 1; @@ -8727,6 +8178,7 @@ void handle_open_channel_LDKChannelMessageHandler_jcall(const void* this_arg, LD msg_var = OpenChannel_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -8757,6 +8209,7 @@ void handle_accept_channel_LDKChannelMessageHandler_jcall(const void* this_arg, uint64_t their_features_ref = 0; CHECK((((uint64_t)their_features_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&their_features_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(their_features_var); their_features_ref = (uint64_t)their_features_var.inner; if (their_features_var.is_owned) { their_features_ref |= 1; @@ -8766,6 +8219,7 @@ void handle_accept_channel_LDKChannelMessageHandler_jcall(const void* this_arg, msg_var = AcceptChannel_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -8797,6 +8251,7 @@ void handle_funding_created_LDKChannelMessageHandler_jcall(const void* this_arg, msg_var = FundingCreated_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -8828,6 +8283,7 @@ void handle_funding_signed_LDKChannelMessageHandler_jcall(const void* this_arg, msg_var = FundingSigned_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -8859,6 +8315,7 @@ void handle_funding_locked_LDKChannelMessageHandler_jcall(const void* this_arg, msg_var = FundingLocked_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -8890,6 +8347,7 @@ void handle_shutdown_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPub their_features_var = InitFeatures_clone(their_features); CHECK((((uint64_t)their_features_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&their_features_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(their_features_var); their_features_ref = (uint64_t)their_features_var.inner; if (their_features_var.is_owned) { their_features_ref |= 1; @@ -8899,6 +8357,7 @@ void handle_shutdown_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPub msg_var = Shutdown_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -8930,6 +8389,7 @@ void handle_closing_signed_LDKChannelMessageHandler_jcall(const void* this_arg, msg_var = ClosingSigned_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -8961,6 +8421,7 @@ void handle_update_add_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, msg_var = UpdateAddHTLC_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -8992,6 +8453,7 @@ void handle_update_fulfill_htlc_LDKChannelMessageHandler_jcall(const void* this_ msg_var = UpdateFulfillHTLC_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -9023,6 +8485,7 @@ void handle_update_fail_htlc_LDKChannelMessageHandler_jcall(const void* this_arg msg_var = UpdateFailHTLC_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -9054,6 +8517,7 @@ void handle_update_fail_malformed_htlc_LDKChannelMessageHandler_jcall(const void msg_var = UpdateFailMalformedHTLC_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -9085,6 +8549,7 @@ void handle_commitment_signed_LDKChannelMessageHandler_jcall(const void* this_ar msg_var = CommitmentSigned_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -9116,6 +8581,7 @@ void handle_revoke_and_ack_LDKChannelMessageHandler_jcall(const void* this_arg, msg_var = RevokeAndACK_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -9147,6 +8613,7 @@ void handle_update_fee_LDKChannelMessageHandler_jcall(const void* this_arg, LDKP msg_var = UpdateFee_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -9178,6 +8645,7 @@ void handle_announcement_signatures_LDKChannelMessageHandler_jcall(const void* t msg_var = AnnouncementSignatures_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -9231,6 +8699,7 @@ void peer_connected_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPubl msg_var = Init_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -9262,6 +8731,7 @@ void handle_channel_reestablish_LDKChannelMessageHandler_jcall(const void* this_ msg_var = ChannelReestablish_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -9293,6 +8763,7 @@ void handle_channel_update_LDKChannelMessageHandler_jcall(const void* this_arg, msg_var = ChannelUpdate_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -9324,6 +8795,7 @@ void handle_error_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublic msg_var = ErrorMessage_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -9441,10 +8913,12 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_ LDKInitFeatures their_features_conv; their_features_conv.inner = (void*)(their_features & (~1)); their_features_conv.is_owned = (their_features & 1) || (their_features == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(their_features_conv); their_features_conv = InitFeatures_clone(&their_features_conv); LDKOpenChannel msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->handle_open_channel)(this_arg_conv->this_arg, their_node_id_ref, their_features_conv, &msg_conv); } @@ -9458,10 +8932,12 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_ LDKInitFeatures their_features_conv; their_features_conv.inner = (void*)(their_features & (~1)); their_features_conv.is_owned = (their_features & 1) || (their_features == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(their_features_conv); their_features_conv = InitFeatures_clone(&their_features_conv); LDKAcceptChannel msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->handle_accept_channel)(this_arg_conv->this_arg, their_node_id_ref, their_features_conv, &msg_conv); } @@ -9475,6 +8951,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_ LDKFundingCreated msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->handle_funding_created)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } @@ -9488,6 +8965,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_ LDKFundingSigned msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->handle_funding_signed)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } @@ -9501,6 +8979,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_ LDKFundingLocked msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->handle_funding_locked)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } @@ -9514,9 +8993,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_ LDKInitFeatures their_features_conv; their_features_conv.inner = (void*)(their_features & (~1)); their_features_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(their_features_conv); LDKShutdown msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->handle_shutdown)(this_arg_conv->this_arg, their_node_id_ref, &their_features_conv, &msg_conv); } @@ -9530,6 +9011,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_ LDKClosingSigned msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->handle_closing_signed)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } @@ -9543,6 +9025,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_ LDKUpdateAddHTLC msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->handle_update_add_htlc)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } @@ -9556,6 +9039,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_ LDKUpdateFulfillHTLC msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->handle_update_fulfill_htlc)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } @@ -9569,6 +9053,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_ LDKUpdateFailHTLC msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->handle_update_fail_htlc)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } @@ -9582,6 +9067,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_ LDKUpdateFailMalformedHTLC msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->handle_update_fail_malformed_htlc)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } @@ -9595,6 +9081,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_ LDKCommitmentSigned msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->handle_commitment_signed)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } @@ -9608,6 +9095,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_ LDKRevokeAndACK msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->handle_revoke_and_ack)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } @@ -9621,6 +9109,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_ LDKUpdateFee msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->handle_update_fee)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } @@ -9634,6 +9123,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_ LDKAnnouncementSignatures msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->handle_announcement_signatures)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } @@ -9657,6 +9147,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1peer_1c LDKInit msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->peer_connected)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } @@ -9670,6 +9161,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_ LDKChannelReestablish msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->handle_channel_reestablish)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } @@ -9683,6 +9175,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_ LDKChannelUpdate msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->handle_channel_update)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } @@ -9696,6 +9189,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_ LDKErrorMessage msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); (this_arg_conv->handle_error)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } @@ -9746,6 +9240,7 @@ LDKCResult_boolLightningErrorZ handle_node_announcement_LDKRoutingMessageHandler msg_var = NodeAnnouncement_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -9760,7 +9255,7 @@ LDKCResult_boolLightningErrorZ handle_node_announcement_LDKRoutingMessageHandler 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)); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -9780,6 +9275,7 @@ LDKCResult_boolLightningErrorZ handle_channel_announcement_LDKRoutingMessageHand msg_var = ChannelAnnouncement_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -9794,7 +9290,7 @@ LDKCResult_boolLightningErrorZ handle_channel_announcement_LDKRoutingMessageHand 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)); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -9814,6 +9310,7 @@ LDKCResult_boolLightningErrorZ handle_channel_update_LDKRoutingMessageHandler_jc msg_var = ChannelUpdate_clone(msg); CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -9828,7 +9325,7 @@ LDKCResult_boolLightningErrorZ handle_channel_update_LDKRoutingMessageHandler_jc 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)); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -9862,7 +9359,7 @@ LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ get_next_channel 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)); + FREE((void*)ret_conv_59); ret_constr.data[h] = ret_conv_59_conv; } (*env)->ReleaseLongArrayElements(env, ret, ret_vals, 0); @@ -9901,7 +9398,7 @@ LDKCVec_NodeAnnouncementZ get_next_node_announcements_LDKRoutingMessageHandler_j LDKNodeAnnouncement ret_conv_18_conv; ret_conv_18_conv.inner = (void*)(ret_conv_18 & (~1)); ret_conv_18_conv.is_owned = (ret_conv_18 & 1) || (ret_conv_18 == 0); - ret_conv_18_conv = NodeAnnouncement_clone(&ret_conv_18_conv); + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_18_conv); ret_constr.data[s] = ret_conv_18_conv; } (*env)->ReleaseLongArrayElements(env, ret, ret_vals, 0); @@ -9926,6 +9423,7 @@ void sync_routing_table_LDKRoutingMessageHandler_jcall(const void* this_arg, LDK init_var = Init_clone(init); CHECK((((uint64_t)init_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&init_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(init_var); init_ref = (uint64_t)init_var.inner; if (init_var.is_owned) { init_ref |= 1; @@ -9956,6 +9454,7 @@ LDKCResult_NoneLightningErrorZ handle_reply_channel_range_LDKRoutingMessageHandl uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -9970,7 +9469,7 @@ LDKCResult_NoneLightningErrorZ handle_reply_channel_range_LDKRoutingMessageHandl 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)); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -9991,6 +9490,7 @@ LDKCResult_NoneLightningErrorZ handle_reply_short_channel_ids_end_LDKRoutingMess uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -10005,7 +9505,7 @@ LDKCResult_NoneLightningErrorZ handle_reply_short_channel_ids_end_LDKRoutingMess 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)); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -10026,6 +9526,7 @@ LDKCResult_NoneLightningErrorZ handle_query_channel_range_LDKRoutingMessageHandl uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -10040,7 +9541,7 @@ LDKCResult_NoneLightningErrorZ handle_query_channel_range_LDKRoutingMessageHandl 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)); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -10061,6 +9562,7 @@ LDKCResult_NoneLightningErrorZ handle_query_short_channel_ids_LDKRoutingMessageH uint64_t msg_ref = 0; CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = (uint64_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; @@ -10075,7 +9577,7 @@ LDKCResult_NoneLightningErrorZ handle_query_short_channel_ids_LDKRoutingMessageH 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)); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -10150,6 +9652,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1hand LDKNodeAnnouncement msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ"); *ret_conv = (this_arg_conv->handle_node_announcement)(this_arg_conv->this_arg, &msg_conv); return (uint64_t)ret_conv; @@ -10162,6 +9665,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1hand LDKChannelAnnouncement msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ"); *ret_conv = (this_arg_conv->handle_channel_announcement)(this_arg_conv->this_arg, &msg_conv); return (uint64_t)ret_conv; @@ -10174,6 +9678,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1hand LDKChannelUpdate msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ"); *ret_conv = (this_arg_conv->handle_channel_update)(this_arg_conv->this_arg, &msg_conv); return (uint64_t)ret_conv; @@ -10213,6 +9718,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_ uint64_t ret_conv_18_ref = 0; CHECK((((uint64_t)ret_conv_18_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_conv_18_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_18_var); ret_conv_18_ref = (uint64_t)ret_conv_18_var.inner; if (ret_conv_18_var.is_owned) { ret_conv_18_ref |= 1; @@ -10234,6 +9740,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1sync_1r LDKInit init_conv; init_conv.inner = (void*)(init & (~1)); init_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(init_conv); (this_arg_conv->sync_routing_table)(this_arg_conv->this_arg, their_node_id_ref, &init_conv); } @@ -10247,6 +9754,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1hand LDKReplyChannelRange msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = ReplyChannelRange_clone(&msg_conv); LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); *ret_conv = (this_arg_conv->handle_reply_channel_range)(this_arg_conv->this_arg, their_node_id_ref, msg_conv); @@ -10263,6 +9771,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1hand LDKReplyShortChannelIdsEnd msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = ReplyShortChannelIdsEnd_clone(&msg_conv); LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); *ret_conv = (this_arg_conv->handle_reply_short_channel_ids_end)(this_arg_conv->this_arg, their_node_id_ref, msg_conv); @@ -10279,6 +9788,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1hand LDKQueryChannelRange msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = QueryChannelRange_clone(&msg_conv); LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); *ret_conv = (this_arg_conv->handle_query_channel_range)(this_arg_conv->this_arg, their_node_id_ref, msg_conv); @@ -10295,6 +9805,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1hand LDKQueryShortChannelIds msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = QueryShortChannelIds_clone(&msg_conv); LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); *ret_conv = (this_arg_conv->handle_query_short_channel_ids)(this_arg_conv->this_arg, their_node_id_ref, msg_conv); @@ -10346,7 +9857,7 @@ LDKCResult_COption_TypeZDecodeErrorZ read_LDKCustomMessageReader_jcall(const voi 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)); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -10439,7 +9950,7 @@ LDKCResult_NoneLightningErrorZ handle_custom_message_LDKCustomMessageHandler_jca 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)); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -10473,7 +9984,7 @@ LDKCVec_C2Tuple_PublicKeyTypeZZ get_and_clear_pending_msg_LDKCustomMessageHandle 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)); + FREE((void*)ret_conv_25); ret_constr.data[z] = ret_conv_25_conv; } (*env)->ReleaseLongArrayElements(env, ret, ret_vals, 0); @@ -10773,6 +10284,7 @@ uint64_t channel_penalty_msat_LDKScore_jcall(const void* this_arg, uint64_t shor source_var = NodeId_clone(source); CHECK((((uint64_t)source_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&source_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(source_var); source_ref = (uint64_t)source_var.inner; if (source_var.is_owned) { source_ref |= 1; @@ -10782,6 +10294,7 @@ uint64_t channel_penalty_msat_LDKScore_jcall(const void* this_arg, uint64_t shor target_var = NodeId_clone(target); CHECK((((uint64_t)target_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&target_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(target_var); target_ref = (uint64_t)target_var.inner; if (target_var.is_owned) { target_ref |= 1; @@ -10816,6 +10329,7 @@ void payment_path_failed_LDKScore_jcall(void* this_arg, LDKCVec_RouteHopZ path, uint64_t path_conv_10_ref = 0; CHECK((((uint64_t)path_conv_10_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&path_conv_10_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var); path_conv_10_ref = (uint64_t)path_conv_10_var.inner; if (path_conv_10_var.is_owned) { path_conv_10_ref |= 1; @@ -10899,9 +10413,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Score_1channel_1penalty_1ms LDKNodeId source_conv; source_conv.inner = (void*)(source & (~1)); source_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(source_conv); LDKNodeId target_conv; target_conv.inner = (void*)(target & (~1)); target_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(target_conv); int64_t ret_val = (this_arg_conv->channel_penalty_msat)(this_arg_conv->this_arg, short_channel_id, &source_conv, &target_conv); return ret_val; } @@ -10922,6 +10438,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Score_1payment_1path_1failed(J LDKRouteHop path_conv_10_conv; path_conv_10_conv.inner = (void*)(path_conv_10 & (~1)); path_conv_10_conv.is_owned = (path_conv_10 & 1) || (path_conv_10 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv); path_conv_10_conv = RouteHop_clone(&path_conv_10_conv); path_constr.data[k] = path_conv_10_conv; } @@ -10977,6 +10494,7 @@ LDKCResult_NoneErrorZ persist_manager_LDKChannelManagerPersister_jcall(const voi // Warning: we may need a move here but no clone is available for LDKChannelManager CHECK((((uint64_t)channel_manager_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&channel_manager_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_manager_var); channel_manager_ref = (uint64_t)channel_manager_var.inner; if (channel_manager_var.is_owned) { channel_manager_ref |= 1; @@ -10991,7 +10509,7 @@ LDKCResult_NoneErrorZ persist_manager_LDKChannelManagerPersister_jcall(const voi 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)); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -11030,6 +10548,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerPersister_1pe LDKChannelManager channel_manager_conv; channel_manager_conv.inner = (void*)(channel_manager & (~1)); channel_manager_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_manager_conv); LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ"); *ret_conv = (this_arg_conv->persist_manager)(this_arg_conv->this_arg, &channel_manager_conv); return (uint64_t)ret_conv; @@ -11159,7 +10678,7 @@ LDKCVec_ChannelDetailsZ first_hops_LDKPayer_jcall(const void* this_arg) { LDKChannelDetails ret_conv_16_conv; ret_conv_16_conv.inner = (void*)(ret_conv_16 & (~1)); ret_conv_16_conv.is_owned = (ret_conv_16 & 1) || (ret_conv_16 == 0); - ret_conv_16_conv = ChannelDetails_clone(&ret_conv_16_conv); + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_conv); ret_constr.data[q] = ret_conv_16_conv; } (*env)->ReleaseLongArrayElements(env, ret, ret_vals, 0); @@ -11182,6 +10701,7 @@ LDKCResult_PaymentIdPaymentSendFailureZ send_payment_LDKPayer_jcall(const void* route_var = Route_clone(route); CHECK((((uint64_t)route_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&route_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_var); route_ref = (uint64_t)route_var.inner; if (route_var.is_owned) { route_ref |= 1; @@ -11200,7 +10720,7 @@ LDKCResult_PaymentIdPaymentSendFailureZ send_payment_LDKPayer_jcall(const void* void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_PaymentIdPaymentSendFailureZ ret_conv = *(LDKCResult_PaymentIdPaymentSendFailureZ*)(ret_ptr); - ret_conv = CResult_PaymentIdPaymentSendFailureZ_clone((LDKCResult_PaymentIdPaymentSendFailureZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -11220,6 +10740,7 @@ LDKCResult_NonePaymentSendFailureZ retry_payment_LDKPayer_jcall(const void* this route_var = Route_clone(route); CHECK((((uint64_t)route_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&route_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_var); route_ref = (uint64_t)route_var.inner; if (route_var.is_owned) { route_ref |= 1; @@ -11236,7 +10757,7 @@ LDKCResult_NonePaymentSendFailureZ retry_payment_LDKPayer_jcall(const void* this void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_NonePaymentSendFailureZ ret_conv = *(LDKCResult_NonePaymentSendFailureZ*)(ret_ptr); - ret_conv = CResult_NonePaymentSendFailureZ_clone((LDKCResult_NonePaymentSendFailureZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -11299,6 +10820,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Payer_1first_1hops(JNI uint64_t ret_conv_16_ref = 0; CHECK((((uint64_t)ret_conv_16_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_conv_16_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var); ret_conv_16_ref = (uint64_t)ret_conv_16_var.inner; if (ret_conv_16_var.is_owned) { ret_conv_16_ref |= 1; @@ -11317,6 +10839,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payer_1send_1payment(JNIEnv LDKRoute route_conv; route_conv.inner = (void*)(route & (~1)); route_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv); LDKThirtyTwoBytes payment_hash_ref; CHECK((*env)->GetArrayLength(env, payment_hash) == 32); (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); @@ -11335,6 +10858,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payer_1retry_1payment(JNIEn LDKRoute route_conv; route_conv.inner = (void*)(route & (~1)); route_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv); LDKThirtyTwoBytes payment_id_ref; CHECK((*env)->GetArrayLength(env, payment_id) == 32); (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data); @@ -11382,6 +10906,7 @@ LDKCResult_RouteLightningErrorZ find_route_LDKRouter_jcall(const void* this_arg, params_var = RouteParameters_clone(params); CHECK((((uint64_t)params_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)¶ms_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(params_var); params_ref = (uint64_t)params_var.inner; if (params_var.is_owned) { params_ref |= 1; @@ -11397,6 +10922,7 @@ LDKCResult_RouteLightningErrorZ find_route_LDKRouter_jcall(const void* this_arg, uint64_t first_hops_conv_16_ref = 0; CHECK((((uint64_t)first_hops_conv_16_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&first_hops_conv_16_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(first_hops_conv_16_var); first_hops_conv_16_ref = (uint64_t)first_hops_conv_16_var.inner; if (first_hops_conv_16_var.is_owned) { first_hops_conv_16_ref |= 1; @@ -11417,7 +10943,7 @@ LDKCResult_RouteLightningErrorZ find_route_LDKRouter_jcall(const void* this_arg, void* ret_ptr = (void*)(((uint64_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_RouteLightningErrorZ ret_conv = *(LDKCResult_RouteLightningErrorZ*)(ret_ptr); - ret_conv = CResult_RouteLightningErrorZ_clone((LDKCResult_RouteLightningErrorZ*)(((uint64_t)ret) & ~1)); + FREE((void*)ret); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -11459,6 +10985,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Router_1find_1route(JNIEnv LDKRouteParameters params_conv; params_conv.inner = (void*)(params & (~1)); params_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(params_conv); LDKCVec_ChannelDetailsZ first_hops_constr; LDKCVec_ChannelDetailsZ *first_hops_ptr = NULL; if (first_hops != NULL) { @@ -11473,6 +11000,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Router_1find_1route(JNIEnv LDKChannelDetails first_hops_conv_16_conv; first_hops_conv_16_conv.inner = (void*)(first_hops_conv_16 & (~1)); first_hops_conv_16_conv.is_owned = (first_hops_conv_16 & 1) || (first_hops_conv_16 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(first_hops_conv_16_conv); first_hops_constr.data[q] = first_hops_conv_16_conv; } (*env)->ReleaseLongArrayElements(env, first_hops, first_hops_vals, 0); @@ -11529,6 +11057,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxOut_1free(JNIEnv *env, jclas TxOut_free(_res_conv); } +static inline uint64_t TxOut_clone_ptr(LDKTxOut *NONNULL_PTR arg) { + LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); + *ret_ref = TxOut_clone(arg); + return (uint64_t)ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxOut_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKTxOut* arg_conv = (LDKTxOut*)(arg & ~1); + int64_t ret_val = TxOut_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxOut_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKTxOut* orig_conv = (LDKTxOut*)(orig & ~1); LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); @@ -11557,6 +11096,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyErrorZ_1e return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_SecretKeyErrorZ* o_conv = (LDKCResult_SecretKeyErrorZ*)(o & ~1); + jboolean ret_val = CResult_SecretKeyErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -11582,6 +11127,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1e return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_PublicKeyErrorZ* o_conv = (LDKCResult_PublicKeyErrorZ*)(o & ~1); + jboolean ret_val = CResult_PublicKeyErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -11591,6 +11142,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1free CResult_PublicKeyErrorZ_free(_res_conv); } +static inline uint64_t CResult_PublicKeyErrorZ_clone_ptr(LDKCResult_PublicKeyErrorZ *NONNULL_PTR arg) { + LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ"); + *ret_conv = CResult_PublicKeyErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_PublicKeyErrorZ* arg_conv = (LDKCResult_PublicKeyErrorZ*)(arg & ~1); + int64_t ret_val = CResult_PublicKeyErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_PublicKeyErrorZ* orig_conv = (LDKCResult_PublicKeyErrorZ*)(orig & ~1); LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ"); @@ -11602,6 +11164,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysDeco LDKTxCreationKeys o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = TxCreationKeys_clone(&o_conv); LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ"); *ret_conv = CResult_TxCreationKeysDecodeErrorZ_ok(o_conv); @@ -11612,12 +11175,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysDeco LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ"); *ret_conv = CResult_TxCreationKeysDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_TxCreationKeysDecodeErrorZ* o_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_TxCreationKeysDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -11627,6 +11197,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysDecodeE CResult_TxCreationKeysDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_TxCreationKeysDecodeErrorZ_clone_ptr(LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ"); + *ret_conv = CResult_TxCreationKeysDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_TxCreationKeysDecodeErrorZ* arg_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_TxCreationKeysDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_TxCreationKeysDecodeErrorZ* orig_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)(orig & ~1); LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ"); @@ -11638,6 +11219,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelPublicKeysD LDKChannelPublicKeys o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = ChannelPublicKeys_clone(&o_conv); LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ"); *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_ok(o_conv); @@ -11648,12 +11230,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelPublicKeysD LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ"); *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelPublicKeysDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_ChannelPublicKeysDecodeErrorZ* o_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_ChannelPublicKeysDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelPublicKeysDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -11663,6 +11252,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelPublicKeysDeco CResult_ChannelPublicKeysDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr(LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ"); + *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelPublicKeysDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_ChannelPublicKeysDecodeErrorZ* arg_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelPublicKeysDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_ChannelPublicKeysDecodeErrorZ* orig_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)(orig & ~1); LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ"); @@ -11674,6 +11274,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysErro LDKTxCreationKeys o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = TxCreationKeys_clone(&o_conv); LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ"); *ret_conv = CResult_TxCreationKeysErrorZ_ok(o_conv); @@ -11687,6 +11288,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysErro return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_TxCreationKeysErrorZ* o_conv = (LDKCResult_TxCreationKeysErrorZ*)(o & ~1); + jboolean ret_val = CResult_TxCreationKeysErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -11696,6 +11303,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysErrorZ_ CResult_TxCreationKeysErrorZ_free(_res_conv); } +static inline uint64_t CResult_TxCreationKeysErrorZ_clone_ptr(LDKCResult_TxCreationKeysErrorZ *NONNULL_PTR arg) { + LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ"); + *ret_conv = CResult_TxCreationKeysErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_TxCreationKeysErrorZ* arg_conv = (LDKCResult_TxCreationKeysErrorZ*)(arg & ~1); + int64_t ret_val = CResult_TxCreationKeysErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_TxCreationKeysErrorZ* orig_conv = (LDKCResult_TxCreationKeysErrorZ*)(orig & ~1); LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ"); @@ -11726,6 +11344,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1u32Z_1free(JNIEnv *en COption_u32Z_free(_res_conv); } +static inline uint64_t COption_u32Z_clone_ptr(LDKCOption_u32Z *NONNULL_PTR arg) { + LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); + *ret_copy = COption_u32Z_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u32Z_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCOption_u32Z* arg_conv = (LDKCOption_u32Z*)arg; + int64_t ret_val = COption_u32Z_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u32Z_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCOption_u32Z* orig_conv = (LDKCOption_u32Z*)orig; LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); @@ -11738,6 +11368,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCOutputInCommit LDKHTLCOutputInCommitment o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = HTLCOutputInCommitment_clone(&o_conv); LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ"); *ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(o_conv); @@ -11748,12 +11379,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCOutputInCommit LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ"); *ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCOutputInCommitmentDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* o_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCOutputInCommitmentDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -11763,6 +11401,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCOutputInCommitmen CResult_HTLCOutputInCommitmentDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ"); + *ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCOutputInCommitmentDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* arg_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCOutputInCommitmentDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* orig_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)(orig & ~1); LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ"); @@ -11774,6 +11423,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyChanne LDKCounterpartyChannelTransactionParameters o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = CounterpartyChannelTransactionParameters_clone(&o_conv); LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ"); *ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(o_conv); @@ -11784,12 +11434,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyChanne LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ"); *ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyChannelTransactionParametersDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* o_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyChannelTransactionParametersDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -11799,6 +11456,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyChannelTr CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ"); + *ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyChannelTransactionParametersDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* arg_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyChannelTransactionParametersDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* orig_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)(orig & ~1); LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ"); @@ -11810,6 +11478,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTransaction LDKChannelTransactionParameters o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = ChannelTransactionParameters_clone(&o_conv); LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ"); *ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_ok(o_conv); @@ -11820,12 +11489,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTransaction LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ"); *ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTransactionParametersDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_ChannelTransactionParametersDecodeErrorZ* o_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_ChannelTransactionParametersDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTransactionParametersDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -11835,6 +11511,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTransactionPar CResult_ChannelTransactionParametersDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr(LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ"); + *ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTransactionParametersDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_ChannelTransactionParametersDecodeErrorZ* arg_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTransactionParametersDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_ChannelTransactionParametersDecodeErrorZ* orig_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)(orig & ~1); LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ"); @@ -11863,6 +11550,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HolderCommitmentTr LDKHolderCommitmentTransaction o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = HolderCommitmentTransaction_clone(&o_conv); LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ"); *ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_ok(o_conv); @@ -11873,12 +11561,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HolderCommitmentTr LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ"); *ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1HolderCommitmentTransactionDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_HolderCommitmentTransactionDecodeErrorZ* o_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1HolderCommitmentTransactionDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -11888,6 +11583,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1HolderCommitmentTrans CResult_HolderCommitmentTransactionDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr(LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ"); + *ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HolderCommitmentTransactionDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_HolderCommitmentTransactionDecodeErrorZ* arg_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HolderCommitmentTransactionDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_HolderCommitmentTransactionDecodeErrorZ* orig_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)(orig & ~1); LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ"); @@ -11899,6 +11605,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BuiltCommitmentTra LDKBuiltCommitmentTransaction o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = BuiltCommitmentTransaction_clone(&o_conv); LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ"); *ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(o_conv); @@ -11909,12 +11616,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BuiltCommitmentTra LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ"); *ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1BuiltCommitmentTransactionDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* o_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BuiltCommitmentTransactionDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -11924,6 +11638,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BuiltCommitmentTransa CResult_BuiltCommitmentTransactionDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ"); + *ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BuiltCommitmentTransactionDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* arg_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BuiltCommitmentTransactionDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* orig_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)(orig & ~1); LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ"); @@ -11935,6 +11660,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedClosingTran LDKTrustedClosingTransaction o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); // Warning: we need a move here but no clone is available for LDKTrustedClosingTransaction LDKCResult_TrustedClosingTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedClosingTransactionNoneZ), "LDKCResult_TrustedClosingTransactionNoneZ"); *ret_conv = CResult_TrustedClosingTransactionNoneZ_ok(o_conv); @@ -11947,6 +11673,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedClosingTran return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedClosingTransactionNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_TrustedClosingTransactionNoneZ* o_conv = (LDKCResult_TrustedClosingTransactionNoneZ*)(o & ~1); + jboolean ret_val = CResult_TrustedClosingTransactionNoneZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedClosingTransactionNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -11960,6 +11692,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentTransact LDKCommitmentTransaction o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = CommitmentTransaction_clone(&o_conv); LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ"); *ret_conv = CResult_CommitmentTransactionDecodeErrorZ_ok(o_conv); @@ -11970,12 +11703,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentTransact LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ"); *ret_conv = CResult_CommitmentTransactionDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentTransactionDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_CommitmentTransactionDecodeErrorZ* o_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_CommitmentTransactionDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentTransactionDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -11985,6 +11725,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentTransaction CResult_CommitmentTransactionDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_CommitmentTransactionDecodeErrorZ_clone_ptr(LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ"); + *ret_conv = CResult_CommitmentTransactionDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentTransactionDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_CommitmentTransactionDecodeErrorZ* arg_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_CommitmentTransactionDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentTransactionDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_CommitmentTransactionDecodeErrorZ* orig_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)(orig & ~1); LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ"); @@ -11996,6 +11747,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedCommitmentT LDKTrustedCommitmentTransaction o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); // Warning: we need a move here but no clone is available for LDKTrustedCommitmentTransaction LDKCResult_TrustedCommitmentTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedCommitmentTransactionNoneZ), "LDKCResult_TrustedCommitmentTransactionNoneZ"); *ret_conv = CResult_TrustedCommitmentTransactionNoneZ_ok(o_conv); @@ -12008,6 +11760,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedCommitmentT return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedCommitmentTransactionNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_TrustedCommitmentTransactionNoneZ* o_conv = (LDKCResult_TrustedCommitmentTransactionNoneZ*)(o & ~1); + jboolean ret_val = CResult_TrustedCommitmentTransactionNoneZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedCommitmentTransactionNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12042,6 +11800,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNo return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_CVec_SignatureZNoneZ* o_conv = (LDKCResult_CVec_SignatureZNoneZ*)(o & ~1); + jboolean ret_val = CResult_CVec_SignatureZNoneZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12051,6 +11815,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ CResult_CVec_SignatureZNoneZ_free(_res_conv); } +static inline uint64_t CResult_CVec_SignatureZNoneZ_clone_ptr(LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR arg) { + LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ"); + *ret_conv = CResult_CVec_SignatureZNoneZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_CVec_SignatureZNoneZ* arg_conv = (LDKCResult_CVec_SignatureZNoneZ*)(arg & ~1); + int64_t ret_val = CResult_CVec_SignatureZNoneZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_CVec_SignatureZNoneZ* orig_conv = (LDKCResult_CVec_SignatureZNoneZ*)(orig & ~1); LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ"); @@ -12062,6 +11837,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptDeco LDKShutdownScript o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = ShutdownScript_clone(&o_conv); LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ"); *ret_conv = CResult_ShutdownScriptDecodeErrorZ_ok(o_conv); @@ -12072,12 +11848,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptDeco LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ"); *ret_conv = CResult_ShutdownScriptDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_ShutdownScriptDecodeErrorZ* o_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_ShutdownScriptDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12087,6 +11870,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptDecodeE CResult_ShutdownScriptDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_ShutdownScriptDecodeErrorZ_clone_ptr(LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ"); + *ret_conv = CResult_ShutdownScriptDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_ShutdownScriptDecodeErrorZ* arg_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_ShutdownScriptDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_ShutdownScriptDecodeErrorZ* orig_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)(orig & ~1); LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ"); @@ -12098,6 +11892,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptInva LDKShutdownScript o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = ShutdownScript_clone(&o_conv); LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ"); *ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_ok(o_conv); @@ -12108,12 +11903,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptInva LDKInvalidShutdownScript e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); 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 jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptInvalidShutdownScriptZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_ShutdownScriptInvalidShutdownScriptZ* o_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)(o & ~1); + jboolean ret_val = CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptInvalidShutdownScriptZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12123,6 +11925,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptInvalid CResult_ShutdownScriptInvalidShutdownScriptZ_free(_res_conv); } +static inline uint64_t CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr(LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR arg) { + LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ"); + *ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptInvalidShutdownScriptZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_ShutdownScriptInvalidShutdownScriptZ* arg_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)(arg & ~1); + int64_t ret_val = CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr(arg_conv); + return ret_val; +} + 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"); @@ -12143,6 +11956,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneErrorZ_1err(JN return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_NoneErrorZ* o_conv = (LDKCResult_NoneErrorZ*)(o & ~1); + jboolean ret_val = CResult_NoneErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12152,6 +11971,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneErrorZ_1free(JNIE CResult_NoneErrorZ_free(_res_conv); } +static inline uint64_t CResult_NoneErrorZ_clone_ptr(LDKCResult_NoneErrorZ *NONNULL_PTR arg) { + LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ"); + *ret_conv = CResult_NoneErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_NoneErrorZ* arg_conv = (LDKCResult_NoneErrorZ*)(arg & ~1); + int64_t ret_val = CResult_NoneErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_NoneErrorZ* orig_conv = (LDKCResult_NoneErrorZ*)(orig & ~1); LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ"); @@ -12163,6 +11993,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErro LDKRouteHop o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = RouteHop_clone(&o_conv); LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ"); *ret_conv = CResult_RouteHopDecodeErrorZ_ok(o_conv); @@ -12173,12 +12004,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErro LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ"); *ret_conv = CResult_RouteHopDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_RouteHopDecodeErrorZ* o_conv = (LDKCResult_RouteHopDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_RouteHopDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12188,6 +12026,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErrorZ_ CResult_RouteHopDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_RouteHopDecodeErrorZ_clone_ptr(LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ"); + *ret_conv = CResult_RouteHopDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_RouteHopDecodeErrorZ* arg_conv = (LDKCResult_RouteHopDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_RouteHopDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_RouteHopDecodeErrorZ* orig_conv = (LDKCResult_RouteHopDecodeErrorZ*)(orig & ~1); LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ"); @@ -12208,6 +12057,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1RouteHopZ_1free(JNIEnv * LDKRouteHop _res_conv_10_conv; _res_conv_10_conv.inner = (void*)(_res_conv_10 & (~1)); _res_conv_10_conv.is_owned = (_res_conv_10 & 1) || (_res_conv_10 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_10_conv); _res_constr.data[k] = _res_conv_10_conv; } (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); @@ -12235,6 +12085,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1CVec_1RouteHopZZ_1free(J LDKRouteHop _res_conv_12_conv_10_conv; _res_conv_12_conv_10_conv.inner = (void*)(_res_conv_12_conv_10 & (~1)); _res_conv_12_conv_10_conv.is_owned = (_res_conv_12_conv_10 & 1) || (_res_conv_12_conv_10 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_12_conv_10_conv); _res_conv_12_constr.data[k] = _res_conv_12_conv_10_conv; } (*env)->ReleaseLongArrayElements(env, _res_conv_12, _res_conv_12_vals, 0); @@ -12247,6 +12098,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_ LDKRoute o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = Route_clone(&o_conv); LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ"); *ret_conv = CResult_RouteDecodeErrorZ_ok(o_conv); @@ -12257,12 +12109,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_ LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ"); *ret_conv = CResult_RouteDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_RouteDecodeErrorZ* o_conv = (LDKCResult_RouteDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_RouteDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12272,6 +12131,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_1fr CResult_RouteDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_RouteDecodeErrorZ_clone_ptr(LDKCResult_RouteDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ"); + *ret_conv = CResult_RouteDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_RouteDecodeErrorZ* arg_conv = (LDKCResult_RouteDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_RouteDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_RouteDecodeErrorZ* orig_conv = (LDKCResult_RouteDecodeErrorZ*)(orig & ~1); LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ"); @@ -12283,6 +12153,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDec LDKRouteParameters o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = RouteParameters_clone(&o_conv); LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ"); *ret_conv = CResult_RouteParametersDecodeErrorZ_ok(o_conv); @@ -12293,12 +12164,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDec LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ"); *ret_conv = CResult_RouteParametersDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_RouteParametersDecodeErrorZ* o_conv = (LDKCResult_RouteParametersDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_RouteParametersDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12308,6 +12186,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecode CResult_RouteParametersDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_RouteParametersDecodeErrorZ_clone_ptr(LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ"); + *ret_conv = CResult_RouteParametersDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_RouteParametersDecodeErrorZ* arg_conv = (LDKCResult_RouteParametersDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_RouteParametersDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_RouteParametersDecodeErrorZ* orig_conv = (LDKCResult_RouteParametersDecodeErrorZ*)(orig & ~1); LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ"); @@ -12328,6 +12217,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1RouteHintZ_1free(JNIEnv LDKRouteHint _res_conv_11_conv; _res_conv_11_conv.inner = (void*)(_res_conv_11 & (~1)); _res_conv_11_conv.is_owned = (_res_conv_11 & 1) || (_res_conv_11 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_11_conv); _res_constr.data[l] = _res_conv_11_conv; } (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); @@ -12357,6 +12247,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1u64Z_1free(JNIEnv *en COption_u64Z_free(_res_conv); } +static inline uint64_t COption_u64Z_clone_ptr(LDKCOption_u64Z *NONNULL_PTR arg) { + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = COption_u64Z_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u64Z_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCOption_u64Z* arg_conv = (LDKCOption_u64Z*)arg; + int64_t ret_val = COption_u64Z_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u64Z_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCOption_u64Z* orig_conv = (LDKCOption_u64Z*)orig; LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); @@ -12369,6 +12271,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PayeeDecodeErrorZ_ LDKPayee o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = Payee_clone(&o_conv); LDKCResult_PayeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeeDecodeErrorZ), "LDKCResult_PayeeDecodeErrorZ"); *ret_conv = CResult_PayeeDecodeErrorZ_ok(o_conv); @@ -12379,12 +12282,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PayeeDecodeErrorZ_ LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_PayeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeeDecodeErrorZ), "LDKCResult_PayeeDecodeErrorZ"); *ret_conv = CResult_PayeeDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PayeeDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_PayeeDecodeErrorZ* o_conv = (LDKCResult_PayeeDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_PayeeDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PayeeDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12394,6 +12304,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PayeeDecodeErrorZ_1fr CResult_PayeeDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_PayeeDecodeErrorZ_clone_ptr(LDKCResult_PayeeDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_PayeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeeDecodeErrorZ), "LDKCResult_PayeeDecodeErrorZ"); + *ret_conv = CResult_PayeeDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PayeeDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_PayeeDecodeErrorZ* arg_conv = (LDKCResult_PayeeDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_PayeeDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PayeeDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_PayeeDecodeErrorZ* orig_conv = (LDKCResult_PayeeDecodeErrorZ*)(orig & ~1); LDKCResult_PayeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeeDecodeErrorZ), "LDKCResult_PayeeDecodeErrorZ"); @@ -12414,6 +12335,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1RouteHintHopZ_1free(JNIE LDKRouteHintHop _res_conv_14_conv; _res_conv_14_conv.inner = (void*)(_res_conv_14 & (~1)); _res_conv_14_conv.is_owned = (_res_conv_14 & 1) || (_res_conv_14 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_14_conv); _res_constr.data[o] = _res_conv_14_conv; } (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); @@ -12424,6 +12346,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErr LDKRouteHint o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = RouteHint_clone(&o_conv); LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ"); *ret_conv = CResult_RouteHintDecodeErrorZ_ok(o_conv); @@ -12434,12 +12357,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErr LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ"); *ret_conv = CResult_RouteHintDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_RouteHintDecodeErrorZ* o_conv = (LDKCResult_RouteHintDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_RouteHintDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12449,6 +12379,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_RouteHintDecodeErrorZ_clone_ptr(LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ"); + *ret_conv = CResult_RouteHintDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_RouteHintDecodeErrorZ* arg_conv = (LDKCResult_RouteHintDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_RouteHintDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_RouteHintDecodeErrorZ* orig_conv = (LDKCResult_RouteHintDecodeErrorZ*)(orig & ~1); LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ"); @@ -12460,6 +12401,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecode LDKRouteHintHop o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = RouteHintHop_clone(&o_conv); LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ"); *ret_conv = CResult_RouteHintHopDecodeErrorZ_ok(o_conv); @@ -12470,12 +12412,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecode LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ"); *ret_conv = CResult_RouteHintHopDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_RouteHintHopDecodeErrorZ* o_conv = (LDKCResult_RouteHintHopDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_RouteHintHopDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12485,6 +12434,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecodeErr CResult_RouteHintHopDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_RouteHintHopDecodeErrorZ_clone_ptr(LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ"); + *ret_conv = CResult_RouteHintHopDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_RouteHintHopDecodeErrorZ* arg_conv = (LDKCResult_RouteHintHopDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_RouteHintHopDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_RouteHintHopDecodeErrorZ* orig_conv = (LDKCResult_RouteHintHopDecodeErrorZ*)(orig & ~1); LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ"); @@ -12505,6 +12465,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1ChannelDetailsZ_1free(JN LDKChannelDetails _res_conv_16_conv; _res_conv_16_conv.inner = (void*)(_res_conv_16 & (~1)); _res_conv_16_conv.is_owned = (_res_conv_16 & 1) || (_res_conv_16 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_16_conv); _res_constr.data[q] = _res_conv_16_conv; } (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); @@ -12515,6 +12476,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErro LDKRoute o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = Route_clone(&o_conv); LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ"); *ret_conv = CResult_RouteLightningErrorZ_ok(o_conv); @@ -12525,12 +12487,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErro LDKLightningError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = LightningError_clone(&e_conv); LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ"); *ret_conv = CResult_RouteLightningErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_RouteLightningErrorZ* o_conv = (LDKCResult_RouteLightningErrorZ*)(o & ~1); + jboolean ret_val = CResult_RouteLightningErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12540,6 +12509,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_ CResult_RouteLightningErrorZ_free(_res_conv); } +static inline uint64_t CResult_RouteLightningErrorZ_clone_ptr(LDKCResult_RouteLightningErrorZ *NONNULL_PTR arg) { + LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ"); + *ret_conv = CResult_RouteLightningErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_RouteLightningErrorZ* arg_conv = (LDKCResult_RouteLightningErrorZ*)(arg & ~1); + int64_t ret_val = CResult_RouteLightningErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_RouteLightningErrorZ* orig_conv = (LDKCResult_RouteLightningErrorZ*)(orig & ~1); LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ"); @@ -12564,6 +12544,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_ return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_TxOutAccessErrorZ* o_conv = (LDKCResult_TxOutAccessErrorZ*)(o & ~1); + jboolean ret_val = CResult_TxOutAccessErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12573,6 +12559,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1fr CResult_TxOutAccessErrorZ_free(_res_conv); } +static inline uint64_t CResult_TxOutAccessErrorZ_clone_ptr(LDKCResult_TxOutAccessErrorZ *NONNULL_PTR arg) { + LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ"); + *ret_conv = CResult_TxOutAccessErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_TxOutAccessErrorZ* arg_conv = (LDKCResult_TxOutAccessErrorZ*)(arg & ~1); + int64_t ret_val = CResult_TxOutAccessErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_TxOutAccessErrorZ* orig_conv = (LDKCResult_TxOutAccessErrorZ*)(orig & ~1); LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ"); @@ -12580,6 +12577,17 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_ return (uint64_t)ret_conv; } +static inline uint64_t C2Tuple_usizeTransactionZ_clone_ptr(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR arg) { + LDKC2Tuple_usizeTransactionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ"); + *ret_conv = C2Tuple_usizeTransactionZ_clone(arg); + return ((uint64_t)ret_conv); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_usizeTransactionZ* arg_conv = (LDKC2Tuple_usizeTransactionZ*)(arg & ~1); + int64_t ret_val = C2Tuple_usizeTransactionZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKC2Tuple_usizeTransactionZ* orig_conv = (LDKC2Tuple_usizeTransactionZ*)(orig & ~1); LDKC2Tuple_usizeTransactionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ"); @@ -12657,6 +12665,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitor return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_NoneChannelMonitorUpdateErrZ* o_conv = (LDKCResult_NoneChannelMonitorUpdateErrZ*)(o & ~1); + jboolean ret_val = CResult_NoneChannelMonitorUpdateErrZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12666,6 +12680,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpd CResult_NoneChannelMonitorUpdateErrZ_free(_res_conv); } +static inline uint64_t CResult_NoneChannelMonitorUpdateErrZ_clone_ptr(LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR arg) { + LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ"); + *ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_NoneChannelMonitorUpdateErrZ* arg_conv = (LDKCResult_NoneChannelMonitorUpdateErrZ*)(arg & ~1); + int64_t ret_val = CResult_NoneChannelMonitorUpdateErrZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_NoneChannelMonitorUpdateErrZ* orig_conv = (LDKCResult_NoneChannelMonitorUpdateErrZ*)(orig & ~1); LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ"); @@ -12720,6 +12745,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1usizeTransac COption_C2Tuple_usizeTransactionZZ_free(_res_conv); } +static inline uint64_t COption_C2Tuple_usizeTransactionZZ_clone_ptr(LDKCOption_C2Tuple_usizeTransactionZZ *NONNULL_PTR arg) { + LDKCOption_C2Tuple_usizeTransactionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_usizeTransactionZZ), "LDKCOption_C2Tuple_usizeTransactionZZ"); + *ret_copy = COption_C2Tuple_usizeTransactionZZ_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1usizeTransactionZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCOption_C2Tuple_usizeTransactionZZ* arg_conv = (LDKCOption_C2Tuple_usizeTransactionZZ*)arg; + int64_t ret_val = COption_C2Tuple_usizeTransactionZZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1usizeTransactionZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCOption_C2Tuple_usizeTransactionZZ* orig_conv = (LDKCOption_C2Tuple_usizeTransactionZZ*)orig; LDKCOption_C2Tuple_usizeTransactionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_usizeTransactionZZ), "LDKCOption_C2Tuple_usizeTransactionZZ"); @@ -12728,6 +12765,107 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1usizeTran return ret_ref; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1ClosureReasonZ_1some(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = (void*)(((uint64_t)o) & ~1); + CHECK_ACCESS(o_ptr); + LDKClosureReason o_conv = *(LDKClosureReason*)(o_ptr); + o_conv = ClosureReason_clone((LDKClosureReason*)(((uint64_t)o) & ~1)); + LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ"); + *ret_copy = COption_ClosureReasonZ_some(o_conv); + uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1ClosureReasonZ_1none(JNIEnv *env, jclass clz) { + LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ"); + *ret_copy = COption_ClosureReasonZ_none(); + uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1ClosureReasonZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if ((_res & 1) != 0) return; + void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + CHECK_ACCESS(_res_ptr); + LDKCOption_ClosureReasonZ _res_conv = *(LDKCOption_ClosureReasonZ*)(_res_ptr); + FREE((void*)_res); + COption_ClosureReasonZ_free(_res_conv); +} + +static inline uint64_t COption_ClosureReasonZ_clone_ptr(LDKCOption_ClosureReasonZ *NONNULL_PTR arg) { + LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ"); + *ret_copy = COption_ClosureReasonZ_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1ClosureReasonZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCOption_ClosureReasonZ* arg_conv = (LDKCOption_ClosureReasonZ*)arg; + int64_t ret_val = COption_ClosureReasonZ_clone_ptr(arg_conv); + return ret_val; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1ClosureReasonZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCOption_ClosureReasonZ* orig_conv = (LDKCOption_ClosureReasonZ*)orig; + LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ"); + *ret_copy = COption_ClosureReasonZ_clone(orig_conv); + uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1ClosureReasonZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = (void*)(((uint64_t)o) & ~1); + CHECK_ACCESS(o_ptr); + LDKCOption_ClosureReasonZ o_conv = *(LDKCOption_ClosureReasonZ*)(o_ptr); + o_conv = COption_ClosureReasonZ_clone((LDKCOption_ClosureReasonZ*)(((uint64_t)o) & ~1)); + LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ"); + *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_ok(o_conv); + return (uint64_t)ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1ClosureReasonZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + LDKDecodeError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); + e_conv = DecodeError_clone(&e_conv); + LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ"); + *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_err(e_conv); + return (uint64_t)ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1ClosureReasonZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_COption_ClosureReasonZDecodeErrorZ* o_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_COption_ClosureReasonZDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1ClosureReasonZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if ((_res & 1) != 0) return; + void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + CHECK_ACCESS(_res_ptr); + LDKCResult_COption_ClosureReasonZDecodeErrorZ _res_conv = *(LDKCResult_COption_ClosureReasonZDecodeErrorZ*)(_res_ptr); + FREE((void*)_res); + CResult_COption_ClosureReasonZDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr(LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ"); + *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1ClosureReasonZDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_COption_ClosureReasonZDecodeErrorZ* arg_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1ClosureReasonZDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_COption_ClosureReasonZDecodeErrorZ* orig_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)(orig & ~1); + LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ"); + *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_clone(orig_conv); + return (uint64_t)ret_conv; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1NetworkUpdateZ_1some(JNIEnv *env, jclass clz, int64_t o) { void* o_ptr = (void*)(((uint64_t)o) & ~1); CHECK_ACCESS(o_ptr); @@ -12755,6 +12893,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1NetworkUpdateZ_1free( COption_NetworkUpdateZ_free(_res_conv); } +static inline uint64_t COption_NetworkUpdateZ_clone_ptr(LDKCOption_NetworkUpdateZ *NONNULL_PTR arg) { + LDKCOption_NetworkUpdateZ *ret_copy = MALLOC(sizeof(LDKCOption_NetworkUpdateZ), "LDKCOption_NetworkUpdateZ"); + *ret_copy = COption_NetworkUpdateZ_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1NetworkUpdateZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCOption_NetworkUpdateZ* arg_conv = (LDKCOption_NetworkUpdateZ*)arg; + int64_t ret_val = COption_NetworkUpdateZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1NetworkUpdateZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCOption_NetworkUpdateZ* orig_conv = (LDKCOption_NetworkUpdateZ*)orig; LDKCOption_NetworkUpdateZ *ret_copy = MALLOC(sizeof(LDKCOption_NetworkUpdateZ), "LDKCOption_NetworkUpdateZ"); @@ -12783,6 +12933,107 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1SpendableOutputDescripto CVec_SpendableOutputDescriptorZ_free(_res_constr); } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1EventZ_1some(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = (void*)(((uint64_t)o) & ~1); + CHECK_ACCESS(o_ptr); + LDKEvent o_conv = *(LDKEvent*)(o_ptr); + o_conv = Event_clone((LDKEvent*)(((uint64_t)o) & ~1)); + LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ"); + *ret_copy = COption_EventZ_some(o_conv); + uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1EventZ_1none(JNIEnv *env, jclass clz) { + LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ"); + *ret_copy = COption_EventZ_none(); + uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1EventZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if ((_res & 1) != 0) return; + void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + CHECK_ACCESS(_res_ptr); + LDKCOption_EventZ _res_conv = *(LDKCOption_EventZ*)(_res_ptr); + FREE((void*)_res); + COption_EventZ_free(_res_conv); +} + +static inline uint64_t COption_EventZ_clone_ptr(LDKCOption_EventZ *NONNULL_PTR arg) { + LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ"); + *ret_copy = COption_EventZ_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1EventZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCOption_EventZ* arg_conv = (LDKCOption_EventZ*)arg; + int64_t ret_val = COption_EventZ_clone_ptr(arg_conv); + return ret_val; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1EventZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCOption_EventZ* orig_conv = (LDKCOption_EventZ*)orig; + LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ"); + *ret_copy = COption_EventZ_clone(orig_conv); + uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = (void*)(((uint64_t)o) & ~1); + CHECK_ACCESS(o_ptr); + LDKCOption_EventZ o_conv = *(LDKCOption_EventZ*)(o_ptr); + o_conv = COption_EventZ_clone((LDKCOption_EventZ*)(((uint64_t)o) & ~1)); + LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ"); + *ret_conv = CResult_COption_EventZDecodeErrorZ_ok(o_conv); + return (uint64_t)ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + LDKDecodeError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); + e_conv = DecodeError_clone(&e_conv); + LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ"); + *ret_conv = CResult_COption_EventZDecodeErrorZ_err(e_conv); + return (uint64_t)ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_COption_EventZDecodeErrorZ* o_conv = (LDKCResult_COption_EventZDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_COption_EventZDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if ((_res & 1) != 0) return; + void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + CHECK_ACCESS(_res_ptr); + LDKCResult_COption_EventZDecodeErrorZ _res_conv = *(LDKCResult_COption_EventZDecodeErrorZ*)(_res_ptr); + FREE((void*)_res); + CResult_COption_EventZDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_COption_EventZDecodeErrorZ_clone_ptr(LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ"); + *ret_conv = CResult_COption_EventZDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_COption_EventZDecodeErrorZ* arg_conv = (LDKCResult_COption_EventZDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_COption_EventZDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_COption_EventZDecodeErrorZ* orig_conv = (LDKCResult_COption_EventZDecodeErrorZ*)(orig & ~1); + LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ"); + *ret_conv = CResult_COption_EventZDecodeErrorZ_clone(orig_conv); + return (uint64_t)ret_conv; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1MessageSendEventZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { LDKCVec_MessageSendEventZ _res_constr; _res_constr.datalen = (*env)->GetArrayLength(env, _res); @@ -12807,6 +13058,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecode LDKInitFeatures o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = InitFeatures_clone(&o_conv); LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ"); *ret_conv = CResult_InitFeaturesDecodeErrorZ_ok(o_conv); @@ -12817,12 +13069,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecode LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ"); *ret_conv = CResult_InitFeaturesDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_InitFeaturesDecodeErrorZ* o_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_InitFeaturesDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12836,6 +13095,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecode LDKNodeFeatures o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = NodeFeatures_clone(&o_conv); LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ"); *ret_conv = CResult_NodeFeaturesDecodeErrorZ_ok(o_conv); @@ -12846,12 +13106,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecode LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ"); *ret_conv = CResult_NodeFeaturesDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_NodeFeaturesDecodeErrorZ* o_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_NodeFeaturesDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12865,6 +13132,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDec LDKChannelFeatures o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = ChannelFeatures_clone(&o_conv); LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ"); *ret_conv = CResult_ChannelFeaturesDecodeErrorZ_ok(o_conv); @@ -12875,12 +13143,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDec LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ"); *ret_conv = CResult_ChannelFeaturesDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_ChannelFeaturesDecodeErrorZ* o_conv = (LDKCResult_ChannelFeaturesDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_ChannelFeaturesDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12894,6 +13169,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDec LDKInvoiceFeatures o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = InvoiceFeatures_clone(&o_conv); LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ"); *ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_ok(o_conv); @@ -12904,12 +13180,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDec LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ"); *ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_InvoiceFeaturesDecodeErrorZ* o_conv = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_InvoiceFeaturesDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12923,6 +13206,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ScoringParametersD LDKScoringParameters o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); // Warning: we need a move here but no clone is available for LDKScoringParameters LDKCResult_ScoringParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ScoringParametersDecodeErrorZ), "LDKCResult_ScoringParametersDecodeErrorZ"); *ret_conv = CResult_ScoringParametersDecodeErrorZ_ok(o_conv); @@ -12933,12 +13217,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ScoringParametersD LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_ScoringParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ScoringParametersDecodeErrorZ), "LDKCResult_ScoringParametersDecodeErrorZ"); *ret_conv = CResult_ScoringParametersDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ScoringParametersDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_ScoringParametersDecodeErrorZ* o_conv = (LDKCResult_ScoringParametersDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_ScoringParametersDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ScoringParametersDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12952,6 +13243,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ScorerDecodeErrorZ LDKScorer o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); // Warning: we need a move here but no clone is available for LDKScorer LDKCResult_ScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ScorerDecodeErrorZ), "LDKCResult_ScorerDecodeErrorZ"); *ret_conv = CResult_ScorerDecodeErrorZ_ok(o_conv); @@ -12962,12 +13254,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ScorerDecodeErrorZ LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_ScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ScorerDecodeErrorZ), "LDKCResult_ScorerDecodeErrorZ"); *ret_conv = CResult_ScorerDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ScorerDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_ScorerDecodeErrorZ* o_conv = (LDKCResult_ScorerDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_ScorerDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ScorerDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -12981,6 +13280,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutp LDKDelayedPaymentOutputDescriptor o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = DelayedPaymentOutputDescriptor_clone(&o_conv); LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ"); *ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(o_conv); @@ -12991,12 +13291,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutp LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ"); *ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* o_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13006,6 +13313,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputD CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone_ptr(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ"); + *ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* arg_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* orig_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)(orig & ~1); LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ"); @@ -13017,6 +13335,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutpu LDKStaticPaymentOutputDescriptor o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = StaticPaymentOutputDescriptor_clone(&o_conv); LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ"); *ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok(o_conv); @@ -13027,12 +13346,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutpu LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ"); *ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* o_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13042,6 +13368,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDe CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone_ptr(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ"); + *ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* arg_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* orig_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)(orig & ~1); LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ"); @@ -13063,12 +13400,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDes LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ"); *ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_SpendableOutputDescriptorDecodeErrorZ* o_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_SpendableOutputDescriptorDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13078,6 +13422,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescri CResult_SpendableOutputDescriptorDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_SpendableOutputDescriptorDecodeErrorZ_clone_ptr(LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ"); + *ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_SpendableOutputDescriptorDecodeErrorZ* arg_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_SpendableOutputDescriptorDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_SpendableOutputDescriptorDecodeErrorZ* orig_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)(orig & ~1); LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ"); @@ -13097,6 +13452,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1err(JNI return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_NoneNoneZ* o_conv = (LDKCResult_NoneNoneZ*)(o & ~1); + jboolean ret_val = CResult_NoneNoneZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13106,6 +13467,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1free(JNIEn CResult_NoneNoneZ_free(_res_conv); } +static inline uint64_t CResult_NoneNoneZ_clone_ptr(LDKCResult_NoneNoneZ *NONNULL_PTR arg) { + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = CResult_NoneNoneZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_NoneNoneZ* arg_conv = (LDKCResult_NoneNoneZ*)(arg & ~1); + int64_t ret_val = CResult_NoneNoneZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_NoneNoneZ* orig_conv = (LDKCResult_NoneNoneZ*)(orig & ~1); LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); @@ -13113,6 +13485,17 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1clone(J return (uint64_t)ret_conv; } +static inline uint64_t C2Tuple_SignatureCVec_SignatureZZ_clone_ptr(LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR arg) { + LDKC2Tuple_SignatureCVec_SignatureZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ"); + *ret_conv = C2Tuple_SignatureCVec_SignatureZZ_clone(arg); + return ((uint64_t)ret_conv); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_SignatureCVec_SignatureZZ* arg_conv = (LDKC2Tuple_SignatureCVec_SignatureZZ*)(arg & ~1); + int64_t ret_val = C2Tuple_SignatureCVec_SignatureZZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKC2Tuple_SignatureCVec_SignatureZZ* orig_conv = (LDKC2Tuple_SignatureCVec_SignatureZZ*)(orig & ~1); LDKC2Tuple_SignatureCVec_SignatureZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ"); @@ -13167,6 +13550,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1Signature return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* o_conv = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(o & ~1); + jboolean ret_val = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_is_ok(o_conv); + return ret_val; +} + 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; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13176,6 +13565,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVe CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(_res_conv); } +static inline uint64_t CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone_ptr(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR arg) { + LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ"); + *ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* arg_conv = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(arg & ~1); + int64_t ret_val = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* orig_conv = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(orig & ~1); LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ"); @@ -13198,6 +13598,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1er return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_SignatureNoneZ* o_conv = (LDKCResult_SignatureNoneZ*)(o & ~1); + jboolean ret_val = CResult_SignatureNoneZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13207,6 +13613,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1free( CResult_SignatureNoneZ_free(_res_conv); } +static inline uint64_t CResult_SignatureNoneZ_clone_ptr(LDKCResult_SignatureNoneZ *NONNULL_PTR arg) { + LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ"); + *ret_conv = CResult_SignatureNoneZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_SignatureNoneZ* arg_conv = (LDKCResult_SignatureNoneZ*)(arg & ~1); + int64_t ret_val = CResult_SignatureNoneZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_SignatureNoneZ* orig_conv = (LDKCResult_SignatureNoneZ*)(orig & ~1); LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ"); @@ -13231,12 +13648,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1 LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ"); *ret_conv = CResult_SignDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_SignDecodeErrorZ* o_conv = (LDKCResult_SignDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_SignDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13246,6 +13670,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1fre CResult_SignDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_SignDecodeErrorZ_clone_ptr(LDKCResult_SignDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ"); + *ret_conv = CResult_SignDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_SignDecodeErrorZ* arg_conv = (LDKCResult_SignDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_SignDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_SignDecodeErrorZ* orig_conv = (LDKCResult_SignDecodeErrorZ*)(orig & ~1); LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ"); @@ -13276,6 +13711,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatu return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_RecoverableSignatureNoneZ* o_conv = (LDKCResult_RecoverableSignatureNoneZ*)(o & ~1); + jboolean ret_val = CResult_RecoverableSignatureNoneZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13285,6 +13726,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureN CResult_RecoverableSignatureNoneZ_free(_res_conv); } +static inline uint64_t CResult_RecoverableSignatureNoneZ_clone_ptr(LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR arg) { + LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ"); + *ret_conv = CResult_RecoverableSignatureNoneZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_RecoverableSignatureNoneZ* arg_conv = (LDKCResult_RecoverableSignatureNoneZ*)(arg & ~1); + int64_t ret_val = CResult_RecoverableSignatureNoneZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_RecoverableSignatureNoneZ* orig_conv = (LDKCResult_RecoverableSignatureNoneZ*)(orig & ~1); LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ"); @@ -13336,6 +13788,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNo return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_CVec_CVec_u8ZZNoneZ* o_conv = (LDKCResult_CVec_CVec_u8ZZNoneZ*)(o & ~1); + jboolean ret_val = CResult_CVec_CVec_u8ZZNoneZ_is_ok(o_conv); + return ret_val; +} + 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; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13345,6 +13803,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_free(_res_conv); } +static inline uint64_t CResult_CVec_CVec_u8ZZNoneZ_clone_ptr(LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR arg) { + LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ"); + *ret_conv = CResult_CVec_CVec_u8ZZNoneZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_CVec_CVec_u8ZZNoneZ* arg_conv = (LDKCResult_CVec_CVec_u8ZZNoneZ*)(arg & ~1); + int64_t ret_val = CResult_CVec_CVec_u8ZZNoneZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_CVec_CVec_u8ZZNoneZ* orig_conv = (LDKCResult_CVec_CVec_u8ZZNoneZ*)(orig & ~1); LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ"); @@ -13356,6 +13825,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDeco LDKInMemorySigner o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = InMemorySigner_clone(&o_conv); LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ"); *ret_conv = CResult_InMemorySignerDecodeErrorZ_ok(o_conv); @@ -13366,12 +13836,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDeco LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ"); *ret_conv = CResult_InMemorySignerDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_InMemorySignerDecodeErrorZ* o_conv = (LDKCResult_InMemorySignerDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_InMemorySignerDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13381,6 +13858,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeE CResult_InMemorySignerDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_InMemorySignerDecodeErrorZ_clone_ptr(LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ"); + *ret_conv = CResult_InMemorySignerDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_InMemorySignerDecodeErrorZ* arg_conv = (LDKCResult_InMemorySignerDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_InMemorySignerDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_InMemorySignerDecodeErrorZ* orig_conv = (LDKCResult_InMemorySignerDecodeErrorZ*)(orig & ~1); LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ"); @@ -13425,6 +13913,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1 return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_TransactionNoneZ* o_conv = (LDKCResult_TransactionNoneZ*)(o & ~1); + jboolean ret_val = CResult_TransactionNoneZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13434,6 +13928,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1fre CResult_TransactionNoneZ_free(_res_conv); } +static inline uint64_t CResult_TransactionNoneZ_clone_ptr(LDKCResult_TransactionNoneZ *NONNULL_PTR arg) { + LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ"); + *ret_conv = CResult_TransactionNoneZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_TransactionNoneZ* arg_conv = (LDKCResult_TransactionNoneZ*)(arg & ~1); + int64_t ret_val = CResult_TransactionNoneZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_TransactionNoneZ* orig_conv = (LDKCResult_TransactionNoneZ*)(orig & ~1); LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ"); @@ -13441,6 +13946,17 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1 return (uint64_t)ret_conv; } +static inline uint64_t C2Tuple_BlockHashChannelMonitorZ_clone_ptr(LDKC2Tuple_BlockHashChannelMonitorZ *NONNULL_PTR arg) { + LDKC2Tuple_BlockHashChannelMonitorZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKC2Tuple_BlockHashChannelMonitorZ"); + *ret_conv = C2Tuple_BlockHashChannelMonitorZ_clone(arg); + return ((uint64_t)ret_conv); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMonitorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_BlockHashChannelMonitorZ* arg_conv = (LDKC2Tuple_BlockHashChannelMonitorZ*)(arg & ~1); + int64_t ret_val = C2Tuple_BlockHashChannelMonitorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMonitorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKC2Tuple_BlockHashChannelMonitorZ* orig_conv = (LDKC2Tuple_BlockHashChannelMonitorZ*)(orig & ~1); LDKC2Tuple_BlockHashChannelMonitorZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKC2Tuple_BlockHashChannelMonitorZ"); @@ -13455,6 +13971,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMo LDKChannelMonitor b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = (b & 1) || (b == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); b_conv = ChannelMonitor_clone(&b_conv); LDKC2Tuple_BlockHashChannelMonitorZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKC2Tuple_BlockHashChannelMonitorZ"); *ret_conv = C2Tuple_BlockHashChannelMonitorZ_new(a_ref, b_conv); @@ -13519,6 +14036,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1Blo return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* o_conv = (LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ*)(o & ~1); + jboolean ret_val = CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_is_ok(o_conv); + return ret_val; +} + 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; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13528,6 +14051,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockH CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_free(_res_conv); } +static inline uint64_t CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone_ptr(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ *NONNULL_PTR arg) { + LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ), "LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ"); + *ret_conv = CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* arg_conv = (LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ*)(arg & ~1); + int64_t ret_val = CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* orig_conv = (LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ*)(orig & ~1); LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ), "LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ"); @@ -13558,6 +14092,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1u16Z_1free(JNIEnv *en COption_u16Z_free(_res_conv); } +static inline uint64_t COption_u16Z_clone_ptr(LDKCOption_u16Z *NONNULL_PTR arg) { + LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z"); + *ret_copy = COption_u16Z_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u16Z_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCOption_u16Z* arg_conv = (LDKCOption_u16Z*)arg; + int64_t ret_val = COption_u16Z_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u16Z_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCOption_u16Z* orig_conv = (LDKCOption_u16Z*)orig; LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z"); @@ -13582,6 +14128,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1err return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_NoneAPIErrorZ* o_conv = (LDKCResult_NoneAPIErrorZ*)(o & ~1); + jboolean ret_val = CResult_NoneAPIErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13591,6 +14143,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1free(J CResult_NoneAPIErrorZ_free(_res_conv); } +static inline uint64_t CResult_NoneAPIErrorZ_clone_ptr(LDKCResult_NoneAPIErrorZ *NONNULL_PTR arg) { + LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); + *ret_conv = CResult_NoneAPIErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_NoneAPIErrorZ* arg_conv = (LDKCResult_NoneAPIErrorZ*)(arg & ~1); + int64_t ret_val = CResult_NoneAPIErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_NoneAPIErrorZ* orig_conv = (LDKCResult_NoneAPIErrorZ*)(orig & ~1); LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); @@ -13657,6 +14220,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1e return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult__u832APIErrorZ* o_conv = (LDKCResult__u832APIErrorZ*)(o & ~1); + jboolean ret_val = CResult__u832APIErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13666,6 +14235,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1free CResult__u832APIErrorZ_free(_res_conv); } +static inline uint64_t CResult__u832APIErrorZ_clone_ptr(LDKCResult__u832APIErrorZ *NONNULL_PTR arg) { + LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ"); + *ret_conv = CResult__u832APIErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult__u832APIErrorZ* arg_conv = (LDKCResult__u832APIErrorZ*)(arg & ~1); + int64_t ret_val = CResult__u832APIErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult__u832APIErrorZ* orig_conv = (LDKCResult__u832APIErrorZ*)(orig & ~1); LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ"); @@ -13692,6 +14272,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSe return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_PaymentIdPaymentSendFailureZ* o_conv = (LDKCResult_PaymentIdPaymentSendFailureZ*)(o & ~1); + jboolean ret_val = CResult_PaymentIdPaymentSendFailureZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13701,6 +14287,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendF CResult_PaymentIdPaymentSendFailureZ_free(_res_conv); } +static inline uint64_t CResult_PaymentIdPaymentSendFailureZ_clone_ptr(LDKCResult_PaymentIdPaymentSendFailureZ *NONNULL_PTR arg) { + LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ"); + *ret_conv = CResult_PaymentIdPaymentSendFailureZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_PaymentIdPaymentSendFailureZ* arg_conv = (LDKCResult_PaymentIdPaymentSendFailureZ*)(arg & ~1); + int64_t ret_val = CResult_PaymentIdPaymentSendFailureZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_PaymentIdPaymentSendFailureZ* orig_conv = (LDKCResult_PaymentIdPaymentSendFailureZ*)(orig & ~1); LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ"); @@ -13724,6 +14321,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFai return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_NonePaymentSendFailureZ* o_conv = (LDKCResult_NonePaymentSendFailureZ*)(o & ~1); + jboolean ret_val = CResult_NonePaymentSendFailureZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13733,6 +14336,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailur CResult_NonePaymentSendFailureZ_free(_res_conv); } +static inline uint64_t CResult_NonePaymentSendFailureZ_clone_ptr(LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR arg) { + LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ"); + *ret_conv = CResult_NonePaymentSendFailureZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_NonePaymentSendFailureZ* arg_conv = (LDKCResult_NonePaymentSendFailureZ*)(arg & ~1); + int64_t ret_val = CResult_NonePaymentSendFailureZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_NonePaymentSendFailureZ* orig_conv = (LDKCResult_NonePaymentSendFailureZ*)(orig & ~1); LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ"); @@ -13740,6 +14354,17 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFai return (uint64_t)ret_conv; } +static inline uint64_t C2Tuple_PaymentHashPaymentIdZ_clone_ptr(LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR arg) { + LDKC2Tuple_PaymentHashPaymentIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentIdZ), "LDKC2Tuple_PaymentHashPaymentIdZ"); + *ret_conv = C2Tuple_PaymentHashPaymentIdZ_clone(arg); + return ((uint64_t)ret_conv); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentIdZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_PaymentHashPaymentIdZ* arg_conv = (LDKC2Tuple_PaymentHashPaymentIdZ*)(arg & ~1); + int64_t ret_val = C2Tuple_PaymentHashPaymentIdZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentIdZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKC2Tuple_PaymentHashPaymentIdZ* orig_conv = (LDKC2Tuple_PaymentHashPaymentIdZ*)(orig & ~1); LDKC2Tuple_PaymentHashPaymentIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentIdZ), "LDKC2Tuple_PaymentHashPaymentIdZ"); @@ -13788,6 +14413,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHa return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* o_conv = (LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)(o & ~1); + jboolean ret_val = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13797,6 +14428,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashP CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_free(_res_conv); } +static inline uint64_t CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone_ptr(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *NONNULL_PTR arg) { + LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ"); + *ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* arg_conv = (LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)(arg & ~1); + int64_t ret_val = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* orig_conv = (LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)(orig & ~1); LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ"); @@ -13824,6 +14466,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1NetAddressZ_1free(JNIEnv CVec_NetAddressZ_free(_res_constr); } +static inline uint64_t C2Tuple_PaymentHashPaymentSecretZ_clone_ptr(LDKC2Tuple_PaymentHashPaymentSecretZ *NONNULL_PTR arg) { + LDKC2Tuple_PaymentHashPaymentSecretZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ"); + *ret_conv = C2Tuple_PaymentHashPaymentSecretZ_clone(arg); + return ((uint64_t)ret_conv); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentSecretZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_PaymentHashPaymentSecretZ* arg_conv = (LDKC2Tuple_PaymentHashPaymentSecretZ*)(arg & ~1); + int64_t ret_val = C2Tuple_PaymentHashPaymentSecretZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentSecretZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKC2Tuple_PaymentHashPaymentSecretZ* orig_conv = (LDKC2Tuple_PaymentHashPaymentSecretZ*)(orig & ~1); LDKC2Tuple_PaymentHashPaymentSecretZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ"); @@ -13871,6 +14524,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIEr return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_PaymentSecretAPIErrorZ* o_conv = (LDKCResult_PaymentSecretAPIErrorZ*)(o & ~1); + jboolean ret_val = CResult_PaymentSecretAPIErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13880,6 +14539,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIError CResult_PaymentSecretAPIErrorZ_free(_res_conv); } +static inline uint64_t CResult_PaymentSecretAPIErrorZ_clone_ptr(LDKCResult_PaymentSecretAPIErrorZ *NONNULL_PTR arg) { + LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ"); + *ret_conv = CResult_PaymentSecretAPIErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_PaymentSecretAPIErrorZ* arg_conv = (LDKCResult_PaymentSecretAPIErrorZ*)(arg & ~1); + int64_t ret_val = CResult_PaymentSecretAPIErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_PaymentSecretAPIErrorZ* orig_conv = (LDKCResult_PaymentSecretAPIErrorZ*)(orig & ~1); LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ"); @@ -13900,6 +14570,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1ChannelMonitorZ_1free(JN LDKChannelMonitor _res_conv_16_conv; _res_conv_16_conv.inner = (void*)(_res_conv_16 & (~1)); _res_conv_16_conv.is_owned = (_res_conv_16 & 1) || (_res_conv_16 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_16_conv); _res_constr.data[q] = _res_conv_16_conv; } (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); @@ -13913,6 +14584,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMa LDKChannelManager b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = (b & 1) || (b == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); // Warning: we need a move here but no clone is available for LDKChannelManager LDKC2Tuple_BlockHashChannelManagerZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelManagerZ), "LDKC2Tuple_BlockHashChannelManagerZ"); *ret_conv = C2Tuple_BlockHashChannelManagerZ_new(a_ref, b_conv); @@ -13942,12 +14614,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHash LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ"); *ret_conv = CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelManagerZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* o_conv = (LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelManagerZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13961,6 +14640,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecod LDKChannelConfig o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = ChannelConfig_clone(&o_conv); LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ"); *ret_conv = CResult_ChannelConfigDecodeErrorZ_ok(o_conv); @@ -13971,12 +14651,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecod LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ"); *ret_conv = CResult_ChannelConfigDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_ChannelConfigDecodeErrorZ* o_conv = (LDKCResult_ChannelConfigDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_ChannelConfigDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -13986,6 +14673,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeEr CResult_ChannelConfigDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_ChannelConfigDecodeErrorZ_clone_ptr(LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ"); + *ret_conv = CResult_ChannelConfigDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_ChannelConfigDecodeErrorZ* arg_conv = (LDKCResult_ChannelConfigDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_ChannelConfigDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_ChannelConfigDecodeErrorZ* orig_conv = (LDKCResult_ChannelConfigDecodeErrorZ*)(orig & ~1); LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ"); @@ -13997,6 +14695,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErro LDKOutPoint o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = OutPoint_clone(&o_conv); LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ"); *ret_conv = CResult_OutPointDecodeErrorZ_ok(o_conv); @@ -14007,12 +14706,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErro LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ"); *ret_conv = CResult_OutPointDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_OutPointDecodeErrorZ* o_conv = (LDKCResult_OutPointDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_OutPointDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -14022,6 +14728,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_ CResult_OutPointDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_OutPointDecodeErrorZ_clone_ptr(LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ"); + *ret_conv = CResult_OutPointDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_OutPointDecodeErrorZ* arg_conv = (LDKCResult_OutPointDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_OutPointDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_OutPointDecodeErrorZ* orig_conv = (LDKCResult_OutPointDecodeErrorZ*)(orig & ~1); LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ"); @@ -14059,6 +14776,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1TypeZ_1free(JNIEnv *e COption_TypeZ_free(_res_conv); } +static inline uint64_t COption_TypeZ_clone_ptr(LDKCOption_TypeZ *NONNULL_PTR arg) { + LDKCOption_TypeZ *ret_copy = MALLOC(sizeof(LDKCOption_TypeZ), "LDKCOption_TypeZ"); + *ret_copy = COption_TypeZ_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1TypeZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCOption_TypeZ* arg_conv = (LDKCOption_TypeZ*)arg; + int64_t ret_val = COption_TypeZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1TypeZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCOption_TypeZ* orig_conv = (LDKCOption_TypeZ*)orig; LDKCOption_TypeZ *ret_copy = MALLOC(sizeof(LDKCOption_TypeZ), "LDKCOption_TypeZ"); @@ -14081,12 +14810,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDeco LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ"); *ret_conv = CResult_COption_TypeZDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_COption_TypeZDecodeErrorZ* o_conv = (LDKCResult_COption_TypeZDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_COption_TypeZDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -14096,6 +14832,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeE CResult_COption_TypeZDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_COption_TypeZDecodeErrorZ_clone_ptr(LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ"); + *ret_conv = CResult_COption_TypeZDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_COption_TypeZDecodeErrorZ* arg_conv = (LDKCResult_COption_TypeZDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_COption_TypeZDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_COption_TypeZDecodeErrorZ* orig_conv = (LDKCResult_COption_TypeZDecodeErrorZ*)(orig & ~1); LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ"); @@ -14122,6 +14869,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentEr return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_PaymentIdPaymentErrorZ* o_conv = (LDKCResult_PaymentIdPaymentErrorZ*)(o & ~1); + jboolean ret_val = CResult_PaymentIdPaymentErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -14131,6 +14884,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentError CResult_PaymentIdPaymentErrorZ_free(_res_conv); } +static inline uint64_t CResult_PaymentIdPaymentErrorZ_clone_ptr(LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR arg) { + LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ"); + *ret_conv = CResult_PaymentIdPaymentErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_PaymentIdPaymentErrorZ* arg_conv = (LDKCResult_PaymentIdPaymentErrorZ*)(arg & ~1); + int64_t ret_val = CResult_PaymentIdPaymentErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_PaymentIdPaymentErrorZ* orig_conv = (LDKCResult_PaymentIdPaymentErrorZ*)(orig & ~1); LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ"); @@ -14151,6 +14915,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixNoneZ_1err return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_SiPrefixNoneZ* o_conv = (LDKCResult_SiPrefixNoneZ*)(o & ~1); + jboolean ret_val = CResult_SiPrefixNoneZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -14160,6 +14930,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixNoneZ_1free(J CResult_SiPrefixNoneZ_free(_res_conv); } +static inline uint64_t CResult_SiPrefixNoneZ_clone_ptr(LDKCResult_SiPrefixNoneZ *NONNULL_PTR arg) { + LDKCResult_SiPrefixNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixNoneZ), "LDKCResult_SiPrefixNoneZ"); + *ret_conv = CResult_SiPrefixNoneZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_SiPrefixNoneZ* arg_conv = (LDKCResult_SiPrefixNoneZ*)(arg & ~1); + int64_t ret_val = CResult_SiPrefixNoneZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_SiPrefixNoneZ* orig_conv = (LDKCResult_SiPrefixNoneZ*)(orig & ~1); LDKCResult_SiPrefixNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixNoneZ), "LDKCResult_SiPrefixNoneZ"); @@ -14171,6 +14952,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceNoneZ_1ok(J LDKInvoice o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = Invoice_clone(&o_conv); LDKCResult_InvoiceNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceNoneZ), "LDKCResult_InvoiceNoneZ"); *ret_conv = CResult_InvoiceNoneZ_ok(o_conv); @@ -14183,6 +14965,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceNoneZ_1err( return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_InvoiceNoneZ* o_conv = (LDKCResult_InvoiceNoneZ*)(o & ~1); + jboolean ret_val = CResult_InvoiceNoneZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -14192,6 +14980,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceNoneZ_1free(JN CResult_InvoiceNoneZ_free(_res_conv); } +static inline uint64_t CResult_InvoiceNoneZ_clone_ptr(LDKCResult_InvoiceNoneZ *NONNULL_PTR arg) { + LDKCResult_InvoiceNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceNoneZ), "LDKCResult_InvoiceNoneZ"); + *ret_conv = CResult_InvoiceNoneZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_InvoiceNoneZ* arg_conv = (LDKCResult_InvoiceNoneZ*)(arg & ~1); + int64_t ret_val = CResult_InvoiceNoneZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_InvoiceNoneZ* orig_conv = (LDKCResult_InvoiceNoneZ*)(orig & ~1); LDKCResult_InvoiceNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceNoneZ), "LDKCResult_InvoiceNoneZ"); @@ -14203,6 +15002,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceNo LDKSignedRawInvoice o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = SignedRawInvoice_clone(&o_conv); LDKCResult_SignedRawInvoiceNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceNoneZ), "LDKCResult_SignedRawInvoiceNoneZ"); *ret_conv = CResult_SignedRawInvoiceNoneZ_ok(o_conv); @@ -14215,6 +15015,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceNo return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_SignedRawInvoiceNoneZ* o_conv = (LDKCResult_SignedRawInvoiceNoneZ*)(o & ~1); + jboolean ret_val = CResult_SignedRawInvoiceNoneZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -14224,6 +15030,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceNoneZ CResult_SignedRawInvoiceNoneZ_free(_res_conv); } +static inline uint64_t CResult_SignedRawInvoiceNoneZ_clone_ptr(LDKCResult_SignedRawInvoiceNoneZ *NONNULL_PTR arg) { + LDKCResult_SignedRawInvoiceNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceNoneZ), "LDKCResult_SignedRawInvoiceNoneZ"); + *ret_conv = CResult_SignedRawInvoiceNoneZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_SignedRawInvoiceNoneZ* arg_conv = (LDKCResult_SignedRawInvoiceNoneZ*)(arg & ~1); + int64_t ret_val = CResult_SignedRawInvoiceNoneZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_SignedRawInvoiceNoneZ* orig_conv = (LDKCResult_SignedRawInvoiceNoneZ*)(orig & ~1); LDKCResult_SignedRawInvoiceNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceNoneZ), "LDKCResult_SignedRawInvoiceNoneZ"); @@ -14231,6 +15048,17 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceNo return (uint64_t)ret_conv; } +static inline uint64_t C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone_ptr(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR arg) { + LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ), "LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ"); + *ret_conv = C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone(arg); + return ((uint64_t)ret_conv); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* arg_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)(arg & ~1); + int64_t ret_val = C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* orig_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)(orig & ~1); LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ), "LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ"); @@ -14242,6 +15070,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832In LDKRawInvoice a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = (a & 1) || (a == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv = RawInvoice_clone(&a_conv); LDKThirtyTwoBytes b_ref; CHECK((*env)->GetArrayLength(env, b) == 32); @@ -14249,6 +15078,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832In LDKInvoiceSignature c_conv; c_conv.inner = (void*)(c & (~1)); c_conv.is_owned = (c & 1) || (c == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(c_conv); c_conv = InvoiceSignature_clone(&c_conv); LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ), "LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ"); *ret_conv = C3Tuple_RawInvoice_u832InvoiceSignatureZ_new(a_conv, b_ref, c_conv); @@ -14268,6 +15098,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_ LDKPayeePubKey o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = PayeePubKey_clone(&o_conv); LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ"); *ret_conv = CResult_PayeePubKeyErrorZ_ok(o_conv); @@ -14281,6 +15112,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_ return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_PayeePubKeyErrorZ* o_conv = (LDKCResult_PayeePubKeyErrorZ*)(o & ~1); + jboolean ret_val = CResult_PayeePubKeyErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -14290,6 +15127,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1fr CResult_PayeePubKeyErrorZ_free(_res_conv); } +static inline uint64_t CResult_PayeePubKeyErrorZ_clone_ptr(LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR arg) { + LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ"); + *ret_conv = CResult_PayeePubKeyErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_PayeePubKeyErrorZ* arg_conv = (LDKCResult_PayeePubKeyErrorZ*)(arg & ~1); + int64_t ret_val = CResult_PayeePubKeyErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_PayeePubKeyErrorZ* orig_conv = (LDKCResult_PayeePubKeyErrorZ*)(orig & ~1); LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ"); @@ -14310,6 +15158,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1PrivateRouteZ_1free(JNIE LDKPrivateRoute _res_conv_14_conv; _res_conv_14_conv.inner = (void*)(_res_conv_14 & (~1)); _res_conv_14_conv.is_owned = (_res_conv_14 & 1) || (_res_conv_14 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_14_conv); _res_constr.data[o] = _res_conv_14_conv; } (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); @@ -14320,6 +15169,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampC LDKPositiveTimestamp o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = PositiveTimestamp_clone(&o_conv); LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ"); *ret_conv = CResult_PositiveTimestampCreationErrorZ_ok(o_conv); @@ -14333,6 +15183,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampC return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_PositiveTimestampCreationErrorZ* o_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)(o & ~1); + jboolean ret_val = CResult_PositiveTimestampCreationErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -14342,6 +15198,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCrea CResult_PositiveTimestampCreationErrorZ_free(_res_conv); } +static inline uint64_t CResult_PositiveTimestampCreationErrorZ_clone_ptr(LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR arg) { + LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ"); + *ret_conv = CResult_PositiveTimestampCreationErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_PositiveTimestampCreationErrorZ* arg_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)(arg & ~1); + int64_t ret_val = CResult_PositiveTimestampCreationErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_PositiveTimestampCreationErrorZ* orig_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)(orig & ~1); LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ"); @@ -14362,6 +15229,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_NoneSemanticErrorZ* o_conv = (LDKCResult_NoneSemanticErrorZ*)(o & ~1); + jboolean ret_val = CResult_NoneSemanticErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -14371,6 +15244,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1f CResult_NoneSemanticErrorZ_free(_res_conv); } +static inline uint64_t CResult_NoneSemanticErrorZ_clone_ptr(LDKCResult_NoneSemanticErrorZ *NONNULL_PTR arg) { + LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ"); + *ret_conv = CResult_NoneSemanticErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_NoneSemanticErrorZ* arg_conv = (LDKCResult_NoneSemanticErrorZ*)(arg & ~1); + int64_t ret_val = CResult_NoneSemanticErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_NoneSemanticErrorZ* orig_conv = (LDKCResult_NoneSemanticErrorZ*)(orig & ~1); LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ"); @@ -14382,6 +15266,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErr LDKInvoice o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = Invoice_clone(&o_conv); LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ"); *ret_conv = CResult_InvoiceSemanticErrorZ_ok(o_conv); @@ -14395,6 +15280,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErr return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_InvoiceSemanticErrorZ* o_conv = (LDKCResult_InvoiceSemanticErrorZ*)(o & ~1); + jboolean ret_val = CResult_InvoiceSemanticErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -14404,6 +15295,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ CResult_InvoiceSemanticErrorZ_free(_res_conv); } +static inline uint64_t CResult_InvoiceSemanticErrorZ_clone_ptr(LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR arg) { + LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ"); + *ret_conv = CResult_InvoiceSemanticErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_InvoiceSemanticErrorZ* arg_conv = (LDKCResult_InvoiceSemanticErrorZ*)(arg & ~1); + int64_t ret_val = CResult_InvoiceSemanticErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_InvoiceSemanticErrorZ* orig_conv = (LDKCResult_InvoiceSemanticErrorZ*)(orig & ~1); LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ"); @@ -14415,6 +15317,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreatio LDKDescription o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = Description_clone(&o_conv); LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ"); *ret_conv = CResult_DescriptionCreationErrorZ_ok(o_conv); @@ -14428,6 +15331,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreatio return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_DescriptionCreationErrorZ* o_conv = (LDKCResult_DescriptionCreationErrorZ*)(o & ~1); + jboolean ret_val = CResult_DescriptionCreationErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -14437,6 +15346,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationEr CResult_DescriptionCreationErrorZ_free(_res_conv); } +static inline uint64_t CResult_DescriptionCreationErrorZ_clone_ptr(LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR arg) { + LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ"); + *ret_conv = CResult_DescriptionCreationErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_DescriptionCreationErrorZ* arg_conv = (LDKCResult_DescriptionCreationErrorZ*)(arg & ~1); + int64_t ret_val = CResult_DescriptionCreationErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_DescriptionCreationErrorZ* orig_conv = (LDKCResult_DescriptionCreationErrorZ*)(orig & ~1); LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ"); @@ -14448,6 +15368,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ExpiryTimeCreation LDKExpiryTime o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = ExpiryTime_clone(&o_conv); LDKCResult_ExpiryTimeCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ExpiryTimeCreationErrorZ), "LDKCResult_ExpiryTimeCreationErrorZ"); *ret_conv = CResult_ExpiryTimeCreationErrorZ_ok(o_conv); @@ -14461,6 +15382,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ExpiryTimeCreation return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ExpiryTimeCreationErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_ExpiryTimeCreationErrorZ* o_conv = (LDKCResult_ExpiryTimeCreationErrorZ*)(o & ~1); + jboolean ret_val = CResult_ExpiryTimeCreationErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ExpiryTimeCreationErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -14470,6 +15397,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ExpiryTimeCreationErr CResult_ExpiryTimeCreationErrorZ_free(_res_conv); } +static inline uint64_t CResult_ExpiryTimeCreationErrorZ_clone_ptr(LDKCResult_ExpiryTimeCreationErrorZ *NONNULL_PTR arg) { + LDKCResult_ExpiryTimeCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ExpiryTimeCreationErrorZ), "LDKCResult_ExpiryTimeCreationErrorZ"); + *ret_conv = CResult_ExpiryTimeCreationErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ExpiryTimeCreationErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_ExpiryTimeCreationErrorZ* arg_conv = (LDKCResult_ExpiryTimeCreationErrorZ*)(arg & ~1); + int64_t ret_val = CResult_ExpiryTimeCreationErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ExpiryTimeCreationErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_ExpiryTimeCreationErrorZ* orig_conv = (LDKCResult_ExpiryTimeCreationErrorZ*)(orig & ~1); LDKCResult_ExpiryTimeCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ExpiryTimeCreationErrorZ), "LDKCResult_ExpiryTimeCreationErrorZ"); @@ -14481,6 +15419,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreati LDKPrivateRoute o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = PrivateRoute_clone(&o_conv); LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ"); *ret_conv = CResult_PrivateRouteCreationErrorZ_ok(o_conv); @@ -14494,6 +15433,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreati return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_PrivateRouteCreationErrorZ* o_conv = (LDKCResult_PrivateRouteCreationErrorZ*)(o & ~1); + jboolean ret_val = CResult_PrivateRouteCreationErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -14503,6 +15448,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationE CResult_PrivateRouteCreationErrorZ_free(_res_conv); } +static inline uint64_t CResult_PrivateRouteCreationErrorZ_clone_ptr(LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR arg) { + LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ"); + *ret_conv = CResult_PrivateRouteCreationErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_PrivateRouteCreationErrorZ* arg_conv = (LDKCResult_PrivateRouteCreationErrorZ*)(arg & ~1); + int64_t ret_val = CResult_PrivateRouteCreationErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_PrivateRouteCreationErrorZ* orig_conv = (LDKCResult_PrivateRouteCreationErrorZ*)(orig & ~1); LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ"); @@ -14524,6 +15480,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1err( return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_StringErrorZ* o_conv = (LDKCResult_StringErrorZ*)(o & ~1); + jboolean ret_val = CResult_StringErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -14537,6 +15499,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpda LDKChannelMonitorUpdate o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = ChannelMonitorUpdate_clone(&o_conv); LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ"); *ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_ok(o_conv); @@ -14547,12 +15510,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpda LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ"); *ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_ChannelMonitorUpdateDecodeErrorZ* o_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_ChannelMonitorUpdateDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -14562,6 +15532,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateD CResult_ChannelMonitorUpdateDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_ChannelMonitorUpdateDecodeErrorZ_clone_ptr(LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ"); + *ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_ChannelMonitorUpdateDecodeErrorZ* arg_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_ChannelMonitorUpdateDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_ChannelMonitorUpdateDecodeErrorZ* orig_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)(orig & ~1); LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ"); @@ -14569,10 +15550,112 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpda return (uint64_t)ret_conv; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1MonitorEventZ_1some(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = (void*)(((uint64_t)o) & ~1); + CHECK_ACCESS(o_ptr); + LDKMonitorEvent o_conv = *(LDKMonitorEvent*)(o_ptr); + o_conv = MonitorEvent_clone((LDKMonitorEvent*)(((uint64_t)o) & ~1)); + LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ"); + *ret_copy = COption_MonitorEventZ_some(o_conv); + uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1MonitorEventZ_1none(JNIEnv *env, jclass clz) { + LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ"); + *ret_copy = COption_MonitorEventZ_none(); + uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1MonitorEventZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if ((_res & 1) != 0) return; + void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + CHECK_ACCESS(_res_ptr); + LDKCOption_MonitorEventZ _res_conv = *(LDKCOption_MonitorEventZ*)(_res_ptr); + FREE((void*)_res); + COption_MonitorEventZ_free(_res_conv); +} + +static inline uint64_t COption_MonitorEventZ_clone_ptr(LDKCOption_MonitorEventZ *NONNULL_PTR arg) { + LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ"); + *ret_copy = COption_MonitorEventZ_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1MonitorEventZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCOption_MonitorEventZ* arg_conv = (LDKCOption_MonitorEventZ*)arg; + int64_t ret_val = COption_MonitorEventZ_clone_ptr(arg_conv); + return ret_val; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1MonitorEventZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCOption_MonitorEventZ* orig_conv = (LDKCOption_MonitorEventZ*)orig; + LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ"); + *ret_copy = COption_MonitorEventZ_clone(orig_conv); + uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = (void*)(((uint64_t)o) & ~1); + CHECK_ACCESS(o_ptr); + LDKCOption_MonitorEventZ o_conv = *(LDKCOption_MonitorEventZ*)(o_ptr); + o_conv = COption_MonitorEventZ_clone((LDKCOption_MonitorEventZ*)(((uint64_t)o) & ~1)); + LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ"); + *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_ok(o_conv); + return (uint64_t)ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + LDKDecodeError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); + e_conv = DecodeError_clone(&e_conv); + LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ"); + *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_err(e_conv); + return (uint64_t)ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_COption_MonitorEventZDecodeErrorZ* o_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_COption_MonitorEventZDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if ((_res & 1) != 0) return; + void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + CHECK_ACCESS(_res_ptr); + LDKCResult_COption_MonitorEventZDecodeErrorZ _res_conv = *(LDKCResult_COption_MonitorEventZDecodeErrorZ*)(_res_ptr); + FREE((void*)_res); + CResult_COption_MonitorEventZDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_COption_MonitorEventZDecodeErrorZ_clone_ptr(LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ"); + *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_COption_MonitorEventZDecodeErrorZ* arg_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_COption_MonitorEventZDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_COption_MonitorEventZDecodeErrorZ* orig_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)(orig & ~1); + LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ"); + *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_clone(orig_conv); + return (uint64_t)ret_conv; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { LDKHTLCUpdate o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = HTLCUpdate_clone(&o_conv); LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ"); *ret_conv = CResult_HTLCUpdateDecodeErrorZ_ok(o_conv); @@ -14583,12 +15666,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeEr LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ"); *ret_conv = CResult_HTLCUpdateDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_HTLCUpdateDecodeErrorZ* o_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_HTLCUpdateDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -14598,6 +15688,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeError CResult_HTLCUpdateDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_HTLCUpdateDecodeErrorZ_clone_ptr(LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ"); + *ret_conv = CResult_HTLCUpdateDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_HTLCUpdateDecodeErrorZ* arg_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_HTLCUpdateDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_HTLCUpdateDecodeErrorZ* orig_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)(orig & ~1); LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ"); @@ -14615,12 +15716,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateE LDKMonitorUpdateError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = MonitorUpdateError_clone(&e_conv); LDKCResult_NoneMonitorUpdateErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneMonitorUpdateErrorZ), "LDKCResult_NoneMonitorUpdateErrorZ"); *ret_conv = CResult_NoneMonitorUpdateErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_NoneMonitorUpdateErrorZ* o_conv = (LDKCResult_NoneMonitorUpdateErrorZ*)(o & ~1); + jboolean ret_val = CResult_NoneMonitorUpdateErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -14630,6 +15738,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErro CResult_NoneMonitorUpdateErrorZ_free(_res_conv); } +static inline uint64_t CResult_NoneMonitorUpdateErrorZ_clone_ptr(LDKCResult_NoneMonitorUpdateErrorZ *NONNULL_PTR arg) { + LDKCResult_NoneMonitorUpdateErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneMonitorUpdateErrorZ), "LDKCResult_NoneMonitorUpdateErrorZ"); + *ret_conv = CResult_NoneMonitorUpdateErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_NoneMonitorUpdateErrorZ* arg_conv = (LDKCResult_NoneMonitorUpdateErrorZ*)(arg & ~1); + int64_t ret_val = CResult_NoneMonitorUpdateErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_NoneMonitorUpdateErrorZ* orig_conv = (LDKCResult_NoneMonitorUpdateErrorZ*)(orig & ~1); LDKCResult_NoneMonitorUpdateErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneMonitorUpdateErrorZ), "LDKCResult_NoneMonitorUpdateErrorZ"); @@ -14637,6 +15756,17 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateE return (uint64_t)ret_conv; } +static inline uint64_t C2Tuple_OutPointScriptZ_clone_ptr(LDKC2Tuple_OutPointScriptZ *NONNULL_PTR arg) { + LDKC2Tuple_OutPointScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ"); + *ret_conv = C2Tuple_OutPointScriptZ_clone(arg); + return ((uint64_t)ret_conv); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_OutPointScriptZ* arg_conv = (LDKC2Tuple_OutPointScriptZ*)(arg & ~1); + int64_t ret_val = C2Tuple_OutPointScriptZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKC2Tuple_OutPointScriptZ* orig_conv = (LDKC2Tuple_OutPointScriptZ*)(orig & ~1); LDKC2Tuple_OutPointScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ"); @@ -14648,6 +15778,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1n LDKOutPoint a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = (a & 1) || (a == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv = OutPoint_clone(&a_conv); LDKCVec_u8Z b_ref; b_ref.datalen = (*env)->GetArrayLength(env, b); @@ -14667,6 +15798,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1free C2Tuple_OutPointScriptZ_free(_res_conv); } +static inline uint64_t C2Tuple_u32ScriptZ_clone_ptr(LDKC2Tuple_u32ScriptZ *NONNULL_PTR arg) { + LDKC2Tuple_u32ScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ), "LDKC2Tuple_u32ScriptZ"); + *ret_conv = C2Tuple_u32ScriptZ_clone(arg); + return ((uint64_t)ret_conv); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32ScriptZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_u32ScriptZ* arg_conv = (LDKC2Tuple_u32ScriptZ*)(arg & ~1); + int64_t ret_val = C2Tuple_u32ScriptZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32ScriptZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKC2Tuple_u32ScriptZ* orig_conv = (LDKC2Tuple_u32ScriptZ*)(orig & ~1); LDKC2Tuple_u32ScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ), "LDKC2Tuple_u32ScriptZ"); @@ -14713,6 +15855,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1u32ScriptZZ_1fr CVec_C2Tuple_u32ScriptZZ_free(_res_constr); } +static inline uint64_t C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone_ptr(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *NONNULL_PTR arg) { + LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ"); + *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone(arg); + return ((uint64_t)ret_conv); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* arg_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(arg & ~1); + int64_t ret_val = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* orig_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(orig & ~1); LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ"); @@ -14813,6 +15966,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1TransactionZ_1free(JNIEn CVec_TransactionZ_free(_res_constr); } +static inline uint64_t C2Tuple_u32TxOutZ_clone_ptr(LDKC2Tuple_u32TxOutZ *NONNULL_PTR arg) { + LDKC2Tuple_u32TxOutZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ), "LDKC2Tuple_u32TxOutZ"); + *ret_conv = C2Tuple_u32TxOutZ_clone(arg); + return ((uint64_t)ret_conv); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32TxOutZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_u32TxOutZ* arg_conv = (LDKC2Tuple_u32TxOutZ*)(arg & ~1); + int64_t ret_val = C2Tuple_u32TxOutZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32TxOutZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKC2Tuple_u32TxOutZ* orig_conv = (LDKC2Tuple_u32TxOutZ*)(orig & ~1); LDKC2Tuple_u32TxOutZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ), "LDKC2Tuple_u32TxOutZ"); @@ -14859,6 +16023,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1u32TxOutZZ_1fre CVec_C2Tuple_u32TxOutZZ_free(_res_constr); } +static inline uint64_t C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone_ptr(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR arg) { + LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ"); + *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone(arg); + return ((uint64_t)ret_conv); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* arg_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(arg & ~1); + int64_t ret_val = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* orig_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(orig & ~1); LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ"); @@ -14954,12 +16129,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHash LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ"); *ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* o_conv = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -14969,6 +16151,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashCha CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone_ptr(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ"); + *ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* arg_conv = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* orig_conv = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)(orig & ~1); LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ"); @@ -14986,12 +16179,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningError LDKLightningError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = LightningError_clone(&e_conv); LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); *ret_conv = CResult_NoneLightningErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_NoneLightningErrorZ* o_conv = (LDKCResult_NoneLightningErrorZ*)(o & ~1); + jboolean ret_val = CResult_NoneLightningErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -15001,6 +16201,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1 CResult_NoneLightningErrorZ_free(_res_conv); } +static inline uint64_t CResult_NoneLightningErrorZ_clone_ptr(LDKCResult_NoneLightningErrorZ *NONNULL_PTR arg) { + LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); + *ret_conv = CResult_NoneLightningErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_NoneLightningErrorZ* arg_conv = (LDKCResult_NoneLightningErrorZ*)(arg & ~1); + int64_t ret_val = CResult_NoneLightningErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_NoneLightningErrorZ* orig_conv = (LDKCResult_NoneLightningErrorZ*)(orig & ~1); LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); @@ -15008,6 +16219,17 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningError return (uint64_t)ret_conv; } +static inline uint64_t C2Tuple_PublicKeyTypeZ_clone_ptr(LDKC2Tuple_PublicKeyTypeZ *NONNULL_PTR arg) { + LDKC2Tuple_PublicKeyTypeZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKC2Tuple_PublicKeyTypeZ"); + *ret_conv = C2Tuple_PublicKeyTypeZ_clone(arg); + return ((uint64_t)ret_conv); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyTypeZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_PublicKeyTypeZ* arg_conv = (LDKC2Tuple_PublicKeyTypeZ*)(arg & ~1); + int64_t ret_val = C2Tuple_PublicKeyTypeZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyTypeZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKC2Tuple_PublicKeyTypeZ* orig_conv = (LDKC2Tuple_PublicKeyTypeZ*)(orig & ~1); LDKC2Tuple_PublicKeyTypeZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKC2Tuple_PublicKeyTypeZ"); @@ -15070,12 +16292,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningError LDKLightningError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = LightningError_clone(&e_conv); LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ"); *ret_conv = CResult_boolLightningErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_boolLightningErrorZ* o_conv = (LDKCResult_boolLightningErrorZ*)(o & ~1); + jboolean ret_val = CResult_boolLightningErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -15085,6 +16314,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1 CResult_boolLightningErrorZ_free(_res_conv); } +static inline uint64_t CResult_boolLightningErrorZ_clone_ptr(LDKCResult_boolLightningErrorZ *NONNULL_PTR arg) { + LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ"); + *ret_conv = CResult_boolLightningErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_boolLightningErrorZ* arg_conv = (LDKCResult_boolLightningErrorZ*)(arg & ~1); + int64_t ret_val = CResult_boolLightningErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_boolLightningErrorZ* orig_conv = (LDKCResult_boolLightningErrorZ*)(orig & ~1); LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ"); @@ -15092,6 +16332,17 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningError return (uint64_t)ret_conv; } +static inline uint64_t C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone_ptr(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR arg) { + LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ"); + *ret_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(arg); + return ((uint64_t)ret_conv); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* arg_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(arg & ~1); + int64_t ret_val = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* orig_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(orig & ~1); LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ"); @@ -15103,14 +16354,17 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncemen LDKChannelAnnouncement a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = (a & 1) || (a == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv = ChannelAnnouncement_clone(&a_conv); LDKChannelUpdate b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = (b & 1) || (b == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); b_conv = ChannelUpdate_clone(&b_conv); LDKChannelUpdate c_conv; c_conv.inner = (void*)(c & (~1)); c_conv.is_owned = (c & 1) || (c == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(c_conv); c_conv = ChannelUpdate_clone(&c_conv); LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ"); *ret_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(a_conv, b_conv, c_conv); @@ -15159,6 +16413,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1NodeAnnouncementZ_1free( LDKNodeAnnouncement _res_conv_18_conv; _res_conv_18_conv.inner = (void*)(_res_conv_18 & (~1)); _res_conv_18_conv.is_owned = (_res_conv_18 & 1) || (_res_conv_18 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_18_conv); _res_constr.data[s] = _res_conv_18_conv; } (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); @@ -15196,12 +16451,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandl LDKPeerHandleError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = PeerHandleError_clone(&e_conv); LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ"); *ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_CVec_u8ZPeerHandleErrorZ* o_conv = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)(o & ~1); + jboolean ret_val = CResult_CVec_u8ZPeerHandleErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -15211,6 +16473,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleEr CResult_CVec_u8ZPeerHandleErrorZ_free(_res_conv); } +static inline uint64_t CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr(LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR arg) { + LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ"); + *ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_CVec_u8ZPeerHandleErrorZ* arg_conv = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)(arg & ~1); + int64_t ret_val = CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_CVec_u8ZPeerHandleErrorZ* orig_conv = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)(orig & ~1); LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ"); @@ -15228,12 +16501,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErro LDKPeerHandleError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = PeerHandleError_clone(&e_conv); LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ"); *ret_conv = CResult_NonePeerHandleErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_NonePeerHandleErrorZ* o_conv = (LDKCResult_NonePeerHandleErrorZ*)(o & ~1); + jboolean ret_val = CResult_NonePeerHandleErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -15243,6 +16523,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_ CResult_NonePeerHandleErrorZ_free(_res_conv); } +static inline uint64_t CResult_NonePeerHandleErrorZ_clone_ptr(LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR arg) { + LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ"); + *ret_conv = CResult_NonePeerHandleErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_NonePeerHandleErrorZ* arg_conv = (LDKCResult_NonePeerHandleErrorZ*)(arg & ~1); + int64_t ret_val = CResult_NonePeerHandleErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_NonePeerHandleErrorZ* orig_conv = (LDKCResult_NonePeerHandleErrorZ*)(orig & ~1); LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ"); @@ -15260,12 +16551,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErro LDKPeerHandleError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = PeerHandleError_clone(&e_conv); LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ"); *ret_conv = CResult_boolPeerHandleErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_boolPeerHandleErrorZ* o_conv = (LDKCResult_boolPeerHandleErrorZ*)(o & ~1); + jboolean ret_val = CResult_boolPeerHandleErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -15275,6 +16573,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_ CResult_boolPeerHandleErrorZ_free(_res_conv); } +static inline uint64_t CResult_boolPeerHandleErrorZ_clone_ptr(LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR arg) { + LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ"); + *ret_conv = CResult_boolPeerHandleErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_boolPeerHandleErrorZ* arg_conv = (LDKCResult_boolPeerHandleErrorZ*)(arg & ~1); + int64_t ret_val = CResult_boolPeerHandleErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_boolPeerHandleErrorZ* orig_conv = (LDKCResult_boolPeerHandleErrorZ*)(orig & ~1); LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ"); @@ -15286,6 +16595,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ LDKNodeId o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = NodeId_clone(&o_conv); LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ"); *ret_conv = CResult_NodeIdDecodeErrorZ_ok(o_conv); @@ -15296,12 +16606,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ"); *ret_conv = CResult_NodeIdDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_NodeIdDecodeErrorZ* o_conv = (LDKCResult_NodeIdDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_NodeIdDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -15311,6 +16628,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1f CResult_NodeIdDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_NodeIdDecodeErrorZ_clone_ptr(LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ"); + *ret_conv = CResult_NodeIdDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_NodeIdDecodeErrorZ* arg_conv = (LDKCResult_NodeIdDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_NodeIdDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_NodeIdDecodeErrorZ* orig_conv = (LDKCResult_NodeIdDecodeErrorZ*)(orig & ~1); LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ"); @@ -15318,6 +16646,60 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ return (uint64_t)ret_conv; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = (void*)(((uint64_t)o) & ~1); + CHECK_ACCESS(o_ptr); + LDKCOption_NetworkUpdateZ o_conv = *(LDKCOption_NetworkUpdateZ*)(o_ptr); + o_conv = COption_NetworkUpdateZ_clone((LDKCOption_NetworkUpdateZ*)(((uint64_t)o) & ~1)); + LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ"); + *ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_ok(o_conv); + return (uint64_t)ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + LDKDecodeError e_conv; + e_conv.inner = (void*)(e & (~1)); + e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); + e_conv = DecodeError_clone(&e_conv); + LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ"); + *ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_err(e_conv); + return (uint64_t)ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_COption_NetworkUpdateZDecodeErrorZ* o_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_COption_NetworkUpdateZDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if ((_res & 1) != 0) return; + void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + CHECK_ACCESS(_res_ptr); + LDKCResult_COption_NetworkUpdateZDecodeErrorZ _res_conv = *(LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)(_res_ptr); + FREE((void*)_res); + CResult_COption_NetworkUpdateZDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_COption_NetworkUpdateZDecodeErrorZ_clone_ptr(LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ"); + *ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_COption_NetworkUpdateZDecodeErrorZ* arg_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_COption_NetworkUpdateZDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_COption_NetworkUpdateZDecodeErrorZ* orig_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)(orig & ~1); + LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ"); + *ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_clone(orig_conv); + return (uint64_t)ret_conv; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1AccessZ_1some(JNIEnv *env, jclass clz, int64_t o) { void* o_ptr = (void*)(((uint64_t)o) & ~1); CHECK_ACCESS(o_ptr); @@ -15352,6 +16734,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DirectionalChannel LDKDirectionalChannelInfo o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = DirectionalChannelInfo_clone(&o_conv); LDKCResult_DirectionalChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DirectionalChannelInfoDecodeErrorZ), "LDKCResult_DirectionalChannelInfoDecodeErrorZ"); *ret_conv = CResult_DirectionalChannelInfoDecodeErrorZ_ok(o_conv); @@ -15362,12 +16745,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DirectionalChannel LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_DirectionalChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DirectionalChannelInfoDecodeErrorZ), "LDKCResult_DirectionalChannelInfoDecodeErrorZ"); *ret_conv = CResult_DirectionalChannelInfoDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1DirectionalChannelInfoDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_DirectionalChannelInfoDecodeErrorZ* o_conv = (LDKCResult_DirectionalChannelInfoDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_DirectionalChannelInfoDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1DirectionalChannelInfoDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -15377,6 +16767,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1DirectionalChannelInf CResult_DirectionalChannelInfoDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_DirectionalChannelInfoDecodeErrorZ_clone_ptr(LDKCResult_DirectionalChannelInfoDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_DirectionalChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DirectionalChannelInfoDecodeErrorZ), "LDKCResult_DirectionalChannelInfoDecodeErrorZ"); + *ret_conv = CResult_DirectionalChannelInfoDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DirectionalChannelInfoDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_DirectionalChannelInfoDecodeErrorZ* arg_conv = (LDKCResult_DirectionalChannelInfoDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_DirectionalChannelInfoDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DirectionalChannelInfoDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_DirectionalChannelInfoDecodeErrorZ* orig_conv = (LDKCResult_DirectionalChannelInfoDecodeErrorZ*)(orig & ~1); LDKCResult_DirectionalChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DirectionalChannelInfoDecodeErrorZ), "LDKCResult_DirectionalChannelInfoDecodeErrorZ"); @@ -15388,6 +16789,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeE LDKChannelInfo o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = ChannelInfo_clone(&o_conv); LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ"); *ret_conv = CResult_ChannelInfoDecodeErrorZ_ok(o_conv); @@ -15398,12 +16800,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeE LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ"); *ret_conv = CResult_ChannelInfoDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_ChannelInfoDecodeErrorZ* o_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_ChannelInfoDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -15413,6 +16822,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErro CResult_ChannelInfoDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_ChannelInfoDecodeErrorZ_clone_ptr(LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ"); + *ret_conv = CResult_ChannelInfoDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_ChannelInfoDecodeErrorZ* arg_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_ChannelInfoDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_ChannelInfoDecodeErrorZ* orig_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)(orig & ~1); LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ"); @@ -15424,6 +16844,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeE LDKRoutingFees o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = RoutingFees_clone(&o_conv); LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ"); *ret_conv = CResult_RoutingFeesDecodeErrorZ_ok(o_conv); @@ -15434,12 +16855,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeE LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ"); *ret_conv = CResult_RoutingFeesDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_RoutingFeesDecodeErrorZ* o_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_RoutingFeesDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -15449,6 +16877,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErro CResult_RoutingFeesDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_RoutingFeesDecodeErrorZ_clone_ptr(LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ"); + *ret_conv = CResult_RoutingFeesDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_RoutingFeesDecodeErrorZ* arg_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_RoutingFeesDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_RoutingFeesDecodeErrorZ* orig_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)(orig & ~1); LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ"); @@ -15460,6 +16899,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementIn LDKNodeAnnouncementInfo o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = NodeAnnouncementInfo_clone(&o_conv); LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ"); *ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_ok(o_conv); @@ -15470,12 +16910,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementIn LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ"); *ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_NodeAnnouncementInfoDecodeErrorZ* o_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_NodeAnnouncementInfoDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -15485,6 +16932,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoD CResult_NodeAnnouncementInfoDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_NodeAnnouncementInfoDecodeErrorZ_clone_ptr(LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ"); + *ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_NodeAnnouncementInfoDecodeErrorZ* arg_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_NodeAnnouncementInfoDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_NodeAnnouncementInfoDecodeErrorZ* orig_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)(orig & ~1); LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ"); @@ -15512,6 +16970,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErro LDKNodeInfo o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = NodeInfo_clone(&o_conv); LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ"); *ret_conv = CResult_NodeInfoDecodeErrorZ_ok(o_conv); @@ -15522,12 +16981,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErro LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ"); *ret_conv = CResult_NodeInfoDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_NodeInfoDecodeErrorZ* o_conv = (LDKCResult_NodeInfoDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_NodeInfoDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -15537,6 +17003,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_ CResult_NodeInfoDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_NodeInfoDecodeErrorZ_clone_ptr(LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ"); + *ret_conv = CResult_NodeInfoDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_NodeInfoDecodeErrorZ* arg_conv = (LDKCResult_NodeInfoDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_NodeInfoDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_NodeInfoDecodeErrorZ* orig_conv = (LDKCResult_NodeInfoDecodeErrorZ*)(orig & ~1); LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ"); @@ -15548,6 +17025,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecode LDKNetworkGraph o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = NetworkGraph_clone(&o_conv); LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ"); *ret_conv = CResult_NetworkGraphDecodeErrorZ_ok(o_conv); @@ -15558,12 +17036,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecode LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ"); *ret_conv = CResult_NetworkGraphDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_NetworkGraphDecodeErrorZ* o_conv = (LDKCResult_NetworkGraphDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_NetworkGraphDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -15573,6 +17058,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErr CResult_NetworkGraphDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_NetworkGraphDecodeErrorZ_clone_ptr(LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ"); + *ret_conv = CResult_NetworkGraphDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_NetworkGraphDecodeErrorZ* arg_conv = (LDKCResult_NetworkGraphDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_NetworkGraphDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_NetworkGraphDecodeErrorZ* orig_conv = (LDKCResult_NetworkGraphDecodeErrorZ*)(orig & ~1); LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ"); @@ -15619,6 +17115,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1CVec_1NetAddressZZ_1f COption_CVec_NetAddressZZ_free(_res_conv); } +static inline uint64_t COption_CVec_NetAddressZZ_clone_ptr(LDKCOption_CVec_NetAddressZZ *NONNULL_PTR arg) { + LDKCOption_CVec_NetAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_NetAddressZZ), "LDKCOption_CVec_NetAddressZZ"); + *ret_copy = COption_CVec_NetAddressZZ_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1CVec_1NetAddressZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCOption_CVec_NetAddressZZ* arg_conv = (LDKCOption_CVec_NetAddressZZ*)arg; + int64_t ret_val = COption_CVec_NetAddressZZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1CVec_1NetAddressZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCOption_CVec_NetAddressZZ* orig_conv = (LDKCOption_CVec_NetAddressZZ*)orig; LDKCOption_CVec_NetAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_NetAddressZZ), "LDKCOption_CVec_NetAddressZZ"); @@ -15641,12 +17149,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeEr LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ"); *ret_conv = CResult_NetAddressDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_NetAddressDecodeErrorZ* o_conv = (LDKCResult_NetAddressDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_NetAddressDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -15656,6 +17171,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeError CResult_NetAddressDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_NetAddressDecodeErrorZ_clone_ptr(LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ"); + *ret_conv = CResult_NetAddressDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_NetAddressDecodeErrorZ* arg_conv = (LDKCResult_NetAddressDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_NetAddressDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_NetAddressDecodeErrorZ* orig_conv = (LDKCResult_NetAddressDecodeErrorZ*)(orig & ~1); LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ"); @@ -15676,6 +17202,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateAddHTLCZ_1free(JNI LDKUpdateAddHTLC _res_conv_15_conv; _res_conv_15_conv.inner = (void*)(_res_conv_15 & (~1)); _res_conv_15_conv.is_owned = (_res_conv_15 & 1) || (_res_conv_15 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_15_conv); _res_constr.data[p] = _res_conv_15_conv; } (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); @@ -15695,6 +17222,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateFulfillHTLCZ_1free LDKUpdateFulfillHTLC _res_conv_19_conv; _res_conv_19_conv.inner = (void*)(_res_conv_19 & (~1)); _res_conv_19_conv.is_owned = (_res_conv_19 & 1) || (_res_conv_19 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_19_conv); _res_constr.data[t] = _res_conv_19_conv; } (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); @@ -15714,6 +17242,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateFailHTLCZ_1free(JN LDKUpdateFailHTLC _res_conv_16_conv; _res_conv_16_conv.inner = (void*)(_res_conv_16 & (~1)); _res_conv_16_conv.is_owned = (_res_conv_16 & 1) || (_res_conv_16 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_16_conv); _res_constr.data[q] = _res_conv_16_conv; } (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); @@ -15733,6 +17262,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateFailMalformedHTLCZ LDKUpdateFailMalformedHTLC _res_conv_25_conv; _res_conv_25_conv.inner = (void*)(_res_conv_25 & (~1)); _res_conv_25_conv.is_owned = (_res_conv_25 & 1) || (_res_conv_25 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_25_conv); _res_constr.data[z] = _res_conv_25_conv; } (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); @@ -15743,6 +17273,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AcceptChannelDecod LDKAcceptChannel o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = AcceptChannel_clone(&o_conv); LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ"); *ret_conv = CResult_AcceptChannelDecodeErrorZ_ok(o_conv); @@ -15753,12 +17284,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AcceptChannelDecod LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ"); *ret_conv = CResult_AcceptChannelDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1AcceptChannelDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_AcceptChannelDecodeErrorZ* o_conv = (LDKCResult_AcceptChannelDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_AcceptChannelDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1AcceptChannelDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -15768,6 +17306,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1AcceptChannelDecodeEr CResult_AcceptChannelDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_AcceptChannelDecodeErrorZ_clone_ptr(LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ"); + *ret_conv = CResult_AcceptChannelDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AcceptChannelDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_AcceptChannelDecodeErrorZ* arg_conv = (LDKCResult_AcceptChannelDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_AcceptChannelDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AcceptChannelDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_AcceptChannelDecodeErrorZ* orig_conv = (LDKCResult_AcceptChannelDecodeErrorZ*)(orig & ~1); LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ"); @@ -15779,6 +17328,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AnnouncementSignat LDKAnnouncementSignatures o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = AnnouncementSignatures_clone(&o_conv); LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ"); *ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_ok(o_conv); @@ -15789,12 +17339,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AnnouncementSignat LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ"); *ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1AnnouncementSignaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_AnnouncementSignaturesDecodeErrorZ* o_conv = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_AnnouncementSignaturesDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1AnnouncementSignaturesDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -15804,6 +17361,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1AnnouncementSignature CResult_AnnouncementSignaturesDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_AnnouncementSignaturesDecodeErrorZ_clone_ptr(LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ"); + *ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AnnouncementSignaturesDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_AnnouncementSignaturesDecodeErrorZ* arg_conv = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_AnnouncementSignaturesDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AnnouncementSignaturesDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_AnnouncementSignaturesDecodeErrorZ* orig_conv = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)(orig & ~1); LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ"); @@ -15815,6 +17383,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReestablish LDKChannelReestablish o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = ChannelReestablish_clone(&o_conv); LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ"); *ret_conv = CResult_ChannelReestablishDecodeErrorZ_ok(o_conv); @@ -15825,12 +17394,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReestablish LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ"); *ret_conv = CResult_ChannelReestablishDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReestablishDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_ChannelReestablishDecodeErrorZ* o_conv = (LDKCResult_ChannelReestablishDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_ChannelReestablishDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReestablishDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -15840,6 +17416,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReestablishDec CResult_ChannelReestablishDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_ChannelReestablishDecodeErrorZ_clone_ptr(LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ"); + *ret_conv = CResult_ChannelReestablishDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReestablishDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_ChannelReestablishDecodeErrorZ* arg_conv = (LDKCResult_ChannelReestablishDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_ChannelReestablishDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReestablishDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_ChannelReestablishDecodeErrorZ* orig_conv = (LDKCResult_ChannelReestablishDecodeErrorZ*)(orig & ~1); LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ"); @@ -15851,6 +17438,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedDecod LDKClosingSigned o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = ClosingSigned_clone(&o_conv); LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ"); *ret_conv = CResult_ClosingSignedDecodeErrorZ_ok(o_conv); @@ -15861,12 +17449,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedDecod LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ"); *ret_conv = CResult_ClosingSignedDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_ClosingSignedDecodeErrorZ* o_conv = (LDKCResult_ClosingSignedDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_ClosingSignedDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -15876,6 +17471,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedDecodeEr CResult_ClosingSignedDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_ClosingSignedDecodeErrorZ_clone_ptr(LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ"); + *ret_conv = CResult_ClosingSignedDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_ClosingSignedDecodeErrorZ* arg_conv = (LDKCResult_ClosingSignedDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_ClosingSignedDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_ClosingSignedDecodeErrorZ* orig_conv = (LDKCResult_ClosingSignedDecodeErrorZ*)(orig & ~1); LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ"); @@ -15887,6 +17493,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedFeeRa LDKClosingSignedFeeRange o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = ClosingSignedFeeRange_clone(&o_conv); LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ"); *ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_ok(o_conv); @@ -15897,12 +17504,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedFeeRa LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ"); *ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedFeeRangeDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* o_conv = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_ClosingSignedFeeRangeDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedFeeRangeDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -15912,6 +17526,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedFeeRange CResult_ClosingSignedFeeRangeDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_ClosingSignedFeeRangeDecodeErrorZ_clone_ptr(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ"); + *ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedFeeRangeDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* arg_conv = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_ClosingSignedFeeRangeDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedFeeRangeDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* orig_conv = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)(orig & ~1); LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ"); @@ -15923,6 +17548,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedDe LDKCommitmentSigned o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = CommitmentSigned_clone(&o_conv); LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ"); *ret_conv = CResult_CommitmentSignedDecodeErrorZ_ok(o_conv); @@ -15933,12 +17559,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedDe LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ"); *ret_conv = CResult_CommitmentSignedDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_CommitmentSignedDecodeErrorZ* o_conv = (LDKCResult_CommitmentSignedDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_CommitmentSignedDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -15948,6 +17581,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedDecod CResult_CommitmentSignedDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_CommitmentSignedDecodeErrorZ_clone_ptr(LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ"); + *ret_conv = CResult_CommitmentSignedDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_CommitmentSignedDecodeErrorZ* arg_conv = (LDKCResult_CommitmentSignedDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_CommitmentSignedDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_CommitmentSignedDecodeErrorZ* orig_conv = (LDKCResult_CommitmentSignedDecodeErrorZ*)(orig & ~1); LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ"); @@ -15959,6 +17603,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingCreatedDeco LDKFundingCreated o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = FundingCreated_clone(&o_conv); LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ"); *ret_conv = CResult_FundingCreatedDecodeErrorZ_ok(o_conv); @@ -15969,12 +17614,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingCreatedDeco LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ"); *ret_conv = CResult_FundingCreatedDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1FundingCreatedDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_FundingCreatedDecodeErrorZ* o_conv = (LDKCResult_FundingCreatedDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_FundingCreatedDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1FundingCreatedDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -15984,6 +17636,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1FundingCreatedDecodeE CResult_FundingCreatedDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_FundingCreatedDecodeErrorZ_clone_ptr(LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ"); + *ret_conv = CResult_FundingCreatedDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingCreatedDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_FundingCreatedDecodeErrorZ* arg_conv = (LDKCResult_FundingCreatedDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_FundingCreatedDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingCreatedDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_FundingCreatedDecodeErrorZ* orig_conv = (LDKCResult_FundingCreatedDecodeErrorZ*)(orig & ~1); LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ"); @@ -15995,6 +17658,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingSignedDecod LDKFundingSigned o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = FundingSigned_clone(&o_conv); LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ"); *ret_conv = CResult_FundingSignedDecodeErrorZ_ok(o_conv); @@ -16005,12 +17669,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingSignedDecod LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ"); *ret_conv = CResult_FundingSignedDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1FundingSignedDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_FundingSignedDecodeErrorZ* o_conv = (LDKCResult_FundingSignedDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_FundingSignedDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1FundingSignedDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -16020,6 +17691,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1FundingSignedDecodeEr CResult_FundingSignedDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_FundingSignedDecodeErrorZ_clone_ptr(LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ"); + *ret_conv = CResult_FundingSignedDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingSignedDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_FundingSignedDecodeErrorZ* arg_conv = (LDKCResult_FundingSignedDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_FundingSignedDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingSignedDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_FundingSignedDecodeErrorZ* orig_conv = (LDKCResult_FundingSignedDecodeErrorZ*)(orig & ~1); LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ"); @@ -16031,6 +17713,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingLockedDecod LDKFundingLocked o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = FundingLocked_clone(&o_conv); LDKCResult_FundingLockedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingLockedDecodeErrorZ), "LDKCResult_FundingLockedDecodeErrorZ"); *ret_conv = CResult_FundingLockedDecodeErrorZ_ok(o_conv); @@ -16041,12 +17724,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingLockedDecod LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_FundingLockedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingLockedDecodeErrorZ), "LDKCResult_FundingLockedDecodeErrorZ"); *ret_conv = CResult_FundingLockedDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1FundingLockedDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_FundingLockedDecodeErrorZ* o_conv = (LDKCResult_FundingLockedDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_FundingLockedDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1FundingLockedDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -16056,6 +17746,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1FundingLockedDecodeEr CResult_FundingLockedDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_FundingLockedDecodeErrorZ_clone_ptr(LDKCResult_FundingLockedDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_FundingLockedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingLockedDecodeErrorZ), "LDKCResult_FundingLockedDecodeErrorZ"); + *ret_conv = CResult_FundingLockedDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingLockedDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_FundingLockedDecodeErrorZ* arg_conv = (LDKCResult_FundingLockedDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_FundingLockedDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingLockedDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_FundingLockedDecodeErrorZ* orig_conv = (LDKCResult_FundingLockedDecodeErrorZ*)(orig & ~1); LDKCResult_FundingLockedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingLockedDecodeErrorZ), "LDKCResult_FundingLockedDecodeErrorZ"); @@ -16067,6 +17768,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitDecodeErrorZ_1 LDKInit o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = Init_clone(&o_conv); LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ"); *ret_conv = CResult_InitDecodeErrorZ_ok(o_conv); @@ -16077,12 +17779,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitDecodeErrorZ_1 LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ"); *ret_conv = CResult_InitDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InitDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_InitDecodeErrorZ* o_conv = (LDKCResult_InitDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_InitDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InitDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -16092,6 +17801,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InitDecodeErrorZ_1fre CResult_InitDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_InitDecodeErrorZ_clone_ptr(LDKCResult_InitDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ"); + *ret_conv = CResult_InitDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_InitDecodeErrorZ* arg_conv = (LDKCResult_InitDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_InitDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_InitDecodeErrorZ* orig_conv = (LDKCResult_InitDecodeErrorZ*)(orig & ~1); LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ"); @@ -16103,6 +17823,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OpenChannelDecodeE LDKOpenChannel o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = OpenChannel_clone(&o_conv); LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ"); *ret_conv = CResult_OpenChannelDecodeErrorZ_ok(o_conv); @@ -16113,12 +17834,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OpenChannelDecodeE LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ"); *ret_conv = CResult_OpenChannelDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1OpenChannelDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_OpenChannelDecodeErrorZ* o_conv = (LDKCResult_OpenChannelDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_OpenChannelDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1OpenChannelDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -16128,6 +17856,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1OpenChannelDecodeErro CResult_OpenChannelDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_OpenChannelDecodeErrorZ_clone_ptr(LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ"); + *ret_conv = CResult_OpenChannelDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OpenChannelDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_OpenChannelDecodeErrorZ* arg_conv = (LDKCResult_OpenChannelDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_OpenChannelDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OpenChannelDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_OpenChannelDecodeErrorZ* orig_conv = (LDKCResult_OpenChannelDecodeErrorZ*)(orig & ~1); LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ"); @@ -16139,6 +17878,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RevokeAndACKDecode LDKRevokeAndACK o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = RevokeAndACK_clone(&o_conv); LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ"); *ret_conv = CResult_RevokeAndACKDecodeErrorZ_ok(o_conv); @@ -16149,12 +17889,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RevokeAndACKDecode LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ"); *ret_conv = CResult_RevokeAndACKDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RevokeAndACKDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_RevokeAndACKDecodeErrorZ* o_conv = (LDKCResult_RevokeAndACKDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_RevokeAndACKDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RevokeAndACKDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -16164,6 +17911,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RevokeAndACKDecodeErr CResult_RevokeAndACKDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_RevokeAndACKDecodeErrorZ_clone_ptr(LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ"); + *ret_conv = CResult_RevokeAndACKDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RevokeAndACKDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_RevokeAndACKDecodeErrorZ* arg_conv = (LDKCResult_RevokeAndACKDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_RevokeAndACKDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RevokeAndACKDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_RevokeAndACKDecodeErrorZ* orig_conv = (LDKCResult_RevokeAndACKDecodeErrorZ*)(orig & ~1); LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ"); @@ -16175,6 +17933,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownDecodeErro LDKShutdown o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = Shutdown_clone(&o_conv); LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ"); *ret_conv = CResult_ShutdownDecodeErrorZ_ok(o_conv); @@ -16185,12 +17944,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownDecodeErro LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ"); *ret_conv = CResult_ShutdownDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_ShutdownDecodeErrorZ* o_conv = (LDKCResult_ShutdownDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_ShutdownDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -16200,6 +17966,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownDecodeErrorZ_ CResult_ShutdownDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_ShutdownDecodeErrorZ_clone_ptr(LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ"); + *ret_conv = CResult_ShutdownDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_ShutdownDecodeErrorZ* arg_conv = (LDKCResult_ShutdownDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_ShutdownDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_ShutdownDecodeErrorZ* orig_conv = (LDKCResult_ShutdownDecodeErrorZ*)(orig & ~1); LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ"); @@ -16211,6 +17988,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailHTLCDeco LDKUpdateFailHTLC o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = UpdateFailHTLC_clone(&o_conv); LDKCResult_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ"); *ret_conv = CResult_UpdateFailHTLCDecodeErrorZ_ok(o_conv); @@ -16221,12 +17999,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailHTLCDeco LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ"); *ret_conv = CResult_UpdateFailHTLCDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailHTLCDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_UpdateFailHTLCDecodeErrorZ* o_conv = (LDKCResult_UpdateFailHTLCDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_UpdateFailHTLCDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailHTLCDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -16236,6 +18021,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailHTLCDecodeE CResult_UpdateFailHTLCDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_UpdateFailHTLCDecodeErrorZ_clone_ptr(LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ"); + *ret_conv = CResult_UpdateFailHTLCDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailHTLCDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_UpdateFailHTLCDecodeErrorZ* arg_conv = (LDKCResult_UpdateFailHTLCDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_UpdateFailHTLCDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailHTLCDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_UpdateFailHTLCDecodeErrorZ* orig_conv = (LDKCResult_UpdateFailHTLCDecodeErrorZ*)(orig & ~1); LDKCResult_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ"); @@ -16247,6 +18043,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailMalforme LDKUpdateFailMalformedHTLC o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = UpdateFailMalformedHTLC_clone(&o_conv); LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ"); *ret_conv = CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(o_conv); @@ -16257,12 +18054,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailMalforme LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ"); *ret_conv = CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailMalformedHTLCDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* o_conv = (LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_UpdateFailMalformedHTLCDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailMalformedHTLCDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -16272,6 +18076,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailMalformedHT CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone_ptr(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ"); + *ret_conv = CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailMalformedHTLCDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* arg_conv = (LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailMalformedHTLCDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* orig_conv = (LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)(orig & ~1); LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ"); @@ -16283,6 +18098,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFeeDecodeErr LDKUpdateFee o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = UpdateFee_clone(&o_conv); LDKCResult_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ"); *ret_conv = CResult_UpdateFeeDecodeErrorZ_ok(o_conv); @@ -16293,12 +18109,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFeeDecodeErr LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ"); *ret_conv = CResult_UpdateFeeDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFeeDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_UpdateFeeDecodeErrorZ* o_conv = (LDKCResult_UpdateFeeDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_UpdateFeeDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFeeDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -16308,6 +18131,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_UpdateFeeDecodeErrorZ_clone_ptr(LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ"); + *ret_conv = CResult_UpdateFeeDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFeeDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_UpdateFeeDecodeErrorZ* arg_conv = (LDKCResult_UpdateFeeDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_UpdateFeeDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFeeDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_UpdateFeeDecodeErrorZ* orig_conv = (LDKCResult_UpdateFeeDecodeErrorZ*)(orig & ~1); LDKCResult_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ"); @@ -16319,6 +18153,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFulfillHTLCD LDKUpdateFulfillHTLC o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = UpdateFulfillHTLC_clone(&o_conv); LDKCResult_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ"); *ret_conv = CResult_UpdateFulfillHTLCDecodeErrorZ_ok(o_conv); @@ -16329,12 +18164,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFulfillHTLCD LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ"); *ret_conv = CResult_UpdateFulfillHTLCDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFulfillHTLCDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_UpdateFulfillHTLCDecodeErrorZ* o_conv = (LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_UpdateFulfillHTLCDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFulfillHTLCDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -16344,6 +18186,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFulfillHTLCDeco CResult_UpdateFulfillHTLCDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_UpdateFulfillHTLCDecodeErrorZ_clone_ptr(LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ"); + *ret_conv = CResult_UpdateFulfillHTLCDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFulfillHTLCDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_UpdateFulfillHTLCDecodeErrorZ* arg_conv = (LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_UpdateFulfillHTLCDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFulfillHTLCDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_UpdateFulfillHTLCDecodeErrorZ* orig_conv = (LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)(orig & ~1); LDKCResult_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ"); @@ -16355,6 +18208,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateAddHTLCDecod LDKUpdateAddHTLC o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = UpdateAddHTLC_clone(&o_conv); LDKCResult_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ"); *ret_conv = CResult_UpdateAddHTLCDecodeErrorZ_ok(o_conv); @@ -16365,12 +18219,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateAddHTLCDecod LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ"); *ret_conv = CResult_UpdateAddHTLCDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateAddHTLCDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_UpdateAddHTLCDecodeErrorZ* o_conv = (LDKCResult_UpdateAddHTLCDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_UpdateAddHTLCDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateAddHTLCDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -16380,6 +18241,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateAddHTLCDecodeEr CResult_UpdateAddHTLCDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_UpdateAddHTLCDecodeErrorZ_clone_ptr(LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ"); + *ret_conv = CResult_UpdateAddHTLCDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateAddHTLCDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_UpdateAddHTLCDecodeErrorZ* arg_conv = (LDKCResult_UpdateAddHTLCDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_UpdateAddHTLCDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateAddHTLCDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_UpdateAddHTLCDecodeErrorZ* orig_conv = (LDKCResult_UpdateAddHTLCDecodeErrorZ*)(orig & ~1); LDKCResult_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ"); @@ -16391,6 +18263,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PingDecodeErrorZ_1 LDKPing o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = Ping_clone(&o_conv); LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ"); *ret_conv = CResult_PingDecodeErrorZ_ok(o_conv); @@ -16401,12 +18274,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PingDecodeErrorZ_1 LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ"); *ret_conv = CResult_PingDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PingDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_PingDecodeErrorZ* o_conv = (LDKCResult_PingDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_PingDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PingDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -16416,6 +18296,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PingDecodeErrorZ_1fre CResult_PingDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_PingDecodeErrorZ_clone_ptr(LDKCResult_PingDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ"); + *ret_conv = CResult_PingDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PingDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_PingDecodeErrorZ* arg_conv = (LDKCResult_PingDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_PingDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PingDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_PingDecodeErrorZ* orig_conv = (LDKCResult_PingDecodeErrorZ*)(orig & ~1); LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ"); @@ -16427,6 +18318,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PongDecodeErrorZ_1 LDKPong o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = Pong_clone(&o_conv); LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ"); *ret_conv = CResult_PongDecodeErrorZ_ok(o_conv); @@ -16437,12 +18329,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PongDecodeErrorZ_1 LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ"); *ret_conv = CResult_PongDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PongDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_PongDecodeErrorZ* o_conv = (LDKCResult_PongDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_PongDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PongDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -16452,6 +18351,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PongDecodeErrorZ_1fre CResult_PongDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_PongDecodeErrorZ_clone_ptr(LDKCResult_PongDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ"); + *ret_conv = CResult_PongDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PongDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_PongDecodeErrorZ* arg_conv = (LDKCResult_PongDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_PongDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PongDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_PongDecodeErrorZ* orig_conv = (LDKCResult_PongDecodeErrorZ*)(orig & ~1); LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ"); @@ -16463,6 +18373,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelAnn LDKUnsignedChannelAnnouncement o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = UnsignedChannelAnnouncement_clone(&o_conv); LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ"); *ret_conv = CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(o_conv); @@ -16473,12 +18384,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelAnn LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ"); *ret_conv = CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelAnnouncementDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* o_conv = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_UnsignedChannelAnnouncementDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelAnnouncementDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -16488,6 +18406,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelAnnoun CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone_ptr(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ"); + *ret_conv = CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelAnnouncementDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* arg_conv = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelAnnouncementDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* orig_conv = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)(orig & ~1); LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ"); @@ -16499,6 +18428,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelAnnouncemen LDKChannelAnnouncement o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = ChannelAnnouncement_clone(&o_conv); LDKCResult_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ"); *ret_conv = CResult_ChannelAnnouncementDecodeErrorZ_ok(o_conv); @@ -16509,12 +18439,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelAnnouncemen LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ"); *ret_conv = CResult_ChannelAnnouncementDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelAnnouncementDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_ChannelAnnouncementDecodeErrorZ* o_conv = (LDKCResult_ChannelAnnouncementDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_ChannelAnnouncementDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelAnnouncementDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -16524,6 +18461,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelAnnouncementDe CResult_ChannelAnnouncementDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_ChannelAnnouncementDecodeErrorZ_clone_ptr(LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ"); + *ret_conv = CResult_ChannelAnnouncementDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelAnnouncementDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_ChannelAnnouncementDecodeErrorZ* arg_conv = (LDKCResult_ChannelAnnouncementDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_ChannelAnnouncementDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelAnnouncementDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_ChannelAnnouncementDecodeErrorZ* orig_conv = (LDKCResult_ChannelAnnouncementDecodeErrorZ*)(orig & ~1); LDKCResult_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ"); @@ -16535,6 +18483,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelUpd LDKUnsignedChannelUpdate o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = UnsignedChannelUpdate_clone(&o_conv); LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ"); *ret_conv = CResult_UnsignedChannelUpdateDecodeErrorZ_ok(o_conv); @@ -16545,12 +18494,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelUpd LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ"); *ret_conv = CResult_UnsignedChannelUpdateDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelUpdateDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_UnsignedChannelUpdateDecodeErrorZ* o_conv = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_UnsignedChannelUpdateDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelUpdateDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -16560,6 +18516,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelUpdate CResult_UnsignedChannelUpdateDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_UnsignedChannelUpdateDecodeErrorZ_clone_ptr(LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ"); + *ret_conv = CResult_UnsignedChannelUpdateDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelUpdateDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_UnsignedChannelUpdateDecodeErrorZ* arg_conv = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_UnsignedChannelUpdateDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelUpdateDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_UnsignedChannelUpdateDecodeErrorZ* orig_conv = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)(orig & ~1); LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ"); @@ -16571,6 +18538,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateDecod LDKChannelUpdate o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = ChannelUpdate_clone(&o_conv); LDKCResult_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ"); *ret_conv = CResult_ChannelUpdateDecodeErrorZ_ok(o_conv); @@ -16581,12 +18549,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateDecod LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ"); *ret_conv = CResult_ChannelUpdateDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_ChannelUpdateDecodeErrorZ* o_conv = (LDKCResult_ChannelUpdateDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_ChannelUpdateDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -16596,6 +18571,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateDecodeEr CResult_ChannelUpdateDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_ChannelUpdateDecodeErrorZ_clone_ptr(LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ"); + *ret_conv = CResult_ChannelUpdateDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_ChannelUpdateDecodeErrorZ* arg_conv = (LDKCResult_ChannelUpdateDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_ChannelUpdateDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_ChannelUpdateDecodeErrorZ* orig_conv = (LDKCResult_ChannelUpdateDecodeErrorZ*)(orig & ~1); LDKCResult_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ"); @@ -16607,6 +18593,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ErrorMessageDecode LDKErrorMessage o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = ErrorMessage_clone(&o_conv); LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ"); *ret_conv = CResult_ErrorMessageDecodeErrorZ_ok(o_conv); @@ -16617,12 +18604,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ErrorMessageDecode LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ"); *ret_conv = CResult_ErrorMessageDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ErrorMessageDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_ErrorMessageDecodeErrorZ* o_conv = (LDKCResult_ErrorMessageDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_ErrorMessageDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ErrorMessageDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -16632,6 +18626,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ErrorMessageDecodeErr CResult_ErrorMessageDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_ErrorMessageDecodeErrorZ_clone_ptr(LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ"); + *ret_conv = CResult_ErrorMessageDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ErrorMessageDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_ErrorMessageDecodeErrorZ* arg_conv = (LDKCResult_ErrorMessageDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_ErrorMessageDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ErrorMessageDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_ErrorMessageDecodeErrorZ* orig_conv = (LDKCResult_ErrorMessageDecodeErrorZ*)(orig & ~1); LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ"); @@ -16643,6 +18648,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedNodeAnnoun LDKUnsignedNodeAnnouncement o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = UnsignedNodeAnnouncement_clone(&o_conv); LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ"); *ret_conv = CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(o_conv); @@ -16653,12 +18659,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedNodeAnnoun LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ"); *ret_conv = CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedNodeAnnouncementDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* o_conv = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_UnsignedNodeAnnouncementDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedNodeAnnouncementDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -16668,6 +18681,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedNodeAnnouncem CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone_ptr(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ"); + *ret_conv = CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedNodeAnnouncementDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* arg_conv = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedNodeAnnouncementDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* orig_conv = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)(orig & ~1); LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ"); @@ -16679,6 +18703,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementDe LDKNodeAnnouncement o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = NodeAnnouncement_clone(&o_conv); LDKCResult_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ"); *ret_conv = CResult_NodeAnnouncementDecodeErrorZ_ok(o_conv); @@ -16689,12 +18714,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementDe LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ"); *ret_conv = CResult_NodeAnnouncementDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_NodeAnnouncementDecodeErrorZ* o_conv = (LDKCResult_NodeAnnouncementDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_NodeAnnouncementDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -16704,6 +18736,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementDecod CResult_NodeAnnouncementDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_NodeAnnouncementDecodeErrorZ_clone_ptr(LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ"); + *ret_conv = CResult_NodeAnnouncementDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_NodeAnnouncementDecodeErrorZ* arg_conv = (LDKCResult_NodeAnnouncementDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_NodeAnnouncementDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_NodeAnnouncementDecodeErrorZ* orig_conv = (LDKCResult_NodeAnnouncementDecodeErrorZ*)(orig & ~1); LDKCResult_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ"); @@ -16715,6 +18758,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1QueryShortChannelI LDKQueryShortChannelIds o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = QueryShortChannelIds_clone(&o_conv); LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ"); *ret_conv = CResult_QueryShortChannelIdsDecodeErrorZ_ok(o_conv); @@ -16725,12 +18769,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1QueryShortChannelI LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ"); *ret_conv = CResult_QueryShortChannelIdsDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1QueryShortChannelIdsDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_QueryShortChannelIdsDecodeErrorZ* o_conv = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_QueryShortChannelIdsDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1QueryShortChannelIdsDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -16740,6 +18791,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1QueryShortChannelIdsD CResult_QueryShortChannelIdsDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_QueryShortChannelIdsDecodeErrorZ_clone_ptr(LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ"); + *ret_conv = CResult_QueryShortChannelIdsDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1QueryShortChannelIdsDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_QueryShortChannelIdsDecodeErrorZ* arg_conv = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_QueryShortChannelIdsDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1QueryShortChannelIdsDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_QueryShortChannelIdsDecodeErrorZ* orig_conv = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)(orig & ~1); LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ"); @@ -16751,6 +18813,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyShortChannelI LDKReplyShortChannelIdsEnd o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = ReplyShortChannelIdsEnd_clone(&o_conv); LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ"); *ret_conv = CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(o_conv); @@ -16761,12 +18824,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyShortChannelI LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ"); *ret_conv = CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyShortChannelIdsEndDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* o_conv = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_ReplyShortChannelIdsEndDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyShortChannelIdsEndDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -16776,6 +18846,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyShortChannelIdsE CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone_ptr(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ"); + *ret_conv = CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyShortChannelIdsEndDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* arg_conv = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyShortChannelIdsEndDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* orig_conv = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)(orig & ~1); LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ"); @@ -16787,6 +18868,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1QueryChannelRangeD LDKQueryChannelRange o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = QueryChannelRange_clone(&o_conv); LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ"); *ret_conv = CResult_QueryChannelRangeDecodeErrorZ_ok(o_conv); @@ -16797,12 +18879,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1QueryChannelRangeD LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ"); *ret_conv = CResult_QueryChannelRangeDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1QueryChannelRangeDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_QueryChannelRangeDecodeErrorZ* o_conv = (LDKCResult_QueryChannelRangeDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_QueryChannelRangeDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1QueryChannelRangeDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -16812,6 +18901,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1QueryChannelRangeDeco CResult_QueryChannelRangeDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_QueryChannelRangeDecodeErrorZ_clone_ptr(LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ"); + *ret_conv = CResult_QueryChannelRangeDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1QueryChannelRangeDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_QueryChannelRangeDecodeErrorZ* arg_conv = (LDKCResult_QueryChannelRangeDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_QueryChannelRangeDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1QueryChannelRangeDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_QueryChannelRangeDecodeErrorZ* orig_conv = (LDKCResult_QueryChannelRangeDecodeErrorZ*)(orig & ~1); LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ"); @@ -16823,6 +18923,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyChannelRangeD LDKReplyChannelRange o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = ReplyChannelRange_clone(&o_conv); LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ"); *ret_conv = CResult_ReplyChannelRangeDecodeErrorZ_ok(o_conv); @@ -16833,12 +18934,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyChannelRangeD LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ"); *ret_conv = CResult_ReplyChannelRangeDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyChannelRangeDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_ReplyChannelRangeDecodeErrorZ* o_conv = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_ReplyChannelRangeDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyChannelRangeDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -16848,6 +18956,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyChannelRangeDeco CResult_ReplyChannelRangeDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_ReplyChannelRangeDecodeErrorZ_clone_ptr(LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ"); + *ret_conv = CResult_ReplyChannelRangeDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyChannelRangeDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_ReplyChannelRangeDecodeErrorZ* arg_conv = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_ReplyChannelRangeDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyChannelRangeDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_ReplyChannelRangeDecodeErrorZ* orig_conv = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)(orig & ~1); LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ"); @@ -16859,6 +18978,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1GossipTimestampFil LDKGossipTimestampFilter o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = GossipTimestampFilter_clone(&o_conv); LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ"); *ret_conv = CResult_GossipTimestampFilterDecodeErrorZ_ok(o_conv); @@ -16869,12 +18989,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1GossipTimestampFil LDKDecodeError e_conv; e_conv.inner = (void*)(e & (~1)); e_conv.is_owned = (e & 1) || (e == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); e_conv = DecodeError_clone(&e_conv); LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ"); *ret_conv = CResult_GossipTimestampFilterDecodeErrorZ_err(e_conv); return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1GossipTimestampFilterDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_GossipTimestampFilterDecodeErrorZ* o_conv = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)(o & ~1); + jboolean ret_val = CResult_GossipTimestampFilterDecodeErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1GossipTimestampFilterDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -16884,6 +19011,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1GossipTimestampFilter CResult_GossipTimestampFilterDecodeErrorZ_free(_res_conv); } +static inline uint64_t CResult_GossipTimestampFilterDecodeErrorZ_clone_ptr(LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ"); + *ret_conv = CResult_GossipTimestampFilterDecodeErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1GossipTimestampFilterDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_GossipTimestampFilterDecodeErrorZ* arg_conv = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)(arg & ~1); + int64_t ret_val = CResult_GossipTimestampFilterDecodeErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1GossipTimestampFilterDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_GossipTimestampFilterDecodeErrorZ* orig_conv = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)(orig & ~1); LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ"); @@ -16895,6 +19033,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSignOrCreat LDKInvoice o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); o_conv = Invoice_clone(&o_conv); LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ"); *ret_conv = CResult_InvoiceSignOrCreationErrorZ_ok(o_conv); @@ -16911,6 +19050,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSignOrCreat return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSignOrCreationErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_InvoiceSignOrCreationErrorZ* o_conv = (LDKCResult_InvoiceSignOrCreationErrorZ*)(o & ~1); + jboolean ret_val = CResult_InvoiceSignOrCreationErrorZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSignOrCreationErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -16920,6 +19065,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSignOrCreation CResult_InvoiceSignOrCreationErrorZ_free(_res_conv); } +static inline uint64_t CResult_InvoiceSignOrCreationErrorZ_clone_ptr(LDKCResult_InvoiceSignOrCreationErrorZ *NONNULL_PTR arg) { + LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ"); + *ret_conv = CResult_InvoiceSignOrCreationErrorZ_clone(arg); + return (uint64_t)ret_conv; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSignOrCreationErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_InvoiceSignOrCreationErrorZ* arg_conv = (LDKCResult_InvoiceSignOrCreationErrorZ*)(arg & ~1); + int64_t ret_val = CResult_InvoiceSignOrCreationErrorZ_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSignOrCreationErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCResult_InvoiceSignOrCreationErrorZ* orig_conv = (LDKCResult_InvoiceSignOrCreationErrorZ*)(orig & ~1); LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ"); @@ -16961,6 +19117,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1LockedChannelMonit LDKLockedChannelMonitor o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = (o & 1) || (o == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); // Warning: we need a move here but no clone is available for LDKLockedChannelMonitor LDKCResult_LockedChannelMonitorNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_LockedChannelMonitorNoneZ), "LDKCResult_LockedChannelMonitorNoneZ"); *ret_conv = CResult_LockedChannelMonitorNoneZ_ok(o_conv); @@ -16973,6 +19130,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1LockedChannelMonit return (uint64_t)ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1LockedChannelMonitorNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_LockedChannelMonitorNoneZ* o_conv = (LDKCResult_LockedChannelMonitorNoneZ*)(o & ~1); + jboolean ret_val = CResult_LockedChannelMonitorNoneZ_is_ok(o_conv); + return ret_val; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1LockedChannelMonitorNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if ((_res & 1) != 0) return; void* _res_ptr = (void*)(((uint64_t)_res) & ~1); @@ -16995,6 +19158,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1OutPointZ_1free(JNIEnv * LDKOutPoint _res_conv_10_conv; _res_conv_10_conv.inner = (void*)(_res_conv_10 & (~1)); _res_conv_10_conv.is_owned = (_res_conv_10 & 1) || (_res_conv_10 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_10_conv); _res_constr.data[k] = _res_conv_10_conv; } (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); @@ -17010,6 +19174,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1free(JNIEnv *e PaymentPurpose_free(this_ptr_conv); } +static inline uint64_t PaymentPurpose_clone_ptr(LDKPaymentPurpose *NONNULL_PTR arg) { + LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose"); + *ret_copy = PaymentPurpose_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKPaymentPurpose* arg_conv = (LDKPaymentPurpose*)arg; + int64_t ret_val = PaymentPurpose_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKPaymentPurpose* orig_conv = (LDKPaymentPurpose*)orig; LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose"); @@ -17050,6 +19226,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosureReason_1free(JNIEnv *en ClosureReason_free(this_ptr_conv); } +static inline uint64_t ClosureReason_clone_ptr(LDKClosureReason *NONNULL_PTR arg) { + LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); + *ret_copy = ClosureReason_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKClosureReason* arg_conv = (LDKClosureReason*)arg; + int64_t ret_val = ClosureReason_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKClosureReason* orig_conv = (LDKClosureReason*)orig; LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); @@ -17118,6 +19306,16 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClosureReason_1write(JN return ret_arr; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ"); + *ret_conv = ClosureReason_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (uint64_t)ret_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; void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1); @@ -17127,6 +19325,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Event_1free(JNIEnv *env, jclas Event_free(this_ptr_conv); } +static inline uint64_t Event_clone_ptr(LDKEvent *NONNULL_PTR arg) { + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKEvent* arg_conv = (LDKEvent*)arg; + int64_t ret_val = Event_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKEvent* orig_conv = (LDKEvent*)orig; LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); @@ -17206,6 +19416,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1path_1faile LDKRouteHop path_conv_10_conv; path_conv_10_conv.inner = (void*)(path_conv_10 & (~1)); path_conv_10_conv.is_owned = (path_conv_10 & 1) || (path_conv_10 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv); path_conv_10_conv = RouteHop_clone(&path_conv_10_conv); path_constr.data[k] = path_conv_10_conv; } @@ -17217,6 +19428,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1path_1faile LDKRouteParameters retry_conv; retry_conv.inner = (void*)(retry & (~1)); retry_conv.is_owned = (retry & 1) || (retry == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(retry_conv); retry_conv = RouteParameters_clone(&retry_conv); LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); *ret_copy = Event_payment_path_failed(payment_id_ref, payment_hash_ref, rejected_by_dest, network_update_conv, all_paths_failed, path_constr, short_channel_id_conv, retry_conv); @@ -17303,6 +19515,16 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Event_1write(JNIEnv *en return ret_arr; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ"); + *ret_conv = Event_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (uint64_t)ret_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; void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1); @@ -17312,6 +19534,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1free(JNIEnv MessageSendEvent_free(this_ptr_conv); } +static inline uint64_t MessageSendEvent_clone_ptr(LDKMessageSendEvent *NONNULL_PTR arg) { + LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); + *ret_copy = MessageSendEvent_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKMessageSendEvent* arg_conv = (LDKMessageSendEvent*)arg; + int64_t ret_val = MessageSendEvent_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKMessageSendEvent* orig_conv = (LDKMessageSendEvent*)orig; LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); @@ -17327,6 +19561,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1acc LDKAcceptChannel msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = AcceptChannel_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_accept_channel(node_id_ref, msg_conv); @@ -17341,6 +19576,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1ope LDKOpenChannel msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = OpenChannel_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_open_channel(node_id_ref, msg_conv); @@ -17355,6 +19591,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1fun LDKFundingCreated msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = FundingCreated_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_funding_created(node_id_ref, msg_conv); @@ -17369,6 +19606,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1fun LDKFundingSigned msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = FundingSigned_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_funding_signed(node_id_ref, msg_conv); @@ -17383,6 +19621,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1fun LDKFundingLocked msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = FundingLocked_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_funding_locked(node_id_ref, msg_conv); @@ -17397,6 +19636,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1ann LDKAnnouncementSignatures msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = AnnouncementSignatures_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_announcement_signatures(node_id_ref, msg_conv); @@ -17411,6 +19651,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1update_1h LDKCommitmentUpdate updates_conv; updates_conv.inner = (void*)(updates & (~1)); updates_conv.is_owned = (updates & 1) || (updates == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(updates_conv); updates_conv = CommitmentUpdate_clone(&updates_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_update_htlcs(node_id_ref, updates_conv); @@ -17425,6 +19666,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1rev LDKRevokeAndACK msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = RevokeAndACK_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_revoke_and_ack(node_id_ref, msg_conv); @@ -17439,6 +19681,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1clo LDKClosingSigned msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = ClosingSigned_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_closing_signed(node_id_ref, msg_conv); @@ -17453,6 +19696,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1shu LDKShutdown msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = Shutdown_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_shutdown(node_id_ref, msg_conv); @@ -17467,6 +19711,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1cha LDKChannelReestablish msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = ChannelReestablish_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_channel_reestablish(node_id_ref, msg_conv); @@ -17478,10 +19723,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1broadcast LDKChannelAnnouncement msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = ChannelAnnouncement_clone(&msg_conv); LDKChannelUpdate update_msg_conv; update_msg_conv.inner = (void*)(update_msg & (~1)); update_msg_conv.is_owned = (update_msg & 1) || (update_msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_msg_conv); update_msg_conv = ChannelUpdate_clone(&update_msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_broadcast_channel_announcement(msg_conv, update_msg_conv); @@ -17493,6 +19740,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1broadcast LDKNodeAnnouncement msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = NodeAnnouncement_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_broadcast_node_announcement(msg_conv); @@ -17504,6 +19752,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1broadcast LDKChannelUpdate msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = ChannelUpdate_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_broadcast_channel_update(msg_conv); @@ -17518,6 +19767,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1cha LDKChannelUpdate msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = ChannelUpdate_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_channel_update(node_id_ref, msg_conv); @@ -17546,6 +19796,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1cha LDKQueryChannelRange msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = QueryChannelRange_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_channel_range_query(node_id_ref, msg_conv); @@ -17560,6 +19811,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1sho LDKQueryShortChannelIds msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = QueryShortChannelIds_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_short_ids_query(node_id_ref, msg_conv); @@ -17574,6 +19826,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1rep LDKReplyChannelRange msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = ReplyChannelRange_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_reply_channel_range(node_id_ref, msg_conv); @@ -17617,6 +19870,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_APIError_1free(JNIEnv *env, jc APIError_free(this_ptr_conv); } +static inline uint64_t APIError_clone_ptr(LDKAPIError *NONNULL_PTR arg) { + LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); + *ret_copy = APIError_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKAPIError* arg_conv = (LDKAPIError*)arg; + int64_t ret_val = APIError_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKAPIError* orig_conv = (LDKAPIError*)orig; LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); @@ -17668,6 +19933,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1incompatible_1shu LDKShutdownScript script_conv; script_conv.inner = (void*)(script & (~1)); script_conv.is_owned = (script & 1) || (script == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(script_conv); script_conv = ShutdownScript_clone(&script_conv); LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); *ret_copy = APIError_incompatible_shutdown_script(script_conv); @@ -17762,6 +20028,147 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1max(JNIEnv *env, jcla return ret_conv; } +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Record_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKRecord this_obj_conv; + this_obj_conv.inner = (void*)(this_obj & (~1)); + this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + Record_free(this_obj_conv); +} + +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Record_1get_1level(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + jclass ret_conv = LDKLevel_to_java(env, Record_get_level(&this_ptr_conv)); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Record_1set_1level(JNIEnv *env, jclass clz, int64_t this_ptr, jclass val) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKLevel val_conv = LDKLevel_from_java(env, val); + Record_set_level(&this_ptr_conv, val_conv); +} + +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Record_1get_1args(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKStr ret_str = Record_get_args(&this_ptr_conv); + jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Record_1set_1args(JNIEnv *env, jclass clz, int64_t this_ptr, jstring val) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKStr val_conv = java_to_owned_str(env, val); + Record_set_args(&this_ptr_conv, val_conv); +} + +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Record_1get_1module_1path(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKStr ret_str = Record_get_module_path(&this_ptr_conv); + jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Record_1set_1module_1path(JNIEnv *env, jclass clz, int64_t this_ptr, jstring val) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKStr val_conv = java_to_owned_str(env, val); + Record_set_module_path(&this_ptr_conv, val_conv); +} + +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Record_1get_1file(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKStr ret_str = Record_get_file(&this_ptr_conv); + jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Record_1set_1file(JNIEnv *env, jclass clz, int64_t this_ptr, jstring val) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + LDKStr val_conv = java_to_owned_str(env, val); + Record_set_file(&this_ptr_conv, val_conv); +} + +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_Record_1get_1line(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + int32_t ret_val = Record_get_line(&this_ptr_conv); + return ret_val; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Record_1set_1line(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = (void*)(this_ptr & (~1)); + this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + Record_set_line(&this_ptr_conv, val); +} + +static inline uint64_t Record_clone_ptr(LDKRecord *NONNULL_PTR arg) { + LDKRecord ret_var = Record_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_Record_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKRecord arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = Record_clone_ptr(&arg_conv); + return ret_val; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Record_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKRecord orig_conv; + orig_conv.inner = (void*)(orig & (~1)); + orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + LDKRecord ret_var = Record_clone(&orig_conv); + uint64_t ret_ref = 0; + 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = (uint64_t)ret_var.inner; + if (ret_var.is_owned) { + ret_ref |= 1; + } + return ret_ref; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Logger_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { if ((this_ptr & 1) != 0) return; void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1); @@ -17775,6 +20182,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1free(J LDKChannelHandshakeConfig this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ChannelHandshakeConfig_free(this_obj_conv); } @@ -17782,6 +20190,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get LDKChannelHandshakeConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = ChannelHandshakeConfig_get_minimum_depth(&this_ptr_conv); return ret_val; } @@ -17790,6 +20199,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1m LDKChannelHandshakeConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelHandshakeConfig_set_minimum_depth(&this_ptr_conv, val); } @@ -17797,6 +20207,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get LDKChannelHandshakeConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = ChannelHandshakeConfig_get_our_to_self_delay(&this_ptr_conv); return ret_val; } @@ -17805,6 +20216,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1o LDKChannelHandshakeConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelHandshakeConfig_set_our_to_self_delay(&this_ptr_conv, val); } @@ -17812,6 +20224,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get LDKChannelHandshakeConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ChannelHandshakeConfig_get_our_htlc_minimum_msat(&this_ptr_conv); return ret_val; } @@ -17820,6 +20233,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1o LDKChannelHandshakeConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelHandshakeConfig_set_our_htlc_minimum_msat(&this_ptr_conv, val); } @@ -17828,6 +20242,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1new uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -17835,14 +20250,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1new return ret_ref; } +static inline uint64_t ChannelHandshakeConfig_clone_ptr(LDKChannelHandshakeConfig *NONNULL_PTR arg) { + LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_ChannelHandshakeConfig_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChannelHandshakeConfig arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ChannelHandshakeConfig_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKChannelHandshakeConfig orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -17855,6 +20293,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1def uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -17866,6 +20305,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1free(J LDKChannelHandshakeLimits this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ChannelHandshakeLimits_free(this_obj_conv); } @@ -17873,6 +20313,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ChannelHandshakeLimits_get_min_funding_satoshis(&this_ptr_conv); return ret_val; } @@ -17881,6 +20322,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1m LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelHandshakeLimits_set_min_funding_satoshis(&this_ptr_conv, val); } @@ -17888,6 +20330,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ChannelHandshakeLimits_get_max_htlc_minimum_msat(&this_ptr_conv); return ret_val; } @@ -17896,6 +20339,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1m LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelHandshakeLimits_set_max_htlc_minimum_msat(&this_ptr_conv, val); } @@ -17903,6 +20347,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(&this_ptr_conv); return ret_val; } @@ -17911,6 +20356,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1m LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(&this_ptr_conv, val); } @@ -17918,6 +20364,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ChannelHandshakeLimits_get_max_channel_reserve_satoshis(&this_ptr_conv); return ret_val; } @@ -17926,6 +20373,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1m LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelHandshakeLimits_set_max_channel_reserve_satoshis(&this_ptr_conv, val); } @@ -17933,6 +20381,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = ChannelHandshakeLimits_get_min_max_accepted_htlcs(&this_ptr_conv); return ret_val; } @@ -17941,6 +20390,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1m LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelHandshakeLimits_set_min_max_accepted_htlcs(&this_ptr_conv, val); } @@ -17948,6 +20398,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = ChannelHandshakeLimits_get_max_minimum_depth(&this_ptr_conv); return ret_val; } @@ -17956,6 +20407,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1m LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelHandshakeLimits_set_max_minimum_depth(&this_ptr_conv, val); } @@ -17963,6 +20415,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1ge LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); jboolean ret_val = ChannelHandshakeLimits_get_force_announced_channel_preference(&this_ptr_conv); return ret_val; } @@ -17971,6 +20424,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1f LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelHandshakeLimits_set_force_announced_channel_preference(&this_ptr_conv, val); } @@ -17978,6 +20432,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = ChannelHandshakeLimits_get_their_to_self_delay(&this_ptr_conv); return ret_val; } @@ -17986,6 +20441,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1t LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelHandshakeLimits_set_their_to_self_delay(&this_ptr_conv, val); } @@ -17994,6 +20450,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1new uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18001,14 +20458,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1new return ret_ref; } +static inline uint64_t ChannelHandshakeLimits_clone_ptr(LDKChannelHandshakeLimits *NONNULL_PTR arg) { + LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_ChannelHandshakeLimits_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChannelHandshakeLimits arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ChannelHandshakeLimits_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKChannelHandshakeLimits orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18021,6 +20501,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1def uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18032,6 +20513,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1free(JNIEnv *en LDKChannelConfig this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ChannelConfig_free(this_obj_conv); } @@ -18039,6 +20521,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1forward LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = ChannelConfig_get_forwarding_fee_proportional_millionths(&this_ptr_conv); return ret_val; } @@ -18047,6 +20530,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1forwarding LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelConfig_set_forwarding_fee_proportional_millionths(&this_ptr_conv, val); } @@ -18054,6 +20538,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1forward LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = ChannelConfig_get_forwarding_fee_base_msat(&this_ptr_conv); return ret_val; } @@ -18062,6 +20547,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1forwarding LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelConfig_set_forwarding_fee_base_msat(&this_ptr_conv, val); } @@ -18069,6 +20555,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1cltv_1e LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = ChannelConfig_get_cltv_expiry_delta(&this_ptr_conv); return ret_val; } @@ -18077,6 +20564,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1cltv_1expi LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelConfig_set_cltv_expiry_delta(&this_ptr_conv, val); } @@ -18084,6 +20572,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1announ LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); jboolean ret_val = ChannelConfig_get_announced_channel(&this_ptr_conv); return ret_val; } @@ -18092,6 +20581,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1announced_ LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelConfig_set_announced_channel(&this_ptr_conv, val); } @@ -18099,6 +20589,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1commit LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); jboolean ret_val = ChannelConfig_get_commit_upfront_shutdown_pubkey(&this_ptr_conv); return ret_val; } @@ -18107,6 +20598,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1commit_1up LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelConfig_set_commit_upfront_shutdown_pubkey(&this_ptr_conv, val); } @@ -18114,6 +20606,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1max_1du LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ChannelConfig_get_max_dust_htlc_exposure_msat(&this_ptr_conv); return ret_val; } @@ -18122,6 +20615,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1max_1dust_ LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelConfig_set_max_dust_htlc_exposure_msat(&this_ptr_conv, val); } @@ -18129,6 +20623,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1force_1 LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ChannelConfig_get_force_close_avoidance_max_fee_satoshis(&this_ptr_conv); return ret_val; } @@ -18137,6 +20632,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1force_1clo LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelConfig_set_force_close_avoidance_max_fee_satoshis(&this_ptr_conv, val); } @@ -18145,6 +20641,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1new(JNIEnv * uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18152,14 +20649,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1new(JNIEnv * return ret_ref; } +static inline uint64_t ChannelConfig_clone_ptr(LDKChannelConfig *NONNULL_PTR arg) { + LDKChannelConfig ret_var = ChannelConfig_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_ChannelConfig_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChannelConfig arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ChannelConfig_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKChannelConfig orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelConfig ret_var = ChannelConfig_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18172,6 +20692,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1default(JNIE uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18183,6 +20704,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1write(JN LDKChannelConfig obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ChannelConfig_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -18204,6 +20726,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1free(JNIEnv *env, LDKUserConfig this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); UserConfig_free(this_obj_conv); } @@ -18211,10 +20734,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1own_1chann LDKUserConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelHandshakeConfig ret_var = UserConfig_get_own_channel_config(&this_ptr_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18226,9 +20751,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1own_1channel_ LDKUserConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelHandshakeConfig val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = ChannelHandshakeConfig_clone(&val_conv); UserConfig_set_own_channel_config(&this_ptr_conv, val_conv); } @@ -18237,10 +20764,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1peer_1chan LDKUserConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelHandshakeLimits ret_var = UserConfig_get_peer_channel_config_limits(&this_ptr_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18252,9 +20781,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1peer_1channel LDKUserConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelHandshakeLimits val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = ChannelHandshakeLimits_clone(&val_conv); UserConfig_set_peer_channel_config_limits(&this_ptr_conv, val_conv); } @@ -18263,10 +20794,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1channel_1o LDKUserConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelConfig ret_var = UserConfig_get_channel_options(&this_ptr_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18278,9 +20811,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1channel_1opti LDKUserConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelConfig val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = ChannelConfig_clone(&val_conv); UserConfig_set_channel_options(&this_ptr_conv, val_conv); } @@ -18289,6 +20824,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1accept_1f LDKUserConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); jboolean ret_val = UserConfig_get_accept_forwards_to_priv_channels(&this_ptr_conv); return ret_val; } @@ -18297,6 +20833,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1accept_1forwa LDKUserConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); UserConfig_set_accept_forwards_to_priv_channels(&this_ptr_conv, val); } @@ -18304,19 +20841,23 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1new(JNIEnv *env LDKChannelHandshakeConfig own_channel_config_arg_conv; own_channel_config_arg_conv.inner = (void*)(own_channel_config_arg & (~1)); own_channel_config_arg_conv.is_owned = (own_channel_config_arg & 1) || (own_channel_config_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(own_channel_config_arg_conv); own_channel_config_arg_conv = ChannelHandshakeConfig_clone(&own_channel_config_arg_conv); LDKChannelHandshakeLimits peer_channel_config_limits_arg_conv; peer_channel_config_limits_arg_conv.inner = (void*)(peer_channel_config_limits_arg & (~1)); peer_channel_config_limits_arg_conv.is_owned = (peer_channel_config_limits_arg & 1) || (peer_channel_config_limits_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(peer_channel_config_limits_arg_conv); peer_channel_config_limits_arg_conv = ChannelHandshakeLimits_clone(&peer_channel_config_limits_arg_conv); LDKChannelConfig channel_options_arg_conv; channel_options_arg_conv.inner = (void*)(channel_options_arg & (~1)); channel_options_arg_conv.is_owned = (channel_options_arg & 1) || (channel_options_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_options_arg_conv); channel_options_arg_conv = ChannelConfig_clone(&channel_options_arg_conv); LDKUserConfig ret_var = UserConfig_new(own_channel_config_arg_conv, peer_channel_config_limits_arg_conv, channel_options_arg_conv, accept_forwards_to_priv_channels_arg); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18324,14 +20865,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1new(JNIEnv *env return ret_ref; } +static inline uint64_t UserConfig_clone_ptr(LDKUserConfig *NONNULL_PTR arg) { + LDKUserConfig ret_var = UserConfig_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_UserConfig_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKUserConfig arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = UserConfig_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKUserConfig orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKUserConfig ret_var = UserConfig_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18344,6 +20908,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1default(JNIEnv uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18355,17 +20920,41 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BestBlock_1free(JNIEnv *env, j LDKBestBlock this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); BestBlock_free(this_obj_conv); } +static inline uint64_t BestBlock_clone_ptr(LDKBestBlock *NONNULL_PTR arg) { + LDKBestBlock ret_var = BestBlock_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_BestBlock_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKBestBlock arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = BestBlock_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BestBlock_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKBestBlock orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKBestBlock ret_var = BestBlock_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18379,6 +20968,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BestBlock_1from_1genesis(JN uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18394,6 +20984,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BestBlock_1new(JNIEnv *env, uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18405,6 +20996,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BestBlock_1block_1hash( LDKBestBlock this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, BestBlock_block_hash(&this_arg_conv).data); return ret_arr; @@ -18414,6 +21006,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_BestBlock_1height(JNIEnv *e LDKBestBlock this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int32_t ret_val = BestBlock_height(&this_arg_conv); return ret_val; } @@ -18499,6 +21092,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1free(JNIEnv *en LDKWatchedOutput this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); WatchedOutput_free(this_obj_conv); } @@ -18506,6 +21100,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1get_1blo LDKWatchedOutput this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, WatchedOutput_get_block_hash(&this_ptr_conv).data); return ret_arr; @@ -18515,6 +21110,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1set_1block_1has LDKWatchedOutput this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -18525,10 +21121,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1get_1outpoin LDKWatchedOutput this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKOutPoint ret_var = WatchedOutput_get_outpoint(&this_ptr_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18540,9 +21138,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1set_1outpoint(J LDKWatchedOutput this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKOutPoint val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = OutPoint_clone(&val_conv); WatchedOutput_set_outpoint(&this_ptr_conv, val_conv); } @@ -18551,6 +21151,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1get_1scr LDKWatchedOutput this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKu8slice ret_var = WatchedOutput_get_script_pubkey(&this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -18561,6 +21162,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1set_1script_1pu LDKWatchedOutput this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_u8Z val_ref; val_ref.datalen = (*env)->GetArrayLength(env, val); val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes"); @@ -18575,6 +21177,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1new(JNIEnv * LDKOutPoint outpoint_arg_conv; outpoint_arg_conv.inner = (void*)(outpoint_arg & (~1)); outpoint_arg_conv.is_owned = (outpoint_arg & 1) || (outpoint_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv); outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv); LDKCVec_u8Z script_pubkey_arg_ref; script_pubkey_arg_ref.datalen = (*env)->GetArrayLength(env, script_pubkey_arg); @@ -18584,6 +21187,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1new(JNIEnv * uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18591,14 +21195,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1new(JNIEnv * return ret_ref; } +static inline uint64_t WatchedOutput_clone_ptr(LDKWatchedOutput *NONNULL_PTR arg) { + LDKWatchedOutput ret_var = WatchedOutput_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_WatchedOutput_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKWatchedOutput arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = WatchedOutput_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKWatchedOutput orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKWatchedOutput ret_var = WatchedOutput_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18610,6 +21237,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1hash(JNIEnv LDKWatchedOutput o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); int64_t ret_val = WatchedOutput_hash(&o_conv); return ret_val; } @@ -18664,17 +21292,41 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MonitorUpdateId_1free(JNIEnv * LDKMonitorUpdateId this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); MonitorUpdateId_free(this_obj_conv); } +static inline uint64_t MonitorUpdateId_clone_ptr(LDKMonitorUpdateId *NONNULL_PTR arg) { + LDKMonitorUpdateId ret_var = MonitorUpdateId_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_MonitorUpdateId_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKMonitorUpdateId arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = MonitorUpdateId_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorUpdateId_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKMonitorUpdateId orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKMonitorUpdateId ret_var = MonitorUpdateId_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18686,6 +21338,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorUpdateId_1hash(JNIEn LDKMonitorUpdateId o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); int64_t ret_val = MonitorUpdateId_hash(&o_conv); return ret_val; } @@ -18694,9 +21347,11 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_MonitorUpdateId_1eq(JNIEnv LDKMonitorUpdateId a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKMonitorUpdateId b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = MonitorUpdateId_eq(&a_conv, &b_conv); return ret_val; } @@ -18714,6 +21369,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LockedChannelMonitor_1free(JNI LDKLockedChannelMonitor this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); LockedChannelMonitor_free(this_obj_conv); } @@ -18721,6 +21377,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1free(JNIEnv *env LDKChainMonitor this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ChainMonitor_free(this_obj_conv); } @@ -18768,6 +21425,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1new(JNIEnv *e uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18779,6 +21437,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1get_1cla LDKChainMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCVec_ChannelDetailsZ ignored_channels_constr; ignored_channels_constr.datalen = (*env)->GetArrayLength(env, ignored_channels); if (ignored_channels_constr.datalen > 0) @@ -18791,6 +21450,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1get_1cla LDKChannelDetails ignored_channels_conv_16_conv; ignored_channels_conv_16_conv.inner = (void*)(ignored_channels_conv_16 & (~1)); ignored_channels_conv_16_conv.is_owned = (ignored_channels_conv_16 & 1) || (ignored_channels_conv_16 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(ignored_channels_conv_16_conv); ignored_channels_conv_16_conv = ChannelDetails_clone(&ignored_channels_conv_16_conv); ignored_channels_constr.data[q] = ignored_channels_conv_16_conv; } @@ -18814,9 +21474,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1get_1monitor( LDKChainMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKOutPoint funding_txo_conv; funding_txo_conv.inner = (void*)(funding_txo & (~1)); funding_txo_conv.is_owned = (funding_txo & 1) || (funding_txo == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv); funding_txo_conv = OutPoint_clone(&funding_txo_conv); LDKCResult_LockedChannelMonitorNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_LockedChannelMonitorNoneZ), "LDKCResult_LockedChannelMonitorNoneZ"); *ret_conv = ChainMonitor_get_monitor(&this_arg_conv, funding_txo_conv); @@ -18827,6 +21489,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1list_1mo LDKChainMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCVec_OutPointZ ret_var = ChainMonitor_list_monitors(&this_arg_conv); int64_tArray ret_arr = NULL; ret_arr = (*env)->NewLongArray(env, ret_var.datalen); @@ -18836,6 +21499,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1list_1mo uint64_t ret_conv_10_ref = 0; CHECK((((uint64_t)ret_conv_10_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_conv_10_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_10_var); ret_conv_10_ref = (uint64_t)ret_conv_10_var.inner; if (ret_conv_10_var.is_owned) { ret_conv_10_ref |= 1; @@ -18851,13 +21515,16 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1channel_1moni LDKChainMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKOutPoint funding_txo_conv; funding_txo_conv.inner = (void*)(funding_txo & (~1)); funding_txo_conv.is_owned = (funding_txo & 1) || (funding_txo == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv); funding_txo_conv = OutPoint_clone(&funding_txo_conv); LDKMonitorUpdateId completed_update_id_conv; completed_update_id_conv.inner = (void*)(completed_update_id & (~1)); completed_update_id_conv.is_owned = (completed_update_id & 1) || (completed_update_id == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(completed_update_id_conv); completed_update_id_conv = MonitorUpdateId_clone(&completed_update_id_conv); LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); *ret_conv = ChainMonitor_channel_monitor_updated(&this_arg_conv, funding_txo_conv, completed_update_id_conv); @@ -18868,6 +21535,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1as_1Listen(JN LDKChainMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKListen* ret_ret = MALLOC(sizeof(LDKListen), "LDKListen"); *ret_ret = ChainMonitor_as_Listen(&this_arg_conv); return (uint64_t)ret_ret; @@ -18877,6 +21545,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1as_1Confirm(J LDKChainMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKConfirm* ret_ret = MALLOC(sizeof(LDKConfirm), "LDKConfirm"); *ret_ret = ChainMonitor_as_Confirm(&this_arg_conv); return (uint64_t)ret_ret; @@ -18886,6 +21555,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1as_1Watch(JNI LDKChainMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKWatch* ret_ret = MALLOC(sizeof(LDKWatch), "LDKWatch"); *ret_ret = ChainMonitor_as_Watch(&this_arg_conv); return (uint64_t)ret_ret; @@ -18895,6 +21565,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1as_1EventsPro LDKChainMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKEventsProvider* ret_ret = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider"); *ret_ret = ChainMonitor_as_EventsProvider(&this_arg_conv); return (uint64_t)ret_ret; @@ -18904,6 +21575,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1free(JNI LDKChannelMonitorUpdate this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ChannelMonitorUpdate_free(this_obj_conv); } @@ -18911,6 +21583,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1get_1 LDKChannelMonitorUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ChannelMonitorUpdate_get_update_id(&this_ptr_conv); return ret_val; } @@ -18919,17 +21592,41 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1set_1upd LDKChannelMonitorUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelMonitorUpdate_set_update_id(&this_ptr_conv, val); } +static inline uint64_t ChannelMonitorUpdate_clone_ptr(LDKChannelMonitorUpdate *NONNULL_PTR arg) { + LDKChannelMonitorUpdate ret_var = ChannelMonitorUpdate_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_ChannelMonitorUpdate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChannelMonitorUpdate arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ChannelMonitorUpdate_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKChannelMonitorUpdate orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelMonitorUpdate ret_var = ChannelMonitorUpdate_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18941,6 +21638,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1w LDKChannelMonitorUpdate obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ChannelMonitorUpdate_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -18962,6 +21660,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MonitorUpdateError_1free(JNIEn LDKMonitorUpdateError this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); MonitorUpdateError_free(this_obj_conv); } @@ -18969,6 +21668,7 @@ JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_MonitorUpdateError_1get_1a( LDKMonitorUpdateError this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKStr ret_str = MonitorUpdateError_get_a(&this_ptr_conv); jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); Str_free(ret_str); @@ -18979,6 +21679,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MonitorUpdateError_1set_1a(JNI LDKMonitorUpdateError this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKStr val_conv = java_to_owned_str(env, val); MonitorUpdateError_set_a(&this_ptr_conv, val_conv); } @@ -18989,6 +21690,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorUpdateError_1new(JNI uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -18996,14 +21698,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorUpdateError_1new(JNI return ret_ref; } +static inline uint64_t MonitorUpdateError_clone_ptr(LDKMonitorUpdateError *NONNULL_PTR arg) { + LDKMonitorUpdateError ret_var = MonitorUpdateError_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_MonitorUpdateError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKMonitorUpdateError arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = MonitorUpdateError_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorUpdateError_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKMonitorUpdateError orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKMonitorUpdateError ret_var = MonitorUpdateError_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -19020,6 +21745,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1free(JNIEnv *env MonitorEvent_free(this_ptr_conv); } +static inline uint64_t MonitorEvent_clone_ptr(LDKMonitorEvent *NONNULL_PTR arg) { + LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); + *ret_copy = MonitorEvent_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKMonitorEvent* arg_conv = (LDKMonitorEvent*)arg; + int64_t ret_val = MonitorEvent_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKMonitorEvent* orig_conv = (LDKMonitorEvent*)orig; LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); @@ -19032,6 +21769,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1htlcevent(JNI LDKHTLCUpdate a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = (a & 1) || (a == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv = HTLCUpdate_clone(&a_conv); LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); *ret_copy = MonitorEvent_htlcevent(a_conv); @@ -19043,6 +21781,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1commitment_1t LDKOutPoint a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = (a & 1) || (a == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv = OutPoint_clone(&a_conv); LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); *ret_copy = MonitorEvent_commitment_tx_confirmed(a_conv); @@ -19054,6 +21793,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1update_1compl LDKOutPoint funding_txo_conv; funding_txo_conv.inner = (void*)(funding_txo & (~1)); funding_txo_conv.is_owned = (funding_txo & 1) || (funding_txo == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv); funding_txo_conv = OutPoint_clone(&funding_txo_conv); LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); *ret_copy = MonitorEvent_update_completed(funding_txo_conv, monitor_update_id); @@ -19065,6 +21805,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1update_1faile LDKOutPoint a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = (a & 1) || (a == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv = OutPoint_clone(&a_conv); LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); *ret_copy = MonitorEvent_update_failed(a_conv); @@ -19081,21 +21822,55 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1write(JNI return ret_arr; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ"); + *ret_conv = MonitorEvent_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (uint64_t)ret_conv; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1free(JNIEnv *env, jclass clz, int64_t this_obj) { LDKHTLCUpdate this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); HTLCUpdate_free(this_obj_conv); } +static inline uint64_t HTLCUpdate_clone_ptr(LDKHTLCUpdate *NONNULL_PTR arg) { + LDKHTLCUpdate ret_var = HTLCUpdate_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_HTLCUpdate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKHTLCUpdate arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = HTLCUpdate_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKHTLCUpdate orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKHTLCUpdate ret_var = HTLCUpdate_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -19107,6 +21882,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1write(JNIEn LDKHTLCUpdate obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = HTLCUpdate_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -19133,6 +21909,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Balance_1free(JNIEnv *env, jcl Balance_free(this_ptr_conv); } +static inline uint64_t Balance_clone_ptr(LDKBalance *NONNULL_PTR arg) { + LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); + *ret_copy = Balance_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Balance_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKBalance* arg_conv = (LDKBalance*)arg; + int64_t ret_val = Balance_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Balance_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKBalance* orig_conv = (LDKBalance*)orig; LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); @@ -19180,17 +21968,41 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1free(JNIEnv *e LDKChannelMonitor this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ChannelMonitor_free(this_obj_conv); } +static inline uint64_t ChannelMonitor_clone_ptr(LDKChannelMonitor *NONNULL_PTR arg) { + LDKChannelMonitor ret_var = ChannelMonitor_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_ChannelMonitor_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChannelMonitor arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ChannelMonitor_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKChannelMonitor orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelMonitor ret_var = ChannelMonitor_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -19202,6 +22014,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1write(J LDKChannelMonitor obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ChannelMonitor_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -19213,9 +22026,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1update_1mon LDKChannelMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKChannelMonitorUpdate updates_conv; updates_conv.inner = (void*)(updates & (~1)); updates_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(updates_conv); void* broadcaster_ptr = (void*)(((uint64_t)broadcaster) & ~1); if (!(broadcaster & 1)) { CHECK_ACCESS(broadcaster_ptr); } LDKBroadcasterInterface* broadcaster_conv = (LDKBroadcasterInterface*)broadcaster_ptr; @@ -19234,6 +22049,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1latest LDKChannelMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int64_t ret_val = ChannelMonitor_get_latest_update_id(&this_arg_conv); return ret_val; } @@ -19242,6 +22058,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1fundin LDKChannelMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKC2Tuple_OutPointScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ"); *ret_conv = ChannelMonitor_get_funding_txo(&this_arg_conv); return ((uint64_t)ret_conv); @@ -19251,6 +22068,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1o LDKChannelMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ ret_var = ChannelMonitor_get_outputs_to_watch(&this_arg_conv); int64_tArray ret_arr = NULL; ret_arr = (*env)->NewLongArray(env, ret_var.datalen); @@ -19269,6 +22087,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1load_1outputs_ LDKChannelMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); void* filter_ptr = (void*)(((uint64_t)filter) & ~1); if (!(filter & 1)) { CHECK_ACCESS(filter_ptr); } LDKFilter* filter_conv = (LDKFilter*)filter_ptr; @@ -19279,6 +22098,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1a LDKChannelMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCVec_MonitorEventZ ret_var = ChannelMonitor_get_and_clear_pending_monitor_events(&this_arg_conv); int64_tArray ret_arr = NULL; ret_arr = (*env)->NewLongArray(env, ret_var.datalen); @@ -19298,6 +22118,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1a LDKChannelMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCVec_EventZ ret_var = ChannelMonitor_get_and_clear_pending_events(&this_arg_conv); int64_tArray ret_arr = NULL; ret_arr = (*env)->NewLongArray(env, ret_var.datalen); @@ -19317,6 +22138,7 @@ JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1l LDKChannelMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); void* logger_ptr = (void*)(((uint64_t)logger) & ~1); if (!(logger & 1)) { CHECK_ACCESS(logger_ptr); } LDKLogger* logger_conv = (LDKLogger*)logger_ptr; @@ -19340,6 +22162,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1block_ LDKChannelMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char header_arr[80]; CHECK((*env)->GetArrayLength(env, header) == 80); (*env)->GetByteArrayRegion(env, header, 0, 80, header_arr); @@ -19399,6 +22222,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1block_1disconn LDKChannelMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char header_arr[80]; CHECK((*env)->GetArrayLength(env, header) == 80); (*env)->GetByteArrayRegion(env, header, 0, 80, header_arr); @@ -19431,6 +22255,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1transa LDKChannelMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char header_arr[80]; CHECK((*env)->GetArrayLength(env, header) == 80); (*env)->GetByteArrayRegion(env, header, 0, 80, header_arr); @@ -19490,6 +22315,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1transaction_1u LDKChannelMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char txid_arr[32]; CHECK((*env)->GetArrayLength(env, txid) == 32); (*env)->GetByteArrayRegion(env, txid, 0, 32, txid_arr); @@ -19522,6 +22348,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1best_1 LDKChannelMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char header_arr[80]; CHECK((*env)->GetArrayLength(env, header) == 80); (*env)->GetByteArrayRegion(env, header, 0, 80, header_arr); @@ -19565,6 +22392,7 @@ JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1r LDKChannelMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCVec_TxidZ ret_var = ChannelMonitor_get_relevant_txids(&this_arg_conv); jobjectArray ret_arr = NULL; ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL); @@ -19583,10 +22411,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1current_1be LDKChannelMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKBestBlock ret_var = ChannelMonitor_current_best_block(&this_arg_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -19598,6 +22428,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1c LDKChannelMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCVec_BalanceZ ret_var = ChannelMonitor_get_claimable_balances(&this_arg_conv); int64_tArray ret_arr = NULL; ret_arr = (*env)->NewLongArray(env, ret_var.datalen); @@ -19630,6 +22461,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OutPoint_1free(JNIEnv *env, jc LDKOutPoint this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); OutPoint_free(this_obj_conv); } @@ -19637,6 +22469,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OutPoint_1get_1txid(JNI LDKOutPoint this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *OutPoint_get_txid(&this_ptr_conv)); return ret_arr; @@ -19646,6 +22479,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OutPoint_1set_1txid(JNIEnv *en LDKOutPoint this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -19656,6 +22490,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_OutPoint_1get_1index(JNIEnv LDKOutPoint this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = OutPoint_get_index(&this_ptr_conv); return ret_val; } @@ -19664,6 +22499,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OutPoint_1set_1index(JNIEnv *e LDKOutPoint this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); OutPoint_set_index(&this_ptr_conv, val); } @@ -19675,6 +22511,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OutPoint_1new(JNIEnv *env, uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -19682,14 +22519,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OutPoint_1new(JNIEnv *env, return ret_ref; } +static inline uint64_t OutPoint_clone_ptr(LDKOutPoint *NONNULL_PTR arg) { + LDKOutPoint ret_var = OutPoint_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_OutPoint_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKOutPoint arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = OutPoint_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OutPoint_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKOutPoint orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKOutPoint ret_var = OutPoint_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -19701,9 +22561,11 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_OutPoint_1eq(JNIEnv *env, LDKOutPoint a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKOutPoint b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = OutPoint_eq(&a_conv, &b_conv); return ret_val; } @@ -19712,6 +22574,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OutPoint_1hash(JNIEnv *env, LDKOutPoint o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); int64_t ret_val = OutPoint_hash(&o_conv); return ret_val; } @@ -19720,6 +22583,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OutPoint_1to_1channel_1 LDKOutPoint this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, OutPoint_to_channel_id(&this_arg_conv).data); return ret_arr; @@ -19729,6 +22593,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OutPoint_1write(JNIEnv LDKOutPoint obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = OutPoint_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -19750,6 +22615,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor LDKDelayedPaymentOutputDescriptor this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); DelayedPaymentOutputDescriptor_free(this_obj_conv); } @@ -19757,10 +22623,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescrip LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKOutPoint ret_var = DelayedPaymentOutputDescriptor_get_outpoint(&this_ptr_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -19772,9 +22640,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKOutPoint val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = OutPoint_clone(&val_conv); DelayedPaymentOutputDescriptor_set_outpoint(&this_ptr_conv, val_conv); } @@ -19783,6 +22653,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDes LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, DelayedPaymentOutputDescriptor_get_per_commitment_point(&this_ptr_conv).compressed_form); return ret_arr; @@ -19792,6 +22663,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -19802,6 +22674,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescrip LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = DelayedPaymentOutputDescriptor_get_to_self_delay(&this_ptr_conv); return ret_val; } @@ -19810,6 +22683,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); DelayedPaymentOutputDescriptor_set_to_self_delay(&this_ptr_conv, val); } @@ -19817,6 +22691,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKTxOut val_conv = *(LDKTxOut*)(val_ptr); @@ -19828,6 +22703,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDes LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, DelayedPaymentOutputDescriptor_get_revocation_pubkey(&this_ptr_conv).compressed_form); return ret_arr; @@ -19837,6 +22713,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -19847,6 +22724,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDes LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *DelayedPaymentOutputDescriptor_get_channel_keys_id(&this_ptr_conv)); return ret_arr; @@ -19856,6 +22734,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -19866,6 +22745,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescrip LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = DelayedPaymentOutputDescriptor_get_channel_value_satoshis(&this_ptr_conv); return ret_val; } @@ -19874,6 +22754,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor LDKDelayedPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); DelayedPaymentOutputDescriptor_set_channel_value_satoshis(&this_ptr_conv, val); } @@ -19881,6 +22762,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescrip LDKOutPoint outpoint_arg_conv; outpoint_arg_conv.inner = (void*)(outpoint_arg & (~1)); outpoint_arg_conv.is_owned = (outpoint_arg & 1) || (outpoint_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv); outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv); LDKPublicKey per_commitment_point_arg_ref; CHECK((*env)->GetArrayLength(env, per_commitment_point_arg) == 33); @@ -19899,6 +22781,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescrip uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -19906,14 +22789,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescrip return ret_ref; } +static inline uint64_t DelayedPaymentOutputDescriptor_clone_ptr(LDKDelayedPaymentOutputDescriptor *NONNULL_PTR arg) { + LDKDelayedPaymentOutputDescriptor ret_var = DelayedPaymentOutputDescriptor_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_DelayedPaymentOutputDescriptor_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKDelayedPaymentOutputDescriptor arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = DelayedPaymentOutputDescriptor_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKDelayedPaymentOutputDescriptor orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKDelayedPaymentOutputDescriptor ret_var = DelayedPaymentOutputDescriptor_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -19925,6 +22831,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDes LDKDelayedPaymentOutputDescriptor obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = DelayedPaymentOutputDescriptor_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -19946,6 +22853,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_ LDKStaticPaymentOutputDescriptor this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); StaticPaymentOutputDescriptor_free(this_obj_conv); } @@ -19953,10 +22861,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescript LDKStaticPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKOutPoint ret_var = StaticPaymentOutputDescriptor_get_outpoint(&this_ptr_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -19968,9 +22878,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_ LDKStaticPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKOutPoint val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = OutPoint_clone(&val_conv); StaticPaymentOutputDescriptor_set_outpoint(&this_ptr_conv, val_conv); } @@ -19979,6 +22891,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_ LDKStaticPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKTxOut val_conv = *(LDKTxOut*)(val_ptr); @@ -19990,6 +22903,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDesc LDKStaticPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *StaticPaymentOutputDescriptor_get_channel_keys_id(&this_ptr_conv)); return ret_arr; @@ -19999,6 +22913,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_ LDKStaticPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -20009,6 +22924,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescript LDKStaticPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = StaticPaymentOutputDescriptor_get_channel_value_satoshis(&this_ptr_conv); return ret_val; } @@ -20017,6 +22933,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_ LDKStaticPaymentOutputDescriptor this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); StaticPaymentOutputDescriptor_set_channel_value_satoshis(&this_ptr_conv, val); } @@ -20024,6 +22941,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescript LDKOutPoint outpoint_arg_conv; outpoint_arg_conv.inner = (void*)(outpoint_arg & (~1)); outpoint_arg_conv.is_owned = (outpoint_arg & 1) || (outpoint_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv); outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv); void* output_arg_ptr = (void*)(((uint64_t)output_arg) & ~1); CHECK_ACCESS(output_arg_ptr); @@ -20036,6 +22954,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescript uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20043,14 +22962,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescript return ret_ref; } +static inline uint64_t StaticPaymentOutputDescriptor_clone_ptr(LDKStaticPaymentOutputDescriptor *NONNULL_PTR arg) { + LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_StaticPaymentOutputDescriptor_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKStaticPaymentOutputDescriptor arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = StaticPaymentOutputDescriptor_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKStaticPaymentOutputDescriptor orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20062,6 +23004,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDesc LDKStaticPaymentOutputDescriptor obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = StaticPaymentOutputDescriptor_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -20088,6 +23031,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1fre SpendableOutputDescriptor_free(this_ptr_conv); } +static inline uint64_t SpendableOutputDescriptor_clone_ptr(LDKSpendableOutputDescriptor *NONNULL_PTR arg) { + LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); + *ret_copy = SpendableOutputDescriptor_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKSpendableOutputDescriptor* arg_conv = (LDKSpendableOutputDescriptor*)arg; + int64_t ret_val = SpendableOutputDescriptor_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKSpendableOutputDescriptor* orig_conv = (LDKSpendableOutputDescriptor*)orig; LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); @@ -20100,6 +23055,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1 LDKOutPoint outpoint_conv; outpoint_conv.inner = (void*)(outpoint & (~1)); outpoint_conv.is_owned = (outpoint & 1) || (outpoint == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_conv); outpoint_conv = OutPoint_clone(&outpoint_conv); void* output_ptr = (void*)(((uint64_t)output) & ~1); CHECK_ACCESS(output_ptr); @@ -20115,6 +23071,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1 LDKDelayedPaymentOutputDescriptor a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = (a & 1) || (a == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv = DelayedPaymentOutputDescriptor_clone(&a_conv); LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); *ret_copy = SpendableOutputDescriptor_delayed_payment_output(a_conv); @@ -20126,6 +23083,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1 LDKStaticPaymentOutputDescriptor a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = (a & 1) || (a == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv = StaticPaymentOutputDescriptor_clone(&a_conv); LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); *ret_copy = SpendableOutputDescriptor_static_payment_output(a_conv); @@ -20161,6 +23119,19 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BaseSign_1free(JNIEnv *env, jc BaseSign_free(this_ptr_conv); } +static inline uint64_t Sign_clone_ptr(LDKSign *NONNULL_PTR arg) { + LDKSign* ret_ret = MALLOC(sizeof(LDKSign), "LDKSign"); + *ret_ret = Sign_clone(arg); + return (uint64_t)ret_ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Sign_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + void* arg_ptr = (void*)(((uint64_t)arg) & ~1); + if (!(arg & 1)) { CHECK_ACCESS(arg_ptr); } + LDKSign* arg_conv = (LDKSign*)arg_ptr; + int64_t ret_val = Sign_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Sign_1clone(JNIEnv *env, jclass clz, int64_t orig) { void* orig_ptr = (void*)(((uint64_t)orig) & ~1); if (!(orig & 1)) { CHECK_ACCESS(orig_ptr); } @@ -20192,6 +23163,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1free(JNIEnv *e LDKInMemorySigner this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); InMemorySigner_free(this_obj_conv); } @@ -20199,6 +23171,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1fu LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_funding_key(&this_ptr_conv)); return ret_arr; @@ -20208,6 +23181,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1funding_1 LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSecretKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.bytes); @@ -20218,6 +23192,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1re LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_revocation_base_key(&this_ptr_conv)); return ret_arr; @@ -20227,6 +23202,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1revocatio LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSecretKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.bytes); @@ -20237,6 +23213,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1pa LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_payment_key(&this_ptr_conv)); return ret_arr; @@ -20246,6 +23223,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1payment_1 LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSecretKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.bytes); @@ -20256,6 +23234,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1de LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_delayed_payment_base_key(&this_ptr_conv)); return ret_arr; @@ -20265,6 +23244,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1delayed_1 LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSecretKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.bytes); @@ -20275,6 +23255,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1ht LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_htlc_base_key(&this_ptr_conv)); return ret_arr; @@ -20284,6 +23265,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1htlc_1bas LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSecretKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.bytes); @@ -20294,6 +23276,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1co LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_commitment_seed(&this_ptr_conv)); return ret_arr; @@ -20303,20 +23286,44 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1commitmen LDKInMemorySigner this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); InMemorySigner_set_commitment_seed(&this_ptr_conv, val_ref); } +static inline uint64_t InMemorySigner_clone_ptr(LDKInMemorySigner *NONNULL_PTR arg) { + LDKInMemorySigner ret_var = InMemorySigner_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_InMemorySigner_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKInMemorySigner arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = InMemorySigner_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKInMemorySigner orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKInMemorySigner ret_var = InMemorySigner_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20350,6 +23357,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1new(JNIEnv uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20361,10 +23369,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1counterpart LDKInMemorySigner this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKChannelPublicKeys ret_var = InMemorySigner_counterparty_pubkeys(&this_arg_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20376,6 +23386,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1counterpart LDKInMemorySigner this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int16_t ret_val = InMemorySigner_counterparty_selected_contest_delay(&this_arg_conv); return ret_val; } @@ -20384,6 +23395,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1holder_1sel LDKInMemorySigner this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int16_t ret_val = InMemorySigner_holder_selected_contest_delay(&this_arg_conv); return ret_val; } @@ -20392,6 +23404,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1is_1outbou LDKInMemorySigner this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); jboolean ret_val = InMemorySigner_is_outbound(&this_arg_conv); return ret_val; } @@ -20400,10 +23413,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1funding_1ou LDKInMemorySigner this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKOutPoint ret_var = InMemorySigner_funding_outpoint(&this_arg_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20415,10 +23430,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1channe LDKInMemorySigner this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKChannelTransactionParameters ret_var = InMemorySigner_get_channel_parameters(&this_arg_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20430,6 +23447,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1sign_1count LDKInMemorySigner this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKTransaction spend_tx_ref; spend_tx_ref.datalen = (*env)->GetArrayLength(env, spend_tx); spend_tx_ref.data = MALLOC(spend_tx_ref.datalen, "LDKTransaction Bytes"); @@ -20438,6 +23456,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1sign_1count LDKStaticPaymentOutputDescriptor descriptor_conv; descriptor_conv.inner = (void*)(descriptor & (~1)); descriptor_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(descriptor_conv); LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ"); *ret_conv = InMemorySigner_sign_counterparty_payment_input(&this_arg_conv, spend_tx_ref, input_idx, &descriptor_conv); return (uint64_t)ret_conv; @@ -20447,6 +23466,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1sign_1dynam LDKInMemorySigner this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKTransaction spend_tx_ref; spend_tx_ref.datalen = (*env)->GetArrayLength(env, spend_tx); spend_tx_ref.data = MALLOC(spend_tx_ref.datalen, "LDKTransaction Bytes"); @@ -20455,6 +23475,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1sign_1dynam LDKDelayedPaymentOutputDescriptor descriptor_conv; descriptor_conv.inner = (void*)(descriptor & (~1)); descriptor_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(descriptor_conv); LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ"); *ret_conv = InMemorySigner_sign_dynamic_p2wsh_input(&this_arg_conv, spend_tx_ref, input_idx, &descriptor_conv); return (uint64_t)ret_conv; @@ -20464,6 +23485,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1as_1BaseSig LDKInMemorySigner this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKBaseSign* ret_ret = MALLOC(sizeof(LDKBaseSign), "LDKBaseSign"); *ret_ret = InMemorySigner_as_BaseSign(&this_arg_conv); return (uint64_t)ret_ret; @@ -20473,6 +23495,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1as_1Sign(JN LDKInMemorySigner this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKSign* ret_ret = MALLOC(sizeof(LDKSign), "LDKSign"); *ret_ret = InMemorySigner_as_Sign(&this_arg_conv); return (uint64_t)ret_ret; @@ -20482,6 +23505,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1write(J LDKInMemorySigner obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = InMemorySigner_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -20503,6 +23527,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_KeysManager_1free(JNIEnv *env, LDKKeysManager this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); KeysManager_free(this_obj_conv); } @@ -20515,6 +23540,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysManager_1new(JNIEnv *en uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20526,6 +23552,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysManager_1derive_1channe LDKKeysManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char params_arr[32]; CHECK((*env)->GetArrayLength(env, params) == 32); (*env)->GetByteArrayRegion(env, params, 0, 32, params_arr); @@ -20534,6 +23561,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysManager_1derive_1channe uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20545,6 +23573,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysManager_1spend_1spendab LDKKeysManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCVec_SpendableOutputDescriptorZ descriptors_constr; descriptors_constr.datalen = (*env)->GetArrayLength(env, descriptors); if (descriptors_constr.datalen > 0) @@ -20590,6 +23619,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysManager_1as_1KeysInterf LDKKeysManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKKeysInterface* ret_ret = MALLOC(sizeof(LDKKeysInterface), "LDKKeysInterface"); *ret_ret = KeysManager_as_KeysInterface(&this_arg_conv); return (uint64_t)ret_ret; @@ -20599,6 +23629,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1free(JNIEnv *e LDKChannelManager this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ChannelManager_free(this_obj_conv); } @@ -20606,6 +23637,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainParameters_1free(JNIEnv * LDKChainParameters this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ChainParameters_free(this_obj_conv); } @@ -20613,6 +23645,7 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ChainParameters_1get_1networ LDKChainParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); jclass ret_conv = LDKNetwork_to_java(env, ChainParameters_get_network(&this_ptr_conv)); return ret_conv; } @@ -20621,6 +23654,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainParameters_1set_1network( LDKChainParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKNetwork val_conv = LDKNetwork_from_java(env, val); ChainParameters_set_network(&this_ptr_conv, val_conv); } @@ -20629,10 +23663,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainParameters_1get_1best_ LDKChainParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKBestBlock ret_var = ChainParameters_get_best_block(&this_ptr_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20644,9 +23680,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainParameters_1set_1best_1bl LDKChainParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKBestBlock val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = BestBlock_clone(&val_conv); ChainParameters_set_best_block(&this_ptr_conv, val_conv); } @@ -20656,11 +23694,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainParameters_1new(JNIEnv LDKBestBlock best_block_arg_conv; best_block_arg_conv.inner = (void*)(best_block_arg & (~1)); best_block_arg_conv.is_owned = (best_block_arg & 1) || (best_block_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(best_block_arg_conv); best_block_arg_conv = BestBlock_clone(&best_block_arg_conv); LDKChainParameters ret_var = ChainParameters_new(network_arg_conv, best_block_arg_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20668,14 +23708,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainParameters_1new(JNIEnv return ret_ref; } +static inline uint64_t ChainParameters_clone_ptr(LDKChainParameters *NONNULL_PTR arg) { + LDKChainParameters ret_var = ChainParameters_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_ChainParameters_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChainParameters arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ChainParameters_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainParameters_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKChainParameters orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChainParameters ret_var = ChainParameters_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20687,6 +23750,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1fr LDKCounterpartyForwardingInfo this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); CounterpartyForwardingInfo_free(this_obj_conv); } @@ -20694,6 +23758,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_ LDKCounterpartyForwardingInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = CounterpartyForwardingInfo_get_fee_base_msat(&this_ptr_conv); return ret_val; } @@ -20702,6 +23767,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1se LDKCounterpartyForwardingInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); CounterpartyForwardingInfo_set_fee_base_msat(&this_ptr_conv, val); } @@ -20709,6 +23775,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_ LDKCounterpartyForwardingInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = CounterpartyForwardingInfo_get_fee_proportional_millionths(&this_ptr_conv); return ret_val; } @@ -20717,6 +23784,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1se LDKCounterpartyForwardingInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); CounterpartyForwardingInfo_set_fee_proportional_millionths(&this_ptr_conv, val); } @@ -20724,6 +23792,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_ LDKCounterpartyForwardingInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = CounterpartyForwardingInfo_get_cltv_expiry_delta(&this_ptr_conv); return ret_val; } @@ -20732,6 +23801,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1se LDKCounterpartyForwardingInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); CounterpartyForwardingInfo_set_cltv_expiry_delta(&this_ptr_conv, val); } @@ -20740,6 +23810,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_ uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20747,14 +23818,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_ return ret_ref; } +static inline uint64_t CounterpartyForwardingInfo_clone_ptr(LDKCounterpartyForwardingInfo *NONNULL_PTR arg) { + LDKCounterpartyForwardingInfo ret_var = CounterpartyForwardingInfo_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_CounterpartyForwardingInfo_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCounterpartyForwardingInfo arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = CounterpartyForwardingInfo_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCounterpartyForwardingInfo orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKCounterpartyForwardingInfo ret_var = CounterpartyForwardingInfo_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20766,6 +23860,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1free(JNIE LDKChannelCounterparty this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ChannelCounterparty_free(this_obj_conv); } @@ -20773,6 +23868,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1ge LDKChannelCounterparty this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelCounterparty_get_node_id(&this_ptr_conv).compressed_form); return ret_arr; @@ -20782,6 +23878,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1set_1node LDKChannelCounterparty this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -20792,10 +23889,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1get_1f LDKChannelCounterparty this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKInitFeatures ret_var = ChannelCounterparty_get_features(&this_ptr_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20807,9 +23906,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1set_1feat LDKChannelCounterparty this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKInitFeatures val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = InitFeatures_clone(&val_conv); ChannelCounterparty_set_features(&this_ptr_conv, val_conv); } @@ -20818,6 +23919,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1get_1u LDKChannelCounterparty this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ChannelCounterparty_get_unspendable_punishment_reserve(&this_ptr_conv); return ret_val; } @@ -20826,6 +23928,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1set_1unsp LDKChannelCounterparty this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelCounterparty_set_unspendable_punishment_reserve(&this_ptr_conv, val); } @@ -20833,11 +23936,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1get_1f LDKChannelCounterparty this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCounterpartyForwardingInfo ret_var = ChannelCounterparty_get_forwarding_info(&this_ptr_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20850,9 +23955,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1set_1forw LDKChannelCounterparty this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCounterpartyForwardingInfo val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = CounterpartyForwardingInfo_clone(&val_conv); ChannelCounterparty_set_forwarding_info(&this_ptr_conv, val_conv); } @@ -20864,15 +23971,18 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1new(JN LDKInitFeatures features_arg_conv; features_arg_conv.inner = (void*)(features_arg & (~1)); features_arg_conv.is_owned = (features_arg & 1) || (features_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv); features_arg_conv = InitFeatures_clone(&features_arg_conv); LDKCounterpartyForwardingInfo forwarding_info_arg_conv; forwarding_info_arg_conv.inner = (void*)(forwarding_info_arg & (~1)); forwarding_info_arg_conv.is_owned = (forwarding_info_arg & 1) || (forwarding_info_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(forwarding_info_arg_conv); forwarding_info_arg_conv = CounterpartyForwardingInfo_clone(&forwarding_info_arg_conv); LDKChannelCounterparty ret_var = ChannelCounterparty_new(node_id_arg_ref, features_arg_conv, unspendable_punishment_reserve_arg, forwarding_info_arg_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20880,14 +23990,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1new(JN return ret_ref; } +static inline uint64_t ChannelCounterparty_clone_ptr(LDKChannelCounterparty *NONNULL_PTR arg) { + LDKChannelCounterparty ret_var = ChannelCounterparty_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_ChannelCounterparty_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChannelCounterparty arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ChannelCounterparty_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKChannelCounterparty orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelCounterparty ret_var = ChannelCounterparty_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20899,6 +24032,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1free(JNIEnv *e LDKChannelDetails this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ChannelDetails_free(this_obj_conv); } @@ -20906,6 +24040,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1ch LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ChannelDetails_get_channel_id(&this_ptr_conv)); return ret_arr; @@ -20915,6 +24050,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1channel_1 LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -20925,10 +24061,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1counte LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelCounterparty ret_var = ChannelDetails_get_counterparty(&this_ptr_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20940,9 +24078,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1counterpa LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelCounterparty val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = ChannelCounterparty_clone(&val_conv); ChannelDetails_set_counterparty(&this_ptr_conv, val_conv); } @@ -20951,11 +24091,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1fundin LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKOutPoint ret_var = ChannelDetails_get_funding_txo(&this_ptr_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -20968,9 +24110,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1funding_1 LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKOutPoint val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = OutPoint_clone(&val_conv); ChannelDetails_set_funding_txo(&this_ptr_conv, val_conv); } @@ -20979,6 +24123,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1short_ LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); *ret_copy = ChannelDetails_get_short_channel_id(&this_ptr_conv); uint64_t ret_ref = (uint64_t)ret_copy; @@ -20989,6 +24134,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1short_1ch LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); @@ -21000,6 +24146,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1channe LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ChannelDetails_get_channel_value_satoshis(&this_ptr_conv); return ret_val; } @@ -21008,6 +24155,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1channel_1 LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelDetails_set_channel_value_satoshis(&this_ptr_conv, val); } @@ -21015,6 +24163,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1unspen LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); *ret_copy = ChannelDetails_get_unspendable_punishment_reserve(&this_ptr_conv); uint64_t ret_ref = (uint64_t)ret_copy; @@ -21025,6 +24174,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1unspendab LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); @@ -21036,6 +24186,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1user_1 LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ChannelDetails_get_user_channel_id(&this_ptr_conv); return ret_val; } @@ -21044,6 +24195,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1user_1cha LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelDetails_set_user_channel_id(&this_ptr_conv, val); } @@ -21051,6 +24203,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1outbou LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ChannelDetails_get_outbound_capacity_msat(&this_ptr_conv); return ret_val; } @@ -21059,6 +24212,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1outbound_ LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelDetails_set_outbound_capacity_msat(&this_ptr_conv, val); } @@ -21066,6 +24220,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1inboun LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ChannelDetails_get_inbound_capacity_msat(&this_ptr_conv); return ret_val; } @@ -21074,6 +24229,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1inbound_1 LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelDetails_set_inbound_capacity_msat(&this_ptr_conv, val); } @@ -21081,6 +24237,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1confir LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); *ret_copy = ChannelDetails_get_confirmations_required(&this_ptr_conv); uint64_t ret_ref = (uint64_t)ret_copy; @@ -21091,6 +24248,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1confirmat LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(val_ptr); @@ -21102,6 +24260,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1force_ LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z"); *ret_copy = ChannelDetails_get_force_close_spend_delay(&this_ptr_conv); uint64_t ret_ref = (uint64_t)ret_copy; @@ -21112,6 +24271,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1force_1cl LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKCOption_u16Z val_conv = *(LDKCOption_u16Z*)(val_ptr); @@ -21123,6 +24283,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1is_1o LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); jboolean ret_val = ChannelDetails_get_is_outbound(&this_ptr_conv); return ret_val; } @@ -21131,6 +24292,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1is_1outbo LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelDetails_set_is_outbound(&this_ptr_conv, val); } @@ -21138,6 +24300,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1is_1f LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); jboolean ret_val = ChannelDetails_get_is_funding_locked(&this_ptr_conv); return ret_val; } @@ -21146,6 +24309,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1is_1fundi LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelDetails_set_is_funding_locked(&this_ptr_conv, val); } @@ -21153,6 +24317,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1is_1u LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); jboolean ret_val = ChannelDetails_get_is_usable(&this_ptr_conv); return ret_val; } @@ -21161,6 +24326,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1is_1usabl LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelDetails_set_is_usable(&this_ptr_conv, val); } @@ -21168,6 +24334,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1is_1p LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); jboolean ret_val = ChannelDetails_get_is_public(&this_ptr_conv); return ret_val; } @@ -21176,6 +24343,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1is_1publi LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelDetails_set_is_public(&this_ptr_conv, val); } @@ -21186,10 +24354,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1new(JNIEnv LDKChannelCounterparty counterparty_arg_conv; counterparty_arg_conv.inner = (void*)(counterparty_arg & (~1)); counterparty_arg_conv.is_owned = (counterparty_arg & 1) || (counterparty_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(counterparty_arg_conv); counterparty_arg_conv = ChannelCounterparty_clone(&counterparty_arg_conv); LDKOutPoint funding_txo_arg_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); + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_arg_conv); funding_txo_arg_conv = OutPoint_clone(&funding_txo_arg_conv); void* short_channel_id_arg_ptr = (void*)(((uint64_t)short_channel_id_arg) & ~1); CHECK_ACCESS(short_channel_id_arg_ptr); @@ -21210,6 +24380,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1new(JNIEnv uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -21217,14 +24388,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1new(JNIEnv return ret_ref; } +static inline uint64_t ChannelDetails_clone_ptr(LDKChannelDetails *NONNULL_PTR arg) { + LDKChannelDetails ret_var = ChannelDetails_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_ChannelDetails_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChannelDetails arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ChannelDetails_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKChannelDetails orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelDetails ret_var = ChannelDetails_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -21241,6 +24435,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1free(JNIEn PaymentSendFailure_free(this_ptr_conv); } +static inline uint64_t PaymentSendFailure_clone_ptr(LDKPaymentSendFailure *NONNULL_PTR arg) { + LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); + *ret_copy = PaymentSendFailure_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKPaymentSendFailure* arg_conv = (LDKPaymentSendFailure*)arg; + int64_t ret_val = PaymentSendFailure_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKPaymentSendFailure* orig_conv = (LDKPaymentSendFailure*)orig; LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); @@ -21325,6 +24531,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1partial LDKRouteParameters failed_paths_retry_conv; failed_paths_retry_conv.inner = (void*)(failed_paths_retry & (~1)); failed_paths_retry_conv.is_owned = (failed_paths_retry & 1) || (failed_paths_retry == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(failed_paths_retry_conv); failed_paths_retry_conv = RouteParameters_clone(&failed_paths_retry_conv); LDKThirtyTwoBytes payment_id_ref; CHECK((*env)->GetArrayLength(env, payment_id) == 32); @@ -21374,15 +24581,18 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1new(JNIEnv LDKUserConfig config_conv; config_conv.inner = (void*)(config & (~1)); config_conv.is_owned = (config & 1) || (config == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(config_conv); config_conv = UserConfig_clone(&config_conv); LDKChainParameters params_conv; params_conv.inner = (void*)(params & (~1)); params_conv.is_owned = (params & 1) || (params == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(params_conv); params_conv = ChainParameters_clone(¶ms_conv); LDKChannelManager ret_var = ChannelManager_new(fee_est_conv, chain_monitor_conv, tx_broadcaster_conv, logger_conv, keys_manager_conv, config_conv, params_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -21394,10 +24604,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1get_1curren LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKUserConfig ret_var = ChannelManager_get_current_default_configuration(&this_arg_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -21409,12 +24621,14 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1create_1cha LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKPublicKey their_network_key_ref; CHECK((*env)->GetArrayLength(env, their_network_key) == 33); (*env)->GetByteArrayRegion(env, their_network_key, 0, 33, their_network_key_ref.compressed_form); LDKUserConfig override_config_conv; override_config_conv.inner = (void*)(override_config & (~1)); override_config_conv.is_owned = (override_config & 1) || (override_config == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(override_config_conv); override_config_conv = UserConfig_clone(&override_config_conv); LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ"); *ret_conv = ChannelManager_create_channel(&this_arg_conv, their_network_key_ref, channel_value_satoshis, push_msat, user_channel_id, override_config_conv); @@ -21425,6 +24639,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelManager_1list_1 LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCVec_ChannelDetailsZ ret_var = ChannelManager_list_channels(&this_arg_conv); int64_tArray ret_arr = NULL; ret_arr = (*env)->NewLongArray(env, ret_var.datalen); @@ -21434,6 +24649,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelManager_1list_1 uint64_t ret_conv_16_ref = 0; CHECK((((uint64_t)ret_conv_16_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_conv_16_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var); ret_conv_16_ref = (uint64_t)ret_conv_16_var.inner; if (ret_conv_16_var.is_owned) { ret_conv_16_ref |= 1; @@ -21449,6 +24665,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelManager_1list_1 LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCVec_ChannelDetailsZ ret_var = ChannelManager_list_usable_channels(&this_arg_conv); int64_tArray ret_arr = NULL; ret_arr = (*env)->NewLongArray(env, ret_var.datalen); @@ -21458,6 +24675,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelManager_1list_1 uint64_t ret_conv_16_ref = 0; CHECK((((uint64_t)ret_conv_16_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_conv_16_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var); ret_conv_16_ref = (uint64_t)ret_conv_16_var.inner; if (ret_conv_16_var.is_owned) { ret_conv_16_ref |= 1; @@ -21473,6 +24691,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1close_1chan LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char channel_id_arr[32]; CHECK((*env)->GetArrayLength(env, channel_id) == 32); (*env)->GetByteArrayRegion(env, channel_id, 0, 32, channel_id_arr); @@ -21486,6 +24705,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1close_1chan LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char channel_id_arr[32]; CHECK((*env)->GetArrayLength(env, channel_id) == 32); (*env)->GetByteArrayRegion(env, channel_id, 0, 32, channel_id_arr); @@ -21499,6 +24719,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1force_1clos LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char channel_id_arr[32]; CHECK((*env)->GetArrayLength(env, channel_id) == 32); (*env)->GetByteArrayRegion(env, channel_id, 0, 32, channel_id_arr); @@ -21512,6 +24733,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1force_1close_1 LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); ChannelManager_force_close_all_channels(&this_arg_conv); } @@ -21519,9 +24741,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1send_1payme LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKRoute route_conv; route_conv.inner = (void*)(route & (~1)); route_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv); LDKThirtyTwoBytes payment_hash_ref; CHECK((*env)->GetArrayLength(env, payment_hash) == 32); (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); @@ -21537,9 +24761,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1retry_1paym LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKRoute route_conv; route_conv.inner = (void*)(route & (~1)); route_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv); LDKThirtyTwoBytes payment_id_ref; CHECK((*env)->GetArrayLength(env, payment_id) == 32); (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data); @@ -21552,9 +24778,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1send_1spont LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKRoute route_conv; route_conv.inner = (void*)(route & (~1)); route_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv); LDKThirtyTwoBytes payment_preimage_ref; CHECK((*env)->GetArrayLength(env, payment_preimage) == 32); (*env)->GetByteArrayRegion(env, payment_preimage, 0, 32, payment_preimage_ref.data); @@ -21567,6 +24795,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1funding_1tr LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char temporary_channel_id_arr[32]; CHECK((*env)->GetArrayLength(env, temporary_channel_id) == 32); (*env)->GetByteArrayRegion(env, temporary_channel_id, 0, 32, temporary_channel_id_arr); @@ -21585,6 +24814,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1broadcast_1nod LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKThreeBytes rgb_ref; CHECK((*env)->GetArrayLength(env, rgb) == 3); (*env)->GetByteArrayRegion(env, rgb, 0, 3, rgb_ref.data); @@ -21613,6 +24843,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1process_1pendi LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); ChannelManager_process_pending_htlc_forwards(&this_arg_conv); } @@ -21620,6 +24851,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1timer_1tick_1o LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); ChannelManager_timer_tick_occurred(&this_arg_conv); } @@ -21627,6 +24859,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelManager_1fail_1htlc LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char payment_hash_arr[32]; CHECK((*env)->GetArrayLength(env, payment_hash) == 32); (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_arr); @@ -21639,6 +24872,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelManager_1claim_1fun LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKThirtyTwoBytes payment_preimage_ref; CHECK((*env)->GetArrayLength(env, payment_preimage) == 32); (*env)->GetByteArrayRegion(env, payment_preimage, 0, 32, payment_preimage_ref.data); @@ -21650,6 +24884,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelManager_1get_1ou LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelManager_get_our_node_id(&this_arg_conv).compressed_form); return ret_arr; @@ -21659,6 +24894,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1create_1inb LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); 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); @@ -21672,6 +24908,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1create_1inb LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKThirtyTwoBytes payment_hash_ref; CHECK((*env)->GetArrayLength(env, payment_hash) == 32); (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); @@ -21688,6 +24925,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1Message LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider"); *ret_ret = ChannelManager_as_MessageSendEventsProvider(&this_arg_conv); return (uint64_t)ret_ret; @@ -21697,6 +24935,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1EventsP LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKEventsProvider* ret_ret = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider"); *ret_ret = ChannelManager_as_EventsProvider(&this_arg_conv); return (uint64_t)ret_ret; @@ -21706,6 +24945,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1Listen( LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKListen* ret_ret = MALLOC(sizeof(LDKListen), "LDKListen"); *ret_ret = ChannelManager_as_Listen(&this_arg_conv); return (uint64_t)ret_ret; @@ -21715,6 +24955,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1Confirm LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKConfirm* ret_ret = MALLOC(sizeof(LDKConfirm), "LDKConfirm"); *ret_ret = ChannelManager_as_Confirm(&this_arg_conv); return (uint64_t)ret_ret; @@ -21724,6 +24965,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelManager_1await_1per LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); jboolean ret_val = ChannelManager_await_persistable_update_timeout(&this_arg_conv, max_wait); return ret_val; } @@ -21732,6 +24974,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1await_1persist LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); ChannelManager_await_persistable_update(&this_arg_conv); } @@ -21739,10 +24982,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1current_1be LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKBestBlock ret_var = ChannelManager_current_best_block(&this_arg_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -21754,6 +24999,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1Channel LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKChannelMessageHandler* ret_ret = MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler"); *ret_ret = ChannelManager_as_ChannelMessageHandler(&this_arg_conv); return (uint64_t)ret_ret; @@ -21763,6 +25009,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelManager_1write(J LDKChannelManager obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ChannelManager_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -21774,6 +25021,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1free(J LDKChannelManagerReadArgs this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ChannelManagerReadArgs_free(this_obj_conv); } @@ -21781,6 +25029,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); // WARNING: This object doesn't live past this scope, needs clone! uint64_t ret_ret = ((uint64_t)ChannelManagerReadArgs_get_keys_manager(&this_ptr_conv)) | 1; return ret_ret; @@ -21790,6 +25039,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1k LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKKeysInterface val_conv = *(LDKKeysInterface*)(val_ptr); @@ -21804,6 +25054,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); // WARNING: This object doesn't live past this scope, needs clone! uint64_t ret_ret = ((uint64_t)ChannelManagerReadArgs_get_fee_estimator(&this_ptr_conv)) | 1; return ret_ret; @@ -21813,6 +25064,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1f LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKFeeEstimator val_conv = *(LDKFeeEstimator*)(val_ptr); @@ -21827,6 +25079,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); // WARNING: This object doesn't live past this scope, needs clone! uint64_t ret_ret = ((uint64_t)ChannelManagerReadArgs_get_chain_monitor(&this_ptr_conv)) | 1; return ret_ret; @@ -21836,6 +25089,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1c LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKWatch val_conv = *(LDKWatch*)(val_ptr); @@ -21850,6 +25104,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); // WARNING: This object doesn't live past this scope, needs clone! uint64_t ret_ret = ((uint64_t)ChannelManagerReadArgs_get_tx_broadcaster(&this_ptr_conv)) | 1; return ret_ret; @@ -21859,6 +25114,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1t LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKBroadcasterInterface val_conv = *(LDKBroadcasterInterface*)(val_ptr); @@ -21873,6 +25129,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); // WARNING: This object doesn't live past this scope, needs clone! uint64_t ret_ret = ((uint64_t)ChannelManagerReadArgs_get_logger(&this_ptr_conv)) | 1; return ret_ret; @@ -21882,6 +25139,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1l LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKLogger val_conv = *(LDKLogger*)(val_ptr); @@ -21896,10 +25154,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKUserConfig ret_var = ChannelManagerReadArgs_get_default_config(&this_ptr_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -21911,9 +25171,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1d LDKChannelManagerReadArgs this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKUserConfig val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = UserConfig_clone(&val_conv); ChannelManagerReadArgs_set_default_config(&this_ptr_conv, val_conv); } @@ -21957,6 +25219,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1new LDKUserConfig default_config_conv; default_config_conv.inner = (void*)(default_config & (~1)); default_config_conv.is_owned = (default_config & 1) || (default_config == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(default_config_conv); default_config_conv = UserConfig_clone(&default_config_conv); LDKCVec_ChannelMonitorZ channel_monitors_constr; channel_monitors_constr.datalen = (*env)->GetArrayLength(env, channel_monitors); @@ -21970,6 +25233,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1new LDKChannelMonitor channel_monitors_conv_16_conv; channel_monitors_conv_16_conv.inner = (void*)(channel_monitors_conv_16 & (~1)); channel_monitors_conv_16_conv.is_owned = (channel_monitors_conv_16 & 1) || (channel_monitors_conv_16 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_monitors_conv_16_conv); channel_monitors_constr.data[q] = channel_monitors_conv_16_conv; } (*env)->ReleaseLongArrayElements(env, channel_monitors, channel_monitors_vals, 0); @@ -21977,6 +25241,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1new uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -21991,6 +25256,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMa LDKChannelManagerReadArgs arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = (arg & 1) || (arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); // Warning: we need a move here but no clone is available for LDKChannelManagerReadArgs LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ"); *ret_conv = C2Tuple_BlockHashChannelManagerZ_read(ser_ref, arg_conv); @@ -22002,17 +25268,41 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DecodeError_1free(JNIEnv *env, LDKDecodeError this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); DecodeError_free(this_obj_conv); } +static inline uint64_t DecodeError_clone_ptr(LDKDecodeError *NONNULL_PTR arg) { + LDKDecodeError ret_var = DecodeError_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_DecodeError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKDecodeError arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = DecodeError_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DecodeError_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKDecodeError orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKDecodeError ret_var = DecodeError_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -22024,6 +25314,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Init_1free(JNIEnv *env, jclass LDKInit this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); Init_free(this_obj_conv); } @@ -22031,10 +25322,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Init_1get_1features(JNIEnv LDKInit this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKInitFeatures ret_var = Init_get_features(&this_ptr_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -22046,9 +25339,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Init_1set_1features(JNIEnv *en LDKInit this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKInitFeatures val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = InitFeatures_clone(&val_conv); Init_set_features(&this_ptr_conv, val_conv); } @@ -22057,11 +25352,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Init_1new(JNIEnv *env, jcla LDKInitFeatures features_arg_conv; features_arg_conv.inner = (void*)(features_arg & (~1)); features_arg_conv.is_owned = (features_arg & 1) || (features_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv); features_arg_conv = InitFeatures_clone(&features_arg_conv); LDKInit ret_var = Init_new(features_arg_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -22069,14 +25366,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Init_1new(JNIEnv *env, jcla return ret_ref; } +static inline uint64_t Init_clone_ptr(LDKInit *NONNULL_PTR arg) { + LDKInit ret_var = Init_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_Init_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKInit arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = Init_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Init_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKInit orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKInit ret_var = Init_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -22088,6 +25408,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1free(JNIEnv *env LDKErrorMessage this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ErrorMessage_free(this_obj_conv); } @@ -22095,6 +25416,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1get_1chan LDKErrorMessage this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ErrorMessage_get_channel_id(&this_ptr_conv)); return ret_arr; @@ -22104,6 +25426,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1set_1channel_1id LDKErrorMessage this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -22114,6 +25437,7 @@ JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1get_1data(JNI LDKErrorMessage this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKStr ret_str = ErrorMessage_get_data(&this_ptr_conv); jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); Str_free(ret_str); @@ -22124,6 +25448,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1set_1data(JNIEnv LDKErrorMessage this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKStr val_conv = java_to_owned_str(env, val); ErrorMessage_set_data(&this_ptr_conv, val_conv); } @@ -22137,6 +25462,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1new(JNIEnv *e uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -22144,14 +25470,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1new(JNIEnv *e return ret_ref; } +static inline uint64_t ErrorMessage_clone_ptr(LDKErrorMessage *NONNULL_PTR arg) { + LDKErrorMessage ret_var = ErrorMessage_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_ErrorMessage_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKErrorMessage arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ErrorMessage_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKErrorMessage orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKErrorMessage ret_var = ErrorMessage_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -22163,6 +25512,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Ping_1free(JNIEnv *env, jclass LDKPing this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); Ping_free(this_obj_conv); } @@ -22170,6 +25520,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_Ping_1get_1ponglen(JNIEnv * LDKPing this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = Ping_get_ponglen(&this_ptr_conv); return ret_val; } @@ -22178,6 +25529,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Ping_1set_1ponglen(JNIEnv *env LDKPing this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); Ping_set_ponglen(&this_ptr_conv, val); } @@ -22185,6 +25537,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_Ping_1get_1byteslen(JNIEnv LDKPing this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = Ping_get_byteslen(&this_ptr_conv); return ret_val; } @@ -22193,6 +25546,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Ping_1set_1byteslen(JNIEnv *en LDKPing this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); Ping_set_byteslen(&this_ptr_conv, val); } @@ -22201,6 +25555,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Ping_1new(JNIEnv *env, jcla uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -22208,14 +25563,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Ping_1new(JNIEnv *env, jcla return ret_ref; } +static inline uint64_t Ping_clone_ptr(LDKPing *NONNULL_PTR arg) { + LDKPing ret_var = Ping_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_Ping_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKPing arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = Ping_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Ping_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKPing orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKPing ret_var = Ping_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -22227,6 +25605,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Pong_1free(JNIEnv *env, jclass LDKPong this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); Pong_free(this_obj_conv); } @@ -22234,6 +25613,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_Pong_1get_1byteslen(JNIEnv LDKPong this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = Pong_get_byteslen(&this_ptr_conv); return ret_val; } @@ -22242,6 +25622,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Pong_1set_1byteslen(JNIEnv *en LDKPong this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); Pong_set_byteslen(&this_ptr_conv, val); } @@ -22250,6 +25631,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Pong_1new(JNIEnv *env, jcla uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -22257,14 +25639,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Pong_1new(JNIEnv *env, jcla return ret_ref; } +static inline uint64_t Pong_clone_ptr(LDKPong *NONNULL_PTR arg) { + LDKPong ret_var = Pong_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_Pong_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKPong arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = Pong_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Pong_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKPong orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKPong ret_var = Pong_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -22276,6 +25681,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1free(JNIEnv *env, LDKOpenChannel this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); OpenChannel_free(this_obj_conv); } @@ -22283,6 +25689,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1chain LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *OpenChannel_get_chain_hash(&this_ptr_conv)); return ret_arr; @@ -22292,6 +25699,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1chain_1hash( LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -22302,6 +25710,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1tempo LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *OpenChannel_get_temporary_channel_id(&this_ptr_conv)); return ret_arr; @@ -22311,6 +25720,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1temporary_1c LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -22321,6 +25731,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1funding_1 LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = OpenChannel_get_funding_satoshis(&this_ptr_conv); return ret_val; } @@ -22329,6 +25740,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1funding_1sat LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); OpenChannel_set_funding_satoshis(&this_ptr_conv, val); } @@ -22336,6 +25748,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1push_1msa LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = OpenChannel_get_push_msat(&this_ptr_conv); return ret_val; } @@ -22344,6 +25757,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1push_1msat(J LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); OpenChannel_set_push_msat(&this_ptr_conv, val); } @@ -22351,6 +25765,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1dust_1lim LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = OpenChannel_get_dust_limit_satoshis(&this_ptr_conv); return ret_val; } @@ -22359,6 +25774,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1dust_1limit_ LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); OpenChannel_set_dust_limit_satoshis(&this_ptr_conv, val); } @@ -22366,6 +25782,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1max_1htlc LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = OpenChannel_get_max_htlc_value_in_flight_msat(&this_ptr_conv); return ret_val; } @@ -22374,6 +25791,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1max_1htlc_1v LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); OpenChannel_set_max_htlc_value_in_flight_msat(&this_ptr_conv, val); } @@ -22381,6 +25799,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1channel_1 LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = OpenChannel_get_channel_reserve_satoshis(&this_ptr_conv); return ret_val; } @@ -22389,6 +25808,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1channel_1res LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); OpenChannel_set_channel_reserve_satoshis(&this_ptr_conv, val); } @@ -22396,6 +25816,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1htlc_1min LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = OpenChannel_get_htlc_minimum_msat(&this_ptr_conv); return ret_val; } @@ -22404,6 +25825,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1htlc_1minimu LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); OpenChannel_set_htlc_minimum_msat(&this_ptr_conv, val); } @@ -22411,6 +25833,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1feerate_1 LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = OpenChannel_get_feerate_per_kw(&this_ptr_conv); return ret_val; } @@ -22419,6 +25842,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1feerate_1per LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); OpenChannel_set_feerate_per_kw(&this_ptr_conv, val); } @@ -22426,6 +25850,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1to_1self_ LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = OpenChannel_get_to_self_delay(&this_ptr_conv); return ret_val; } @@ -22434,6 +25859,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1to_1self_1de LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); OpenChannel_set_to_self_delay(&this_ptr_conv, val); } @@ -22441,6 +25867,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1max_1acce LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = OpenChannel_get_max_accepted_htlcs(&this_ptr_conv); return ret_val; } @@ -22449,6 +25876,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1max_1accepte LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); OpenChannel_set_max_accepted_htlcs(&this_ptr_conv, val); } @@ -22456,6 +25884,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1fundi LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, OpenChannel_get_funding_pubkey(&this_ptr_conv).compressed_form); return ret_arr; @@ -22465,6 +25894,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1funding_1pub LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -22475,6 +25905,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1revoc LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, OpenChannel_get_revocation_basepoint(&this_ptr_conv).compressed_form); return ret_arr; @@ -22484,6 +25915,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1revocation_1 LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -22494,6 +25926,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1payme LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, OpenChannel_get_payment_point(&this_ptr_conv).compressed_form); return ret_arr; @@ -22503,6 +25936,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1payment_1poi LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -22513,6 +25947,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1delay LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, OpenChannel_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form); return ret_arr; @@ -22522,6 +25957,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1delayed_1pay LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -22532,6 +25968,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1htlc_ LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, OpenChannel_get_htlc_basepoint(&this_ptr_conv).compressed_form); return ret_arr; @@ -22541,6 +25978,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1htlc_1basepo LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -22551,6 +25989,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1first LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, OpenChannel_get_first_per_commitment_point(&this_ptr_conv).compressed_form); return ret_arr; @@ -22560,6 +25999,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1first_1per_1 LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -22570,6 +26010,7 @@ JNIEXPORT int8_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1channel_1f LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_t ret_val = OpenChannel_get_channel_flags(&this_ptr_conv); return ret_val; } @@ -22578,17 +26019,41 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1channel_1fla LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); OpenChannel_set_channel_flags(&this_ptr_conv, val); } +static inline uint64_t OpenChannel_clone_ptr(LDKOpenChannel *NONNULL_PTR arg) { + LDKOpenChannel ret_var = OpenChannel_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_OpenChannel_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKOpenChannel arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = OpenChannel_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKOpenChannel orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKOpenChannel ret_var = OpenChannel_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -22600,6 +26065,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1free(JNIEnv *en LDKAcceptChannel this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); AcceptChannel_free(this_obj_conv); } @@ -22607,6 +26073,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1tem LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *AcceptChannel_get_temporary_channel_id(&this_ptr_conv)); return ret_arr; @@ -22616,6 +26083,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1temporary_ LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -22626,6 +26094,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1dust_1l LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = AcceptChannel_get_dust_limit_satoshis(&this_ptr_conv); return ret_val; } @@ -22634,6 +26103,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1dust_1limi LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); AcceptChannel_set_dust_limit_satoshis(&this_ptr_conv, val); } @@ -22641,6 +26111,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1max_1ht LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = AcceptChannel_get_max_htlc_value_in_flight_msat(&this_ptr_conv); return ret_val; } @@ -22649,6 +26120,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1max_1htlc_ LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); AcceptChannel_set_max_htlc_value_in_flight_msat(&this_ptr_conv, val); } @@ -22656,6 +26128,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1channel LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = AcceptChannel_get_channel_reserve_satoshis(&this_ptr_conv); return ret_val; } @@ -22664,6 +26137,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1channel_1r LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); AcceptChannel_set_channel_reserve_satoshis(&this_ptr_conv, val); } @@ -22671,6 +26145,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1htlc_1m LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = AcceptChannel_get_htlc_minimum_msat(&this_ptr_conv); return ret_val; } @@ -22679,6 +26154,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1htlc_1mini LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); AcceptChannel_set_htlc_minimum_msat(&this_ptr_conv, val); } @@ -22686,6 +26162,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1minimum LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = AcceptChannel_get_minimum_depth(&this_ptr_conv); return ret_val; } @@ -22694,6 +26171,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1minimum_1d LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); AcceptChannel_set_minimum_depth(&this_ptr_conv, val); } @@ -22701,6 +26179,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1to_1sel LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = AcceptChannel_get_to_self_delay(&this_ptr_conv); return ret_val; } @@ -22709,6 +26188,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1to_1self_1 LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); AcceptChannel_set_to_self_delay(&this_ptr_conv, val); } @@ -22716,6 +26196,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1max_1ac LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = AcceptChannel_get_max_accepted_htlcs(&this_ptr_conv); return ret_val; } @@ -22724,6 +26205,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1max_1accep LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); AcceptChannel_set_max_accepted_htlcs(&this_ptr_conv, val); } @@ -22731,6 +26213,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1fun LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, AcceptChannel_get_funding_pubkey(&this_ptr_conv).compressed_form); return ret_arr; @@ -22740,6 +26223,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1funding_1p LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -22750,6 +26234,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1rev LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, AcceptChannel_get_revocation_basepoint(&this_ptr_conv).compressed_form); return ret_arr; @@ -22759,6 +26244,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1revocation LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -22769,6 +26255,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1pay LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, AcceptChannel_get_payment_point(&this_ptr_conv).compressed_form); return ret_arr; @@ -22778,6 +26265,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1payment_1p LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -22788,6 +26276,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1del LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, AcceptChannel_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form); return ret_arr; @@ -22797,6 +26286,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1delayed_1p LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -22807,6 +26297,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1htl LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, AcceptChannel_get_htlc_basepoint(&this_ptr_conv).compressed_form); return ret_arr; @@ -22816,6 +26307,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1htlc_1base LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -22826,6 +26318,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1fir LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, AcceptChannel_get_first_per_commitment_point(&this_ptr_conv).compressed_form); return ret_arr; @@ -22835,20 +26328,44 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1first_1per LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); AcceptChannel_set_first_per_commitment_point(&this_ptr_conv, val_ref); } +static inline uint64_t AcceptChannel_clone_ptr(LDKAcceptChannel *NONNULL_PTR arg) { + LDKAcceptChannel ret_var = AcceptChannel_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_AcceptChannel_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKAcceptChannel arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = AcceptChannel_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKAcceptChannel orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKAcceptChannel ret_var = AcceptChannel_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -22860,6 +26377,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1free(JNIEnv *e LDKFundingCreated this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); FundingCreated_free(this_obj_conv); } @@ -22867,6 +26385,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1te LDKFundingCreated this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *FundingCreated_get_temporary_channel_id(&this_ptr_conv)); return ret_arr; @@ -22876,6 +26395,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1temporary LDKFundingCreated this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -22886,6 +26406,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1fu LDKFundingCreated this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *FundingCreated_get_funding_txid(&this_ptr_conv)); return ret_arr; @@ -22895,6 +26416,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1funding_1 LDKFundingCreated this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -22905,6 +26427,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1fundin LDKFundingCreated this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = FundingCreated_get_funding_output_index(&this_ptr_conv); return ret_val; } @@ -22913,6 +26436,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1funding_1 LDKFundingCreated this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); FundingCreated_set_funding_output_index(&this_ptr_conv, val); } @@ -22920,6 +26444,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1si LDKFundingCreated this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 64); (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, FundingCreated_get_signature(&this_ptr_conv).compact_form); return ret_arr; @@ -22929,6 +26454,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1signature LDKFundingCreated this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK((*env)->GetArrayLength(env, val) == 64); (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form); @@ -22949,6 +26475,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingCreated_1new(JNIEnv uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -22956,14 +26483,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingCreated_1new(JNIEnv return ret_ref; } +static inline uint64_t FundingCreated_clone_ptr(LDKFundingCreated *NONNULL_PTR arg) { + LDKFundingCreated ret_var = FundingCreated_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_FundingCreated_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKFundingCreated arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = FundingCreated_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingCreated_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKFundingCreated orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKFundingCreated ret_var = FundingCreated_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -22975,6 +26525,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingSigned_1free(JNIEnv *en LDKFundingSigned this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); FundingSigned_free(this_obj_conv); } @@ -22982,6 +26533,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingSigned_1get_1cha LDKFundingSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *FundingSigned_get_channel_id(&this_ptr_conv)); return ret_arr; @@ -22991,6 +26543,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingSigned_1set_1channel_1i LDKFundingSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -23001,6 +26554,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingSigned_1get_1sig LDKFundingSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 64); (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, FundingSigned_get_signature(&this_ptr_conv).compact_form); return ret_arr; @@ -23010,6 +26564,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingSigned_1set_1signature( LDKFundingSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK((*env)->GetArrayLength(env, val) == 64); (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form); @@ -23027,6 +26582,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingSigned_1new(JNIEnv * uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -23034,14 +26590,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingSigned_1new(JNIEnv * return ret_ref; } +static inline uint64_t FundingSigned_clone_ptr(LDKFundingSigned *NONNULL_PTR arg) { + LDKFundingSigned ret_var = FundingSigned_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_FundingSigned_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKFundingSigned arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = FundingSigned_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingSigned_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKFundingSigned orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKFundingSigned ret_var = FundingSigned_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -23053,6 +26632,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingLocked_1free(JNIEnv *en LDKFundingLocked this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); FundingLocked_free(this_obj_conv); } @@ -23060,6 +26640,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingLocked_1get_1cha LDKFundingLocked this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *FundingLocked_get_channel_id(&this_ptr_conv)); return ret_arr; @@ -23069,6 +26650,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingLocked_1set_1channel_1i LDKFundingLocked this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -23079,6 +26661,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingLocked_1get_1nex LDKFundingLocked this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, FundingLocked_get_next_per_commitment_point(&this_ptr_conv).compressed_form); return ret_arr; @@ -23088,6 +26671,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingLocked_1set_1next_1per_ LDKFundingLocked this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -23105,6 +26689,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingLocked_1new(JNIEnv * uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -23112,14 +26697,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingLocked_1new(JNIEnv * return ret_ref; } +static inline uint64_t FundingLocked_clone_ptr(LDKFundingLocked *NONNULL_PTR arg) { + LDKFundingLocked ret_var = FundingLocked_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_FundingLocked_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKFundingLocked arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = FundingLocked_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingLocked_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKFundingLocked orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKFundingLocked ret_var = FundingLocked_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -23131,6 +26739,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Shutdown_1free(JNIEnv *env, jc LDKShutdown this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); Shutdown_free(this_obj_conv); } @@ -23138,6 +26747,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Shutdown_1get_1channel_ LDKShutdown this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *Shutdown_get_channel_id(&this_ptr_conv)); return ret_arr; @@ -23147,6 +26757,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Shutdown_1set_1channel_1id(JNI LDKShutdown this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -23157,6 +26768,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Shutdown_1get_1scriptpu LDKShutdown this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKu8slice ret_var = Shutdown_get_scriptpubkey(&this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -23167,6 +26779,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Shutdown_1set_1scriptpubkey(JN LDKShutdown this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_u8Z val_ref; val_ref.datalen = (*env)->GetArrayLength(env, val); val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes"); @@ -23186,6 +26799,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Shutdown_1new(JNIEnv *env, uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -23193,14 +26807,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Shutdown_1new(JNIEnv *env, return ret_ref; } +static inline uint64_t Shutdown_clone_ptr(LDKShutdown *NONNULL_PTR arg) { + LDKShutdown ret_var = Shutdown_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_Shutdown_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKShutdown arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = Shutdown_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Shutdown_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKShutdown orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKShutdown ret_var = Shutdown_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -23212,6 +26849,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1free(JN LDKClosingSignedFeeRange this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ClosingSignedFeeRange_free(this_obj_conv); } @@ -23219,6 +26857,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1get_ LDKClosingSignedFeeRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ClosingSignedFeeRange_get_min_fee_satoshis(&this_ptr_conv); return ret_val; } @@ -23227,6 +26866,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1set_1mi LDKClosingSignedFeeRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ClosingSignedFeeRange_set_min_fee_satoshis(&this_ptr_conv, val); } @@ -23234,6 +26874,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1get_ LDKClosingSignedFeeRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ClosingSignedFeeRange_get_max_fee_satoshis(&this_ptr_conv); return ret_val; } @@ -23242,6 +26883,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1set_1ma LDKClosingSignedFeeRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ClosingSignedFeeRange_set_max_fee_satoshis(&this_ptr_conv, val); } @@ -23250,6 +26892,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1new( uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -23257,14 +26900,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1new( return ret_ref; } +static inline uint64_t ClosingSignedFeeRange_clone_ptr(LDKClosingSignedFeeRange *NONNULL_PTR arg) { + LDKClosingSignedFeeRange ret_var = ClosingSignedFeeRange_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_ClosingSignedFeeRange_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKClosingSignedFeeRange arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ClosingSignedFeeRange_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKClosingSignedFeeRange orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKClosingSignedFeeRange ret_var = ClosingSignedFeeRange_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -23276,6 +26942,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1free(JNIEnv *en LDKClosingSigned this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ClosingSigned_free(this_obj_conv); } @@ -23283,6 +26950,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1cha LDKClosingSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ClosingSigned_get_channel_id(&this_ptr_conv)); return ret_arr; @@ -23292,6 +26960,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1set_1channel_1i LDKClosingSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -23302,6 +26971,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1fee_1sa LDKClosingSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ClosingSigned_get_fee_satoshis(&this_ptr_conv); return ret_val; } @@ -23310,6 +26980,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1set_1fee_1satos LDKClosingSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ClosingSigned_set_fee_satoshis(&this_ptr_conv, val); } @@ -23317,6 +26988,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1sig LDKClosingSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 64); (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, ClosingSigned_get_signature(&this_ptr_conv).compact_form); return ret_arr; @@ -23326,6 +26998,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1set_1signature( LDKClosingSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK((*env)->GetArrayLength(env, val) == 64); (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form); @@ -23336,11 +27009,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1fee_1ra LDKClosingSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKClosingSignedFeeRange ret_var = ClosingSigned_get_fee_range(&this_ptr_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -23353,9 +27028,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1set_1fee_1range LDKClosingSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKClosingSignedFeeRange val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = ClosingSignedFeeRange_clone(&val_conv); ClosingSigned_set_fee_range(&this_ptr_conv, val_conv); } @@ -23370,11 +27047,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1new(JNIEnv * LDKClosingSignedFeeRange fee_range_arg_conv; fee_range_arg_conv.inner = (void*)(fee_range_arg & (~1)); fee_range_arg_conv.is_owned = (fee_range_arg & 1) || (fee_range_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(fee_range_arg_conv); fee_range_arg_conv = ClosingSignedFeeRange_clone(&fee_range_arg_conv); LDKClosingSigned ret_var = ClosingSigned_new(channel_id_arg_ref, fee_satoshis_arg, signature_arg_ref, fee_range_arg_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -23382,14 +27061,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1new(JNIEnv * return ret_ref; } +static inline uint64_t ClosingSigned_clone_ptr(LDKClosingSigned *NONNULL_PTR arg) { + LDKClosingSigned ret_var = ClosingSigned_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_ClosingSigned_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKClosingSigned arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ClosingSigned_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKClosingSigned orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKClosingSigned ret_var = ClosingSigned_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -23401,6 +27103,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1free(JNIEnv *en LDKUpdateAddHTLC this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); UpdateAddHTLC_free(this_obj_conv); } @@ -23408,6 +27111,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1cha LDKUpdateAddHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UpdateAddHTLC_get_channel_id(&this_ptr_conv)); return ret_arr; @@ -23417,6 +27121,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1channel_1i LDKUpdateAddHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -23427,6 +27132,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1htlc_1i LDKUpdateAddHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = UpdateAddHTLC_get_htlc_id(&this_ptr_conv); return ret_val; } @@ -23435,6 +27141,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1htlc_1id(J LDKUpdateAddHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); UpdateAddHTLC_set_htlc_id(&this_ptr_conv, val); } @@ -23442,6 +27149,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1amount_ LDKUpdateAddHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = UpdateAddHTLC_get_amount_msat(&this_ptr_conv); return ret_val; } @@ -23450,6 +27158,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1amount_1ms LDKUpdateAddHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); UpdateAddHTLC_set_amount_msat(&this_ptr_conv, val); } @@ -23457,6 +27166,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1pay LDKUpdateAddHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UpdateAddHTLC_get_payment_hash(&this_ptr_conv)); return ret_arr; @@ -23466,6 +27176,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1payment_1h LDKUpdateAddHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -23476,6 +27187,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1cltv_1e LDKUpdateAddHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = UpdateAddHTLC_get_cltv_expiry(&this_ptr_conv); return ret_val; } @@ -23484,17 +27196,41 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1cltv_1expi LDKUpdateAddHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); UpdateAddHTLC_set_cltv_expiry(&this_ptr_conv, val); } +static inline uint64_t UpdateAddHTLC_clone_ptr(LDKUpdateAddHTLC *NONNULL_PTR arg) { + LDKUpdateAddHTLC ret_var = UpdateAddHTLC_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_UpdateAddHTLC_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKUpdateAddHTLC arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = UpdateAddHTLC_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKUpdateAddHTLC orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKUpdateAddHTLC ret_var = UpdateAddHTLC_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -23506,6 +27242,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1free(JNIEnv LDKUpdateFulfillHTLC this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); UpdateFulfillHTLC_free(this_obj_conv); } @@ -23513,6 +27250,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1get_ LDKUpdateFulfillHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UpdateFulfillHTLC_get_channel_id(&this_ptr_conv)); return ret_arr; @@ -23522,6 +27260,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1set_1channe LDKUpdateFulfillHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -23532,6 +27271,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1get_1htl LDKUpdateFulfillHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = UpdateFulfillHTLC_get_htlc_id(&this_ptr_conv); return ret_val; } @@ -23540,6 +27280,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1set_1htlc_1 LDKUpdateFulfillHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); UpdateFulfillHTLC_set_htlc_id(&this_ptr_conv, val); } @@ -23547,6 +27288,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1get_ LDKUpdateFulfillHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UpdateFulfillHTLC_get_payment_preimage(&this_ptr_conv)); return ret_arr; @@ -23556,6 +27298,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1set_1paymen LDKUpdateFulfillHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -23573,6 +27316,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1new(JNIE uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -23580,14 +27324,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1new(JNIE return ret_ref; } +static inline uint64_t UpdateFulfillHTLC_clone_ptr(LDKUpdateFulfillHTLC *NONNULL_PTR arg) { + LDKUpdateFulfillHTLC ret_var = UpdateFulfillHTLC_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_UpdateFulfillHTLC_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKUpdateFulfillHTLC arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = UpdateFulfillHTLC_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKUpdateFulfillHTLC orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKUpdateFulfillHTLC ret_var = UpdateFulfillHTLC_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -23599,6 +27366,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1free(JNIEnv *e LDKUpdateFailHTLC this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); UpdateFailHTLC_free(this_obj_conv); } @@ -23606,6 +27374,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1get_1ch LDKUpdateFailHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UpdateFailHTLC_get_channel_id(&this_ptr_conv)); return ret_arr; @@ -23615,6 +27384,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1set_1channel_1 LDKUpdateFailHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -23625,6 +27395,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1get_1htlc_1 LDKUpdateFailHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = UpdateFailHTLC_get_htlc_id(&this_ptr_conv); return ret_val; } @@ -23633,17 +27404,41 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1set_1htlc_1id( LDKUpdateFailHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); UpdateFailHTLC_set_htlc_id(&this_ptr_conv, val); } +static inline uint64_t UpdateFailHTLC_clone_ptr(LDKUpdateFailHTLC *NONNULL_PTR arg) { + LDKUpdateFailHTLC ret_var = UpdateFailHTLC_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_UpdateFailHTLC_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKUpdateFailHTLC arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = UpdateFailHTLC_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKUpdateFailHTLC orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKUpdateFailHTLC ret_var = UpdateFailHTLC_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -23655,6 +27450,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1free( LDKUpdateFailMalformedHTLC this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); UpdateFailMalformedHTLC_free(this_obj_conv); } @@ -23662,6 +27458,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC LDKUpdateFailMalformedHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UpdateFailMalformedHTLC_get_channel_id(&this_ptr_conv)); return ret_arr; @@ -23671,6 +27468,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1set_1 LDKUpdateFailMalformedHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -23681,6 +27479,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1ge LDKUpdateFailMalformedHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = UpdateFailMalformedHTLC_get_htlc_id(&this_ptr_conv); return ret_val; } @@ -23689,6 +27488,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1set_1 LDKUpdateFailMalformedHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); UpdateFailMalformedHTLC_set_htlc_id(&this_ptr_conv, val); } @@ -23696,6 +27496,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1ge LDKUpdateFailMalformedHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = UpdateFailMalformedHTLC_get_failure_code(&this_ptr_conv); return ret_val; } @@ -23704,17 +27505,41 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1set_1 LDKUpdateFailMalformedHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); UpdateFailMalformedHTLC_set_failure_code(&this_ptr_conv, val); } +static inline uint64_t UpdateFailMalformedHTLC_clone_ptr(LDKUpdateFailMalformedHTLC *NONNULL_PTR arg) { + LDKUpdateFailMalformedHTLC ret_var = UpdateFailMalformedHTLC_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_UpdateFailMalformedHTLC_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKUpdateFailMalformedHTLC arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = UpdateFailMalformedHTLC_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKUpdateFailMalformedHTLC orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKUpdateFailMalformedHTLC ret_var = UpdateFailMalformedHTLC_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -23726,6 +27551,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1free(JNIEnv LDKCommitmentSigned this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); CommitmentSigned_free(this_obj_conv); } @@ -23733,6 +27559,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1get_1 LDKCommitmentSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *CommitmentSigned_get_channel_id(&this_ptr_conv)); return ret_arr; @@ -23742,6 +27569,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1set_1channel LDKCommitmentSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -23752,6 +27580,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1get_1 LDKCommitmentSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 64); (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, CommitmentSigned_get_signature(&this_ptr_conv).compact_form); return ret_arr; @@ -23761,6 +27590,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1set_1signatu LDKCommitmentSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK((*env)->GetArrayLength(env, val) == 64); (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form); @@ -23771,6 +27601,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1set_1htlc_1s LDKCommitmentSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_SignatureZ val_constr; val_constr.datalen = (*env)->GetArrayLength(env, val); if (val_constr.datalen > 0) @@ -23811,6 +27642,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1new(JNIEn uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -23818,14 +27650,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1new(JNIEn return ret_ref; } +static inline uint64_t CommitmentSigned_clone_ptr(LDKCommitmentSigned *NONNULL_PTR arg) { + LDKCommitmentSigned ret_var = CommitmentSigned_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_CommitmentSigned_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCommitmentSigned arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = CommitmentSigned_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCommitmentSigned orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKCommitmentSigned ret_var = CommitmentSigned_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -23837,6 +27692,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1free(JNIEnv *env LDKRevokeAndACK this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); RevokeAndACK_free(this_obj_conv); } @@ -23844,6 +27700,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1get_1chan LDKRevokeAndACK this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *RevokeAndACK_get_channel_id(&this_ptr_conv)); return ret_arr; @@ -23853,6 +27710,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1set_1channel_1id LDKRevokeAndACK this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -23863,6 +27721,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1get_1per_ LDKRevokeAndACK this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *RevokeAndACK_get_per_commitment_secret(&this_ptr_conv)); return ret_arr; @@ -23872,6 +27731,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1set_1per_1commit LDKRevokeAndACK this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -23882,6 +27742,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1get_1next LDKRevokeAndACK this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, RevokeAndACK_get_next_per_commitment_point(&this_ptr_conv).compressed_form); return ret_arr; @@ -23891,6 +27752,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1set_1next_1per_1 LDKRevokeAndACK this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -23911,6 +27773,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1new(JNIEnv *e uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -23918,14 +27781,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1new(JNIEnv *e return ret_ref; } +static inline uint64_t RevokeAndACK_clone_ptr(LDKRevokeAndACK *NONNULL_PTR arg) { + LDKRevokeAndACK ret_var = RevokeAndACK_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_RevokeAndACK_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKRevokeAndACK arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = RevokeAndACK_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKRevokeAndACK orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKRevokeAndACK ret_var = RevokeAndACK_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -23937,6 +27823,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFee_1free(JNIEnv *env, j LDKUpdateFee this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); UpdateFee_free(this_obj_conv); } @@ -23944,6 +27831,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFee_1get_1channel LDKUpdateFee this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UpdateFee_get_channel_id(&this_ptr_conv)); return ret_arr; @@ -23953,6 +27841,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFee_1set_1channel_1id(JN LDKUpdateFee this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -23963,6 +27852,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_UpdateFee_1get_1feerate_1pe LDKUpdateFee this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = UpdateFee_get_feerate_per_kw(&this_ptr_conv); return ret_val; } @@ -23971,6 +27861,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFee_1set_1feerate_1per_1 LDKUpdateFee this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); UpdateFee_set_feerate_per_kw(&this_ptr_conv, val); } @@ -23982,6 +27873,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFee_1new(JNIEnv *env, uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -23989,14 +27881,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFee_1new(JNIEnv *env, return ret_ref; } +static inline uint64_t UpdateFee_clone_ptr(LDKUpdateFee *NONNULL_PTR arg) { + LDKUpdateFee ret_var = UpdateFee_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_UpdateFee_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKUpdateFee arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = UpdateFee_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFee_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKUpdateFee orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKUpdateFee ret_var = UpdateFee_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -24008,6 +27923,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1free(JNIEnv * LDKDataLossProtect this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); DataLossProtect_free(this_obj_conv); } @@ -24015,6 +27931,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1get_1y LDKDataLossProtect this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *DataLossProtect_get_your_last_per_commitment_secret(&this_ptr_conv)); return ret_arr; @@ -24024,6 +27941,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1set_1your_1la LDKDataLossProtect this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -24034,6 +27952,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1get_1m LDKDataLossProtect this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, DataLossProtect_get_my_current_per_commitment_point(&this_ptr_conv).compressed_form); return ret_arr; @@ -24043,6 +27962,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1set_1my_1curr LDKDataLossProtect this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -24060,6 +27980,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1new(JNIEnv uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -24067,14 +27988,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1new(JNIEnv return ret_ref; } +static inline uint64_t DataLossProtect_clone_ptr(LDKDataLossProtect *NONNULL_PTR arg) { + LDKDataLossProtect ret_var = DataLossProtect_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_DataLossProtect_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKDataLossProtect arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = DataLossProtect_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKDataLossProtect orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKDataLossProtect ret_var = DataLossProtect_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -24086,6 +28030,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1free(JNIEn LDKChannelReestablish this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ChannelReestablish_free(this_obj_conv); } @@ -24093,6 +28038,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1get LDKChannelReestablish this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ChannelReestablish_get_channel_id(&this_ptr_conv)); return ret_arr; @@ -24102,6 +28048,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1set_1chann LDKChannelReestablish this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -24112,6 +28059,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1get_1ne LDKChannelReestablish this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ChannelReestablish_get_next_local_commitment_number(&this_ptr_conv); return ret_val; } @@ -24120,6 +28068,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1set_1next_ LDKChannelReestablish this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelReestablish_set_next_local_commitment_number(&this_ptr_conv, val); } @@ -24127,6 +28076,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1get_1ne LDKChannelReestablish this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ChannelReestablish_get_next_remote_commitment_number(&this_ptr_conv); return ret_val; } @@ -24135,17 +28085,41 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1set_1next_ LDKChannelReestablish this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelReestablish_set_next_remote_commitment_number(&this_ptr_conv, val); } +static inline uint64_t ChannelReestablish_clone_ptr(LDKChannelReestablish *NONNULL_PTR arg) { + LDKChannelReestablish ret_var = ChannelReestablish_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_ChannelReestablish_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChannelReestablish arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ChannelReestablish_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKChannelReestablish orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelReestablish ret_var = ChannelReestablish_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -24157,6 +28131,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1free(J LDKAnnouncementSignatures this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); AnnouncementSignatures_free(this_obj_conv); } @@ -24164,6 +28139,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_ LDKAnnouncementSignatures this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *AnnouncementSignatures_get_channel_id(&this_ptr_conv)); return ret_arr; @@ -24173,6 +28149,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1c LDKAnnouncementSignatures this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -24183,6 +28160,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get LDKAnnouncementSignatures this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = AnnouncementSignatures_get_short_channel_id(&this_ptr_conv); return ret_val; } @@ -24191,6 +28169,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1s LDKAnnouncementSignatures this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); AnnouncementSignatures_set_short_channel_id(&this_ptr_conv, val); } @@ -24198,6 +28177,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_ LDKAnnouncementSignatures this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 64); (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, AnnouncementSignatures_get_node_signature(&this_ptr_conv).compact_form); return ret_arr; @@ -24207,6 +28187,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1n LDKAnnouncementSignatures this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK((*env)->GetArrayLength(env, val) == 64); (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form); @@ -24217,6 +28198,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_ LDKAnnouncementSignatures this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 64); (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, AnnouncementSignatures_get_bitcoin_signature(&this_ptr_conv).compact_form); return ret_arr; @@ -24226,6 +28208,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1b LDKAnnouncementSignatures this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK((*env)->GetArrayLength(env, val) == 64); (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form); @@ -24246,6 +28229,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1new uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -24253,14 +28237,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1new return ret_ref; } +static inline uint64_t AnnouncementSignatures_clone_ptr(LDKAnnouncementSignatures *NONNULL_PTR arg) { + LDKAnnouncementSignatures ret_var = AnnouncementSignatures_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_AnnouncementSignatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKAnnouncementSignatures arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = AnnouncementSignatures_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKAnnouncementSignatures orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKAnnouncementSignatures ret_var = AnnouncementSignatures_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -24277,6 +28284,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetAddress_1free(JNIEnv *env, NetAddress_free(this_ptr_conv); } +static inline uint64_t NetAddress_clone_ptr(LDKNetAddress *NONNULL_PTR arg) { + LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress"); + *ret_copy = NetAddress_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetAddress_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKNetAddress* arg_conv = (LDKNetAddress*)arg; + int64_t ret_val = NetAddress_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetAddress_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKNetAddress* orig_conv = (LDKNetAddress*)orig; LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress"); @@ -24348,6 +28367,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1free LDKUnsignedNodeAnnouncement this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); UnsignedNodeAnnouncement_free(this_obj_conv); } @@ -24355,10 +28375,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1g LDKUnsignedNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKNodeFeatures ret_var = UnsignedNodeAnnouncement_get_features(&this_ptr_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -24370,9 +28392,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_ LDKUnsignedNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKNodeFeatures val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = NodeFeatures_clone(&val_conv); UnsignedNodeAnnouncement_set_features(&this_ptr_conv, val_conv); } @@ -24381,6 +28405,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1g LDKUnsignedNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = UnsignedNodeAnnouncement_get_timestamp(&this_ptr_conv); return ret_val; } @@ -24389,6 +28414,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_ LDKUnsignedNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); UnsignedNodeAnnouncement_set_timestamp(&this_ptr_conv, val); } @@ -24396,6 +28422,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncemen LDKUnsignedNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, UnsignedNodeAnnouncement_get_node_id(&this_ptr_conv).compressed_form); return ret_arr; @@ -24405,6 +28432,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_ LDKUnsignedNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -24415,6 +28443,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncemen LDKUnsignedNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 3); (*env)->SetByteArrayRegion(env, ret_arr, 0, 3, *UnsignedNodeAnnouncement_get_rgb(&this_ptr_conv)); return ret_arr; @@ -24424,6 +28453,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_ LDKUnsignedNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThreeBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 3); (*env)->GetByteArrayRegion(env, val, 0, 3, val_ref.data); @@ -24434,6 +28464,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncemen LDKUnsignedNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UnsignedNodeAnnouncement_get_alias(&this_ptr_conv)); return ret_arr; @@ -24443,6 +28474,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_ LDKUnsignedNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -24453,6 +28485,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_ LDKUnsignedNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_NetAddressZ val_constr; val_constr.datalen = (*env)->GetArrayLength(env, val); if (val_constr.datalen > 0) @@ -24472,14 +28505,37 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_ UnsignedNodeAnnouncement_set_addresses(&this_ptr_conv, val_constr); } +static inline uint64_t UnsignedNodeAnnouncement_clone_ptr(LDKUnsignedNodeAnnouncement *NONNULL_PTR arg) { + LDKUnsignedNodeAnnouncement ret_var = UnsignedNodeAnnouncement_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_UnsignedNodeAnnouncement_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKUnsignedNodeAnnouncement arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = UnsignedNodeAnnouncement_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKUnsignedNodeAnnouncement orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKUnsignedNodeAnnouncement ret_var = UnsignedNodeAnnouncement_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -24491,6 +28547,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1free(JNIEnv LDKNodeAnnouncement this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); NodeAnnouncement_free(this_obj_conv); } @@ -24498,6 +28555,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1get_1 LDKNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 64); (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, NodeAnnouncement_get_signature(&this_ptr_conv).compact_form); return ret_arr; @@ -24507,6 +28565,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1set_1signatu LDKNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK((*env)->GetArrayLength(env, val) == 64); (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form); @@ -24517,10 +28576,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1get_1cont LDKNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKUnsignedNodeAnnouncement ret_var = NodeAnnouncement_get_contents(&this_ptr_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -24532,9 +28593,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1set_1content LDKNodeAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKUnsignedNodeAnnouncement val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = UnsignedNodeAnnouncement_clone(&val_conv); NodeAnnouncement_set_contents(&this_ptr_conv, val_conv); } @@ -24546,11 +28609,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1new(JNIEn LDKUnsignedNodeAnnouncement contents_arg_conv; contents_arg_conv.inner = (void*)(contents_arg & (~1)); contents_arg_conv.is_owned = (contents_arg & 1) || (contents_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(contents_arg_conv); contents_arg_conv = UnsignedNodeAnnouncement_clone(&contents_arg_conv); LDKNodeAnnouncement ret_var = NodeAnnouncement_new(signature_arg_ref, contents_arg_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -24558,14 +28623,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1new(JNIEn return ret_ref; } +static inline uint64_t NodeAnnouncement_clone_ptr(LDKNodeAnnouncement *NONNULL_PTR arg) { + LDKNodeAnnouncement ret_var = NodeAnnouncement_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_NodeAnnouncement_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKNodeAnnouncement arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = NodeAnnouncement_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKNodeAnnouncement orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKNodeAnnouncement ret_var = NodeAnnouncement_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -24577,6 +28665,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1f LDKUnsignedChannelAnnouncement this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); UnsignedChannelAnnouncement_free(this_obj_conv); } @@ -24584,10 +28673,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement LDKUnsignedChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelFeatures ret_var = UnsignedChannelAnnouncement_get_features(&this_ptr_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -24599,9 +28690,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1s LDKUnsignedChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelFeatures val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = ChannelFeatures_clone(&val_conv); UnsignedChannelAnnouncement_set_features(&this_ptr_conv, val_conv); } @@ -24610,6 +28703,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnounce LDKUnsignedChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UnsignedChannelAnnouncement_get_chain_hash(&this_ptr_conv)); return ret_arr; @@ -24619,6 +28713,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1s LDKUnsignedChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -24629,6 +28724,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement LDKUnsignedChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = UnsignedChannelAnnouncement_get_short_channel_id(&this_ptr_conv); return ret_val; } @@ -24637,6 +28733,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1s LDKUnsignedChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); UnsignedChannelAnnouncement_set_short_channel_id(&this_ptr_conv, val); } @@ -24644,6 +28741,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnounce LDKUnsignedChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, UnsignedChannelAnnouncement_get_node_id_1(&this_ptr_conv).compressed_form); return ret_arr; @@ -24653,6 +28751,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1s LDKUnsignedChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -24663,6 +28762,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnounce LDKUnsignedChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, UnsignedChannelAnnouncement_get_node_id_2(&this_ptr_conv).compressed_form); return ret_arr; @@ -24672,6 +28772,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1s LDKUnsignedChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -24682,6 +28783,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnounce LDKUnsignedChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, UnsignedChannelAnnouncement_get_bitcoin_key_1(&this_ptr_conv).compressed_form); return ret_arr; @@ -24691,6 +28793,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1s LDKUnsignedChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -24701,6 +28804,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnounce LDKUnsignedChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, UnsignedChannelAnnouncement_get_bitcoin_key_2(&this_ptr_conv).compressed_form); return ret_arr; @@ -24710,20 +28814,44 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1s LDKUnsignedChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); UnsignedChannelAnnouncement_set_bitcoin_key_2(&this_ptr_conv, val_ref); } +static inline uint64_t UnsignedChannelAnnouncement_clone_ptr(LDKUnsignedChannelAnnouncement *NONNULL_PTR arg) { + LDKUnsignedChannelAnnouncement ret_var = UnsignedChannelAnnouncement_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_UnsignedChannelAnnouncement_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKUnsignedChannelAnnouncement arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = UnsignedChannelAnnouncement_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKUnsignedChannelAnnouncement orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKUnsignedChannelAnnouncement ret_var = UnsignedChannelAnnouncement_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -24735,6 +28863,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1free(JNIE LDKChannelAnnouncement this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ChannelAnnouncement_free(this_obj_conv); } @@ -24742,6 +28871,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1ge LDKChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 64); (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, ChannelAnnouncement_get_node_signature_1(&this_ptr_conv).compact_form); return ret_arr; @@ -24751,6 +28881,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1node LDKChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK((*env)->GetArrayLength(env, val) == 64); (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form); @@ -24761,6 +28892,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1ge LDKChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 64); (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, ChannelAnnouncement_get_node_signature_2(&this_ptr_conv).compact_form); return ret_arr; @@ -24770,6 +28902,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1node LDKChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK((*env)->GetArrayLength(env, val) == 64); (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form); @@ -24780,6 +28913,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1ge LDKChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 64); (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, ChannelAnnouncement_get_bitcoin_signature_1(&this_ptr_conv).compact_form); return ret_arr; @@ -24789,6 +28923,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1bitc LDKChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK((*env)->GetArrayLength(env, val) == 64); (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form); @@ -24799,6 +28934,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1ge LDKChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 64); (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, ChannelAnnouncement_get_bitcoin_signature_2(&this_ptr_conv).compact_form); return ret_arr; @@ -24808,6 +28944,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1bitc LDKChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK((*env)->GetArrayLength(env, val) == 64); (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form); @@ -24818,10 +28955,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1c LDKChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKUnsignedChannelAnnouncement ret_var = ChannelAnnouncement_get_contents(&this_ptr_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -24833,9 +28972,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1cont LDKChannelAnnouncement this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKUnsignedChannelAnnouncement val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = UnsignedChannelAnnouncement_clone(&val_conv); ChannelAnnouncement_set_contents(&this_ptr_conv, val_conv); } @@ -24856,11 +28997,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1new(JN LDKUnsignedChannelAnnouncement contents_arg_conv; contents_arg_conv.inner = (void*)(contents_arg & (~1)); contents_arg_conv.is_owned = (contents_arg & 1) || (contents_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(contents_arg_conv); contents_arg_conv = UnsignedChannelAnnouncement_clone(&contents_arg_conv); LDKChannelAnnouncement ret_var = ChannelAnnouncement_new(node_signature_1_arg_ref, node_signature_2_arg_ref, bitcoin_signature_1_arg_ref, bitcoin_signature_2_arg_ref, contents_arg_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -24868,14 +29011,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1new(JN return ret_ref; } +static inline uint64_t ChannelAnnouncement_clone_ptr(LDKChannelAnnouncement *NONNULL_PTR arg) { + LDKChannelAnnouncement ret_var = ChannelAnnouncement_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_ChannelAnnouncement_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChannelAnnouncement arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ChannelAnnouncement_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKChannelAnnouncement orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelAnnouncement ret_var = ChannelAnnouncement_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -24887,6 +29053,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1free(JN LDKUnsignedChannelUpdate this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); UnsignedChannelUpdate_free(this_obj_conv); } @@ -24894,6 +29061,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1 LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UnsignedChannelUpdate_get_chain_hash(&this_ptr_conv)); return ret_arr; @@ -24903,6 +29071,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1ch LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -24913,6 +29082,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_ LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = UnsignedChannelUpdate_get_short_channel_id(&this_ptr_conv); return ret_val; } @@ -24921,6 +29091,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1sh LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); UnsignedChannelUpdate_set_short_channel_id(&this_ptr_conv, val); } @@ -24928,6 +29099,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_ LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = UnsignedChannelUpdate_get_timestamp(&this_ptr_conv); return ret_val; } @@ -24936,6 +29108,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1ti LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); UnsignedChannelUpdate_set_timestamp(&this_ptr_conv, val); } @@ -24943,6 +29116,7 @@ JNIEXPORT int8_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1 LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_t ret_val = UnsignedChannelUpdate_get_flags(&this_ptr_conv); return ret_val; } @@ -24951,6 +29125,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1fl LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); UnsignedChannelUpdate_set_flags(&this_ptr_conv, val); } @@ -24958,6 +29133,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_ LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = UnsignedChannelUpdate_get_cltv_expiry_delta(&this_ptr_conv); return ret_val; } @@ -24966,6 +29142,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1cl LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); UnsignedChannelUpdate_set_cltv_expiry_delta(&this_ptr_conv, val); } @@ -24973,6 +29150,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_ LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = UnsignedChannelUpdate_get_htlc_minimum_msat(&this_ptr_conv); return ret_val; } @@ -24981,6 +29159,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1ht LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); UnsignedChannelUpdate_set_htlc_minimum_msat(&this_ptr_conv, val); } @@ -24988,6 +29167,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_ LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = UnsignedChannelUpdate_get_fee_base_msat(&this_ptr_conv); return ret_val; } @@ -24996,6 +29176,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1fe LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); UnsignedChannelUpdate_set_fee_base_msat(&this_ptr_conv, val); } @@ -25003,6 +29184,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_ LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = UnsignedChannelUpdate_get_fee_proportional_millionths(&this_ptr_conv); return ret_val; } @@ -25011,17 +29193,41 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1fe LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); UnsignedChannelUpdate_set_fee_proportional_millionths(&this_ptr_conv, val); } +static inline uint64_t UnsignedChannelUpdate_clone_ptr(LDKUnsignedChannelUpdate *NONNULL_PTR arg) { + LDKUnsignedChannelUpdate ret_var = UnsignedChannelUpdate_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_UnsignedChannelUpdate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKUnsignedChannelUpdate arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = UnsignedChannelUpdate_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKUnsignedChannelUpdate orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKUnsignedChannelUpdate ret_var = UnsignedChannelUpdate_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25033,6 +29239,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1free(JNIEnv *en LDKChannelUpdate this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ChannelUpdate_free(this_obj_conv); } @@ -25040,6 +29247,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1get_1sig LDKChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 64); (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, ChannelUpdate_get_signature(&this_ptr_conv).compact_form); return ret_arr; @@ -25049,6 +29257,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1set_1signature( LDKChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK((*env)->GetArrayLength(env, val) == 64); (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form); @@ -25059,10 +29268,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1get_1content LDKChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKUnsignedChannelUpdate ret_var = ChannelUpdate_get_contents(&this_ptr_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25074,9 +29285,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1set_1contents(J LDKChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKUnsignedChannelUpdate val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = UnsignedChannelUpdate_clone(&val_conv); ChannelUpdate_set_contents(&this_ptr_conv, val_conv); } @@ -25088,11 +29301,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1new(JNIEnv * LDKUnsignedChannelUpdate contents_arg_conv; contents_arg_conv.inner = (void*)(contents_arg & (~1)); contents_arg_conv.is_owned = (contents_arg & 1) || (contents_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(contents_arg_conv); contents_arg_conv = UnsignedChannelUpdate_clone(&contents_arg_conv); LDKChannelUpdate ret_var = ChannelUpdate_new(signature_arg_ref, contents_arg_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25100,14 +29315,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1new(JNIEnv * return ret_ref; } +static inline uint64_t ChannelUpdate_clone_ptr(LDKChannelUpdate *NONNULL_PTR arg) { + LDKChannelUpdate ret_var = ChannelUpdate_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_ChannelUpdate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChannelUpdate arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ChannelUpdate_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKChannelUpdate orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelUpdate ret_var = ChannelUpdate_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25119,6 +29357,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1free(JNIEnv LDKQueryChannelRange this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); QueryChannelRange_free(this_obj_conv); } @@ -25126,6 +29365,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1get_ LDKQueryChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *QueryChannelRange_get_chain_hash(&this_ptr_conv)); return ret_arr; @@ -25135,6 +29375,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1set_1chain_ LDKQueryChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -25145,6 +29386,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1get_1fir LDKQueryChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = QueryChannelRange_get_first_blocknum(&this_ptr_conv); return ret_val; } @@ -25153,6 +29395,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1set_1first_ LDKQueryChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); QueryChannelRange_set_first_blocknum(&this_ptr_conv, val); } @@ -25160,6 +29403,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1get_1num LDKQueryChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = QueryChannelRange_get_number_of_blocks(&this_ptr_conv); return ret_val; } @@ -25168,6 +29412,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1set_1number LDKQueryChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); QueryChannelRange_set_number_of_blocks(&this_ptr_conv, val); } @@ -25179,6 +29424,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1new(JNIE uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25186,14 +29432,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1new(JNIE return ret_ref; } +static inline uint64_t QueryChannelRange_clone_ptr(LDKQueryChannelRange *NONNULL_PTR arg) { + LDKQueryChannelRange ret_var = QueryChannelRange_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_QueryChannelRange_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKQueryChannelRange arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = QueryChannelRange_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKQueryChannelRange orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKQueryChannelRange ret_var = QueryChannelRange_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25205,6 +29474,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1free(JNIEnv LDKReplyChannelRange this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ReplyChannelRange_free(this_obj_conv); } @@ -25212,6 +29482,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_ LDKReplyChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ReplyChannelRange_get_chain_hash(&this_ptr_conv)); return ret_arr; @@ -25221,6 +29492,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1chain_ LDKReplyChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -25231,6 +29503,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1fir LDKReplyChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = ReplyChannelRange_get_first_blocknum(&this_ptr_conv); return ret_val; } @@ -25239,6 +29512,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1first_ LDKReplyChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ReplyChannelRange_set_first_blocknum(&this_ptr_conv, val); } @@ -25246,6 +29520,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1num LDKReplyChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = ReplyChannelRange_get_number_of_blocks(&this_ptr_conv); return ret_val; } @@ -25254,6 +29529,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1number LDKReplyChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ReplyChannelRange_set_number_of_blocks(&this_ptr_conv, val); } @@ -25261,6 +29537,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1sy LDKReplyChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); jboolean ret_val = ReplyChannelRange_get_sync_complete(&this_ptr_conv); return ret_val; } @@ -25269,6 +29546,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1sync_1 LDKReplyChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ReplyChannelRange_set_sync_complete(&this_ptr_conv, val); } @@ -25276,6 +29554,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1short_ LDKReplyChannelRange this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_u64Z val_constr; val_constr.datalen = (*env)->GetArrayLength(env, val); if (val_constr.datalen > 0) @@ -25311,6 +29590,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1new(JNIE uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25318,14 +29598,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1new(JNIE return ret_ref; } +static inline uint64_t ReplyChannelRange_clone_ptr(LDKReplyChannelRange *NONNULL_PTR arg) { + LDKReplyChannelRange ret_var = ReplyChannelRange_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_ReplyChannelRange_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKReplyChannelRange arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ReplyChannelRange_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKReplyChannelRange orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKReplyChannelRange ret_var = ReplyChannelRange_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25337,6 +29640,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1free(JNI LDKQueryShortChannelIds this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); QueryShortChannelIds_free(this_obj_conv); } @@ -25344,6 +29648,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1g LDKQueryShortChannelIds this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *QueryShortChannelIds_get_chain_hash(&this_ptr_conv)); return ret_arr; @@ -25353,6 +29658,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1set_1cha LDKQueryShortChannelIds this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -25363,6 +29669,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1set_1sho LDKQueryShortChannelIds this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_u64Z val_constr; val_constr.datalen = (*env)->GetArrayLength(env, val); if (val_constr.datalen > 0) @@ -25398,6 +29705,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1new(J uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25405,14 +29713,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1new(J return ret_ref; } +static inline uint64_t QueryShortChannelIds_clone_ptr(LDKQueryShortChannelIds *NONNULL_PTR arg) { + LDKQueryShortChannelIds ret_var = QueryShortChannelIds_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_QueryShortChannelIds_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKQueryShortChannelIds arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = QueryShortChannelIds_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKQueryShortChannelIds orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKQueryShortChannelIds ret_var = QueryShortChannelIds_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25424,6 +29755,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1free( LDKReplyShortChannelIdsEnd this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ReplyShortChannelIdsEnd_free(this_obj_conv); } @@ -25431,6 +29763,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd LDKReplyShortChannelIdsEnd this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ReplyShortChannelIdsEnd_get_chain_hash(&this_ptr_conv)); return ret_arr; @@ -25440,6 +29773,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1set_1 LDKReplyShortChannelIdsEnd this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -25450,6 +29784,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1g LDKReplyShortChannelIdsEnd this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); jboolean ret_val = ReplyShortChannelIdsEnd_get_full_information(&this_ptr_conv); return ret_val; } @@ -25458,6 +29793,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1set_1 LDKReplyShortChannelIdsEnd this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ReplyShortChannelIdsEnd_set_full_information(&this_ptr_conv, val); } @@ -25469,6 +29805,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1ne uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25476,14 +29813,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1ne return ret_ref; } +static inline uint64_t ReplyShortChannelIdsEnd_clone_ptr(LDKReplyShortChannelIdsEnd *NONNULL_PTR arg) { + LDKReplyShortChannelIdsEnd ret_var = ReplyShortChannelIdsEnd_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_ReplyShortChannelIdsEnd_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKReplyShortChannelIdsEnd arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ReplyShortChannelIdsEnd_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKReplyShortChannelIdsEnd orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKReplyShortChannelIdsEnd ret_var = ReplyShortChannelIdsEnd_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25495,6 +29855,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1free(JN LDKGossipTimestampFilter this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); GossipTimestampFilter_free(this_obj_conv); } @@ -25502,6 +29863,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1 LDKGossipTimestampFilter this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *GossipTimestampFilter_get_chain_hash(&this_ptr_conv)); return ret_arr; @@ -25511,6 +29873,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1set_1ch LDKGossipTimestampFilter this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -25521,6 +29884,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1get_ LDKGossipTimestampFilter this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = GossipTimestampFilter_get_first_timestamp(&this_ptr_conv); return ret_val; } @@ -25529,6 +29893,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1set_1fi LDKGossipTimestampFilter this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); GossipTimestampFilter_set_first_timestamp(&this_ptr_conv, val); } @@ -25536,6 +29901,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1get_ LDKGossipTimestampFilter this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = GossipTimestampFilter_get_timestamp_range(&this_ptr_conv); return ret_val; } @@ -25544,6 +29910,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1set_1ti LDKGossipTimestampFilter this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); GossipTimestampFilter_set_timestamp_range(&this_ptr_conv, val); } @@ -25555,6 +29922,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1new( uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25562,14 +29930,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1new( return ret_ref; } +static inline uint64_t GossipTimestampFilter_clone_ptr(LDKGossipTimestampFilter *NONNULL_PTR arg) { + LDKGossipTimestampFilter ret_var = GossipTimestampFilter_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_GossipTimestampFilter_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKGossipTimestampFilter arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = GossipTimestampFilter_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKGossipTimestampFilter orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKGossipTimestampFilter ret_var = GossipTimestampFilter_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25586,6 +29977,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorAction_1free(JNIEnv *env, ErrorAction_free(this_ptr_conv); } +static inline uint64_t ErrorAction_clone_ptr(LDKErrorAction *NONNULL_PTR arg) { + LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); + *ret_copy = ErrorAction_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorAction_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKErrorAction* arg_conv = (LDKErrorAction*)arg; + int64_t ret_val = ErrorAction_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorAction_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKErrorAction* orig_conv = (LDKErrorAction*)orig; LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); @@ -25598,6 +30001,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorAction_1disconnect_1pe LDKErrorMessage msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = ErrorMessage_clone(&msg_conv); LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); *ret_copy = ErrorAction_disconnect_peer(msg_conv); @@ -25624,6 +30028,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorAction_1send_1error_1m LDKErrorMessage msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = ErrorMessage_clone(&msg_conv); LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); *ret_copy = ErrorAction_send_error_message(msg_conv); @@ -25635,6 +30040,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LightningError_1free(JNIEnv *e LDKLightningError this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); LightningError_free(this_obj_conv); } @@ -25642,6 +30048,7 @@ JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_LightningError_1get_1err(JN LDKLightningError this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKStr ret_str = LightningError_get_err(&this_ptr_conv); jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); Str_free(ret_str); @@ -25652,6 +30059,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LightningError_1set_1err(JNIEn LDKLightningError this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKStr val_conv = java_to_owned_str(env, val); LightningError_set_err(&this_ptr_conv, val_conv); } @@ -25660,6 +30068,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LightningError_1get_1action LDKLightningError this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); *ret_copy = LightningError_get_action(&this_ptr_conv); uint64_t ret_ref = (uint64_t)ret_copy; @@ -25670,6 +30079,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LightningError_1set_1action(JN LDKLightningError this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKErrorAction val_conv = *(LDKErrorAction*)(val_ptr); @@ -25687,6 +30097,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LightningError_1new(JNIEnv uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25694,14 +30105,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LightningError_1new(JNIEnv return ret_ref; } +static inline uint64_t LightningError_clone_ptr(LDKLightningError *NONNULL_PTR arg) { + LDKLightningError ret_var = LightningError_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_LightningError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKLightningError arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = LightningError_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LightningError_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKLightningError orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKLightningError ret_var = LightningError_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25713,6 +30147,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1free(JNIEnv LDKCommitmentUpdate this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); CommitmentUpdate_free(this_obj_conv); } @@ -25720,6 +30155,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_ LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_UpdateAddHTLCZ ret_var = CommitmentUpdate_get_update_add_htlcs(&this_ptr_conv); int64_tArray ret_arr = NULL; ret_arr = (*env)->NewLongArray(env, ret_var.datalen); @@ -25729,6 +30165,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_ uint64_t ret_conv_15_ref = 0; CHECK((((uint64_t)ret_conv_15_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_conv_15_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_15_var); ret_conv_15_ref = (uint64_t)ret_conv_15_var.inner; if (ret_conv_15_var.is_owned) { ret_conv_15_ref |= 1; @@ -25744,6 +30181,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_ LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_UpdateAddHTLCZ val_constr; val_constr.datalen = (*env)->GetArrayLength(env, val); if (val_constr.datalen > 0) @@ -25756,6 +30194,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_ LDKUpdateAddHTLC val_conv_15_conv; val_conv_15_conv.inner = (void*)(val_conv_15 & (~1)); val_conv_15_conv.is_owned = (val_conv_15 & 1) || (val_conv_15 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_15_conv); val_conv_15_conv = UpdateAddHTLC_clone(&val_conv_15_conv); val_constr.data[p] = val_conv_15_conv; } @@ -25767,6 +30206,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_ LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_UpdateFulfillHTLCZ ret_var = CommitmentUpdate_get_update_fulfill_htlcs(&this_ptr_conv); int64_tArray ret_arr = NULL; ret_arr = (*env)->NewLongArray(env, ret_var.datalen); @@ -25776,6 +30216,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_ uint64_t ret_conv_19_ref = 0; CHECK((((uint64_t)ret_conv_19_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_conv_19_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_19_var); ret_conv_19_ref = (uint64_t)ret_conv_19_var.inner; if (ret_conv_19_var.is_owned) { ret_conv_19_ref |= 1; @@ -25791,6 +30232,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_ LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_UpdateFulfillHTLCZ val_constr; val_constr.datalen = (*env)->GetArrayLength(env, val); if (val_constr.datalen > 0) @@ -25803,6 +30245,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_ LDKUpdateFulfillHTLC val_conv_19_conv; val_conv_19_conv.inner = (void*)(val_conv_19 & (~1)); val_conv_19_conv.is_owned = (val_conv_19 & 1) || (val_conv_19 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_19_conv); val_conv_19_conv = UpdateFulfillHTLC_clone(&val_conv_19_conv); val_constr.data[t] = val_conv_19_conv; } @@ -25814,6 +30257,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_ LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_UpdateFailHTLCZ ret_var = CommitmentUpdate_get_update_fail_htlcs(&this_ptr_conv); int64_tArray ret_arr = NULL; ret_arr = (*env)->NewLongArray(env, ret_var.datalen); @@ -25823,6 +30267,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_ uint64_t ret_conv_16_ref = 0; CHECK((((uint64_t)ret_conv_16_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_conv_16_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var); ret_conv_16_ref = (uint64_t)ret_conv_16_var.inner; if (ret_conv_16_var.is_owned) { ret_conv_16_ref |= 1; @@ -25838,6 +30283,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_ LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_UpdateFailHTLCZ val_constr; val_constr.datalen = (*env)->GetArrayLength(env, val); if (val_constr.datalen > 0) @@ -25850,6 +30296,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_ LDKUpdateFailHTLC val_conv_16_conv; val_conv_16_conv.inner = (void*)(val_conv_16 & (~1)); val_conv_16_conv.is_owned = (val_conv_16 & 1) || (val_conv_16 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_16_conv); val_conv_16_conv = UpdateFailHTLC_clone(&val_conv_16_conv); val_constr.data[q] = val_conv_16_conv; } @@ -25861,6 +30308,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_ LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_UpdateFailMalformedHTLCZ ret_var = CommitmentUpdate_get_update_fail_malformed_htlcs(&this_ptr_conv); int64_tArray ret_arr = NULL; ret_arr = (*env)->NewLongArray(env, ret_var.datalen); @@ -25870,6 +30318,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_ uint64_t ret_conv_25_ref = 0; CHECK((((uint64_t)ret_conv_25_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_conv_25_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_25_var); ret_conv_25_ref = (uint64_t)ret_conv_25_var.inner; if (ret_conv_25_var.is_owned) { ret_conv_25_ref |= 1; @@ -25885,6 +30334,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_ LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_UpdateFailMalformedHTLCZ val_constr; val_constr.datalen = (*env)->GetArrayLength(env, val); if (val_constr.datalen > 0) @@ -25897,6 +30347,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_ LDKUpdateFailMalformedHTLC val_conv_25_conv; val_conv_25_conv.inner = (void*)(val_conv_25 & (~1)); val_conv_25_conv.is_owned = (val_conv_25 & 1) || (val_conv_25 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_25_conv); val_conv_25_conv = UpdateFailMalformedHTLC_clone(&val_conv_25_conv); val_constr.data[z] = val_conv_25_conv; } @@ -25908,11 +30359,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_1upda LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKUpdateFee ret_var = CommitmentUpdate_get_update_fee(&this_ptr_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25925,9 +30378,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_ LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKUpdateFee val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = UpdateFee_clone(&val_conv); CommitmentUpdate_set_update_fee(&this_ptr_conv, val_conv); } @@ -25936,10 +30391,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_1comm LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCommitmentSigned ret_var = CommitmentUpdate_get_commitment_signed(&this_ptr_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -25951,9 +30408,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1commitm LDKCommitmentUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCommitmentSigned val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = CommitmentSigned_clone(&val_conv); CommitmentUpdate_set_commitment_signed(&this_ptr_conv, val_conv); } @@ -25971,6 +30430,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1new(JNIEn LDKUpdateAddHTLC update_add_htlcs_arg_conv_15_conv; update_add_htlcs_arg_conv_15_conv.inner = (void*)(update_add_htlcs_arg_conv_15 & (~1)); update_add_htlcs_arg_conv_15_conv.is_owned = (update_add_htlcs_arg_conv_15 & 1) || (update_add_htlcs_arg_conv_15 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_add_htlcs_arg_conv_15_conv); update_add_htlcs_arg_conv_15_conv = UpdateAddHTLC_clone(&update_add_htlcs_arg_conv_15_conv); update_add_htlcs_arg_constr.data[p] = update_add_htlcs_arg_conv_15_conv; } @@ -25987,6 +30447,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1new(JNIEn LDKUpdateFulfillHTLC update_fulfill_htlcs_arg_conv_19_conv; update_fulfill_htlcs_arg_conv_19_conv.inner = (void*)(update_fulfill_htlcs_arg_conv_19 & (~1)); update_fulfill_htlcs_arg_conv_19_conv.is_owned = (update_fulfill_htlcs_arg_conv_19 & 1) || (update_fulfill_htlcs_arg_conv_19 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_fulfill_htlcs_arg_conv_19_conv); update_fulfill_htlcs_arg_conv_19_conv = UpdateFulfillHTLC_clone(&update_fulfill_htlcs_arg_conv_19_conv); update_fulfill_htlcs_arg_constr.data[t] = update_fulfill_htlcs_arg_conv_19_conv; } @@ -26003,6 +30464,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1new(JNIEn LDKUpdateFailHTLC update_fail_htlcs_arg_conv_16_conv; update_fail_htlcs_arg_conv_16_conv.inner = (void*)(update_fail_htlcs_arg_conv_16 & (~1)); update_fail_htlcs_arg_conv_16_conv.is_owned = (update_fail_htlcs_arg_conv_16 & 1) || (update_fail_htlcs_arg_conv_16 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_fail_htlcs_arg_conv_16_conv); update_fail_htlcs_arg_conv_16_conv = UpdateFailHTLC_clone(&update_fail_htlcs_arg_conv_16_conv); update_fail_htlcs_arg_constr.data[q] = update_fail_htlcs_arg_conv_16_conv; } @@ -26019,6 +30481,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1new(JNIEn LDKUpdateFailMalformedHTLC update_fail_malformed_htlcs_arg_conv_25_conv; update_fail_malformed_htlcs_arg_conv_25_conv.inner = (void*)(update_fail_malformed_htlcs_arg_conv_25 & (~1)); update_fail_malformed_htlcs_arg_conv_25_conv.is_owned = (update_fail_malformed_htlcs_arg_conv_25 & 1) || (update_fail_malformed_htlcs_arg_conv_25 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_fail_malformed_htlcs_arg_conv_25_conv); update_fail_malformed_htlcs_arg_conv_25_conv = UpdateFailMalformedHTLC_clone(&update_fail_malformed_htlcs_arg_conv_25_conv); update_fail_malformed_htlcs_arg_constr.data[z] = update_fail_malformed_htlcs_arg_conv_25_conv; } @@ -26026,15 +30489,18 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1new(JNIEn LDKUpdateFee update_fee_arg_conv; update_fee_arg_conv.inner = (void*)(update_fee_arg & (~1)); update_fee_arg_conv.is_owned = (update_fee_arg & 1) || (update_fee_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_fee_arg_conv); update_fee_arg_conv = UpdateFee_clone(&update_fee_arg_conv); LDKCommitmentSigned commitment_signed_arg_conv; commitment_signed_arg_conv.inner = (void*)(commitment_signed_arg & (~1)); commitment_signed_arg_conv.is_owned = (commitment_signed_arg & 1) || (commitment_signed_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_signed_arg_conv); commitment_signed_arg_conv = CommitmentSigned_clone(&commitment_signed_arg_conv); LDKCommitmentUpdate ret_var = CommitmentUpdate_new(update_add_htlcs_arg_constr, update_fulfill_htlcs_arg_constr, update_fail_htlcs_arg_constr, update_fail_malformed_htlcs_arg_constr, update_fee_arg_conv, commitment_signed_arg_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -26042,14 +30508,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1new(JNIEn return ret_ref; } +static inline uint64_t CommitmentUpdate_clone_ptr(LDKCommitmentUpdate *NONNULL_PTR arg) { + LDKCommitmentUpdate ret_var = CommitmentUpdate_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_CommitmentUpdate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCommitmentUpdate arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = CommitmentUpdate_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCommitmentUpdate orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKCommitmentUpdate ret_var = CommitmentUpdate_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -26079,6 +30568,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1write(JN LDKAcceptChannel obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = AcceptChannel_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26100,6 +30590,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_ LDKAnnouncementSignatures obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = AnnouncementSignatures_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26121,6 +30612,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1wri LDKChannelReestablish obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ChannelReestablish_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26142,6 +30634,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1write(JN LDKClosingSigned obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ClosingSigned_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26163,6 +30656,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1 LDKClosingSignedFeeRange obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ClosingSignedFeeRange_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26184,6 +30678,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1write LDKCommitmentSigned obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = CommitmentSigned_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26205,6 +30700,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1write(J LDKFundingCreated obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = FundingCreated_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26226,6 +30722,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingSigned_1write(JN LDKFundingSigned obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = FundingSigned_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26247,6 +30744,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingLocked_1write(JN LDKFundingLocked obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = FundingLocked_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26268,6 +30766,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Init_1write(JNIEnv *env LDKInit obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = Init_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26289,6 +30788,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1write(JNIE LDKOpenChannel obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = OpenChannel_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26310,6 +30810,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1write(JNI LDKRevokeAndACK obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = RevokeAndACK_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26331,6 +30832,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Shutdown_1write(JNIEnv LDKShutdown obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = Shutdown_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26352,6 +30854,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1write(J LDKUpdateFailHTLC obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = UpdateFailHTLC_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26373,6 +30876,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC LDKUpdateFailMalformedHTLC obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = UpdateFailMalformedHTLC_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26394,6 +30898,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFee_1write(JNIEnv LDKUpdateFee obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = UpdateFee_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26415,6 +30920,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1writ LDKUpdateFulfillHTLC obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = UpdateFulfillHTLC_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26436,6 +30942,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1write(JN LDKUpdateAddHTLC obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = UpdateAddHTLC_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26457,6 +30964,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Ping_1write(JNIEnv *env LDKPing obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = Ping_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26478,6 +30986,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Pong_1write(JNIEnv *env LDKPong obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = Pong_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26499,6 +31008,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnounce LDKUnsignedChannelAnnouncement obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = UnsignedChannelAnnouncement_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26520,6 +31030,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1wr LDKChannelAnnouncement obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ChannelAnnouncement_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26541,6 +31052,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1 LDKUnsignedChannelUpdate obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = UnsignedChannelUpdate_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26562,6 +31074,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1write(JN LDKChannelUpdate obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ChannelUpdate_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26583,6 +31096,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1write(JNI LDKErrorMessage obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ErrorMessage_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26604,6 +31118,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncemen LDKUnsignedNodeAnnouncement obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = UnsignedNodeAnnouncement_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26625,6 +31140,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1write LDKNodeAnnouncement obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = NodeAnnouncement_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26656,6 +31172,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1w LDKQueryShortChannelIds obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = QueryShortChannelIds_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26667,6 +31184,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd LDKReplyShortChannelIdsEnd obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ReplyShortChannelIdsEnd_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26688,6 +31206,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1end_1blo LDKQueryChannelRange this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int32_t ret_val = QueryChannelRange_end_blocknum(&this_arg_conv); return ret_val; } @@ -26696,6 +31215,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1writ LDKQueryChannelRange obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = QueryChannelRange_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26727,6 +31247,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1writ LDKReplyChannelRange obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ReplyChannelRange_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26738,6 +31259,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1 LDKGossipTimestampFilter obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = GossipTimestampFilter_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -26768,6 +31290,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1free(J LDKIgnoringMessageHandler this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); IgnoringMessageHandler_free(this_obj_conv); } @@ -26776,6 +31299,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1new uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -26787,6 +31311,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1as_ LDKIgnoringMessageHandler this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider"); *ret_ret = IgnoringMessageHandler_as_MessageSendEventsProvider(&this_arg_conv); return (uint64_t)ret_ret; @@ -26796,6 +31321,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1as_ LDKIgnoringMessageHandler this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKRoutingMessageHandler* ret_ret = MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler"); *ret_ret = IgnoringMessageHandler_as_RoutingMessageHandler(&this_arg_conv); return (uint64_t)ret_ret; @@ -26805,6 +31331,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1as_ LDKIgnoringMessageHandler this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCustomMessageReader* ret_ret = MALLOC(sizeof(LDKCustomMessageReader), "LDKCustomMessageReader"); *ret_ret = IgnoringMessageHandler_as_CustomMessageReader(&this_arg_conv); return (uint64_t)ret_ret; @@ -26814,6 +31341,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1as_ LDKIgnoringMessageHandler this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCustomMessageHandler* ret_ret = MALLOC(sizeof(LDKCustomMessageHandler), "LDKCustomMessageHandler"); *ret_ret = IgnoringMessageHandler_as_CustomMessageHandler(&this_arg_conv); return (uint64_t)ret_ret; @@ -26823,6 +31351,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErroringMessageHandler_1free(J LDKErroringMessageHandler this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ErroringMessageHandler_free(this_obj_conv); } @@ -26831,6 +31360,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErroringMessageHandler_1new uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -26842,6 +31372,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErroringMessageHandler_1as_ LDKErroringMessageHandler this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider"); *ret_ret = ErroringMessageHandler_as_MessageSendEventsProvider(&this_arg_conv); return (uint64_t)ret_ret; @@ -26851,6 +31382,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErroringMessageHandler_1as_ LDKErroringMessageHandler this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKChannelMessageHandler* ret_ret = MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler"); *ret_ret = ErroringMessageHandler_as_ChannelMessageHandler(&this_arg_conv); return (uint64_t)ret_ret; @@ -26860,6 +31392,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1free(JNIEnv *e LDKMessageHandler this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); MessageHandler_free(this_obj_conv); } @@ -26867,6 +31400,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageHandler_1get_1chan_1 LDKMessageHandler this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); // WARNING: This object doesn't live past this scope, needs clone! uint64_t ret_ret = ((uint64_t)MessageHandler_get_chan_handler(&this_ptr_conv)) | 1; return ret_ret; @@ -26876,6 +31410,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1set_1chan_1han LDKMessageHandler this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKChannelMessageHandler val_conv = *(LDKChannelMessageHandler*)(val_ptr); @@ -26890,6 +31425,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageHandler_1get_1route_ LDKMessageHandler this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); // WARNING: This object doesn't live past this scope, needs clone! uint64_t ret_ret = ((uint64_t)MessageHandler_get_route_handler(&this_ptr_conv)) | 1; return ret_ret; @@ -26899,6 +31435,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1set_1route_1ha LDKMessageHandler this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKRoutingMessageHandler val_conv = *(LDKRoutingMessageHandler*)(val_ptr); @@ -26928,6 +31465,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageHandler_1new(JNIEnv uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -26935,6 +31473,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageHandler_1new(JNIEnv return ret_ref; } +static inline uint64_t SocketDescriptor_clone_ptr(LDKSocketDescriptor *NONNULL_PTR arg) { + LDKSocketDescriptor* ret_ret = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor"); + *ret_ret = SocketDescriptor_clone(arg); + return (uint64_t)ret_ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + void* arg_ptr = (void*)(((uint64_t)arg) & ~1); + if (!(arg & 1)) { CHECK_ACCESS(arg_ptr); } + LDKSocketDescriptor* arg_conv = (LDKSocketDescriptor*)arg_ptr; + int64_t ret_val = SocketDescriptor_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1clone(JNIEnv *env, jclass clz, int64_t orig) { void* orig_ptr = (void*)(((uint64_t)orig) & ~1); if (!(orig & 1)) { CHECK_ACCESS(orig_ptr); } @@ -26957,6 +31508,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1free(JNIEnv * LDKPeerHandleError this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); PeerHandleError_free(this_obj_conv); } @@ -26964,6 +31516,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1get_1no_1 LDKPeerHandleError this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); jboolean ret_val = PeerHandleError_get_no_connection_possible(&this_ptr_conv); return ret_val; } @@ -26972,6 +31525,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1set_1no_1conn LDKPeerHandleError this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); PeerHandleError_set_no_connection_possible(&this_ptr_conv, val); } @@ -26980,6 +31534,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1new(JNIEnv uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -26987,14 +31542,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1new(JNIEnv return ret_ref; } +static inline uint64_t PeerHandleError_clone_ptr(LDKPeerHandleError *NONNULL_PTR arg) { + LDKPeerHandleError ret_var = PeerHandleError_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_PeerHandleError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKPeerHandleError arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = PeerHandleError_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKPeerHandleError orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKPeerHandleError ret_var = PeerHandleError_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -27006,6 +31584,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1free(JNIEnv *env, LDKPeerManager this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); PeerManager_free(this_obj_conv); } @@ -27013,6 +31592,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerManager_1new(JNIEnv *en LDKMessageHandler message_handler_conv; message_handler_conv.inner = (void*)(message_handler & (~1)); message_handler_conv.is_owned = (message_handler & 1) || (message_handler == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(message_handler_conv); // Warning: we need a move here but no clone is available for LDKMessageHandler LDKSecretKey our_node_secret_ref; CHECK((*env)->GetArrayLength(env, our_node_secret) == 32); @@ -27039,6 +31619,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerManager_1new(JNIEnv *en uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -27050,6 +31631,7 @@ JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_PeerManager_1get_1peer LDKPeerManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCVec_PublicKeyZ ret_var = PeerManager_get_peer_node_ids(&this_arg_conv); jobjectArray ret_arr = NULL; ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL); @@ -27068,6 +31650,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerManager_1new_1outbound_ LDKPeerManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_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); @@ -27087,6 +31670,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerManager_1new_1inbound_1 LDKPeerManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); void* descriptor_ptr = (void*)(((uint64_t)descriptor) & ~1); CHECK_ACCESS(descriptor_ptr); LDKSocketDescriptor descriptor_conv = *(LDKSocketDescriptor*)(descriptor_ptr); @@ -27103,6 +31687,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerManager_1write_1buffer_ LDKPeerManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); void* descriptor_ptr = (void*)(((uint64_t)descriptor) & ~1); if (!(descriptor & 1)) { CHECK_ACCESS(descriptor_ptr); } LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)descriptor_ptr; @@ -27115,6 +31700,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerManager_1read_1event(JN LDKPeerManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); 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; @@ -27131,6 +31717,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1process_1events(J LDKPeerManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); PeerManager_process_events(&this_arg_conv); } @@ -27138,6 +31725,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1socket_1disconnec LDKPeerManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); void* descriptor_ptr = (void*)(((uint64_t)descriptor) & ~1); if (!(descriptor & 1)) { CHECK_ACCESS(descriptor_ptr); } LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)descriptor_ptr; @@ -27148,6 +31736,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1disconnect_1by_1n LDKPeerManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKPublicKey node_id_ref; CHECK((*env)->GetArrayLength(env, node_id) == 33); (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form); @@ -27158,6 +31747,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1disconnect_1all_1 LDKPeerManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); PeerManager_disconnect_all_peers(&this_arg_conv); } @@ -27165,6 +31755,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1timer_1tick_1occu LDKPeerManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); PeerManager_timer_tick_occurred(&this_arg_conv); } @@ -27190,6 +31781,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_build_1closing_1transac LDKOutPoint funding_outpoint_conv; funding_outpoint_conv.inner = (void*)(funding_outpoint & (~1)); funding_outpoint_conv.is_owned = (funding_outpoint & 1) || (funding_outpoint == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_conv); funding_outpoint_conv = OutPoint_clone(&funding_outpoint_conv); LDKTransaction ret_var = build_closing_transaction(to_holder_value_sat, to_counterparty_value_sat, to_holder_script_ref, to_counterparty_script_ref, funding_outpoint_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); @@ -27253,6 +31845,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1free(JNIEnv *e LDKTxCreationKeys this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); TxCreationKeys_free(this_obj_conv); } @@ -27260,6 +31853,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1pe LDKTxCreationKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, TxCreationKeys_get_per_commitment_point(&this_ptr_conv).compressed_form); return ret_arr; @@ -27269,6 +31863,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1per_1comm LDKTxCreationKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -27279,6 +31874,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1re LDKTxCreationKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, TxCreationKeys_get_revocation_key(&this_ptr_conv).compressed_form); return ret_arr; @@ -27288,6 +31884,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1revocatio LDKTxCreationKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -27298,6 +31895,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1br LDKTxCreationKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, TxCreationKeys_get_broadcaster_htlc_key(&this_ptr_conv).compressed_form); return ret_arr; @@ -27307,6 +31905,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1broadcast LDKTxCreationKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -27317,6 +31916,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1co LDKTxCreationKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, TxCreationKeys_get_countersignatory_htlc_key(&this_ptr_conv).compressed_form); return ret_arr; @@ -27326,6 +31926,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1countersi LDKTxCreationKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -27336,6 +31937,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1br LDKTxCreationKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, TxCreationKeys_get_broadcaster_delayed_payment_key(&this_ptr_conv).compressed_form); return ret_arr; @@ -27345,6 +31947,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1broadcast LDKTxCreationKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -27371,6 +31974,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1new(JNIEnv uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -27378,14 +31982,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1new(JNIEnv return ret_ref; } +static inline uint64_t TxCreationKeys_clone_ptr(LDKTxCreationKeys *NONNULL_PTR arg) { + LDKTxCreationKeys ret_var = TxCreationKeys_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_TxCreationKeys_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKTxCreationKeys arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = TxCreationKeys_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKTxCreationKeys orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKTxCreationKeys ret_var = TxCreationKeys_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -27397,6 +32024,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1write(J LDKTxCreationKeys obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = TxCreationKeys_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -27418,6 +32046,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1free(JNIEnv LDKChannelPublicKeys this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ChannelPublicKeys_free(this_obj_conv); } @@ -27425,6 +32054,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_ LDKChannelPublicKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelPublicKeys_get_funding_pubkey(&this_ptr_conv).compressed_form); return ret_arr; @@ -27434,6 +32064,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1fundin LDKChannelPublicKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -27444,6 +32075,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_ LDKChannelPublicKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelPublicKeys_get_revocation_basepoint(&this_ptr_conv).compressed_form); return ret_arr; @@ -27453,6 +32085,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1revoca LDKChannelPublicKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -27463,6 +32096,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_ LDKChannelPublicKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelPublicKeys_get_payment_point(&this_ptr_conv).compressed_form); return ret_arr; @@ -27472,6 +32106,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1paymen LDKChannelPublicKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -27482,6 +32117,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_ LDKChannelPublicKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelPublicKeys_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form); return ret_arr; @@ -27491,6 +32127,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1delaye LDKChannelPublicKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -27501,6 +32138,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_ LDKChannelPublicKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelPublicKeys_get_htlc_basepoint(&this_ptr_conv).compressed_form); return ret_arr; @@ -27510,6 +32148,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1htlc_1 LDKChannelPublicKeys this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -27536,6 +32175,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1new(JNIE uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -27543,14 +32183,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1new(JNIE return ret_ref; } +static inline uint64_t ChannelPublicKeys_clone_ptr(LDKChannelPublicKeys *NONNULL_PTR arg) { + LDKChannelPublicKeys ret_var = ChannelPublicKeys_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_ChannelPublicKeys_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChannelPublicKeys arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ChannelPublicKeys_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKChannelPublicKeys orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelPublicKeys ret_var = ChannelPublicKeys_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -27562,6 +32225,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1writ LDKChannelPublicKeys obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ChannelPublicKeys_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -27607,9 +32271,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1from_1chann LDKChannelPublicKeys broadcaster_keys_conv; broadcaster_keys_conv.inner = (void*)(broadcaster_keys & (~1)); broadcaster_keys_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(broadcaster_keys_conv); LDKChannelPublicKeys countersignatory_keys_conv; countersignatory_keys_conv.inner = (void*)(countersignatory_keys & (~1)); countersignatory_keys_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(countersignatory_keys_conv); LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ"); *ret_conv = TxCreationKeys_from_channel_static_keys(per_commitment_point_ref, &broadcaster_keys_conv, &countersignatory_keys_conv); return (uint64_t)ret_conv; @@ -27633,6 +32299,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1free(J LDKHTLCOutputInCommitment this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); HTLCOutputInCommitment_free(this_obj_conv); } @@ -27640,6 +32307,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1ge LDKHTLCOutputInCommitment this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); jboolean ret_val = HTLCOutputInCommitment_get_offered(&this_ptr_conv); return ret_val; } @@ -27648,6 +32316,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1o LDKHTLCOutputInCommitment this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); HTLCOutputInCommitment_set_offered(&this_ptr_conv, val); } @@ -27655,6 +32324,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get LDKHTLCOutputInCommitment this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = HTLCOutputInCommitment_get_amount_msat(&this_ptr_conv); return ret_val; } @@ -27663,6 +32333,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1a LDKHTLCOutputInCommitment this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); HTLCOutputInCommitment_set_amount_msat(&this_ptr_conv, val); } @@ -27670,6 +32341,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get LDKHTLCOutputInCommitment this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = HTLCOutputInCommitment_get_cltv_expiry(&this_ptr_conv); return ret_val; } @@ -27678,6 +32350,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1c LDKHTLCOutputInCommitment this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); HTLCOutputInCommitment_set_cltv_expiry(&this_ptr_conv, val); } @@ -27685,6 +32358,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_ LDKHTLCOutputInCommitment this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *HTLCOutputInCommitment_get_payment_hash(&this_ptr_conv)); return ret_arr; @@ -27694,6 +32368,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1p LDKHTLCOutputInCommitment this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -27704,6 +32379,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get LDKHTLCOutputInCommitment this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); *ret_copy = HTLCOutputInCommitment_get_transaction_output_index(&this_ptr_conv); uint64_t ret_ref = (uint64_t)ret_copy; @@ -27714,6 +32390,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1t LDKHTLCOutputInCommitment this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(val_ptr); @@ -27733,6 +32410,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1new uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -27740,14 +32418,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1new return ret_ref; } +static inline uint64_t HTLCOutputInCommitment_clone_ptr(LDKHTLCOutputInCommitment *NONNULL_PTR arg) { + LDKHTLCOutputInCommitment ret_var = HTLCOutputInCommitment_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_HTLCOutputInCommitment_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKHTLCOutputInCommitment arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = HTLCOutputInCommitment_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKHTLCOutputInCommitment orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKHTLCOutputInCommitment ret_var = HTLCOutputInCommitment_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -27759,6 +32460,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_ LDKHTLCOutputInCommitment obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = HTLCOutputInCommitment_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -27780,9 +32482,11 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_get_1htlc_1redeemscript LDKHTLCOutputInCommitment htlc_conv; htlc_conv.inner = (void*)(htlc & (~1)); htlc_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_conv); LDKTxCreationKeys keys_conv; keys_conv.inner = (void*)(keys & (~1)); keys_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(keys_conv); LDKCVec_u8Z ret_var = get_htlc_redeemscript(&htlc_conv, &keys_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -27812,6 +32516,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_build_1htlc_1transactio LDKHTLCOutputInCommitment htlc_conv; htlc_conv.inner = (void*)(htlc & (~1)); htlc_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_conv); LDKPublicKey broadcaster_delayed_payment_key_ref; CHECK((*env)->GetArrayLength(env, broadcaster_delayed_payment_key) == 33); (*env)->GetByteArrayRegion(env, broadcaster_delayed_payment_key, 0, 33, broadcaster_delayed_payment_key_ref.compressed_form); @@ -27829,6 +32534,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1 LDKChannelTransactionParameters this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ChannelTransactionParameters_free(this_obj_conv); } @@ -27836,10 +32542,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameter LDKChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelPublicKeys ret_var = ChannelTransactionParameters_get_holder_pubkeys(&this_ptr_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -27851,9 +32559,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1 LDKChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelPublicKeys val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = ChannelPublicKeys_clone(&val_conv); ChannelTransactionParameters_set_holder_pubkeys(&this_ptr_conv, val_conv); } @@ -27862,6 +32572,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameter LDKChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = ChannelTransactionParameters_get_holder_selected_contest_delay(&this_ptr_conv); return ret_val; } @@ -27870,6 +32581,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1 LDKChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelTransactionParameters_set_holder_selected_contest_delay(&this_ptr_conv, val); } @@ -27877,6 +32589,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParamete LDKChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); jboolean ret_val = ChannelTransactionParameters_get_is_outbound_from_holder(&this_ptr_conv); return ret_val; } @@ -27885,6 +32598,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1 LDKChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ChannelTransactionParameters_set_is_outbound_from_holder(&this_ptr_conv, val); } @@ -27892,11 +32606,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameter LDKChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCounterpartyChannelTransactionParameters ret_var = ChannelTransactionParameters_get_counterparty_parameters(&this_ptr_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -27909,9 +32625,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1 LDKChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCounterpartyChannelTransactionParameters val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = CounterpartyChannelTransactionParameters_clone(&val_conv); ChannelTransactionParameters_set_counterparty_parameters(&this_ptr_conv, val_conv); } @@ -27920,11 +32638,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameter LDKChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKOutPoint ret_var = ChannelTransactionParameters_get_funding_outpoint(&this_ptr_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -27937,9 +32657,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1 LDKChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKOutPoint val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = OutPoint_clone(&val_conv); ChannelTransactionParameters_set_funding_outpoint(&this_ptr_conv, val_conv); } @@ -27948,19 +32670,23 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameter LDKChannelPublicKeys holder_pubkeys_arg_conv; holder_pubkeys_arg_conv.inner = (void*)(holder_pubkeys_arg & (~1)); holder_pubkeys_arg_conv.is_owned = (holder_pubkeys_arg & 1) || (holder_pubkeys_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(holder_pubkeys_arg_conv); holder_pubkeys_arg_conv = ChannelPublicKeys_clone(&holder_pubkeys_arg_conv); LDKCounterpartyChannelTransactionParameters counterparty_parameters_arg_conv; counterparty_parameters_arg_conv.inner = (void*)(counterparty_parameters_arg & (~1)); counterparty_parameters_arg_conv.is_owned = (counterparty_parameters_arg & 1) || (counterparty_parameters_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(counterparty_parameters_arg_conv); counterparty_parameters_arg_conv = CounterpartyChannelTransactionParameters_clone(&counterparty_parameters_arg_conv); LDKOutPoint funding_outpoint_arg_conv; funding_outpoint_arg_conv.inner = (void*)(funding_outpoint_arg & (~1)); funding_outpoint_arg_conv.is_owned = (funding_outpoint_arg & 1) || (funding_outpoint_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_arg_conv); funding_outpoint_arg_conv = OutPoint_clone(&funding_outpoint_arg_conv); LDKChannelTransactionParameters ret_var = ChannelTransactionParameters_new(holder_pubkeys_arg_conv, holder_selected_contest_delay_arg, is_outbound_from_holder_arg, counterparty_parameters_arg_conv, funding_outpoint_arg_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -27968,14 +32694,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameter return ret_ref; } +static inline uint64_t ChannelTransactionParameters_clone_ptr(LDKChannelTransactionParameters *NONNULL_PTR arg) { + LDKChannelTransactionParameters ret_var = ChannelTransactionParameters_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_ChannelTransactionParameters_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChannelTransactionParameters arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ChannelTransactionParameters_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKChannelTransactionParameters orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelTransactionParameters ret_var = ChannelTransactionParameters_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -27987,6 +32736,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransaction LDKCounterpartyChannelTransactionParameters this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); CounterpartyChannelTransactionParameters_free(this_obj_conv); } @@ -27994,10 +32744,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransact LDKCounterpartyChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelPublicKeys ret_var = CounterpartyChannelTransactionParameters_get_pubkeys(&this_ptr_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28009,9 +32761,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransaction LDKCounterpartyChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelPublicKeys val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = ChannelPublicKeys_clone(&val_conv); CounterpartyChannelTransactionParameters_set_pubkeys(&this_ptr_conv, val_conv); } @@ -28020,6 +32774,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransact LDKCounterpartyChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = CounterpartyChannelTransactionParameters_get_selected_contest_delay(&this_ptr_conv); return ret_val; } @@ -28028,6 +32783,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransaction LDKCounterpartyChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); CounterpartyChannelTransactionParameters_set_selected_contest_delay(&this_ptr_conv, val); } @@ -28035,11 +32791,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransact LDKChannelPublicKeys pubkeys_arg_conv; pubkeys_arg_conv.inner = (void*)(pubkeys_arg & (~1)); pubkeys_arg_conv.is_owned = (pubkeys_arg & 1) || (pubkeys_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(pubkeys_arg_conv); pubkeys_arg_conv = ChannelPublicKeys_clone(&pubkeys_arg_conv); LDKCounterpartyChannelTransactionParameters ret_var = CounterpartyChannelTransactionParameters_new(pubkeys_arg_conv, selected_contest_delay_arg); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28047,14 +32805,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransact return ret_ref; } +static inline uint64_t CounterpartyChannelTransactionParameters_clone_ptr(LDKCounterpartyChannelTransactionParameters *NONNULL_PTR arg) { + LDKCounterpartyChannelTransactionParameters ret_var = CounterpartyChannelTransactionParameters_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_CounterpartyChannelTransactionParameters_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCounterpartyChannelTransactionParameters arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = CounterpartyChannelTransactionParameters_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCounterpartyChannelTransactionParameters orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKCounterpartyChannelTransactionParameters ret_var = CounterpartyChannelTransactionParameters_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28066,6 +32847,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParamete LDKChannelTransactionParameters this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); jboolean ret_val = ChannelTransactionParameters_is_populated(&this_arg_conv); return ret_val; } @@ -28074,10 +32856,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameter LDKChannelTransactionParameters this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKDirectedChannelTransactionParameters ret_var = ChannelTransactionParameters_as_holder_broadcastable(&this_arg_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28089,10 +32873,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameter LDKChannelTransactionParameters this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKDirectedChannelTransactionParameters ret_var = ChannelTransactionParameters_as_counterparty_broadcastable(&this_arg_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28104,6 +32890,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTran LDKCounterpartyChannelTransactionParameters obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = CounterpartyChannelTransactionParameters_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -28125,6 +32912,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParam LDKChannelTransactionParameters obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ChannelTransactionParameters_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -28146,6 +32934,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionPara LDKDirectedChannelTransactionParameters this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); DirectedChannelTransactionParameters_free(this_obj_conv); } @@ -28153,10 +32942,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionP LDKDirectedChannelTransactionParameters this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKChannelPublicKeys ret_var = DirectedChannelTransactionParameters_broadcaster_pubkeys(&this_arg_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28168,10 +32959,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionP LDKDirectedChannelTransactionParameters this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKChannelPublicKeys ret_var = DirectedChannelTransactionParameters_countersignatory_pubkeys(&this_arg_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28183,6 +32976,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionP LDKDirectedChannelTransactionParameters this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int16_t ret_val = DirectedChannelTransactionParameters_contest_delay(&this_arg_conv); return ret_val; } @@ -28191,6 +32985,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransaction LDKDirectedChannelTransactionParameters this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); jboolean ret_val = DirectedChannelTransactionParameters_is_outbound(&this_arg_conv); return ret_val; } @@ -28199,10 +32994,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionP LDKDirectedChannelTransactionParameters this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKOutPoint ret_var = DirectedChannelTransactionParameters_funding_outpoint(&this_arg_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28214,6 +33011,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1f LDKHolderCommitmentTransaction this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); HolderCommitmentTransaction_free(this_obj_conv); } @@ -28221,6 +33019,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransac LDKHolderCommitmentTransaction this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 64); (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, HolderCommitmentTransaction_get_counterparty_sig(&this_ptr_conv).compact_form); return ret_arr; @@ -28230,6 +33029,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1s LDKHolderCommitmentTransaction this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK((*env)->GetArrayLength(env, val) == 64); (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form); @@ -28240,6 +33040,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1s LDKHolderCommitmentTransaction this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_SignatureZ val_constr; val_constr.datalen = (*env)->GetArrayLength(env, val); if (val_constr.datalen > 0) @@ -28256,14 +33057,37 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1s HolderCommitmentTransaction_set_counterparty_htlc_sigs(&this_ptr_conv, val_constr); } +static inline uint64_t HolderCommitmentTransaction_clone_ptr(LDKHolderCommitmentTransaction *NONNULL_PTR arg) { + LDKHolderCommitmentTransaction ret_var = HolderCommitmentTransaction_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_HolderCommitmentTransaction_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKHolderCommitmentTransaction arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = HolderCommitmentTransaction_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKHolderCommitmentTransaction orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKHolderCommitmentTransaction ret_var = HolderCommitmentTransaction_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28275,6 +33099,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransac LDKHolderCommitmentTransaction obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = HolderCommitmentTransaction_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -28296,6 +33121,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction LDKCommitmentTransaction commitment_tx_conv; commitment_tx_conv.inner = (void*)(commitment_tx & (~1)); commitment_tx_conv.is_owned = (commitment_tx & 1) || (commitment_tx == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_conv); commitment_tx_conv = CommitmentTransaction_clone(&commitment_tx_conv); LDKSignature counterparty_sig_ref; CHECK((*env)->GetArrayLength(env, counterparty_sig) == 64); @@ -28323,6 +33149,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28334,6 +33161,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1fr LDKBuiltCommitmentTransaction this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); BuiltCommitmentTransaction_free(this_obj_conv); } @@ -28341,6 +33169,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransact LDKBuiltCommitmentTransaction this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKTransaction ret_var = BuiltCommitmentTransaction_get_transaction(&this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -28352,6 +33181,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1se LDKBuiltCommitmentTransaction this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKTransaction val_ref; val_ref.datalen = (*env)->GetArrayLength(env, val); val_ref.data = MALLOC(val_ref.datalen, "LDKTransaction Bytes"); @@ -28364,6 +33194,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransact LDKBuiltCommitmentTransaction this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *BuiltCommitmentTransaction_get_txid(&this_ptr_conv)); return ret_arr; @@ -28373,6 +33204,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1se LDKBuiltCommitmentTransaction this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -28392,6 +33224,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_ uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28399,14 +33232,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_ return ret_ref; } +static inline uint64_t BuiltCommitmentTransaction_clone_ptr(LDKBuiltCommitmentTransaction *NONNULL_PTR arg) { + LDKBuiltCommitmentTransaction ret_var = BuiltCommitmentTransaction_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_BuiltCommitmentTransaction_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKBuiltCommitmentTransaction arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = BuiltCommitmentTransaction_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKBuiltCommitmentTransaction orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKBuiltCommitmentTransaction ret_var = BuiltCommitmentTransaction_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28418,6 +33274,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransact LDKBuiltCommitmentTransaction obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = BuiltCommitmentTransaction_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -28439,6 +33296,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransact LDKBuiltCommitmentTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKu8slice funding_redeemscript_ref; funding_redeemscript_ref.datalen = (*env)->GetArrayLength(env, funding_redeemscript); funding_redeemscript_ref.data = (*env)->GetByteArrayElements (env, funding_redeemscript, NULL); @@ -28452,6 +33310,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransact LDKBuiltCommitmentTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char funding_key_arr[32]; CHECK((*env)->GetArrayLength(env, funding_key) == 32); (*env)->GetByteArrayRegion(env, funding_key, 0, 32, funding_key_arr); @@ -28469,17 +33328,41 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1free(JNIEn LDKClosingTransaction this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ClosingTransaction_free(this_obj_conv); } +static inline uint64_t ClosingTransaction_clone_ptr(LDKClosingTransaction *NONNULL_PTR arg) { + LDKClosingTransaction ret_var = ClosingTransaction_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKClosingTransaction arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ClosingTransaction_clone_ptr(&arg_conv); + return ret_val; +} + 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; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKClosingTransaction ret_var = ClosingTransaction_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28491,6 +33374,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1hash(JN LDKClosingTransaction o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); int64_t ret_val = ClosingTransaction_hash(&o_conv); return ret_val; } @@ -28507,11 +33391,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1new(JNI LDKOutPoint funding_outpoint_conv; funding_outpoint_conv.inner = (void*)(funding_outpoint & (~1)); funding_outpoint_conv.is_owned = (funding_outpoint & 1) || (funding_outpoint == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_conv); funding_outpoint_conv = OutPoint_clone(&funding_outpoint_conv); LDKClosingTransaction ret_var = ClosingTransaction_new(to_holder_value_sat, to_counterparty_value_sat, to_holder_script_ref, to_counterparty_script_ref, funding_outpoint_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28523,10 +33409,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1trust(J LDKClosingTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKTrustedClosingTransaction ret_var = ClosingTransaction_trust(&this_arg_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28538,9 +33426,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1verify( LDKClosingTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKOutPoint funding_outpoint_conv; funding_outpoint_conv.inner = (void*)(funding_outpoint & (~1)); funding_outpoint_conv.is_owned = (funding_outpoint & 1) || (funding_outpoint == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_conv); funding_outpoint_conv = OutPoint_clone(&funding_outpoint_conv); LDKCResult_TrustedClosingTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedClosingTransactionNoneZ), "LDKCResult_TrustedClosingTransactionNoneZ"); *ret_conv = ClosingTransaction_verify(&this_arg_conv, funding_outpoint_conv); @@ -28551,6 +33441,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1to_1hol LDKClosingTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int64_t ret_val = ClosingTransaction_to_holder_value_sat(&this_arg_conv); return ret_val; } @@ -28559,6 +33450,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1to_1cou LDKClosingTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int64_t ret_val = ClosingTransaction_to_counterparty_value_sat(&this_arg_conv); return ret_val; } @@ -28567,6 +33459,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1to_ LDKClosingTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKu8slice ret_var = ClosingTransaction_to_holder_script(&this_arg_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -28577,6 +33470,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1to_ LDKClosingTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKu8slice ret_var = ClosingTransaction_to_counterparty_script(&this_arg_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -28587,6 +33481,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TrustedClosingTransaction_1fre LDKTrustedClosingTransaction this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); TrustedClosingTransaction_free(this_obj_conv); } @@ -28594,6 +33489,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TrustedClosingTransacti LDKTrustedClosingTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKTransaction ret_var = TrustedClosingTransaction_built_transaction(&this_arg_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -28605,6 +33501,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TrustedClosingTransacti LDKTrustedClosingTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKu8slice funding_redeemscript_ref; funding_redeemscript_ref.datalen = (*env)->GetArrayLength(env, funding_redeemscript); funding_redeemscript_ref.data = (*env)->GetByteArrayElements (env, funding_redeemscript, NULL); @@ -28618,6 +33515,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TrustedClosingTransacti LDKTrustedClosingTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char funding_key_arr[32]; CHECK((*env)->GetArrayLength(env, funding_key) == 32); (*env)->GetByteArrayRegion(env, funding_key, 0, 32, funding_key_arr); @@ -28635,17 +33533,41 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1free(JN LDKCommitmentTransaction this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); CommitmentTransaction_free(this_obj_conv); } +static inline uint64_t CommitmentTransaction_clone_ptr(LDKCommitmentTransaction *NONNULL_PTR arg) { + LDKCommitmentTransaction ret_var = CommitmentTransaction_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_CommitmentTransaction_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCommitmentTransaction arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = CommitmentTransaction_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKCommitmentTransaction orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKCommitmentTransaction ret_var = CommitmentTransaction_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28657,6 +33579,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1 LDKCommitmentTransaction obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = CommitmentTransaction_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -28678,6 +33601,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1comm LDKCommitmentTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int64_t ret_val = CommitmentTransaction_commitment_number(&this_arg_conv); return ret_val; } @@ -28686,6 +33610,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1to_1 LDKCommitmentTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int64_t ret_val = CommitmentTransaction_to_broadcaster_value_sat(&this_arg_conv); return ret_val; } @@ -28694,6 +33619,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1to_1 LDKCommitmentTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int64_t ret_val = CommitmentTransaction_to_countersignatory_value_sat(&this_arg_conv); return ret_val; } @@ -28702,6 +33628,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1feer LDKCommitmentTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int32_t ret_val = CommitmentTransaction_feerate_per_kw(&this_arg_conv); return ret_val; } @@ -28710,10 +33637,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1trus LDKCommitmentTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKTrustedCommitmentTransaction ret_var = CommitmentTransaction_trust(&this_arg_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28725,15 +33654,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1veri LDKCommitmentTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKDirectedChannelTransactionParameters channel_parameters_conv; channel_parameters_conv.inner = (void*)(channel_parameters & (~1)); channel_parameters_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_parameters_conv); LDKChannelPublicKeys broadcaster_keys_conv; broadcaster_keys_conv.inner = (void*)(broadcaster_keys & (~1)); broadcaster_keys_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(broadcaster_keys_conv); LDKChannelPublicKeys countersignatory_keys_conv; countersignatory_keys_conv.inner = (void*)(countersignatory_keys & (~1)); countersignatory_keys_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(countersignatory_keys_conv); LDKCResult_TrustedCommitmentTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedCommitmentTransactionNoneZ), "LDKCResult_TrustedCommitmentTransactionNoneZ"); *ret_conv = CommitmentTransaction_verify(&this_arg_conv, &channel_parameters_conv, &broadcaster_keys_conv, &countersignatory_keys_conv); return (uint64_t)ret_conv; @@ -28743,6 +33676,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransaction_1 LDKTrustedCommitmentTransaction this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); TrustedCommitmentTransaction_free(this_obj_conv); } @@ -28750,6 +33684,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransa LDKTrustedCommitmentTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, TrustedCommitmentTransaction_txid(&this_arg_conv).data); return ret_arr; @@ -28759,10 +33694,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransactio LDKTrustedCommitmentTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKBuiltCommitmentTransaction ret_var = TrustedCommitmentTransaction_built_transaction(&this_arg_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28774,10 +33711,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransactio LDKTrustedCommitmentTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKTxCreationKeys ret_var = TrustedCommitmentTransaction_keys(&this_arg_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28789,6 +33728,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransactio LDKTrustedCommitmentTransaction this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char htlc_base_key_arr[32]; CHECK((*env)->GetArrayLength(env, htlc_base_key) == 32); (*env)->GetByteArrayRegion(env, htlc_base_key, 0, 32, htlc_base_key_arr); @@ -28796,6 +33736,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransactio LDKDirectedChannelTransactionParameters channel_parameters_conv; channel_parameters_conv.inner = (void*)(channel_parameters & (~1)); channel_parameters_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_parameters_conv); LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ"); *ret_conv = TrustedCommitmentTransaction_get_htlc_sigs(&this_arg_conv, htlc_base_key_ref, &channel_parameters_conv); return (uint64_t)ret_conv; @@ -28816,9 +33757,11 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1eq(JNIEnv *e LDKInitFeatures a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKInitFeatures b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = InitFeatures_eq(&a_conv, &b_conv); return ret_val; } @@ -28827,9 +33770,11 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1eq(JNIEnv *e LDKNodeFeatures a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKNodeFeatures b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = NodeFeatures_eq(&a_conv, &b_conv); return ret_val; } @@ -28838,9 +33783,11 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1eq(JNIEnv LDKChannelFeatures a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKChannelFeatures b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = ChannelFeatures_eq(&a_conv, &b_conv); return ret_val; } @@ -28849,21 +33796,46 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1eq(JNIEnv LDKInvoiceFeatures a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKInvoiceFeatures b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = InvoiceFeatures_eq(&a_conv, &b_conv); return ret_val; } +static inline uint64_t InitFeatures_clone_ptr(LDKInitFeatures *NONNULL_PTR arg) { + LDKInitFeatures ret_var = InitFeatures_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_InitFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKInitFeatures arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = InitFeatures_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKInitFeatures orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKInitFeatures ret_var = InitFeatures_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28871,14 +33843,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1clone(JNIEnv return ret_ref; } +static inline uint64_t NodeFeatures_clone_ptr(LDKNodeFeatures *NONNULL_PTR arg) { + LDKNodeFeatures ret_var = NodeFeatures_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_NodeFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKNodeFeatures arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = NodeFeatures_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKNodeFeatures orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKNodeFeatures ret_var = NodeFeatures_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28886,14 +33881,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1clone(JNIEnv return ret_ref; } +static inline uint64_t ChannelFeatures_clone_ptr(LDKChannelFeatures *NONNULL_PTR arg) { + LDKChannelFeatures ret_var = ChannelFeatures_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_ChannelFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChannelFeatures arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ChannelFeatures_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKChannelFeatures orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelFeatures ret_var = ChannelFeatures_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28901,14 +33919,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1clone(JNIE return ret_ref; } +static inline uint64_t InvoiceFeatures_clone_ptr(LDKInvoiceFeatures *NONNULL_PTR arg) { + LDKInvoiceFeatures ret_var = InvoiceFeatures_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_InvoiceFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKInvoiceFeatures arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = InvoiceFeatures_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKInvoiceFeatures orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKInvoiceFeatures ret_var = InvoiceFeatures_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28920,6 +33961,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1free(JNIEnv *env LDKInitFeatures this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); InitFeatures_free(this_obj_conv); } @@ -28927,6 +33969,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1free(JNIEnv *env LDKNodeFeatures this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); NodeFeatures_free(this_obj_conv); } @@ -28934,6 +33977,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1free(JNIEnv * LDKChannelFeatures this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ChannelFeatures_free(this_obj_conv); } @@ -28941,6 +33985,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1free(JNIEnv * LDKInvoiceFeatures this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); InvoiceFeatures_free(this_obj_conv); } @@ -28949,6 +33994,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1empty(JNIEnv uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28961,6 +34007,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1known(JNIEnv uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28972,6 +34019,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1un LDKInitFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); jboolean ret_val = InitFeatures_requires_unknown_bits(&this_arg_conv); return ret_val; } @@ -28981,6 +34029,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1empty(JNIEnv uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -28993,6 +34042,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1known(JNIEnv uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29004,6 +34054,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1un LDKNodeFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); jboolean ret_val = NodeFeatures_requires_unknown_bits(&this_arg_conv); return ret_val; } @@ -29013,6 +34064,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1empty(JNIE uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29025,6 +34077,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1known(JNIE uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29036,6 +34089,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1requires_ LDKChannelFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); jboolean ret_val = ChannelFeatures_requires_unknown_bits(&this_arg_conv); return ret_val; } @@ -29045,6 +34099,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1empty(JNIE uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29057,6 +34112,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1known(JNIE uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29068,6 +34124,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1requires_ LDKInvoiceFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); jboolean ret_val = InvoiceFeatures_requires_unknown_bits(&this_arg_conv); return ret_val; } @@ -29076,6 +34133,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1pa LDKInitFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); jboolean ret_val = InitFeatures_supports_payment_secret(&this_arg_conv); return ret_val; } @@ -29084,6 +34142,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1pa LDKNodeFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); jboolean ret_val = NodeFeatures_supports_payment_secret(&this_arg_conv); return ret_val; } @@ -29092,6 +34151,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1supports_ LDKInvoiceFeatures this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); jboolean ret_val = InvoiceFeatures_supports_payment_secret(&this_arg_conv); return ret_val; } @@ -29100,6 +34160,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InitFeatures_1write(JNI LDKInitFeatures obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = InitFeatures_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -29111,6 +34172,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1write(JNI LDKNodeFeatures obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = NodeFeatures_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -29122,6 +34184,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1write( LDKChannelFeatures obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ChannelFeatures_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -29133,6 +34196,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1write( LDKInvoiceFeatures obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = InvoiceFeatures_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -29184,17 +34248,41 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1free(JNIEnv *e LDKShutdownScript this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ShutdownScript_free(this_obj_conv); } +static inline uint64_t ShutdownScript_clone_ptr(LDKShutdownScript *NONNULL_PTR arg) { + LDKShutdownScript ret_var = ShutdownScript_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_ShutdownScript_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKShutdownScript arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ShutdownScript_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKShutdownScript orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKShutdownScript ret_var = ShutdownScript_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29206,6 +34294,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1free(JN LDKInvalidShutdownScript this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); InvalidShutdownScript_free(this_obj_conv); } @@ -29213,6 +34302,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1 LDKInvalidShutdownScript this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKu8slice ret_var = InvalidShutdownScript_get_script(&this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -29223,6 +34313,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1set_1sc LDKInvalidShutdownScript this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_u8Z val_ref; val_ref.datalen = (*env)->GetArrayLength(env, val); val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes"); @@ -29239,6 +34330,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1new( uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29246,14 +34338,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1new( return ret_ref; } +static inline uint64_t InvalidShutdownScript_clone_ptr(LDKInvalidShutdownScript *NONNULL_PTR arg) { + LDKInvalidShutdownScript ret_var = InvalidShutdownScript_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_InvalidShutdownScript_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKInvalidShutdownScript arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = InvalidShutdownScript_clone_ptr(&arg_conv); + return ret_val; +} + 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; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKInvalidShutdownScript ret_var = InvalidShutdownScript_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29265,6 +34380,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1write(J LDKShutdownScript obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ShutdownScript_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -29291,6 +34407,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1new_1p2wpkh uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29307,6 +34424,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1new_1p2wsh( uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29328,6 +34446,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1into_1i LDKShutdownScript this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv = ShutdownScript_clone(&this_arg_conv); LDKCVec_u8Z ret_var = ShutdownScript_into_inner(this_arg_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); @@ -29340,6 +34459,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1as_1leg LDKShutdownScript this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ShutdownScript_as_legacy_pubkey(&this_arg_conv).compressed_form); return ret_arr; @@ -29349,9 +34469,11 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1is_1compat LDKShutdownScript this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKInitFeatures features_conv; features_conv.inner = (void*)(features & (~1)); features_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(features_conv); jboolean ret_val = ShutdownScript_is_compatible(&this_arg_conv, &features_conv); return ret_val; } @@ -29365,6 +34487,19 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CustomMessageReader_1free(JNIE CustomMessageReader_free(this_ptr_conv); } +static inline uint64_t Type_clone_ptr(LDKType *NONNULL_PTR arg) { + LDKType* ret_ret = MALLOC(sizeof(LDKType), "LDKType"); + *ret_ret = Type_clone(arg); + return (uint64_t)ret_ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Type_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + void* arg_ptr = (void*)(((uint64_t)arg) & ~1); + if (!(arg & 1)) { CHECK_ACCESS(arg_ptr); } + LDKType* arg_conv = (LDKType*)arg_ptr; + int64_t ret_val = Type_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Type_1clone(JNIEnv *env, jclass clz, int64_t orig) { void* orig_ptr = (void*)(((uint64_t)orig) & ~1); if (!(orig & 1)) { CHECK_ACCESS(orig_ptr); } @@ -29396,6 +34531,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LockableScore_1free(JNIEnv *en LDKLockableScore this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); LockableScore_free(this_obj_conv); } @@ -29411,6 +34547,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LockableScore_1new(JNIEnv * uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29422,6 +34559,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_LockableScore_1write(JN LDKLockableScore obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = LockableScore_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -29433,17 +34571,41 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeId_1free(JNIEnv *env, jcla LDKNodeId this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); NodeId_free(this_obj_conv); } +static inline uint64_t NodeId_clone_ptr(LDKNodeId *NONNULL_PTR arg) { + LDKNodeId ret_var = NodeId_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_NodeId_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKNodeId arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = NodeId_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeId_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKNodeId orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKNodeId ret_var = NodeId_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29459,6 +34621,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeId_1from_1pubkey(JNIEnv uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29470,6 +34633,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeId_1as_1slice(JNIEn LDKNodeId this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKu8slice ret_var = NodeId_as_slice(&this_arg_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -29480,6 +34644,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeId_1hash(JNIEnv *env, j LDKNodeId o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); int64_t ret_val = NodeId_hash(&o_conv); return ret_val; } @@ -29488,6 +34653,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeId_1write(JNIEnv *e LDKNodeId obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = NodeId_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -29509,17 +34675,41 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1free(JNIEnv *env LDKNetworkGraph this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); NetworkGraph_free(this_obj_conv); } +static inline uint64_t NetworkGraph_clone_ptr(LDKNetworkGraph *NONNULL_PTR arg) { + LDKNetworkGraph ret_var = NetworkGraph_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_NetworkGraph_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKNetworkGraph arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = NetworkGraph_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKNetworkGraph orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKNetworkGraph ret_var = NetworkGraph_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29531,6 +34721,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReadOnlyNetworkGraph_1free(JNI LDKReadOnlyNetworkGraph this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ReadOnlyNetworkGraph_free(this_obj_conv); } @@ -29543,6 +34734,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1free(JNIEnv *en NetworkUpdate_free(this_ptr_conv); } +static inline uint64_t NetworkUpdate_clone_ptr(LDKNetworkUpdate *NONNULL_PTR arg) { + LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate"); + *ret_copy = NetworkUpdate_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKNetworkUpdate* arg_conv = (LDKNetworkUpdate*)arg; + int64_t ret_val = NetworkUpdate_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKNetworkUpdate* orig_conv = (LDKNetworkUpdate*)orig; LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate"); @@ -29555,6 +34758,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1channel_1upd LDKChannelUpdate msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); msg_conv = ChannelUpdate_clone(&msg_conv); LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate"); *ret_copy = NetworkUpdate_channel_update_message(msg_conv); @@ -29588,10 +34792,21 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1write(JN return ret_arr; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ"); + *ret_conv = NetworkUpdate_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return (uint64_t)ret_conv; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1as_1EventHandler(JNIEnv *env, jclass clz, int64_t this_arg) { LDKNetGraphMsgHandler this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKEventHandler* ret_ret = MALLOC(sizeof(LDKEventHandler), "LDKEventHandler"); *ret_ret = NetGraphMsgHandler_as_EventHandler(&this_arg_conv); return (uint64_t)ret_ret; @@ -29601,6 +34816,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1free(JNIEn LDKNetGraphMsgHandler this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); NetGraphMsgHandler_free(this_obj_conv); } @@ -29608,6 +34824,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1new(JNI LDKNetworkGraph network_graph_conv; network_graph_conv.inner = (void*)(network_graph & (~1)); network_graph_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); 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); @@ -29630,6 +34847,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1new(JNI uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29641,6 +34859,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1add_1chain LDKNetGraphMsgHandler this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); 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); @@ -29659,6 +34878,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1as_1Rou LDKNetGraphMsgHandler this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKRoutingMessageHandler* ret_ret = MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler"); *ret_ret = NetGraphMsgHandler_as_RoutingMessageHandler(&this_arg_conv); return (uint64_t)ret_ret; @@ -29668,6 +34888,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1as_1Mes LDKNetGraphMsgHandler this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider"); *ret_ret = NetGraphMsgHandler_as_MessageSendEventsProvider(&this_arg_conv); return (uint64_t)ret_ret; @@ -29677,6 +34898,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1free(J LDKDirectionalChannelInfo this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); DirectionalChannelInfo_free(this_obj_conv); } @@ -29684,6 +34906,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get LDKDirectionalChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = DirectionalChannelInfo_get_last_update(&this_ptr_conv); return ret_val; } @@ -29692,6 +34915,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1l LDKDirectionalChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); DirectionalChannelInfo_set_last_update(&this_ptr_conv, val); } @@ -29699,6 +34923,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1ge LDKDirectionalChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); jboolean ret_val = DirectionalChannelInfo_get_enabled(&this_ptr_conv); return ret_val; } @@ -29707,6 +34932,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1e LDKDirectionalChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); DirectionalChannelInfo_set_enabled(&this_ptr_conv, val); } @@ -29714,6 +34940,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get LDKDirectionalChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = DirectionalChannelInfo_get_cltv_expiry_delta(&this_ptr_conv); return ret_val; } @@ -29722,6 +34949,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1c LDKDirectionalChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); DirectionalChannelInfo_set_cltv_expiry_delta(&this_ptr_conv, val); } @@ -29729,6 +34957,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get LDKDirectionalChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = DirectionalChannelInfo_get_htlc_minimum_msat(&this_ptr_conv); return ret_val; } @@ -29737,6 +34966,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1h LDKDirectionalChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); DirectionalChannelInfo_set_htlc_minimum_msat(&this_ptr_conv, val); } @@ -29744,6 +34974,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get LDKDirectionalChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); *ret_copy = DirectionalChannelInfo_get_htlc_maximum_msat(&this_ptr_conv); uint64_t ret_ref = (uint64_t)ret_copy; @@ -29754,6 +34985,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1h LDKDirectionalChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); @@ -29765,10 +34997,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get LDKDirectionalChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKRoutingFees ret_var = DirectionalChannelInfo_get_fees(&this_ptr_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29780,9 +35014,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1f LDKDirectionalChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKRoutingFees val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = RoutingFees_clone(&val_conv); DirectionalChannelInfo_set_fees(&this_ptr_conv, val_conv); } @@ -29791,11 +35027,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get LDKDirectionalChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelUpdate ret_var = DirectionalChannelInfo_get_last_update_message(&this_ptr_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29808,9 +35046,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1l LDKDirectionalChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelUpdate val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = ChannelUpdate_clone(&val_conv); DirectionalChannelInfo_set_last_update_message(&this_ptr_conv, val_conv); } @@ -29823,15 +35063,18 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1new LDKRoutingFees fees_arg_conv; fees_arg_conv.inner = (void*)(fees_arg & (~1)); fees_arg_conv.is_owned = (fees_arg & 1) || (fees_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(fees_arg_conv); fees_arg_conv = RoutingFees_clone(&fees_arg_conv); LDKChannelUpdate last_update_message_arg_conv; last_update_message_arg_conv.inner = (void*)(last_update_message_arg & (~1)); last_update_message_arg_conv.is_owned = (last_update_message_arg & 1) || (last_update_message_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(last_update_message_arg_conv); last_update_message_arg_conv = ChannelUpdate_clone(&last_update_message_arg_conv); LDKDirectionalChannelInfo ret_var = DirectionalChannelInfo_new(last_update_arg, enabled_arg, cltv_expiry_delta_arg, htlc_minimum_msat_arg, htlc_maximum_msat_arg_conv, fees_arg_conv, last_update_message_arg_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29839,14 +35082,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1new return ret_ref; } +static inline uint64_t DirectionalChannelInfo_clone_ptr(LDKDirectionalChannelInfo *NONNULL_PTR arg) { + LDKDirectionalChannelInfo ret_var = DirectionalChannelInfo_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_DirectionalChannelInfo_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKDirectionalChannelInfo arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = DirectionalChannelInfo_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKDirectionalChannelInfo orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKDirectionalChannelInfo ret_var = DirectionalChannelInfo_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29858,6 +35124,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_ LDKDirectionalChannelInfo obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = DirectionalChannelInfo_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -29879,6 +35146,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1free(JNIEnv *env, LDKChannelInfo this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ChannelInfo_free(this_obj_conv); } @@ -29886,10 +35154,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1features( LDKChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelFeatures ret_var = ChannelInfo_get_features(&this_ptr_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29901,9 +35171,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1features(JNI LDKChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelFeatures val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = ChannelFeatures_clone(&val_conv); ChannelInfo_set_features(&this_ptr_conv, val_conv); } @@ -29912,10 +35184,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1node_1one LDKChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKNodeId ret_var = ChannelInfo_get_node_one(&this_ptr_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29927,9 +35201,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1node_1one(JN LDKChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKNodeId val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = NodeId_clone(&val_conv); ChannelInfo_set_node_one(&this_ptr_conv, val_conv); } @@ -29938,11 +35214,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1one_1to_1 LDKChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKDirectionalChannelInfo ret_var = ChannelInfo_get_one_to_two(&this_ptr_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29955,9 +35233,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1one_1to_1two LDKChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKDirectionalChannelInfo val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = DirectionalChannelInfo_clone(&val_conv); ChannelInfo_set_one_to_two(&this_ptr_conv, val_conv); } @@ -29966,10 +35246,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1node_1two LDKChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKNodeId ret_var = ChannelInfo_get_node_two(&this_ptr_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -29981,9 +35263,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1node_1two(JN LDKChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKNodeId val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = NodeId_clone(&val_conv); ChannelInfo_set_node_two(&this_ptr_conv, val_conv); } @@ -29992,11 +35276,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1two_1to_1 LDKChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKDirectionalChannelInfo ret_var = ChannelInfo_get_two_to_one(&this_ptr_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -30009,9 +35295,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1two_1to_1one LDKChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKDirectionalChannelInfo val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = DirectionalChannelInfo_clone(&val_conv); ChannelInfo_set_two_to_one(&this_ptr_conv, val_conv); } @@ -30020,6 +35308,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1capacity_ LDKChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); *ret_copy = ChannelInfo_get_capacity_sats(&this_ptr_conv); uint64_t ret_ref = (uint64_t)ret_copy; @@ -30030,6 +35319,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1capacity_1sa LDKChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); @@ -30041,11 +35331,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1announcem LDKChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelAnnouncement ret_var = ChannelInfo_get_announcement_message(&this_ptr_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -30058,9 +35350,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1announcement LDKChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelAnnouncement val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = ChannelAnnouncement_clone(&val_conv); ChannelInfo_set_announcement_message(&this_ptr_conv, val_conv); } @@ -30069,22 +35363,27 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1new(JNIEnv *en LDKChannelFeatures features_arg_conv; features_arg_conv.inner = (void*)(features_arg & (~1)); features_arg_conv.is_owned = (features_arg & 1) || (features_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv); features_arg_conv = ChannelFeatures_clone(&features_arg_conv); LDKNodeId node_one_arg_conv; node_one_arg_conv.inner = (void*)(node_one_arg & (~1)); node_one_arg_conv.is_owned = (node_one_arg & 1) || (node_one_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(node_one_arg_conv); node_one_arg_conv = NodeId_clone(&node_one_arg_conv); LDKDirectionalChannelInfo one_to_two_arg_conv; one_to_two_arg_conv.inner = (void*)(one_to_two_arg & (~1)); one_to_two_arg_conv.is_owned = (one_to_two_arg & 1) || (one_to_two_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(one_to_two_arg_conv); one_to_two_arg_conv = DirectionalChannelInfo_clone(&one_to_two_arg_conv); LDKNodeId node_two_arg_conv; node_two_arg_conv.inner = (void*)(node_two_arg & (~1)); node_two_arg_conv.is_owned = (node_two_arg & 1) || (node_two_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(node_two_arg_conv); node_two_arg_conv = NodeId_clone(&node_two_arg_conv); LDKDirectionalChannelInfo two_to_one_arg_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); + CHECK_INNER_FIELD_ACCESS_OR_NULL(two_to_one_arg_conv); two_to_one_arg_conv = DirectionalChannelInfo_clone(&two_to_one_arg_conv); void* capacity_sats_arg_ptr = (void*)(((uint64_t)capacity_sats_arg) & ~1); CHECK_ACCESS(capacity_sats_arg_ptr); @@ -30093,11 +35392,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1new(JNIEnv *en LDKChannelAnnouncement announcement_message_arg_conv; announcement_message_arg_conv.inner = (void*)(announcement_message_arg & (~1)); announcement_message_arg_conv.is_owned = (announcement_message_arg & 1) || (announcement_message_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(announcement_message_arg_conv); announcement_message_arg_conv = ChannelAnnouncement_clone(&announcement_message_arg_conv); LDKChannelInfo ret_var = ChannelInfo_new(features_arg_conv, node_one_arg_conv, one_to_two_arg_conv, node_two_arg_conv, two_to_one_arg_conv, capacity_sats_arg_conv, announcement_message_arg_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -30105,14 +35406,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1new(JNIEnv *en return ret_ref; } +static inline uint64_t ChannelInfo_clone_ptr(LDKChannelInfo *NONNULL_PTR arg) { + LDKChannelInfo ret_var = ChannelInfo_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_ChannelInfo_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKChannelInfo arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ChannelInfo_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKChannelInfo orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelInfo ret_var = ChannelInfo_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -30124,6 +35448,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1write(JNIE LDKChannelInfo obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ChannelInfo_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -30145,6 +35470,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingFees_1free(JNIEnv *env, LDKRoutingFees this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); RoutingFees_free(this_obj_conv); } @@ -30152,6 +35478,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_RoutingFees_1get_1base_1msa LDKRoutingFees this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = RoutingFees_get_base_msat(&this_ptr_conv); return ret_val; } @@ -30160,6 +35487,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingFees_1set_1base_1msat(J LDKRoutingFees this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); RoutingFees_set_base_msat(&this_ptr_conv, val); } @@ -30167,6 +35495,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_RoutingFees_1get_1proportio LDKRoutingFees this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = RoutingFees_get_proportional_millionths(&this_ptr_conv); return ret_val; } @@ -30175,6 +35504,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingFees_1set_1proportional LDKRoutingFees this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); RoutingFees_set_proportional_millionths(&this_ptr_conv, val); } @@ -30183,6 +35513,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingFees_1new(JNIEnv *en uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -30194,21 +35525,46 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RoutingFees_1eq(JNIEnv *en LDKRoutingFees a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKRoutingFees b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = RoutingFees_eq(&a_conv, &b_conv); return ret_val; } +static inline uint64_t RoutingFees_clone_ptr(LDKRoutingFees *NONNULL_PTR arg) { + LDKRoutingFees ret_var = RoutingFees_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_RoutingFees_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKRoutingFees arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = RoutingFees_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingFees_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKRoutingFees orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKRoutingFees ret_var = RoutingFees_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -30220,6 +35576,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingFees_1hash(JNIEnv *e LDKRoutingFees o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); int64_t ret_val = RoutingFees_hash(&o_conv); return ret_val; } @@ -30228,6 +35585,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RoutingFees_1write(JNIE LDKRoutingFees obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = RoutingFees_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -30249,6 +35607,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1free(JNI LDKNodeAnnouncementInfo this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); NodeAnnouncementInfo_free(this_obj_conv); } @@ -30256,10 +35615,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1 LDKNodeAnnouncementInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKNodeFeatures ret_var = NodeAnnouncementInfo_get_features(&this_ptr_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -30271,9 +35632,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1fea LDKNodeAnnouncementInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKNodeFeatures val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = NodeFeatures_clone(&val_conv); NodeAnnouncementInfo_set_features(&this_ptr_conv, val_conv); } @@ -30282,6 +35645,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1 LDKNodeAnnouncementInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = NodeAnnouncementInfo_get_last_update(&this_ptr_conv); return ret_val; } @@ -30290,6 +35654,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1las LDKNodeAnnouncementInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); NodeAnnouncementInfo_set_last_update(&this_ptr_conv, val); } @@ -30297,6 +35662,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1g LDKNodeAnnouncementInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 3); (*env)->SetByteArrayRegion(env, ret_arr, 0, 3, *NodeAnnouncementInfo_get_rgb(&this_ptr_conv)); return ret_arr; @@ -30306,6 +35672,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1rgb LDKNodeAnnouncementInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThreeBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 3); (*env)->GetByteArrayRegion(env, val, 0, 3, val_ref.data); @@ -30316,6 +35683,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1g LDKNodeAnnouncementInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *NodeAnnouncementInfo_get_alias(&this_ptr_conv)); return ret_arr; @@ -30325,6 +35693,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1ali LDKNodeAnnouncementInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK((*env)->GetArrayLength(env, val) == 32); (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data); @@ -30335,6 +35704,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1add LDKNodeAnnouncementInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_NetAddressZ val_constr; val_constr.datalen = (*env)->GetArrayLength(env, val); if (val_constr.datalen > 0) @@ -30358,11 +35728,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1 LDKNodeAnnouncementInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKNodeAnnouncement ret_var = NodeAnnouncementInfo_get_announcement_message(&this_ptr_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -30375,9 +35747,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1ann LDKNodeAnnouncementInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKNodeAnnouncement val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = NodeAnnouncement_clone(&val_conv); NodeAnnouncementInfo_set_announcement_message(&this_ptr_conv, val_conv); } @@ -30386,6 +35760,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1new(J LDKNodeFeatures features_arg_conv; features_arg_conv.inner = (void*)(features_arg & (~1)); features_arg_conv.is_owned = (features_arg & 1) || (features_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv); features_arg_conv = NodeFeatures_clone(&features_arg_conv); LDKThreeBytes rgb_arg_ref; CHECK((*env)->GetArrayLength(env, rgb_arg) == 3); @@ -30411,11 +35786,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1new(J LDKNodeAnnouncement announcement_message_arg_conv; announcement_message_arg_conv.inner = (void*)(announcement_message_arg & (~1)); announcement_message_arg_conv.is_owned = (announcement_message_arg & 1) || (announcement_message_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(announcement_message_arg_conv); announcement_message_arg_conv = NodeAnnouncement_clone(&announcement_message_arg_conv); LDKNodeAnnouncementInfo ret_var = NodeAnnouncementInfo_new(features_arg_conv, last_update_arg, rgb_arg_ref, alias_arg_ref, addresses_arg_constr, announcement_message_arg_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -30423,14 +35800,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1new(J return ret_ref; } +static inline uint64_t NodeAnnouncementInfo_clone_ptr(LDKNodeAnnouncementInfo *NONNULL_PTR arg) { + LDKNodeAnnouncementInfo ret_var = NodeAnnouncementInfo_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_NodeAnnouncementInfo_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKNodeAnnouncementInfo arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = NodeAnnouncementInfo_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKNodeAnnouncementInfo orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKNodeAnnouncementInfo ret_var = NodeAnnouncementInfo_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -30442,6 +35842,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1w LDKNodeAnnouncementInfo obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = NodeAnnouncementInfo_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -30463,6 +35864,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1free(JNIEnv *env, jc LDKNodeInfo this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); NodeInfo_free(this_obj_conv); } @@ -30470,6 +35872,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1set_1channels(JNIEnv LDKNodeInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_u64Z val_constr; val_constr.datalen = (*env)->GetArrayLength(env, val); if (val_constr.datalen > 0) @@ -30489,11 +35892,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeInfo_1get_1lowest_1inbo LDKNodeInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKRoutingFees ret_var = NodeInfo_get_lowest_inbound_channel_fees(&this_ptr_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -30506,9 +35911,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1set_1lowest_1inbound LDKNodeInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKRoutingFees val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = RoutingFees_clone(&val_conv); NodeInfo_set_lowest_inbound_channel_fees(&this_ptr_conv, val_conv); } @@ -30517,11 +35924,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeInfo_1get_1announcement LDKNodeInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKNodeAnnouncementInfo ret_var = NodeInfo_get_announcement_info(&this_ptr_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -30534,9 +35943,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1set_1announcement_1i LDKNodeInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKNodeAnnouncementInfo val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = NodeAnnouncementInfo_clone(&val_conv); NodeInfo_set_announcement_info(&this_ptr_conv, val_conv); } @@ -30557,15 +35968,18 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeInfo_1new(JNIEnv *env, LDKRoutingFees lowest_inbound_channel_fees_arg_conv; lowest_inbound_channel_fees_arg_conv.inner = (void*)(lowest_inbound_channel_fees_arg & (~1)); lowest_inbound_channel_fees_arg_conv.is_owned = (lowest_inbound_channel_fees_arg & 1) || (lowest_inbound_channel_fees_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(lowest_inbound_channel_fees_arg_conv); lowest_inbound_channel_fees_arg_conv = RoutingFees_clone(&lowest_inbound_channel_fees_arg_conv); LDKNodeAnnouncementInfo announcement_info_arg_conv; announcement_info_arg_conv.inner = (void*)(announcement_info_arg & (~1)); announcement_info_arg_conv.is_owned = (announcement_info_arg & 1) || (announcement_info_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(announcement_info_arg_conv); announcement_info_arg_conv = NodeAnnouncementInfo_clone(&announcement_info_arg_conv); LDKNodeInfo ret_var = NodeInfo_new(channels_arg_constr, lowest_inbound_channel_fees_arg_conv, announcement_info_arg_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -30573,14 +35987,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeInfo_1new(JNIEnv *env, return ret_ref; } +static inline uint64_t NodeInfo_clone_ptr(LDKNodeInfo *NONNULL_PTR arg) { + LDKNodeInfo ret_var = NodeInfo_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_NodeInfo_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKNodeInfo arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = NodeInfo_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeInfo_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKNodeInfo orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKNodeInfo ret_var = NodeInfo_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -30592,6 +36029,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeInfo_1write(JNIEnv LDKNodeInfo obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = NodeInfo_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -30613,6 +36051,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1write(JNI LDKNetworkGraph obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = NetworkGraph_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -30638,6 +36077,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1new(JNIEnv *e uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -30649,10 +36089,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1read_1only(JN LDKNetworkGraph this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKReadOnlyNetworkGraph ret_var = NetworkGraph_read_only(&this_arg_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -30664,9 +36106,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1node_ LDKNetworkGraph this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKNodeAnnouncement msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); *ret_conv = NetworkGraph_update_node_from_announcement(&this_arg_conv, &msg_conv); return (uint64_t)ret_conv; @@ -30676,9 +36120,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1node_ LDKNetworkGraph this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKUnsignedNodeAnnouncement msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); *ret_conv = NetworkGraph_update_node_from_unsigned_announcement(&this_arg_conv, &msg_conv); return (uint64_t)ret_conv; @@ -30688,9 +36134,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1chann LDKNetworkGraph this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKChannelAnnouncement msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); 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); @@ -30711,9 +36159,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1chann LDKNetworkGraph this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKUnsignedChannelAnnouncement msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); 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); @@ -30734,6 +36184,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1close_1channel_1 LDKNetworkGraph this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); NetworkGraph_close_channel_from_update(&this_arg_conv, short_channel_id, is_permanent); } @@ -30741,6 +36192,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1fail_1node(JNIEn LDKNetworkGraph this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKPublicKey _node_id_ref; CHECK((*env)->GetArrayLength(env, _node_id) == 33); (*env)->GetByteArrayRegion(env, _node_id, 0, 33, _node_id_ref.compressed_form); @@ -30751,9 +36203,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1chann LDKNetworkGraph this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKChannelUpdate msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); *ret_conv = NetworkGraph_update_channel(&this_arg_conv, &msg_conv); return (uint64_t)ret_conv; @@ -30763,9 +36217,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1chann LDKNetworkGraph this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKUnsignedChannelUpdate msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); *ret_conv = NetworkGraph_update_channel_unsigned(&this_arg_conv, &msg_conv); return (uint64_t)ret_conv; @@ -30775,6 +36231,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReadOnlyNetworkGraph_1get_1 LDKReadOnlyNetworkGraph this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKPublicKey pubkey_ref; CHECK((*env)->GetArrayLength(env, pubkey) == 33); (*env)->GetByteArrayRegion(env, pubkey, 0, 33, pubkey_ref.compressed_form); @@ -30788,6 +36245,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1free(JNIEnv *env, jc LDKRouteHop this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); RouteHop_free(this_obj_conv); } @@ -30795,6 +36253,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1pubkey(J LDKRouteHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, RouteHop_get_pubkey(&this_ptr_conv).compressed_form); return ret_arr; @@ -30804,6 +36263,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1pubkey(JNIEnv * LDKRouteHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -30814,10 +36274,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1node_1featur LDKRouteHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKNodeFeatures ret_var = RouteHop_get_node_features(&this_ptr_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -30829,9 +36291,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1node_1features( LDKRouteHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKNodeFeatures val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = NodeFeatures_clone(&val_conv); RouteHop_set_node_features(&this_ptr_conv, val_conv); } @@ -30840,6 +36304,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1short_1chann LDKRouteHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = RouteHop_get_short_channel_id(&this_ptr_conv); return ret_val; } @@ -30848,6 +36313,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1short_1channel_ LDKRouteHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); RouteHop_set_short_channel_id(&this_ptr_conv, val); } @@ -30855,10 +36321,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1channel_1fea LDKRouteHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelFeatures ret_var = RouteHop_get_channel_features(&this_ptr_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -30870,9 +36338,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1channel_1featur LDKRouteHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelFeatures val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = ChannelFeatures_clone(&val_conv); RouteHop_set_channel_features(&this_ptr_conv, val_conv); } @@ -30881,6 +36351,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1fee_1msat(JN LDKRouteHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = RouteHop_get_fee_msat(&this_ptr_conv); return ret_val; } @@ -30889,6 +36360,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1fee_1msat(JNIEn LDKRouteHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); RouteHop_set_fee_msat(&this_ptr_conv, val); } @@ -30896,6 +36368,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1cltv_1expiry LDKRouteHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = RouteHop_get_cltv_expiry_delta(&this_ptr_conv); return ret_val; } @@ -30904,6 +36377,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1cltv_1expiry_1d LDKRouteHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); RouteHop_set_cltv_expiry_delta(&this_ptr_conv, val); } @@ -30914,15 +36388,18 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1new(JNIEnv *env, LDKNodeFeatures node_features_arg_conv; node_features_arg_conv.inner = (void*)(node_features_arg & (~1)); node_features_arg_conv.is_owned = (node_features_arg & 1) || (node_features_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(node_features_arg_conv); node_features_arg_conv = NodeFeatures_clone(&node_features_arg_conv); LDKChannelFeatures channel_features_arg_conv; channel_features_arg_conv.inner = (void*)(channel_features_arg & (~1)); channel_features_arg_conv.is_owned = (channel_features_arg & 1) || (channel_features_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_features_arg_conv); channel_features_arg_conv = ChannelFeatures_clone(&channel_features_arg_conv); LDKRouteHop ret_var = RouteHop_new(pubkey_arg_ref, node_features_arg_conv, short_channel_id_arg, channel_features_arg_conv, fee_msat_arg, cltv_expiry_delta_arg); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -30930,14 +36407,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1new(JNIEnv *env, return ret_ref; } +static inline uint64_t RouteHop_clone_ptr(LDKRouteHop *NONNULL_PTR arg) { + LDKRouteHop ret_var = RouteHop_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_RouteHop_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKRouteHop arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = RouteHop_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKRouteHop orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKRouteHop ret_var = RouteHop_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -30949,6 +36449,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1hash(JNIEnv *env, LDKRouteHop o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); int64_t ret_val = RouteHop_hash(&o_conv); return ret_val; } @@ -30957,9 +36458,11 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RouteHop_1eq(JNIEnv *env, LDKRouteHop a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKRouteHop b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = RouteHop_eq(&a_conv, &b_conv); return ret_val; } @@ -30968,6 +36471,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RouteHop_1write(JNIEnv LDKRouteHop obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = RouteHop_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -30989,6 +36493,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Route_1free(JNIEnv *env, jclas LDKRoute this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); Route_free(this_obj_conv); } @@ -30996,6 +36501,7 @@ JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_Route_1get_1paths(JNIE LDKRoute this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_CVec_RouteHopZZ ret_var = Route_get_paths(&this_ptr_conv); jobjectArray ret_arr = NULL; ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_J_clz, NULL); @@ -31010,6 +36516,7 @@ JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_Route_1get_1paths(JNIE uint64_t ret_conv_12_conv_10_ref = 0; CHECK((((uint64_t)ret_conv_12_conv_10_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_conv_12_conv_10_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_12_conv_10_var); ret_conv_12_conv_10_ref = (uint64_t)ret_conv_12_conv_10_var.inner; if (ret_conv_12_conv_10_var.is_owned) { ret_conv_12_conv_10_ref |= 1; @@ -31029,6 +36536,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Route_1set_1paths(JNIEnv *env, LDKRoute this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_CVec_RouteHopZZ val_constr; val_constr.datalen = (*env)->GetArrayLength(env, val); if (val_constr.datalen > 0) @@ -31049,6 +36557,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Route_1set_1paths(JNIEnv *env, LDKRouteHop val_conv_12_conv_10_conv; val_conv_12_conv_10_conv.inner = (void*)(val_conv_12_conv_10 & (~1)); val_conv_12_conv_10_conv.is_owned = (val_conv_12_conv_10 & 1) || (val_conv_12_conv_10 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_12_conv_10_conv); val_conv_12_conv_10_conv = RouteHop_clone(&val_conv_12_conv_10_conv); val_conv_12_constr.data[k] = val_conv_12_conv_10_conv; } @@ -31062,11 +36571,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1get_1payee(JNIEnv *e LDKRoute this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPayee ret_var = Route_get_payee(&this_ptr_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -31079,9 +36590,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Route_1set_1payee(JNIEnv *env, LDKRoute this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPayee val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = Payee_clone(&val_conv); Route_set_payee(&this_ptr_conv, val_conv); } @@ -31107,6 +36620,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1new(JNIEnv *env, jcl LDKRouteHop paths_arg_conv_12_conv_10_conv; paths_arg_conv_12_conv_10_conv.inner = (void*)(paths_arg_conv_12_conv_10 & (~1)); paths_arg_conv_12_conv_10_conv.is_owned = (paths_arg_conv_12_conv_10 & 1) || (paths_arg_conv_12_conv_10 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(paths_arg_conv_12_conv_10_conv); paths_arg_conv_12_conv_10_conv = RouteHop_clone(&paths_arg_conv_12_conv_10_conv); paths_arg_conv_12_constr.data[k] = paths_arg_conv_12_conv_10_conv; } @@ -31116,11 +36630,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1new(JNIEnv *env, jcl LDKPayee payee_arg_conv; payee_arg_conv.inner = (void*)(payee_arg & (~1)); payee_arg_conv.is_owned = (payee_arg & 1) || (payee_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(payee_arg_conv); payee_arg_conv = Payee_clone(&payee_arg_conv); LDKRoute ret_var = Route_new(paths_arg_constr, payee_arg_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -31128,14 +36644,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1new(JNIEnv *env, jcl return ret_ref; } +static inline uint64_t Route_clone_ptr(LDKRoute *NONNULL_PTR arg) { + LDKRoute ret_var = Route_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_Route_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKRoute arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = Route_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKRoute orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKRoute ret_var = Route_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -31147,6 +36686,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1hash(JNIEnv *env, jc LDKRoute o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); int64_t ret_val = Route_hash(&o_conv); return ret_val; } @@ -31155,9 +36695,11 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Route_1eq(JNIEnv *env, jcl LDKRoute a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKRoute b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = Route_eq(&a_conv, &b_conv); return ret_val; } @@ -31166,6 +36708,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1get_1total_1fees(JNI LDKRoute this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int64_t ret_val = Route_get_total_fees(&this_arg_conv); return ret_val; } @@ -31174,6 +36717,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1get_1total_1amount(J LDKRoute this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int64_t ret_val = Route_get_total_amount(&this_arg_conv); return ret_val; } @@ -31182,6 +36726,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Route_1write(JNIEnv *en LDKRoute obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = Route_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -31203,6 +36748,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteParameters_1free(JNIEnv * LDKRouteParameters this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); RouteParameters_free(this_obj_conv); } @@ -31210,10 +36756,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1get_1payee LDKRouteParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPayee ret_var = RouteParameters_get_payee(&this_ptr_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -31225,9 +36773,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteParameters_1set_1payee(JN LDKRouteParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPayee val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = Payee_clone(&val_conv); RouteParameters_set_payee(&this_ptr_conv, val_conv); } @@ -31236,6 +36786,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1get_1final LDKRouteParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = RouteParameters_get_final_value_msat(&this_ptr_conv); return ret_val; } @@ -31244,6 +36795,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteParameters_1set_1final_1v LDKRouteParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); RouteParameters_set_final_value_msat(&this_ptr_conv, val); } @@ -31251,6 +36803,7 @@ JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1get_1final LDKRouteParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int32_t ret_val = RouteParameters_get_final_cltv_expiry_delta(&this_ptr_conv); return ret_val; } @@ -31259,6 +36812,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteParameters_1set_1final_1c LDKRouteParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); RouteParameters_set_final_cltv_expiry_delta(&this_ptr_conv, val); } @@ -31266,11 +36820,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1new(JNIEnv LDKPayee payee_arg_conv; payee_arg_conv.inner = (void*)(payee_arg & (~1)); payee_arg_conv.is_owned = (payee_arg & 1) || (payee_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(payee_arg_conv); payee_arg_conv = Payee_clone(&payee_arg_conv); LDKRouteParameters ret_var = RouteParameters_new(payee_arg_conv, final_value_msat_arg, final_cltv_expiry_delta_arg); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -31278,14 +36834,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1new(JNIEnv return ret_ref; } +static inline uint64_t RouteParameters_clone_ptr(LDKRouteParameters *NONNULL_PTR arg) { + LDKRouteParameters ret_var = RouteParameters_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_RouteParameters_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKRouteParameters arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = RouteParameters_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKRouteParameters orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKRouteParameters ret_var = RouteParameters_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -31297,6 +36876,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RouteParameters_1write( LDKRouteParameters obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = RouteParameters_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -31318,6 +36898,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Payee_1free(JNIEnv *env, jclas LDKPayee this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); Payee_free(this_obj_conv); } @@ -31325,6 +36906,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Payee_1get_1pubkey(JNIE LDKPayee this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, Payee_get_pubkey(&this_ptr_conv).compressed_form); return ret_arr; @@ -31334,6 +36916,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Payee_1set_1pubkey(JNIEnv *env LDKPayee this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -31344,11 +36927,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payee_1get_1features(JNIEnv LDKPayee this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKInvoiceFeatures ret_var = Payee_get_features(&this_ptr_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -31361,9 +36946,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Payee_1set_1features(JNIEnv *e LDKPayee this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKInvoiceFeatures val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = InvoiceFeatures_clone(&val_conv); Payee_set_features(&this_ptr_conv, val_conv); } @@ -31372,6 +36959,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Payee_1get_1route_1hin LDKPayee this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_RouteHintZ ret_var = Payee_get_route_hints(&this_ptr_conv); int64_tArray ret_arr = NULL; ret_arr = (*env)->NewLongArray(env, ret_var.datalen); @@ -31381,6 +36969,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Payee_1get_1route_1hin uint64_t ret_conv_11_ref = 0; CHECK((((uint64_t)ret_conv_11_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_conv_11_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_11_var); ret_conv_11_ref = (uint64_t)ret_conv_11_var.inner; if (ret_conv_11_var.is_owned) { ret_conv_11_ref |= 1; @@ -31396,6 +36985,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Payee_1set_1route_1hints(JNIEn LDKPayee this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_RouteHintZ val_constr; val_constr.datalen = (*env)->GetArrayLength(env, val); if (val_constr.datalen > 0) @@ -31408,6 +36998,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Payee_1set_1route_1hints(JNIEn LDKRouteHint val_conv_11_conv; val_conv_11_conv.inner = (void*)(val_conv_11 & (~1)); val_conv_11_conv.is_owned = (val_conv_11 & 1) || (val_conv_11 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_11_conv); val_conv_11_conv = RouteHint_clone(&val_conv_11_conv); val_constr.data[l] = val_conv_11_conv; } @@ -31419,6 +37010,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payee_1get_1expiry_1time(JN LDKPayee this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); *ret_copy = Payee_get_expiry_time(&this_ptr_conv); uint64_t ret_ref = (uint64_t)ret_copy; @@ -31429,6 +37021,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Payee_1set_1expiry_1time(JNIEn LDKPayee this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); @@ -31443,6 +37036,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payee_1new(JNIEnv *env, jcl LDKInvoiceFeatures features_arg_conv; features_arg_conv.inner = (void*)(features_arg & (~1)); features_arg_conv.is_owned = (features_arg & 1) || (features_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv); features_arg_conv = InvoiceFeatures_clone(&features_arg_conv); LDKCVec_RouteHintZ route_hints_arg_constr; route_hints_arg_constr.datalen = (*env)->GetArrayLength(env, route_hints_arg); @@ -31456,6 +37050,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payee_1new(JNIEnv *env, jcl LDKRouteHint route_hints_arg_conv_11_conv; route_hints_arg_conv_11_conv.inner = (void*)(route_hints_arg_conv_11 & (~1)); route_hints_arg_conv_11_conv.is_owned = (route_hints_arg_conv_11 & 1) || (route_hints_arg_conv_11 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_hints_arg_conv_11_conv); route_hints_arg_conv_11_conv = RouteHint_clone(&route_hints_arg_conv_11_conv); route_hints_arg_constr.data[l] = route_hints_arg_conv_11_conv; } @@ -31468,6 +37063,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payee_1new(JNIEnv *env, jcl uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -31475,14 +37071,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payee_1new(JNIEnv *env, jcl return ret_ref; } +static inline uint64_t Payee_clone_ptr(LDKPayee *NONNULL_PTR arg) { + LDKPayee ret_var = Payee_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_Payee_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKPayee arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = Payee_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payee_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKPayee orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKPayee ret_var = Payee_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -31494,6 +37113,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payee_1hash(JNIEnv *env, jc LDKPayee o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); int64_t ret_val = Payee_hash(&o_conv); return ret_val; } @@ -31502,9 +37122,11 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Payee_1eq(JNIEnv *env, jcl LDKPayee a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKPayee b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = Payee_eq(&a_conv, &b_conv); return ret_val; } @@ -31513,6 +37135,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Payee_1write(JNIEnv *en LDKPayee obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = Payee_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -31538,6 +37161,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payee_1from_1node_1id(JNIEn uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -31553,6 +37177,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payee_1for_1keysend(JNIEnv uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -31564,6 +37189,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1free(JNIEnv *env, j LDKRouteHint this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); RouteHint_free(this_obj_conv); } @@ -31571,6 +37197,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_RouteHint_1get_1a(JNIE LDKRouteHint this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_RouteHintHopZ ret_var = RouteHint_get_a(&this_ptr_conv); int64_tArray ret_arr = NULL; ret_arr = (*env)->NewLongArray(env, ret_var.datalen); @@ -31580,6 +37207,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_RouteHint_1get_1a(JNIE uint64_t ret_conv_14_ref = 0; CHECK((((uint64_t)ret_conv_14_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_conv_14_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_14_var); ret_conv_14_ref = (uint64_t)ret_conv_14_var.inner; if (ret_conv_14_var.is_owned) { ret_conv_14_ref |= 1; @@ -31595,6 +37223,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1set_1a(JNIEnv *env, LDKRouteHint this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_RouteHintHopZ val_constr; val_constr.datalen = (*env)->GetArrayLength(env, val); if (val_constr.datalen > 0) @@ -31607,6 +37236,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1set_1a(JNIEnv *env, LDKRouteHintHop val_conv_14_conv; val_conv_14_conv.inner = (void*)(val_conv_14 & (~1)); val_conv_14_conv.is_owned = (val_conv_14 & 1) || (val_conv_14 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_14_conv); val_conv_14_conv = RouteHintHop_clone(&val_conv_14_conv); val_constr.data[o] = val_conv_14_conv; } @@ -31627,6 +37257,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHint_1new(JNIEnv *env, LDKRouteHintHop a_arg_conv_14_conv; a_arg_conv_14_conv.inner = (void*)(a_arg_conv_14 & (~1)); a_arg_conv_14_conv.is_owned = (a_arg_conv_14 & 1) || (a_arg_conv_14 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_arg_conv_14_conv); a_arg_conv_14_conv = RouteHintHop_clone(&a_arg_conv_14_conv); a_arg_constr.data[o] = a_arg_conv_14_conv; } @@ -31635,6 +37266,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHint_1new(JNIEnv *env, uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -31642,14 +37274,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHint_1new(JNIEnv *env, return ret_ref; } +static inline uint64_t RouteHint_clone_ptr(LDKRouteHint *NONNULL_PTR arg) { + LDKRouteHint ret_var = RouteHint_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_RouteHint_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKRouteHint arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = RouteHint_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHint_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKRouteHint orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKRouteHint ret_var = RouteHint_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -31661,6 +37316,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHint_1hash(JNIEnv *env LDKRouteHint o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); int64_t ret_val = RouteHint_hash(&o_conv); return ret_val; } @@ -31669,9 +37325,11 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RouteHint_1eq(JNIEnv *env, LDKRouteHint a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKRouteHint b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = RouteHint_eq(&a_conv, &b_conv); return ret_val; } @@ -31680,6 +37338,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RouteHint_1write(JNIEnv LDKRouteHint obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = RouteHint_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -31701,6 +37360,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1free(JNIEnv *env LDKRouteHintHop this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); RouteHintHop_free(this_obj_conv); } @@ -31708,6 +37368,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1get_1src_ LDKRouteHintHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, RouteHintHop_get_src_node_id(&this_ptr_conv).compressed_form); return ret_arr; @@ -31717,6 +37378,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1set_1src_1node_1 LDKRouteHintHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -31727,6 +37389,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1get_1short_1c LDKRouteHintHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = RouteHintHop_get_short_channel_id(&this_ptr_conv); return ret_val; } @@ -31735,6 +37398,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1set_1short_1chan LDKRouteHintHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); RouteHintHop_set_short_channel_id(&this_ptr_conv, val); } @@ -31742,10 +37406,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1get_1fees(JNI LDKRouteHintHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKRoutingFees ret_var = RouteHintHop_get_fees(&this_ptr_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -31757,9 +37423,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1set_1fees(JNIEnv LDKRouteHintHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKRoutingFees val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = RoutingFees_clone(&val_conv); RouteHintHop_set_fees(&this_ptr_conv, val_conv); } @@ -31768,6 +37436,7 @@ JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1get_1cltv_1ex LDKRouteHintHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int16_t ret_val = RouteHintHop_get_cltv_expiry_delta(&this_ptr_conv); return ret_val; } @@ -31776,6 +37445,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1set_1cltv_1expir LDKRouteHintHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); RouteHintHop_set_cltv_expiry_delta(&this_ptr_conv, val); } @@ -31783,6 +37453,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1get_1htlc_1mi LDKRouteHintHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); *ret_copy = RouteHintHop_get_htlc_minimum_msat(&this_ptr_conv); uint64_t ret_ref = (uint64_t)ret_copy; @@ -31793,6 +37464,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1set_1htlc_1minim LDKRouteHintHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); @@ -31804,6 +37476,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1get_1htlc_1ma LDKRouteHintHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); *ret_copy = RouteHintHop_get_htlc_maximum_msat(&this_ptr_conv); uint64_t ret_ref = (uint64_t)ret_copy; @@ -31814,6 +37487,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1set_1htlc_1maxim LDKRouteHintHop this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); void* val_ptr = (void*)(((uint64_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); @@ -31828,6 +37502,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1new(JNIEnv *e LDKRoutingFees fees_arg_conv; fees_arg_conv.inner = (void*)(fees_arg & (~1)); fees_arg_conv.is_owned = (fees_arg & 1) || (fees_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(fees_arg_conv); fees_arg_conv = RoutingFees_clone(&fees_arg_conv); void* htlc_minimum_msat_arg_ptr = (void*)(((uint64_t)htlc_minimum_msat_arg) & ~1); CHECK_ACCESS(htlc_minimum_msat_arg_ptr); @@ -31841,6 +37516,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1new(JNIEnv *e uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -31848,14 +37524,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1new(JNIEnv *e return ret_ref; } +static inline uint64_t RouteHintHop_clone_ptr(LDKRouteHintHop *NONNULL_PTR arg) { + LDKRouteHintHop ret_var = RouteHintHop_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_RouteHintHop_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKRouteHintHop arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = RouteHintHop_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKRouteHintHop orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKRouteHintHop ret_var = RouteHintHop_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -31867,6 +37566,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1hash(JNIEnv * LDKRouteHintHop o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); int64_t ret_val = RouteHintHop_hash(&o_conv); return ret_val; } @@ -31875,9 +37575,11 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1eq(JNIEnv *e LDKRouteHintHop a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKRouteHintHop b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = RouteHintHop_eq(&a_conv, &b_conv); return ret_val; } @@ -31886,6 +37588,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1write(JNI LDKRouteHintHop obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = RouteHintHop_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -31910,9 +37613,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_find_1route(JNIEnv *env, jc LDKRouteParameters params_conv; params_conv.inner = (void*)(params & (~1)); params_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(params_conv); LDKNetworkGraph network_conv; network_conv.inner = (void*)(network & (~1)); network_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(network_conv); LDKCVec_ChannelDetailsZ first_hops_constr; LDKCVec_ChannelDetailsZ *first_hops_ptr = NULL; if (first_hops != NULL) { @@ -31927,6 +37632,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_find_1route(JNIEnv *env, jc LDKChannelDetails first_hops_conv_16_conv; first_hops_conv_16_conv.inner = (void*)(first_hops_conv_16 & (~1)); first_hops_conv_16_conv.is_owned = (first_hops_conv_16 & 1) || (first_hops_conv_16 == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(first_hops_conv_16_conv); first_hops_constr.data[q] = first_hops_conv_16_conv; } (*env)->ReleaseLongArrayElements(env, first_hops, first_hops_vals, 0); @@ -31952,6 +37658,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Scorer_1free(JNIEnv *env, jcla LDKScorer this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); Scorer_free(this_obj_conv); } @@ -31959,6 +37666,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1free(JNIEnv LDKScoringParameters this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ScoringParameters_free(this_obj_conv); } @@ -31966,6 +37674,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1get_1bas LDKScoringParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ScoringParameters_get_base_penalty_msat(&this_ptr_conv); return ret_val; } @@ -31974,6 +37683,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1set_1base_1 LDKScoringParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ScoringParameters_set_base_penalty_msat(&this_ptr_conv, val); } @@ -31981,6 +37691,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1get_1fai LDKScoringParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ScoringParameters_get_failure_penalty_msat(&this_ptr_conv); return ret_val; } @@ -31989,6 +37700,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1set_1failur LDKScoringParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ScoringParameters_set_failure_penalty_msat(&this_ptr_conv, val); } @@ -31996,6 +37708,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1get_1fai LDKScoringParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = ScoringParameters_get_failure_penalty_half_life(&this_ptr_conv); return ret_val; } @@ -32004,6 +37717,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1set_1failur LDKScoringParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); ScoringParameters_set_failure_penalty_half_life(&this_ptr_conv, val); } @@ -32012,6 +37726,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1new(JNIE uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -32023,6 +37738,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1writ LDKScoringParameters obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ScoringParameters_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -32044,11 +37760,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Scorer_1new(JNIEnv *env, jc LDKScoringParameters params_conv; params_conv.inner = (void*)(params & (~1)); params_conv.is_owned = (params & 1) || (params == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(params_conv); // Warning: we need a move here but no clone is available for LDKScoringParameters LDKScorer ret_var = Scorer_new(params_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -32061,6 +37779,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Scorer_1default(JNIEnv *env uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -32073,6 +37792,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ScoringParameters_1default( uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -32084,6 +37804,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Scorer_1as_1Score(JNIEnv *e LDKScorer this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKScore* ret_ret = MALLOC(sizeof(LDKScore), "LDKScore"); *ret_ret = Scorer_as_Score(&this_arg_conv); return (uint64_t)ret_ret; @@ -32093,6 +37814,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Scorer_1write(JNIEnv *e LDKScorer obj_conv; obj_conv.inner = (void*)(obj & (~1)); obj_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = Scorer_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); @@ -32114,6 +37836,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FilesystemPersister_1free(JNIE LDKFilesystemPersister this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); FilesystemPersister_free(this_obj_conv); } @@ -32123,6 +37846,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FilesystemPersister_1new(JN uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -32134,6 +37858,7 @@ JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_FilesystemPersister_1get_1d LDKFilesystemPersister this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKStr ret_str = FilesystemPersister_get_data_dir(&this_arg_conv); jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); Str_free(ret_str); @@ -32145,6 +37870,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FilesystemPersister_1persis LDKChannelManager manager_conv; manager_conv.inner = (void*)(manager & (~1)); manager_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(manager_conv); LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ"); *ret_conv = FilesystemPersister_persist_manager(data_dir_conv, &manager_conv); return (uint64_t)ret_conv; @@ -32154,6 +37880,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FilesystemPersister_1read_1 LDKFilesystemPersister this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); void* keys_manager_ptr = (void*)(((uint64_t)keys_manager) & ~1); CHECK_ACCESS(keys_manager_ptr); LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(keys_manager_ptr); @@ -32170,6 +37897,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FilesystemPersister_1as_1Pe LDKFilesystemPersister this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKPersist* ret_ret = MALLOC(sizeof(LDKPersist), "LDKPersist"); *ret_ret = FilesystemPersister_as_Persist(&this_arg_conv); return (uint64_t)ret_ret; @@ -32179,6 +37907,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BackgroundProcessor_1free(JNIE LDKBackgroundProcessor this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); BackgroundProcessor_free(this_obj_conv); } @@ -32209,15 +37938,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BackgroundProcessor_1start( LDKChainMonitor chain_monitor_conv; chain_monitor_conv.inner = (void*)(chain_monitor & (~1)); chain_monitor_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(chain_monitor_conv); LDKChannelManager channel_manager_conv; channel_manager_conv.inner = (void*)(channel_manager & (~1)); channel_manager_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_manager_conv); LDKNetGraphMsgHandler net_graph_msg_handler_conv; net_graph_msg_handler_conv.inner = (void*)(net_graph_msg_handler & (~1)); net_graph_msg_handler_conv.is_owned = (net_graph_msg_handler & 1) || (net_graph_msg_handler == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(net_graph_msg_handler_conv); LDKPeerManager peer_manager_conv; peer_manager_conv.inner = (void*)(peer_manager & (~1)); peer_manager_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(peer_manager_conv); void* logger_ptr = (void*)(((uint64_t)logger) & ~1); CHECK_ACCESS(logger_ptr); LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); @@ -32229,6 +37962,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BackgroundProcessor_1start( uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -32240,6 +37974,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BackgroundProcessor_1join(J LDKBackgroundProcessor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); // Warning: we need a move here but no clone is available for LDKBackgroundProcessor LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ"); *ret_conv = BackgroundProcessor_join(this_arg_conv); @@ -32250,6 +37985,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BackgroundProcessor_1stop(J LDKBackgroundProcessor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); // Warning: we need a move here but no clone is available for LDKBackgroundProcessor LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ"); *ret_conv = BackgroundProcessor_stop(this_arg_conv); @@ -32264,6 +38000,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Invoice_1free(JNIEnv *env, jcl LDKInvoice this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); Invoice_free(this_obj_conv); } @@ -32271,21 +38008,46 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Invoice_1eq(JNIEnv *env, j LDKInvoice a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKInvoice b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = Invoice_eq(&a_conv, &b_conv); return ret_val; } +static inline uint64_t Invoice_clone_ptr(LDKInvoice *NONNULL_PTR arg) { + LDKInvoice ret_var = Invoice_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_Invoice_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKInvoice arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = Invoice_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKInvoice orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKInvoice ret_var = Invoice_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -32297,6 +38059,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1free(JNIEnv LDKSignedRawInvoice this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); SignedRawInvoice_free(this_obj_conv); } @@ -32304,21 +38067,46 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1eq(JNIEn LDKSignedRawInvoice a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKSignedRawInvoice b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = SignedRawInvoice_eq(&a_conv, &b_conv); return ret_val; } +static inline uint64_t SignedRawInvoice_clone_ptr(LDKSignedRawInvoice *NONNULL_PTR arg) { + LDKSignedRawInvoice ret_var = SignedRawInvoice_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_SignedRawInvoice_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKSignedRawInvoice arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = SignedRawInvoice_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKSignedRawInvoice orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKSignedRawInvoice ret_var = SignedRawInvoice_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -32330,6 +38118,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RawInvoice_1free(JNIEnv *env, LDKRawInvoice this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); RawInvoice_free(this_obj_conv); } @@ -32337,10 +38126,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1get_1data(JNIEn LDKRawInvoice this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKRawDataPart ret_var = RawInvoice_get_data(&this_ptr_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -32352,9 +38143,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RawInvoice_1set_1data(JNIEnv * LDKRawInvoice this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKRawDataPart val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = RawDataPart_clone(&val_conv); RawInvoice_set_data(&this_ptr_conv, val_conv); } @@ -32363,21 +38156,46 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RawInvoice_1eq(JNIEnv *env LDKRawInvoice a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKRawInvoice b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = RawInvoice_eq(&a_conv, &b_conv); return ret_val; } +static inline uint64_t RawInvoice_clone_ptr(LDKRawInvoice *NONNULL_PTR arg) { + LDKRawInvoice ret_var = RawInvoice_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_RawInvoice_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKRawInvoice arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = RawInvoice_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKRawInvoice orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKRawInvoice ret_var = RawInvoice_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -32389,6 +38207,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RawDataPart_1free(JNIEnv *env, LDKRawDataPart this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); RawDataPart_free(this_obj_conv); } @@ -32396,10 +38215,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawDataPart_1get_1timestamp LDKRawDataPart this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPositiveTimestamp ret_var = RawDataPart_get_timestamp(&this_ptr_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -32411,9 +38232,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RawDataPart_1set_1timestamp(JN LDKRawDataPart this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPositiveTimestamp val_conv; val_conv.inner = (void*)(val & (~1)); val_conv.is_owned = (val & 1) || (val == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = PositiveTimestamp_clone(&val_conv); RawDataPart_set_timestamp(&this_ptr_conv, val_conv); } @@ -32422,21 +38245,46 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RawDataPart_1eq(JNIEnv *en LDKRawDataPart a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKRawDataPart b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = RawDataPart_eq(&a_conv, &b_conv); return ret_val; } +static inline uint64_t RawDataPart_clone_ptr(LDKRawDataPart *NONNULL_PTR arg) { + LDKRawDataPart ret_var = RawDataPart_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_RawDataPart_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKRawDataPart arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = RawDataPart_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawDataPart_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKRawDataPart orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKRawDataPart ret_var = RawDataPart_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -32448,6 +38296,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PositiveTimestamp_1free(JNIEnv LDKPositiveTimestamp this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); PositiveTimestamp_free(this_obj_conv); } @@ -32455,21 +38304,46 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PositiveTimestamp_1eq(JNIE LDKPositiveTimestamp a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKPositiveTimestamp b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = PositiveTimestamp_eq(&a_conv, &b_conv); return ret_val; } +static inline uint64_t PositiveTimestamp_clone_ptr(LDKPositiveTimestamp *NONNULL_PTR arg) { + LDKPositiveTimestamp ret_var = PositiveTimestamp_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_PositiveTimestamp_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKPositiveTimestamp arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = PositiveTimestamp_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PositiveTimestamp_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKPositiveTimestamp orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKPositiveTimestamp ret_var = PositiveTimestamp_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -32564,17 +38438,41 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Sha256_1free(JNIEnv *env, jcla LDKSha256 this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); Sha256_free(this_obj_conv); } +static inline uint64_t Sha256_clone_ptr(LDKSha256 *NONNULL_PTR arg) { + LDKSha256 ret_var = Sha256_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_Sha256_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKSha256 arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = Sha256_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Sha256_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKSha256 orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKSha256 ret_var = Sha256_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -32586,6 +38484,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Sha256_1hash(JNIEnv *env, j LDKSha256 o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); int64_t ret_val = Sha256_hash(&o_conv); return ret_val; } @@ -32594,9 +38493,11 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Sha256_1eq(JNIEnv *env, jc LDKSha256 a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKSha256 b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = Sha256_eq(&a_conv, &b_conv); return ret_val; } @@ -32605,17 +38506,41 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Description_1free(JNIEnv *env, LDKDescription this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); Description_free(this_obj_conv); } +static inline uint64_t Description_clone_ptr(LDKDescription *NONNULL_PTR arg) { + LDKDescription ret_var = Description_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_Description_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKDescription arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = Description_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Description_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKDescription orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKDescription ret_var = Description_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -32627,6 +38552,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Description_1hash(JNIEnv *e LDKDescription o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); int64_t ret_val = Description_hash(&o_conv); return ret_val; } @@ -32635,9 +38561,11 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Description_1eq(JNIEnv *en LDKDescription a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKDescription b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = Description_eq(&a_conv, &b_conv); return ret_val; } @@ -32646,6 +38574,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PayeePubKey_1free(JNIEnv *env, LDKPayeePubKey this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); PayeePubKey_free(this_obj_conv); } @@ -32653,6 +38582,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_PayeePubKey_1get_1a(JNI LDKPayeePubKey this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, PayeePubKey_get_a(&this_ptr_conv).compressed_form); return ret_arr; @@ -32662,6 +38592,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PayeePubKey_1set_1a(JNIEnv *en LDKPayeePubKey this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK((*env)->GetArrayLength(env, val) == 33); (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form); @@ -32676,6 +38607,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PayeePubKey_1new(JNIEnv *en uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -32683,14 +38615,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PayeePubKey_1new(JNIEnv *en return ret_ref; } +static inline uint64_t PayeePubKey_clone_ptr(LDKPayeePubKey *NONNULL_PTR arg) { + LDKPayeePubKey ret_var = PayeePubKey_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_PayeePubKey_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKPayeePubKey arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = PayeePubKey_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PayeePubKey_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKPayeePubKey orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKPayeePubKey ret_var = PayeePubKey_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -32702,6 +38657,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PayeePubKey_1hash(JNIEnv *e LDKPayeePubKey o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); int64_t ret_val = PayeePubKey_hash(&o_conv); return ret_val; } @@ -32710,9 +38666,11 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PayeePubKey_1eq(JNIEnv *en LDKPayeePubKey a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKPayeePubKey b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = PayeePubKey_eq(&a_conv, &b_conv); return ret_val; } @@ -32721,17 +38679,41 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ExpiryTime_1free(JNIEnv *env, LDKExpiryTime this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); ExpiryTime_free(this_obj_conv); } +static inline uint64_t ExpiryTime_clone_ptr(LDKExpiryTime *NONNULL_PTR arg) { + LDKExpiryTime ret_var = ExpiryTime_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_ExpiryTime_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKExpiryTime arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = ExpiryTime_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ExpiryTime_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKExpiryTime orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKExpiryTime ret_var = ExpiryTime_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -32743,6 +38725,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ExpiryTime_1hash(JNIEnv *en LDKExpiryTime o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); int64_t ret_val = ExpiryTime_hash(&o_conv); return ret_val; } @@ -32751,9 +38734,11 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ExpiryTime_1eq(JNIEnv *env LDKExpiryTime a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKExpiryTime b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = ExpiryTime_eq(&a_conv, &b_conv); return ret_val; } @@ -32762,6 +38747,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MinFinalCltvExpiry_1free(JNIEn LDKMinFinalCltvExpiry this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); MinFinalCltvExpiry_free(this_obj_conv); } @@ -32769,6 +38755,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MinFinalCltvExpiry_1get_1a( LDKMinFinalCltvExpiry this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = MinFinalCltvExpiry_get_a(&this_ptr_conv); return ret_val; } @@ -32777,6 +38764,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MinFinalCltvExpiry_1set_1a(JNI LDKMinFinalCltvExpiry this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); MinFinalCltvExpiry_set_a(&this_ptr_conv, val); } @@ -32785,6 +38773,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MinFinalCltvExpiry_1new(JNI uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -32792,14 +38781,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MinFinalCltvExpiry_1new(JNI return ret_ref; } +static inline uint64_t MinFinalCltvExpiry_clone_ptr(LDKMinFinalCltvExpiry *NONNULL_PTR arg) { + LDKMinFinalCltvExpiry ret_var = MinFinalCltvExpiry_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_MinFinalCltvExpiry_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKMinFinalCltvExpiry arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = MinFinalCltvExpiry_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MinFinalCltvExpiry_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKMinFinalCltvExpiry orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKMinFinalCltvExpiry ret_var = MinFinalCltvExpiry_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -32811,6 +38823,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MinFinalCltvExpiry_1hash(JN LDKMinFinalCltvExpiry o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); int64_t ret_val = MinFinalCltvExpiry_hash(&o_conv); return ret_val; } @@ -32819,9 +38832,11 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_MinFinalCltvExpiry_1eq(JNI LDKMinFinalCltvExpiry a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKMinFinalCltvExpiry b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = MinFinalCltvExpiry_eq(&a_conv, &b_conv); return ret_val; } @@ -32835,6 +38850,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Fallback_1free(JNIEnv *env, jc Fallback_free(this_ptr_conv); } +static inline uint64_t Fallback_clone_ptr(LDKFallback *NONNULL_PTR arg) { + LDKFallback *ret_copy = MALLOC(sizeof(LDKFallback), "LDKFallback"); + *ret_copy = Fallback_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Fallback_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKFallback* arg_conv = (LDKFallback*)arg; + int64_t ret_val = Fallback_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Fallback_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKFallback* orig_conv = (LDKFallback*)orig; LDKFallback *ret_copy = MALLOC(sizeof(LDKFallback), "LDKFallback"); @@ -32892,17 +38919,41 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceSignature_1free(JNIEnv LDKInvoiceSignature this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); InvoiceSignature_free(this_obj_conv); } +static inline uint64_t InvoiceSignature_clone_ptr(LDKInvoiceSignature *NONNULL_PTR arg) { + LDKInvoiceSignature ret_var = InvoiceSignature_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_InvoiceSignature_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKInvoiceSignature arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = InvoiceSignature_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceSignature_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKInvoiceSignature orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKInvoiceSignature ret_var = InvoiceSignature_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -32914,9 +38965,11 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceSignature_1eq(JNIEn LDKInvoiceSignature a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKInvoiceSignature b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = InvoiceSignature_eq(&a_conv, &b_conv); return ret_val; } @@ -32925,17 +38978,41 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PrivateRoute_1free(JNIEnv *env LDKPrivateRoute this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); PrivateRoute_free(this_obj_conv); } +static inline uint64_t PrivateRoute_clone_ptr(LDKPrivateRoute *NONNULL_PTR arg) { + LDKPrivateRoute ret_var = PrivateRoute_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_PrivateRoute_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKPrivateRoute arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = PrivateRoute_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PrivateRoute_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKPrivateRoute orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKPrivateRoute ret_var = PrivateRoute_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -32947,6 +39024,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PrivateRoute_1hash(JNIEnv * LDKPrivateRoute o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); int64_t ret_val = PrivateRoute_hash(&o_conv); return ret_val; } @@ -32955,9 +39033,11 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PrivateRoute_1eq(JNIEnv *e LDKPrivateRoute a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKPrivateRoute b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = PrivateRoute_eq(&a_conv, &b_conv); return ret_val; } @@ -32966,6 +39046,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1into_1par LDKSignedRawInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv = SignedRawInvoice_clone(&this_arg_conv); LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ), "LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ"); *ret_conv = SignedRawInvoice_into_parts(this_arg_conv); @@ -32976,10 +39057,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1raw_1invo LDKSignedRawInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKRawInvoice ret_var = SignedRawInvoice_raw_invoice(&this_arg_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -32991,6 +39074,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1hash( LDKSignedRawInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *SignedRawInvoice_hash(&this_arg_conv)); return ret_arr; @@ -33000,10 +39084,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1signature LDKSignedRawInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKInvoiceSignature ret_var = SignedRawInvoice_signature(&this_arg_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -33015,6 +39101,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1recover_1 LDKSignedRawInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ"); *ret_conv = SignedRawInvoice_recover_payee_pub_key(&this_arg_conv); return (uint64_t)ret_conv; @@ -33024,6 +39111,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1check_1s LDKSignedRawInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); jboolean ret_val = SignedRawInvoice_check_signature(&this_arg_conv); return ret_val; } @@ -33032,6 +39120,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RawInvoice_1hash(JNIEnv LDKRawInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, RawInvoice_hash(&this_arg_conv).data); return ret_arr; @@ -33041,11 +39130,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1payment_1hash(J LDKRawInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKSha256 ret_var = RawInvoice_payment_hash(&this_arg_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -33058,11 +39149,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1description(JNI LDKRawInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKDescription ret_var = RawInvoice_description(&this_arg_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -33075,11 +39168,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1payee_1pub_1key LDKRawInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKPayeePubKey ret_var = RawInvoice_payee_pub_key(&this_arg_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -33092,11 +39187,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1description_1ha LDKRawInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKSha256 ret_var = RawInvoice_description_hash(&this_arg_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -33109,11 +39206,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1expiry_1time(JN LDKRawInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKExpiryTime ret_var = RawInvoice_expiry_time(&this_arg_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -33126,11 +39225,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1min_1final_1clt LDKRawInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKMinFinalCltvExpiry ret_var = RawInvoice_min_final_cltv_expiry(&this_arg_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -33143,6 +39244,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RawInvoice_1payment_1se LDKRawInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, RawInvoice_payment_secret(&this_arg_conv).data); return ret_arr; @@ -33152,11 +39254,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1features(JNIEnv LDKRawInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKInvoiceFeatures ret_var = RawInvoice_features(&this_arg_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -33169,6 +39273,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_RawInvoice_1private_1r LDKRawInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCVec_PrivateRouteZ ret_var = RawInvoice_private_routes(&this_arg_conv); int64_tArray ret_arr = NULL; ret_arr = (*env)->NewLongArray(env, ret_var.datalen); @@ -33178,6 +39283,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_RawInvoice_1private_1r uint64_t ret_conv_14_ref = 0; CHECK((((uint64_t)ret_conv_14_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_conv_14_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_14_var); ret_conv_14_ref = (uint64_t)ret_conv_14_var.inner; if (ret_conv_14_var.is_owned) { ret_conv_14_ref |= 1; @@ -33193,6 +39299,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1amount_1pico_1b LDKRawInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); *ret_copy = RawInvoice_amount_pico_btc(&this_arg_conv); uint64_t ret_ref = (uint64_t)ret_copy; @@ -33203,6 +39310,7 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_RawInvoice_1currency(JNIEnv LDKRawInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); jclass ret_conv = LDKCurrency_to_java(env, RawInvoice_currency(&this_arg_conv)); return ret_conv; } @@ -33223,6 +39331,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PositiveTimestamp_1as_1unix LDKPositiveTimestamp this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int64_t ret_val = PositiveTimestamp_as_unix_timestamp(&this_arg_conv); return ret_val; } @@ -33231,6 +39340,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PositiveTimestamp_1as_1time LDKPositiveTimestamp this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int64_t ret_val = PositiveTimestamp_as_time(&this_arg_conv); return ret_val; } @@ -33239,11 +39349,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1into_1signed_1raw( LDKInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv = Invoice_clone(&this_arg_conv); LDKSignedRawInvoice ret_var = Invoice_into_signed_raw(this_arg_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -33255,6 +39367,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1check_1signature(J LDKInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ"); *ret_conv = Invoice_check_signature(&this_arg_conv); return (uint64_t)ret_conv; @@ -33264,6 +39377,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1from_1signed(JNIEn LDKSignedRawInvoice signed_invoice_conv; signed_invoice_conv.inner = (void*)(signed_invoice & (~1)); signed_invoice_conv.is_owned = (signed_invoice & 1) || (signed_invoice == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(signed_invoice_conv); signed_invoice_conv = SignedRawInvoice_clone(&signed_invoice_conv); LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ"); *ret_conv = Invoice_from_signed(signed_invoice_conv); @@ -33274,6 +39388,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1timestamp(JNIEnv * LDKInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int64_t ret_val = Invoice_timestamp(&this_arg_conv); return ret_val; } @@ -33282,6 +39397,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Invoice_1payment_1hash( LDKInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *Invoice_payment_hash(&this_arg_conv)); return ret_arr; @@ -33291,6 +39407,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Invoice_1payee_1pub_1ke LDKInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, Invoice_payee_pub_key(&this_arg_conv).compressed_form); return ret_arr; @@ -33300,6 +39417,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Invoice_1payment_1secre LDKInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *Invoice_payment_secret(&this_arg_conv)); return ret_arr; @@ -33309,11 +39427,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1features(JNIEnv *e LDKInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKInvoiceFeatures ret_var = Invoice_features(&this_arg_conv); uint64_t ret_ref = 0; if ((uint64_t)ret_var.inner > 4096) { 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -33326,6 +39446,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Invoice_1recover_1payee LDKInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, Invoice_recover_payee_pub_key(&this_arg_conv).compressed_form); return ret_arr; @@ -33335,6 +39456,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1expiry_1time(JNIEn LDKInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int64_t ret_val = Invoice_expiry_time(&this_arg_conv); return ret_val; } @@ -33343,6 +39465,7 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Invoice_1is_1expired(JNIEn LDKInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); jboolean ret_val = Invoice_is_expired(&this_arg_conv); return ret_val; } @@ -33351,6 +39474,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1min_1final_1cltv_1 LDKInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int64_t ret_val = Invoice_min_final_cltv_expiry(&this_arg_conv); return ret_val; } @@ -33359,6 +39483,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Invoice_1private_1rout LDKInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCVec_PrivateRouteZ ret_var = Invoice_private_routes(&this_arg_conv); int64_tArray ret_arr = NULL; ret_arr = (*env)->NewLongArray(env, ret_var.datalen); @@ -33368,6 +39493,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Invoice_1private_1rout uint64_t ret_conv_14_ref = 0; CHECK((((uint64_t)ret_conv_14_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_conv_14_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_14_var); ret_conv_14_ref = (uint64_t)ret_conv_14_var.inner; if (ret_conv_14_var.is_owned) { ret_conv_14_ref |= 1; @@ -33383,6 +39509,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Invoice_1route_1hints( LDKInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCVec_RouteHintZ ret_var = Invoice_route_hints(&this_arg_conv); int64_tArray ret_arr = NULL; ret_arr = (*env)->NewLongArray(env, ret_var.datalen); @@ -33392,6 +39519,7 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Invoice_1route_1hints( uint64_t ret_conv_11_ref = 0; CHECK((((uint64_t)ret_conv_11_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((uint64_t)&ret_conv_11_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_11_var); ret_conv_11_ref = (uint64_t)ret_conv_11_var.inner; if (ret_conv_11_var.is_owned) { ret_conv_11_ref |= 1; @@ -33407,6 +39535,7 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Invoice_1currency(JNIEnv *en LDKInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); jclass ret_conv = LDKCurrency_to_java(env, Invoice_currency(&this_arg_conv)); return ret_conv; } @@ -33415,6 +39544,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1amount_1milli_1sat LDKInvoice this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); *ret_copy = Invoice_amount_milli_satoshis(&this_arg_conv); uint64_t ret_ref = (uint64_t)ret_copy; @@ -33432,6 +39562,7 @@ JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Description_1into_1inner(JN LDKDescription this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv = Description_clone(&this_arg_conv); LDKStr ret_str = Description_into_inner(this_arg_conv); jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); @@ -33455,6 +39586,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ExpiryTime_1as_1seconds(JNI LDKExpiryTime this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int64_t ret_val = ExpiryTime_as_seconds(&this_arg_conv); return ret_val; } @@ -33463,6 +39595,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ExpiryTime_1as_1duration(JN LDKExpiryTime this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); int64_t ret_val = ExpiryTime_as_duration(&this_arg_conv); return ret_val; } @@ -33471,6 +39604,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PrivateRoute_1new(JNIEnv *e LDKRouteHint hops_conv; hops_conv.inner = (void*)(hops & (~1)); hops_conv.is_owned = (hops & 1) || (hops == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(hops_conv); hops_conv = RouteHint_clone(&hops_conv); LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ"); *ret_conv = PrivateRoute_new(hops_conv); @@ -33481,11 +39615,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PrivateRoute_1into_1inner(J LDKPrivateRoute this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv = PrivateRoute_clone(&this_arg_conv); LDKRouteHint ret_var = PrivateRoute_into_inner(this_arg_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -33614,6 +39750,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SignOrCreationError_1free(JNIE SignOrCreationError_free(this_ptr_conv); } +static inline uint64_t SignOrCreationError_clone_ptr(LDKSignOrCreationError *NONNULL_PTR arg) { + LDKSignOrCreationError *ret_copy = MALLOC(sizeof(LDKSignOrCreationError), "LDKSignOrCreationError"); + *ret_copy = SignOrCreationError_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignOrCreationError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKSignOrCreationError* arg_conv = (LDKSignOrCreationError*)arg; + int64_t ret_val = SignOrCreationError_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignOrCreationError_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKSignOrCreationError* orig_conv = (LDKSignOrCreationError*)orig; LDKSignOrCreationError *ret_copy = MALLOC(sizeof(LDKSignOrCreationError), "LDKSignOrCreationError"); @@ -33656,6 +39804,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1free(JNIEnv *env LDKInvoicePayer this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); InvoicePayer_free(this_obj_conv); } @@ -33681,6 +39830,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RetryAttempts_1free(JNIEnv *en LDKRetryAttempts this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); RetryAttempts_free(this_obj_conv); } @@ -33688,6 +39838,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RetryAttempts_1get_1a(JNIEn LDKRetryAttempts this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); int64_t ret_val = RetryAttempts_get_a(&this_ptr_conv); return ret_val; } @@ -33696,6 +39847,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RetryAttempts_1set_1a(JNIEnv * LDKRetryAttempts this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); RetryAttempts_set_a(&this_ptr_conv, val); } @@ -33704,6 +39856,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RetryAttempts_1new(JNIEnv * uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -33711,14 +39864,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RetryAttempts_1new(JNIEnv * return ret_ref; } +static inline uint64_t RetryAttempts_clone_ptr(LDKRetryAttempts *NONNULL_PTR arg) { + LDKRetryAttempts ret_var = RetryAttempts_clone(arg); +uint64_t ret_ref = 0; +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. +CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); +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_RetryAttempts_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKRetryAttempts arg_conv; + arg_conv.inner = (void*)(arg & (~1)); + arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + int64_t ret_val = RetryAttempts_clone_ptr(&arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RetryAttempts_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKRetryAttempts orig_conv; orig_conv.inner = (void*)(orig & (~1)); orig_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKRetryAttempts ret_var = RetryAttempts_clone(&orig_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -33730,9 +39906,11 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RetryAttempts_1eq(JNIEnv * LDKRetryAttempts a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); LDKRetryAttempts b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); jboolean ret_val = RetryAttempts_eq(&a_conv, &b_conv); return ret_val; } @@ -33741,6 +39919,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RetryAttempts_1hash(JNIEnv LDKRetryAttempts o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); int64_t ret_val = RetryAttempts_hash(&o_conv); return ret_val; } @@ -33754,6 +39933,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentError_1free(JNIEnv *env PaymentError_free(this_ptr_conv); } +static inline uint64_t PaymentError_clone_ptr(LDKPaymentError *NONNULL_PTR arg) { + LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError"); + *ret_copy = PaymentError_clone(arg); +uint64_t ret_ref = (uint64_t)ret_copy; + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKPaymentError* arg_conv = (LDKPaymentError*)arg; + int64_t ret_val = PaymentError_clone_ptr(arg_conv); + return ret_val; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentError_1clone(JNIEnv *env, jclass clz, int64_t orig) { LDKPaymentError* orig_conv = (LDKPaymentError*)orig; LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError"); @@ -33774,6 +39965,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentError_1routing(JNIEn LDKLightningError a_conv; a_conv.inner = (void*)(a & (~1)); a_conv.is_owned = (a & 1) || (a == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv = LightningError_clone(&a_conv); LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError"); *ret_copy = PaymentError_routing(a_conv); @@ -33810,6 +40002,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1new(JNIEnv *e LDKLockableScore scorer_conv; scorer_conv.inner = (void*)(scorer & (~1)); scorer_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(scorer_conv); void* logger_ptr = (void*)(((uint64_t)logger) & ~1); CHECK_ACCESS(logger_ptr); LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); @@ -33827,11 +40020,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1new(JNIEnv *e LDKRetryAttempts retry_attempts_conv; retry_attempts_conv.inner = (void*)(retry_attempts & (~1)); retry_attempts_conv.is_owned = (retry_attempts & 1) || (retry_attempts == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(retry_attempts_conv); retry_attempts_conv = RetryAttempts_clone(&retry_attempts_conv); LDKInvoicePayer ret_var = InvoicePayer_new(payer_conv, router_conv, &scorer_conv, logger_conv, event_handler_conv, retry_attempts_conv); uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -33843,9 +40038,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1pay_1invoice( LDKInvoicePayer this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKInvoice invoice_conv; invoice_conv.inner = (void*)(invoice & (~1)); invoice_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_conv); LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ"); *ret_conv = InvoicePayer_pay_invoice(&this_arg_conv, &invoice_conv); return (uint64_t)ret_conv; @@ -33855,9 +40052,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1pay_1zero_1va LDKInvoicePayer this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKInvoice invoice_conv; invoice_conv.inner = (void*)(invoice & (~1)); invoice_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_conv); LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ"); *ret_conv = InvoicePayer_pay_zero_value_invoice(&this_arg_conv, &invoice_conv, amount_msats); return (uint64_t)ret_conv; @@ -33867,6 +40066,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1remove_1cached_1 LDKInvoicePayer this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char payment_hash_arr[32]; CHECK((*env)->GetArrayLength(env, payment_hash) == 32); (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_arr); @@ -33878,6 +40078,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1as_1EventHand LDKInvoicePayer this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKEventHandler* ret_ret = MALLOC(sizeof(LDKEventHandler), "LDKEventHandler"); *ret_ret = InvoicePayer_as_EventHandler(&this_arg_conv); return (uint64_t)ret_ret; @@ -33887,6 +40088,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1chan LDKChannelManager channelmanager_conv; channelmanager_conv.inner = (void*)(channelmanager & (~1)); channelmanager_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv); void* keys_manager_ptr = (void*)(((uint64_t)keys_manager) & ~1); CHECK_ACCESS(keys_manager_ptr); LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(keys_manager_ptr); @@ -33909,6 +40111,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DefaultRouter_1free(JNIEnv *en LDKDefaultRouter this_obj_conv; this_obj_conv.inner = (void*)(this_obj & (~1)); this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); DefaultRouter_free(this_obj_conv); } @@ -33916,6 +40119,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DefaultRouter_1new(JNIEnv * LDKNetworkGraph network_graph_conv; network_graph_conv.inner = (void*)(network_graph & (~1)); network_graph_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); void* logger_ptr = (void*)(((uint64_t)logger) & ~1); CHECK_ACCESS(logger_ptr); LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); @@ -33927,6 +40131,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DefaultRouter_1new(JNIEnv * uint64_t ret_ref = 0; 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. + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = (uint64_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; @@ -33938,6 +40143,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DefaultRouter_1as_1Router(J LDKDefaultRouter this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKRouter* ret_ret = MALLOC(sizeof(LDKRouter), "LDKRouter"); *ret_ret = DefaultRouter_as_Router(&this_arg_conv); return (uint64_t)ret_ret; @@ -33947,6 +40153,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1Payer(J LDKChannelManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKPayer* ret_ret = MALLOC(sizeof(LDKPayer), "LDKPayer"); *ret_ret = ChannelManager_as_Payer(&this_arg_conv); return (uint64_t)ret_ret; @@ -33977,6 +40184,7 @@ JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Invoice_1to_1str(JNIEnv *en LDKInvoice o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); LDKStr ret_str = Invoice_to_str(&o_conv); jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); Str_free(ret_str); @@ -33987,6 +40195,7 @@ JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1to_1str(J LDKSignedRawInvoice o_conv; o_conv.inner = (void*)(o & (~1)); o_conv.is_owned = false; + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); LDKStr ret_str = SignedRawInvoice_to_str(&o_conv); jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); Str_free(ret_str);