X-Git-Url: http://git.bitcoin.ninja/index.cgi?p=ldk-c-bindings;a=blobdiff_plain;f=c-bindings-gen%2Fsrc%2Ftypes.rs;h=5fc90b1ff29fbcd478a50cf1389e174954540ab0;hp=0b3aaf32ca6a3f2b74a50ff4788709eb667b2dcd;hb=690a087df3712fc4aa64521e6a9beb4a29f876eb;hpb=276366419f9d8902bf5166cb07d22b57edef555e diff --git a/c-bindings-gen/src/types.rs b/c-bindings-gen/src/types.rs index 0b3aaf3..5fc90b1 100644 --- a/c-bindings-gen/src/types.rs +++ b/c-bindings-gen/src/types.rs @@ -921,9 +921,11 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> { "bitcoin::hash_types::Txid"|"bitcoin::hash_types::BlockHash"|"bitcoin_hashes::sha256::Hash" if !is_ref => Some("crate::c_types::ThirtyTwoBytes"), "bitcoin::secp256k1::Message" if !is_ref => Some("crate::c_types::ThirtyTwoBytes"), - "lightning::ln::PaymentHash"|"lightning::ln::PaymentPreimage"|"lightning::ln::PaymentSecret"|"lightning::ln::channelmanager::PaymentId" + "lightning::ln::PaymentHash"|"lightning::ln::PaymentPreimage"|"lightning::ln::PaymentSecret" + |"lightning::ln::channelmanager::PaymentId"|"lightning::chain::keysinterface::KeyMaterial" if is_ref => Some("*const [u8; 32]"), - "lightning::ln::PaymentHash"|"lightning::ln::PaymentPreimage"|"lightning::ln::PaymentSecret"|"lightning::ln::channelmanager::PaymentId" + "lightning::ln::PaymentHash"|"lightning::ln::PaymentPreimage"|"lightning::ln::PaymentSecret" + |"lightning::ln::channelmanager::PaymentId"|"lightning::chain::keysinterface::KeyMaterial" if !is_ref => Some("crate::c_types::ThirtyTwoBytes"), "lightning::io::Read" => Some("crate::c_types::u8slice"), @@ -1011,6 +1013,8 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> { "lightning::ln::PaymentSecret" if !is_ref => Some("::lightning::ln::PaymentSecret("), "lightning::ln::channelmanager::PaymentId" if !is_ref => Some("::lightning::ln::channelmanager::PaymentId("), "lightning::ln::channelmanager::PaymentId" if is_ref=> Some("&::lightning::ln::channelmanager::PaymentId( unsafe { *"), + "lightning::chain::keysinterface::KeyMaterial" if !is_ref => Some("::lightning::chain::keysinterface::KeyMaterial("), + "lightning::chain::keysinterface::KeyMaterial" if is_ref=> Some("&::lightning::chain::keysinterface::KeyMaterial( unsafe { *"), // List of traits we map (possibly during processing of other files): "lightning::io::Read" => Some("&mut "), @@ -1075,9 +1079,11 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> { "bitcoin::hash_types::Txid" if is_ref => Some(" }[..]).unwrap()"), "bitcoin::hash_types::Txid" => Some(".data[..]).unwrap()"), "bitcoin::hash_types::BlockHash" if !is_ref => Some(".data[..]).unwrap()"), - "lightning::ln::PaymentHash"|"lightning::ln::PaymentPreimage"|"lightning::ln::PaymentSecret"|"lightning::ln::channelmanager::PaymentId" + "lightning::ln::PaymentHash"|"lightning::ln::PaymentPreimage"|"lightning::ln::PaymentSecret" + |"lightning::ln::channelmanager::PaymentId"|"lightning::chain::keysinterface::KeyMaterial" if !is_ref => Some(".data)"), - "lightning::ln::PaymentHash"|"lightning::ln::PaymentPreimage"|"lightning::ln::PaymentSecret"|"lightning::ln::channelmanager::PaymentId" + "lightning::ln::PaymentHash"|"lightning::ln::PaymentPreimage"|"lightning::ln::PaymentSecret" + |"lightning::ln::channelmanager::PaymentId"|"lightning::chain::keysinterface::KeyMaterial" if is_ref => Some(" })"), // List of traits we map (possibly during processing of other files): @@ -1162,9 +1168,11 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> { "bitcoin::hash_types::Txid"|"bitcoin::hash_types::BlockHash"|"bitcoin_hashes::sha256::Hash" if !is_ref => Some("crate::c_types::ThirtyTwoBytes { data: "), "bitcoin::secp256k1::Message" if !is_ref => Some("crate::c_types::ThirtyTwoBytes { data: "), - "lightning::ln::PaymentHash"|"lightning::ln::PaymentPreimage"|"lightning::ln::PaymentSecret"|"lightning::ln::channelmanager::PaymentId" + "lightning::ln::PaymentHash"|"lightning::ln::PaymentPreimage"|"lightning::ln::PaymentSecret" + |"lightning::ln::channelmanager::PaymentId"|"lightning::chain::keysinterface::KeyMaterial" if is_ref => Some("&"), - "lightning::ln::PaymentHash"|"lightning::ln::PaymentPreimage"|"lightning::ln::PaymentSecret"|"lightning::ln::channelmanager::PaymentId" + "lightning::ln::PaymentHash"|"lightning::ln::PaymentPreimage"|"lightning::ln::PaymentSecret" + |"lightning::ln::channelmanager::PaymentId"|"lightning::chain::keysinterface::KeyMaterial" if !is_ref => Some("crate::c_types::ThirtyTwoBytes { data: "), "lightning::io::Read" => Some("crate::c_types::u8slice::from_vec(&crate::c_types::reader_to_vec("), @@ -1232,9 +1240,11 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> { "bitcoin::hash_types::Txid"|"bitcoin::hash_types::BlockHash"|"bitcoin_hashes::sha256::Hash" if !is_ref => Some(".into_inner() }"), "bitcoin::secp256k1::Message" if !is_ref => Some(".as_ref().clone() }"), - "lightning::ln::PaymentHash"|"lightning::ln::PaymentPreimage"|"lightning::ln::PaymentSecret"|"lightning::ln::channelmanager::PaymentId" + "lightning::ln::PaymentHash"|"lightning::ln::PaymentPreimage"|"lightning::ln::PaymentSecret" + |"lightning::ln::channelmanager::PaymentId"|"lightning::chain::keysinterface::KeyMaterial" if is_ref => Some(".0"), - "lightning::ln::PaymentHash"|"lightning::ln::PaymentPreimage"|"lightning::ln::PaymentSecret"|"lightning::ln::channelmanager::PaymentId" + "lightning::ln::PaymentHash"|"lightning::ln::PaymentPreimage"|"lightning::ln::PaymentSecret" + |"lightning::ln::channelmanager::PaymentId"|"lightning::chain::keysinterface::KeyMaterial" if !is_ref => Some(".0 }"), "lightning::io::Read" => Some("))"),