X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=c-bindings-gen%2Fsrc%2Ftypes.rs;h=b1224a96d8be657623d32bdc670f21f6c842c27c;hb=f160848382e6a1bc43dc100d77b96c4b4ecb3beb;hp=cfa5b5f15fc0d2eacddb74cc188a4ae69bb2c908;hpb=7613eb0c40d726769bfc2b43e84421017858c532;p=ldk-c-bindings diff --git a/c-bindings-gen/src/types.rs b/c-bindings-gen/src/types.rs index cfa5b5f..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, } } @@ -1014,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()) } @@ -1081,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()) } @@ -1169,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()) } @@ -1238,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()) }