X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=c-bindings-gen%2Fsrc%2Ftypes.rs;h=b1224a96d8be657623d32bdc670f21f6c842c27c;hb=f160848382e6a1bc43dc100d77b96c4b4ecb3beb;hp=38752da2198603038aaaf67bfc8c617593fd30ea;hpb=c4cf32b1fa04571d4a7fdadca4554c6a6d045119;p=ldk-c-bindings diff --git a/c-bindings-gen/src/types.rs b/c-bindings-gen/src/types.rs index 38752da..b1224a9 100644 --- a/c-bindings-gen/src/types.rs +++ b/c-bindings-gen/src/types.rs @@ -931,6 +931,8 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> { // Override the default since Records contain an fmt with a lifetime: "lightning::util::logger::Record" => Some("*const std::os::raw::c_char"), + "lightning::io::Read" => Some("crate::c_types::u8slice"), + _ => None, } } @@ -986,6 +988,7 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> { "bitcoin::blockdata::script::Script" if !is_ref => Some("::bitcoin::blockdata::script::Script::from("), "bitcoin::blockdata::transaction::Transaction" if is_ref => Some("&"), "bitcoin::blockdata::transaction::Transaction" => Some(""), + "bitcoin::blockdata::transaction::OutPoint" => Some("crate::c_types::C_to_bitcoin_outpoint("), "bitcoin::blockdata::transaction::TxOut" if !is_ref => Some(""), "bitcoin::network::constants::Network" => Some(""), "bitcoin::blockdata::block::BlockHeader" => Some("&::bitcoin::consensus::encode::deserialize(unsafe { &*"), @@ -1013,6 +1016,8 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> { // List of traits we map (possibly during processing of other files): "crate::util::logger::Logger" => Some(""), + "lightning::io::Read" => Some("&mut "), + _ => None, }.map(|s| s.to_owned()) } @@ -1057,6 +1062,7 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> { "bitcoin::blockdata::script::Script" if is_ref => Some(".to_slice()))"), "bitcoin::blockdata::script::Script" if !is_ref => Some(".into_rust())"), "bitcoin::blockdata::transaction::Transaction" => Some(".into_bitcoin()"), + "bitcoin::blockdata::transaction::OutPoint" => Some(")"), "bitcoin::blockdata::transaction::TxOut" if !is_ref => Some(".into_rust()"), "bitcoin::network::constants::Network" => Some(".into_bitcoin()"), "bitcoin::blockdata::block::BlockHeader" => Some(" }).unwrap()"), @@ -1079,6 +1085,8 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> { // List of traits we map (possibly during processing of other files): "crate::util::logger::Logger" => Some(""), + "lightning::io::Read" => Some(".to_reader()"), + _ => None, }.map(|s| s.to_owned()) } @@ -1167,6 +1175,8 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> { // Override the default since Records contain an fmt with a lifetime: "lightning::util::logger::Record" => Some("local_"), + "lightning::io::Read" => Some("crate::c_types::u8slice::from_vec(&crate::c_types::reader_to_vec("), + _ => None, }.map(|s| s.to_owned()) } @@ -1236,6 +1246,8 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> { // Override the default since Records contain an fmt with a lifetime: "lightning::util::logger::Record" => Some(".as_ptr()"), + "lightning::io::Read" => Some("))"), + _ => None, }.map(|s| s.to_owned()) }