Skip to content

Commit 3b25dea

Browse files
authored
Merge pull request #106 from TheBlueMatt/main
Make `BitEndianScalar` clonable
2 parents 7ef5b8d + 32fe657 commit 3b25dea

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

c-bindings-gen/src/types.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -814,6 +814,7 @@ fn initial_clonable_types() -> HashSet<String> {
814814
res.insert("crate::c_types::TxOut".to_owned());
815815
res.insert("crate::c_types::Signature".to_owned());
816816
res.insert("crate::c_types::RecoverableSignature".to_owned());
817+
res.insert("crate::c_types::BigEndianScalar".to_owned());
817818
res.insert("crate::c_types::Bech32Error".to_owned());
818819
res.insert("crate::c_types::Secp256k1Error".to_owned());
819820
res.insert("crate::c_types::IOError".to_owned());

lightning-c-bindings/include/lightning.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18324,6 +18324,12 @@ struct LDKCOption_ScalarZ COption_ScalarZ_none(void);
1832418324
*/
1832518325
void COption_ScalarZ_free(struct LDKCOption_ScalarZ _res);
1832618326

18327+
/**
18328+
* Creates a new COption_ScalarZ which has the same data as `orig`
18329+
* but with all dynamically-allocated buffers duplicated in new buffers.
18330+
*/
18331+
struct LDKCOption_ScalarZ COption_ScalarZ_clone(const struct LDKCOption_ScalarZ *NONNULL_PTR orig);
18332+
1832718333
/**
1832818334
* Creates a new CResult_SharedSecretNoneZ in the success state.
1832918335
*/

lightning-c-bindings/src/c_types/derived.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7826,6 +7826,7 @@ impl Clone for CResult_PublicKeyNoneZ {
78267826
/// but with all dynamically-allocated buffers duplicated in new buffers.
78277827
pub extern "C" fn CResult_PublicKeyNoneZ_clone(orig: &CResult_PublicKeyNoneZ) -> CResult_PublicKeyNoneZ { Clone::clone(&orig) }
78287828
#[repr(C)]
7829+
#[derive(Clone)]
78297830
/// An enum which can either contain a crate::c_types::BigEndianScalar or not
78307831
pub enum COption_ScalarZ {
78317832
/// When we're in this state, this COption_ScalarZ contains a crate::c_types::BigEndianScalar
@@ -7857,6 +7858,10 @@ pub extern "C" fn COption_ScalarZ_none() -> COption_ScalarZ {
78577858
#[no_mangle]
78587859
/// Frees any resources associated with the crate::c_types::BigEndianScalar, if we are in the Some state
78597860
pub extern "C" fn COption_ScalarZ_free(_res: COption_ScalarZ) { }
7861+
#[no_mangle]
7862+
/// Creates a new COption_ScalarZ which has the same data as `orig`
7863+
/// but with all dynamically-allocated buffers duplicated in new buffers.
7864+
pub extern "C" fn COption_ScalarZ_clone(orig: &COption_ScalarZ) -> COption_ScalarZ { Clone::clone(&orig) }
78607865
#[repr(C)]
78617866
/// The contents of CResult_SharedSecretNoneZ
78627867
pub union CResult_SharedSecretNoneZPtr {

0 commit comments

Comments
 (0)