]> git.bitcoin.ninja Git - ldk-java/commitdiff
Add ability to check if a CResult<> is OK, and get its value pointer
authorMatt Corallo <git@bluematt.me>
Tue, 6 Oct 2020 00:55:35 +0000 (20:55 -0400)
committerMatt Corallo <git@bluematt.me>
Tue, 6 Oct 2020 19:52:23 +0000 (15:52 -0400)
genbindings.py
src/main/java/org/ldk/impl/bindings.java
src/main/jni/bindings.c
src/main/jni/org_ldk_impl_bindings.h

index 8c7e7378b0e1f41276ad3f125f753cf8ced1acff..deea360c406a12bed4b4e31e263e6c5684752739 100755 (executable)
@@ -532,6 +532,7 @@ public class bindings {
     reg_fn_regex = re.compile("([A-Za-z_0-9\* ]* \*?)([a-zA-Z_0-9]*)\((.*)\);$")
     const_val_regex = re.compile("^extern const ([A-Za-z_0-9]*) ([A-Za-z_0-9]*);$")
 
+    line_indicates_result_regex = re.compile("^   bool result_ok;$")
     line_indicates_opaque_regex = re.compile("^   bool is_owned;$")
     line_indicates_trait_regex = re.compile("^   ([A-Za-z_0-9]* \*?)\(\*([A-Za-z_0-9]*)\)\((const )?void \*this_arg(.*)\);$")
     assert(line_indicates_trait_regex.match("   uintptr_t (*send_data)(void *this_arg, LDKu8slice data, bool resume_read);"))
@@ -542,7 +543,10 @@ public class bindings {
     struct_name_regex = re.compile("^typedef (struct|enum|union) (MUST_USE_STRUCT )?(LDK[A-Za-z_0-9]*) {$")
     assert(struct_name_regex.match("typedef struct LDKCVecTempl_u8 {"))
     assert(struct_name_regex.match("typedef enum LDKNetwork {"))
+    struct_alias_regex = re.compile("^typedef (LDK[A-Za-z_0-9]*) (LDK[A-Za-z_0-9]*);$")
+    assert(struct_alias_regex.match("typedef LDKCResultTempl_bool__PeerHandleError LDKCResult_boolPeerHandleErrorZ;"))
 
+    result_templ_structs = set()
     for line in in_h:
         if in_block_comment:
             #out_java.write("\t" + line)
@@ -555,6 +559,7 @@ public class bindings {
                 struct_name = None
                 obj_lines = cur_block_obj.split("\n")
                 is_opaque = False
+                is_result = False
                 is_unitary_enum = False
                 is_union_enum = False
                 is_union = False
@@ -580,6 +585,8 @@ public class bindings {
                                 is_union = True
                         if line_indicates_opaque_regex.match(struct_line):
                             is_opaque = True
+                        elif line_indicates_result_regex.match(struct_line):
+                            is_result = True
                         trait_fn_match = line_indicates_trait_regex.match(struct_line)
                         if trait_fn_match is not None:
                             trait_fn_lines.append(trait_fn_match)
@@ -596,6 +603,8 @@ public class bindings {
                 assert(not is_union or not (len(trait_fn_lines) != 0 or is_unitary_enum or is_union_enum or is_opaque))
                 if is_opaque:
                     opaque_structs.add(struct_name)
+                elif is_result:
+                    result_templ_structs.add(struct_name)
                 elif is_unitary_enum:
                     unitary_enums.add(struct_name)
                     out_c.write("static inline " + struct_name + " " + struct_name + "_from_java(JNIEnv *env, jclass val) {\n")
@@ -659,6 +668,19 @@ public class bindings {
             elif line.startswith("typedef union "):
                 cur_block_obj = line
             elif line.startswith("typedef "):
+                alias_match =  struct_alias_regex.match(line)
+                if alias_match.group(1) in result_templ_structs:
+                    out_java.write("\tpublic static native boolean " + alias_match.group(2) + "_result_ok(long arg);\n")
+                    out_java.write("\tpublic static native long " + alias_match.group(2) + "_get_inner(long arg);\n")
+                    out_c.write("JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_" + alias_match.group(2).replace("_", "_1") + "_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {\n")
+                    out_c.write("\treturn ((" + alias_match.group(2) + "*)arg)->result_ok;\n")
+                    out_c.write("}\n")
+                    out_c.write("JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_" + alias_match.group(2).replace("_", "_1") + "_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {\n")
+                    out_c.write("\tif (((" + alias_match.group(2) + "*)arg)->result_ok) {\n")
+                    out_c.write("\t\treturn (long)((" + alias_match.group(2) + "*)arg)->contents.result;\n")
+                    out_c.write("\t} else {\n")
+                    out_c.write("\t\treturn (long)((" + alias_match.group(2) + "*)arg)->contents.err;\n")
+                    out_c.write("\t}\n}\n")
                 pass
             elif fn_ptr is not None:
                 map_fn(fn_ptr, None)
index b57129d3b915b4cfc4418654b91d6cec985439ea..b19a13352425509e0149e08d58bc84d219bb8374 100644 (file)
@@ -46,6 +46,22 @@ public class bindings {
           LDKSecp256k1Error_NotEnoughMemory,
           LDKSecp256k1Error_CallbackPanicked,
        }
+       public static native boolean LDKCResult_NoneChannelMonitorUpdateErrZ_result_ok(long arg);
+       public static native long LDKCResult_NoneChannelMonitorUpdateErrZ_get_inner(long arg);
+       public static native boolean LDKCResult_NoneMonitorUpdateErrorZ_result_ok(long arg);
+       public static native long LDKCResult_NoneMonitorUpdateErrorZ_get_inner(long arg);
+       public static native boolean LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_result_ok(long arg);
+       public static native long LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_inner(long arg);
+       public static native boolean LDKCResult_SignatureNoneZ_result_ok(long arg);
+       public static native long LDKCResult_SignatureNoneZ_get_inner(long arg);
+       public static native boolean LDKCResult_CVec_SignatureZNoneZ_result_ok(long arg);
+       public static native long LDKCResult_CVec_SignatureZNoneZ_get_inner(long arg);
+       public static native boolean LDKCResult_NoneAPIErrorZ_result_ok(long arg);
+       public static native long LDKCResult_NoneAPIErrorZ_get_inner(long arg);
+       public static native boolean LDKCResult_NonePaymentSendFailureZ_result_ok(long arg);
+       public static native long LDKCResult_NonePaymentSendFailureZ_get_inner(long arg);
+       public static native boolean LDKCResult_NonePeerHandleErrorZ_result_ok(long arg);
+       public static native long LDKCResult_NonePeerHandleErrorZ_get_inner(long arg);
        public interface LDKMessageSendEventsProvider {
                 long get_and_clear_pending_msg_events();
        }
@@ -61,6 +77,8 @@ public class bindings {
        }
        public static native long LDKLogger_new(LDKLogger impl);
        public static native LDKLogger LDKLogger_get_obj_from_jcalls(long val);
+       public static native boolean LDKCResult_TxOutAccessErrorZ_result_ok(long arg);
+       public static native long LDKCResult_TxOutAccessErrorZ_get_inner(long arg);
        public interface LDKAccess {
                 long get_utxo(byte[] genesis_hash, long short_channel_id);
        }
@@ -136,6 +154,8 @@ public class bindings {
        }
        public static native long LDKChannelMessageHandler_new(LDKChannelMessageHandler impl, LDKMessageSendEventsProvider MessageSendEventsProvider);
        public static native LDKChannelMessageHandler LDKChannelMessageHandler_get_obj_from_jcalls(long val);
+       public static native boolean LDKCResult_boolLightningErrorZ_result_ok(long arg);
+       public static native long LDKCResult_boolLightningErrorZ_get_inner(long arg);
        public interface LDKRoutingMessageHandler {
                 long handle_node_announcement(long msg);
                 long handle_channel_announcement(long msg);
@@ -155,6 +175,18 @@ public class bindings {
        }
        public static native long LDKSocketDescriptor_new(LDKSocketDescriptor impl);
        public static native LDKSocketDescriptor LDKSocketDescriptor_get_obj_from_jcalls(long val);
+       public static native boolean LDKCResult_CVec_u8ZPeerHandleErrorZ_result_ok(long arg);
+       public static native long LDKCResult_CVec_u8ZPeerHandleErrorZ_get_inner(long arg);
+       public static native boolean LDKCResult_boolPeerHandleErrorZ_result_ok(long arg);
+       public static native long LDKCResult_boolPeerHandleErrorZ_get_inner(long arg);
+       public static native boolean LDKCResult_SecretKeySecpErrorZ_result_ok(long arg);
+       public static native long LDKCResult_SecretKeySecpErrorZ_get_inner(long arg);
+       public static native boolean LDKCResult_PublicKeySecpErrorZ_result_ok(long arg);
+       public static native long LDKCResult_PublicKeySecpErrorZ_get_inner(long arg);
+       public static native boolean LDKCResult_TxCreationKeysSecpErrorZ_result_ok(long arg);
+       public static native long LDKCResult_TxCreationKeysSecpErrorZ_get_inner(long arg);
+       public static native boolean LDKCResult_RouteLightningErrorZ_result_ok(long arg);
+       public static native long LDKCResult_RouteLightningErrorZ_get_inner(long arg);
        /// extern const void (*C2Tuple_HTLCOutputInCommitmentSignatureZ_free)(LDKC2Tuple_HTLCOutputInCommitmentSignatureZ);
        public static native void C2Tuple_HTLCOutputInCommitmentSignatureZ_free(long arg);
        /// extern const void (*C2Tuple_OutPointScriptZ_free)(LDKC2Tuple_OutPointScriptZ);
index d5a017753302f14267aa415cbaaf22fa3068d2a7..fb492f34a856534e0b0b60d043d03622ae4a9c96 100644 (file)
@@ -252,6 +252,86 @@ static inline jclass LDKSecp256k1Error_to_java(JNIEnv *env, LDKSecp256k1Error va
        }
 }
 
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneChannelMonitorUpdateErrZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
+       return ((LDKCResult_NoneChannelMonitorUpdateErrZ*)arg)->result_ok;
+}
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneChannelMonitorUpdateErrZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
+       if (((LDKCResult_NoneChannelMonitorUpdateErrZ*)arg)->result_ok) {
+               return (long)((LDKCResult_NoneChannelMonitorUpdateErrZ*)arg)->contents.result;
+       } else {
+               return (long)((LDKCResult_NoneChannelMonitorUpdateErrZ*)arg)->contents.err;
+       }
+}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneMonitorUpdateErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
+       return ((LDKCResult_NoneMonitorUpdateErrorZ*)arg)->result_ok;
+}
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneMonitorUpdateErrorZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
+       if (((LDKCResult_NoneMonitorUpdateErrorZ*)arg)->result_ok) {
+               return (long)((LDKCResult_NoneMonitorUpdateErrorZ*)arg)->contents.result;
+       } else {
+               return (long)((LDKCResult_NoneMonitorUpdateErrorZ*)arg)->contents.err;
+       }
+}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
+       return ((LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)arg)->result_ok;
+}
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
+       if (((LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)arg)->result_ok) {
+               return (long)((LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)arg)->contents.result;
+       } else {
+               return (long)((LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)arg)->contents.err;
+       }
+}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SignatureNoneZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
+       return ((LDKCResult_SignatureNoneZ*)arg)->result_ok;
+}
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SignatureNoneZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
+       if (((LDKCResult_SignatureNoneZ*)arg)->result_ok) {
+               return (long)((LDKCResult_SignatureNoneZ*)arg)->contents.result;
+       } else {
+               return (long)((LDKCResult_SignatureNoneZ*)arg)->contents.err;
+       }
+}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1SignatureZNoneZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
+       return ((LDKCResult_CVec_SignatureZNoneZ*)arg)->result_ok;
+}
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1SignatureZNoneZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
+       if (((LDKCResult_CVec_SignatureZNoneZ*)arg)->result_ok) {
+               return (long)((LDKCResult_CVec_SignatureZNoneZ*)arg)->contents.result;
+       } else {
+               return (long)((LDKCResult_CVec_SignatureZNoneZ*)arg)->contents.err;
+       }
+}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneAPIErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
+       return ((LDKCResult_NoneAPIErrorZ*)arg)->result_ok;
+}
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneAPIErrorZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
+       if (((LDKCResult_NoneAPIErrorZ*)arg)->result_ok) {
+               return (long)((LDKCResult_NoneAPIErrorZ*)arg)->contents.result;
+       } else {
+               return (long)((LDKCResult_NoneAPIErrorZ*)arg)->contents.err;
+       }
+}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NonePaymentSendFailureZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
+       return ((LDKCResult_NonePaymentSendFailureZ*)arg)->result_ok;
+}
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NonePaymentSendFailureZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
+       if (((LDKCResult_NonePaymentSendFailureZ*)arg)->result_ok) {
+               return (long)((LDKCResult_NonePaymentSendFailureZ*)arg)->contents.result;
+       } else {
+               return (long)((LDKCResult_NonePaymentSendFailureZ*)arg)->contents.err;
+       }
+}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NonePeerHandleErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
+       return ((LDKCResult_NonePeerHandleErrorZ*)arg)->result_ok;
+}
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NonePeerHandleErrorZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
+       if (((LDKCResult_NonePeerHandleErrorZ*)arg)->result_ok) {
+               return (long)((LDKCResult_NonePeerHandleErrorZ*)arg)->contents.result;
+       } else {
+               return (long)((LDKCResult_NonePeerHandleErrorZ*)arg)->contents.err;
+       }
+}
 typedef struct LDKMessageSendEventsProvider_JCalls {
        atomic_size_t refcnt;
        JNIEnv *env;
@@ -400,6 +480,16 @@ JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKLogger_1new (JNIEnv * env,
 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKLogger_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
        return ((LDKLogger_JCalls*)val)->o;
 }
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxOutAccessErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
+       return ((LDKCResult_TxOutAccessErrorZ*)arg)->result_ok;
+}
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxOutAccessErrorZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
+       if (((LDKCResult_TxOutAccessErrorZ*)arg)->result_ok) {
+               return (long)((LDKCResult_TxOutAccessErrorZ*)arg)->contents.result;
+       } else {
+               return (long)((LDKCResult_TxOutAccessErrorZ*)arg)->contents.err;
+       }
+}
 typedef struct LDKAccess_JCalls {
        atomic_size_t refcnt;
        JNIEnv *env;
@@ -1125,6 +1215,16 @@ JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1new
 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
        return ((LDKChannelMessageHandler_JCalls*)val)->o;
 }
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1boolLightningErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
+       return ((LDKCResult_boolLightningErrorZ*)arg)->result_ok;
+}
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1boolLightningErrorZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
+       if (((LDKCResult_boolLightningErrorZ*)arg)->result_ok) {
+               return (long)((LDKCResult_boolLightningErrorZ*)arg)->contents.result;
+       } else {
+               return (long)((LDKCResult_boolLightningErrorZ*)arg)->contents.err;
+       }
+}
 typedef struct LDKRoutingMessageHandler_JCalls {
        atomic_size_t refcnt;
        JNIEnv *env;
@@ -1307,6 +1407,66 @@ JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKSocketDescriptor_1new (JNIE
 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKSocketDescriptor_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
        return ((LDKSocketDescriptor_JCalls*)val)->o;
 }
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1u8ZPeerHandleErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
+       return ((LDKCResult_CVec_u8ZPeerHandleErrorZ*)arg)->result_ok;
+}
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1u8ZPeerHandleErrorZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
+       if (((LDKCResult_CVec_u8ZPeerHandleErrorZ*)arg)->result_ok) {
+               return (long)((LDKCResult_CVec_u8ZPeerHandleErrorZ*)arg)->contents.result;
+       } else {
+               return (long)((LDKCResult_CVec_u8ZPeerHandleErrorZ*)arg)->contents.err;
+       }
+}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1boolPeerHandleErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
+       return ((LDKCResult_boolPeerHandleErrorZ*)arg)->result_ok;
+}
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1boolPeerHandleErrorZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
+       if (((LDKCResult_boolPeerHandleErrorZ*)arg)->result_ok) {
+               return (long)((LDKCResult_boolPeerHandleErrorZ*)arg)->contents.result;
+       } else {
+               return (long)((LDKCResult_boolPeerHandleErrorZ*)arg)->contents.err;
+       }
+}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SecretKeySecpErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
+       return ((LDKCResult_SecretKeySecpErrorZ*)arg)->result_ok;
+}
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SecretKeySecpErrorZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
+       if (((LDKCResult_SecretKeySecpErrorZ*)arg)->result_ok) {
+               return (long)((LDKCResult_SecretKeySecpErrorZ*)arg)->contents.result;
+       } else {
+               return (long)((LDKCResult_SecretKeySecpErrorZ*)arg)->contents.err;
+       }
+}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PublicKeySecpErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
+       return ((LDKCResult_PublicKeySecpErrorZ*)arg)->result_ok;
+}
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PublicKeySecpErrorZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
+       if (((LDKCResult_PublicKeySecpErrorZ*)arg)->result_ok) {
+               return (long)((LDKCResult_PublicKeySecpErrorZ*)arg)->contents.result;
+       } else {
+               return (long)((LDKCResult_PublicKeySecpErrorZ*)arg)->contents.err;
+       }
+}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxCreationKeysSecpErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
+       return ((LDKCResult_TxCreationKeysSecpErrorZ*)arg)->result_ok;
+}
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxCreationKeysSecpErrorZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
+       if (((LDKCResult_TxCreationKeysSecpErrorZ*)arg)->result_ok) {
+               return (long)((LDKCResult_TxCreationKeysSecpErrorZ*)arg)->contents.result;
+       } else {
+               return (long)((LDKCResult_TxCreationKeysSecpErrorZ*)arg)->contents.err;
+       }
+}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteLightningErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
+       return ((LDKCResult_RouteLightningErrorZ*)arg)->result_ok;
+}
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteLightningErrorZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
+       if (((LDKCResult_RouteLightningErrorZ*)arg)->result_ok) {
+               return (long)((LDKCResult_RouteLightningErrorZ*)arg)->contents.result;
+       } else {
+               return (long)((LDKCResult_RouteLightningErrorZ*)arg)->contents.err;
+       }
+}
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1HTLCOutputInCommitmentSignatureZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
        LDKC2Tuple_HTLCOutputInCommitmentSignatureZ arg_conv = *(LDKC2Tuple_HTLCOutputInCommitmentSignatureZ*)arg;
        FREE((void*)arg);
index 0a93322a25d8a0aba39a87c3848cdb9d655f7305..6a3bdbd155d0b821ca8fd08aa64f0cade868fdde 100644 (file)
@@ -23,6 +23,134 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_init
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKSecretKey_1new
   (JNIEnv *, jclass);
 
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    LDKCResult_NoneChannelMonitorUpdateErrZ_result_ok
+ * Signature: (J)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneChannelMonitorUpdateErrZ_1result_1ok
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    LDKCResult_NoneChannelMonitorUpdateErrZ_get_inner
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneChannelMonitorUpdateErrZ_1get_1inner
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    LDKCResult_NoneMonitorUpdateErrorZ_result_ok
+ * Signature: (J)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneMonitorUpdateErrorZ_1result_1ok
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    LDKCResult_NoneMonitorUpdateErrorZ_get_inner
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneMonitorUpdateErrorZ_1get_1inner
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_result_ok
+ * Signature: (J)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1result_1ok
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_inner
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1get_1inner
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    LDKCResult_SignatureNoneZ_result_ok
+ * Signature: (J)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SignatureNoneZ_1result_1ok
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    LDKCResult_SignatureNoneZ_get_inner
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SignatureNoneZ_1get_1inner
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    LDKCResult_CVec_SignatureZNoneZ_result_ok
+ * Signature: (J)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1SignatureZNoneZ_1result_1ok
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    LDKCResult_CVec_SignatureZNoneZ_get_inner
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1SignatureZNoneZ_1get_1inner
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    LDKCResult_NoneAPIErrorZ_result_ok
+ * Signature: (J)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneAPIErrorZ_1result_1ok
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    LDKCResult_NoneAPIErrorZ_get_inner
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneAPIErrorZ_1get_1inner
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    LDKCResult_NonePaymentSendFailureZ_result_ok
+ * Signature: (J)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NonePaymentSendFailureZ_1result_1ok
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    LDKCResult_NonePaymentSendFailureZ_get_inner
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NonePaymentSendFailureZ_1get_1inner
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    LDKCResult_NonePeerHandleErrorZ_result_ok
+ * Signature: (J)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NonePeerHandleErrorZ_1result_1ok
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    LDKCResult_NonePeerHandleErrorZ_get_inner
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NonePeerHandleErrorZ_1get_1inner
+  (JNIEnv *, jclass, jlong);
+
 /*
  * Class:     org_ldk_impl_bindings
  * Method:    LDKMessageSendEventsProvider_new
@@ -71,6 +199,22 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKLogger_1new
 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKLogger_1get_1obj_1from_1jcalls
   (JNIEnv *, jclass, jlong);
 
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    LDKCResult_TxOutAccessErrorZ_result_ok
+ * Signature: (J)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxOutAccessErrorZ_1result_1ok
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    LDKCResult_TxOutAccessErrorZ_get_inner
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxOutAccessErrorZ_1get_1inner
+  (JNIEnv *, jclass, jlong);
+
 /*
  * Class:     org_ldk_impl_bindings
  * Method:    LDKAccess_new
@@ -199,6 +343,22 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1new
 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1get_1obj_1from_1jcalls
   (JNIEnv *, jclass, jlong);
 
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    LDKCResult_boolLightningErrorZ_result_ok
+ * Signature: (J)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1boolLightningErrorZ_1result_1ok
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    LDKCResult_boolLightningErrorZ_get_inner
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1boolLightningErrorZ_1get_1inner
+  (JNIEnv *, jclass, jlong);
+
 /*
  * Class:     org_ldk_impl_bindings
  * Method:    LDKRoutingMessageHandler_new
@@ -231,6 +391,102 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKSocketDescriptor_1new
 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKSocketDescriptor_1get_1obj_1from_1jcalls
   (JNIEnv *, jclass, jlong);
 
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    LDKCResult_CVec_u8ZPeerHandleErrorZ_result_ok
+ * Signature: (J)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1u8ZPeerHandleErrorZ_1result_1ok
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    LDKCResult_CVec_u8ZPeerHandleErrorZ_get_inner
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1u8ZPeerHandleErrorZ_1get_1inner
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    LDKCResult_boolPeerHandleErrorZ_result_ok
+ * Signature: (J)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1boolPeerHandleErrorZ_1result_1ok
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    LDKCResult_boolPeerHandleErrorZ_get_inner
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1boolPeerHandleErrorZ_1get_1inner
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    LDKCResult_SecretKeySecpErrorZ_result_ok
+ * Signature: (J)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SecretKeySecpErrorZ_1result_1ok
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    LDKCResult_SecretKeySecpErrorZ_get_inner
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SecretKeySecpErrorZ_1get_1inner
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    LDKCResult_PublicKeySecpErrorZ_result_ok
+ * Signature: (J)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PublicKeySecpErrorZ_1result_1ok
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    LDKCResult_PublicKeySecpErrorZ_get_inner
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PublicKeySecpErrorZ_1get_1inner
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    LDKCResult_TxCreationKeysSecpErrorZ_result_ok
+ * Signature: (J)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxCreationKeysSecpErrorZ_1result_1ok
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    LDKCResult_TxCreationKeysSecpErrorZ_get_inner
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxCreationKeysSecpErrorZ_1get_1inner
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    LDKCResult_RouteLightningErrorZ_result_ok
+ * Signature: (J)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteLightningErrorZ_1result_1ok
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    LDKCResult_RouteLightningErrorZ_get_inner
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteLightningErrorZ_1get_1inner
+  (JNIEnv *, jclass, jlong);
+
 /*
  * Class:     org_ldk_impl_bindings
  * Method:    C2Tuple_HTLCOutputInCommitmentSignatureZ_free