- bindings update
authorMatt Corallo <git@bluematt.me>
Thu, 11 Feb 2021 21:15:24 +0000 (16:15 -0500)
committerMatt Corallo <git@bluematt.me>
Thu, 11 Feb 2021 21:19:41 +0000 (16:19 -0500)
lightning-c-bindings/include/lightning.h
lightning-c-bindings/src/ln/features.rs

index 6c823d4cd569b2a4638ffc69129c79762a4d33a4..704feb9b150dc82daf0486ff06f43d55d38968ec 100644 (file)
@@ -8226,6 +8226,12 @@ MUST_USE_RES struct LDKCResult_CVec_SignatureZNoneZ TrustedCommitmentTransaction
  */
 uint64_t get_commitment_transaction_number_obscure_factor(struct LDKPublicKey broadcaster_payment_basepoint, struct LDKPublicKey countersignatory_payment_basepoint, bool outbound_from_broadcaster);
 
+struct LDKInitFeatures InitFeatures_clone(const struct LDKInitFeatures *NONNULL_PTR orig);
+
+struct LDKNodeFeatures NodeFeatures_clone(const struct LDKNodeFeatures *NONNULL_PTR orig);
+
+struct LDKChannelFeatures ChannelFeatures_clone(const struct LDKChannelFeatures *NONNULL_PTR orig);
+
 void InitFeatures_free(struct LDKInitFeatures this_ptr);
 
 void NodeFeatures_free(struct LDKNodeFeatures this_ptr);
index 5a5b7b786a4762c2cb47532ceebeef3d40020d65..71adebeb5725210808a956616cc8fa71e0641575 100644 (file)
@@ -20,6 +20,60 @@ use std::ffi::c_void;
 use bitcoin::hashes::Hash;
 use crate::c_types::*;
 
+impl Clone for InitFeatures {
+       fn clone(&self) -> Self {
+               Self {
+                       inner: if self.inner.is_null() { std::ptr::null_mut() } else {
+                               Box::into_raw(Box::new(unsafe { &*self.inner }.clone())) },
+                       is_owned: true,
+               }
+       }
+}
+#[allow(unused)]
+/// Used only if an object of this type is returned as a trait impl by a method
+pub(crate) extern "C" fn InitFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
+       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeInitFeatures)).clone() })) as *mut c_void
+}
+#[no_mangle]
+pub extern "C" fn InitFeatures_clone(orig: &InitFeatures) -> InitFeatures {
+       orig.clone()
+}
+impl Clone for NodeFeatures {
+       fn clone(&self) -> Self {
+               Self {
+                       inner: if self.inner.is_null() { std::ptr::null_mut() } else {
+                               Box::into_raw(Box::new(unsafe { &*self.inner }.clone())) },
+                       is_owned: true,
+               }
+       }
+}
+#[allow(unused)]
+/// Used only if an object of this type is returned as a trait impl by a method
+pub(crate) extern "C" fn NodeFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
+       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeNodeFeatures)).clone() })) as *mut c_void
+}
+#[no_mangle]
+pub extern "C" fn NodeFeatures_clone(orig: &NodeFeatures) -> NodeFeatures {
+       orig.clone()
+}
+impl Clone for ChannelFeatures {
+       fn clone(&self) -> Self {
+               Self {
+                       inner: if self.inner.is_null() { std::ptr::null_mut() } else {
+                               Box::into_raw(Box::new(unsafe { &*self.inner }.clone())) },
+                       is_owned: true,
+               }
+       }
+}
+#[allow(unused)]
+/// Used only if an object of this type is returned as a trait impl by a method
+pub(crate) extern "C" fn ChannelFeatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
+       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeChannelFeatures)).clone() })) as *mut c_void
+}
+#[no_mangle]
+pub extern "C" fn ChannelFeatures_clone(orig: &ChannelFeatures) -> ChannelFeatures {
+       orig.clone()
+}
 
 use lightning::ln::features::InitFeatures as nativeInitFeaturesImport;
 type nativeInitFeatures = nativeInitFeaturesImport;