From: Matt Corallo <649246+TheBlueMatt@users.noreply.github.com> Date: Wed, 10 Mar 2021 04:47:47 +0000 (+0000) Subject: Merge pull request #3 from TheBlueMatt/main X-Git-Tag: v0.0.98~23 X-Git-Url: http://git.bitcoin.ninja/index.cgi?p=ldk-c-bindings;a=commitdiff_plain;h=19e04c9362c00205b6133bb4f7fd74d1b9859b48;hp=04fcb2d0d013cfb63ed656de156f0659f1b1411e Merge pull request #3 from TheBlueMatt/main Fix indentation on trait `free` documentation --- diff --git a/c-bindings-gen/src/main.rs b/c-bindings-gen/src/main.rs index 9665fdc..3a7bfd6 100644 --- a/c-bindings-gen/src/main.rs +++ b/c-bindings-gen/src/main.rs @@ -382,8 +382,8 @@ fn writeln_trait<'a, 'b, W: std::io::Write>(w: &mut W, t: &'a syn::ItemTrait, ty }); } ) ); - writeln!(w, "/// Frees any resources associated with this object given its this_arg pointer.").unwrap(); - writeln!(w, "/// Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.").unwrap(); + writeln!(w, "\t/// Frees any resources associated with this object given its this_arg pointer.").unwrap(); + writeln!(w, "\t/// Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.").unwrap(); writeln!(w, "\tpub free: Option,").unwrap(); generated_fields.push("free".to_owned()); writeln!(w, "}}").unwrap(); diff --git a/lightning-c-bindings/src/chain/chaininterface.rs b/lightning-c-bindings/src/chain/chaininterface.rs index 3b585d3..032bd55 100644 --- a/lightning-c-bindings/src/chain/chaininterface.rs +++ b/lightning-c-bindings/src/chain/chaininterface.rs @@ -16,8 +16,8 @@ pub struct BroadcasterInterface { pub this_arg: *mut c_void, /// Sends a transaction out to (hopefully) be mined. pub broadcast_transaction: extern "C" fn (this_arg: *const c_void, tx: crate::c_types::Transaction), -/// Frees any resources associated with this object given its this_arg pointer. -/// Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed. + /// Frees any resources associated with this object given its this_arg pointer. + /// Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed. pub free: Option, } unsafe impl Sync for BroadcasterInterface {} @@ -122,8 +122,8 @@ pub struct FeeEstimator { /// * ceil(satoshis-per-kbyte / 4) #[must_use] pub get_est_sat_per_1000_weight: extern "C" fn (this_arg: *const c_void, confirmation_target: crate::chain::chaininterface::ConfirmationTarget) -> u32, -/// Frees any resources associated with this object given its this_arg pointer. -/// Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed. + /// Frees any resources associated with this object given its this_arg pointer. + /// Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed. pub free: Option, } unsafe impl Sync for FeeEstimator {} diff --git a/lightning-c-bindings/src/chain/channelmonitor.rs b/lightning-c-bindings/src/chain/channelmonitor.rs index ae4dc26..67880d4 100644 --- a/lightning-c-bindings/src/chain/channelmonitor.rs +++ b/lightning-c-bindings/src/chain/channelmonitor.rs @@ -723,8 +723,8 @@ pub struct Persist { /// [`ChannelMonitorUpdateErr`]: enum.ChannelMonitorUpdateErr.html #[must_use] pub update_persisted_channel: extern "C" fn (this_arg: *const c_void, id: crate::chain::transaction::OutPoint, update: &crate::chain::channelmonitor::ChannelMonitorUpdate, data: &crate::chain::channelmonitor::ChannelMonitor) -> crate::c_types::derived::CResult_NoneChannelMonitorUpdateErrZ, -/// Frees any resources associated with this object given its this_arg pointer. -/// Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed. + /// Frees any resources associated with this object given its this_arg pointer. + /// Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed. pub free: Option, } unsafe impl Send for Persist {} diff --git a/lightning-c-bindings/src/chain/keysinterface.rs b/lightning-c-bindings/src/chain/keysinterface.rs index c5b0324..ae533b6 100644 --- a/lightning-c-bindings/src/chain/keysinterface.rs +++ b/lightning-c-bindings/src/chain/keysinterface.rs @@ -591,8 +591,8 @@ pub struct Sign { pub clone: Option *mut c_void>, /// Serialize the object into a byte array pub write: extern "C" fn (this_arg: *const c_void) -> crate::c_types::derived::CVec_u8Z, -/// Frees any resources associated with this object given its this_arg pointer. -/// Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed. + /// Frees any resources associated with this object given its this_arg pointer. + /// Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed. pub free: Option, } unsafe impl Send for Sign {} @@ -752,8 +752,8 @@ pub struct KeysInterface { /// you've read all of the provided bytes to ensure no corruption occurred. #[must_use] pub read_chan_signer: extern "C" fn (this_arg: *const c_void, reader: crate::c_types::u8slice) -> crate::c_types::derived::CResult_SignDecodeErrorZ, -/// Frees any resources associated with this object given its this_arg pointer. -/// Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed. + /// Frees any resources associated with this object given its this_arg pointer. + /// Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed. pub free: Option, } unsafe impl Send for KeysInterface {} diff --git a/lightning-c-bindings/src/chain/mod.rs b/lightning-c-bindings/src/chain/mod.rs index c3adcf6..1fe2510 100644 --- a/lightning-c-bindings/src/chain/mod.rs +++ b/lightning-c-bindings/src/chain/mod.rs @@ -71,8 +71,8 @@ pub struct Access { /// [`short_channel_id`]: https://github.com/lightningnetwork/lightning-rfc/blob/master/07-routing-gossip.md#definition-of-short_channel_id #[must_use] pub get_utxo: extern "C" fn (this_arg: *const c_void, genesis_hash: *const [u8; 32], short_channel_id: u64) -> crate::c_types::derived::CResult_TxOutAccessErrorZ, -/// Frees any resources associated with this object given its this_arg pointer. -/// Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed. + /// Frees any resources associated with this object given its this_arg pointer. + /// Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed. pub free: Option, } unsafe impl Send for Access {} @@ -118,8 +118,8 @@ pub struct Listen { pub block_connected: extern "C" fn (this_arg: *const c_void, block: crate::c_types::u8slice, height: u32), /// Notifies the listener that a block was removed at the given height. pub block_disconnected: extern "C" fn (this_arg: *const c_void, header: *const [u8; 80], height: u32), -/// Frees any resources associated with this object given its this_arg pointer. -/// Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed. + /// Frees any resources associated with this object given its this_arg pointer. + /// Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed. pub free: Option, } @@ -203,8 +203,8 @@ pub struct Watch { /// events. #[must_use] pub release_pending_monitor_events: extern "C" fn (this_arg: *const c_void) -> crate::c_types::derived::CVec_MonitorEventZ, -/// Frees any resources associated with this object given its this_arg pointer. -/// Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed. + /// Frees any resources associated with this object given its this_arg pointer. + /// Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed. pub free: Option, } unsafe impl Send for Watch {} @@ -279,8 +279,8 @@ pub struct Filter { /// Registers interest in spends of a transaction output identified by `outpoint` having /// `script_pubkey` as the spending condition. pub register_output: extern "C" fn (this_arg: *const c_void, outpoint: &crate::chain::transaction::OutPoint, script_pubkey: crate::c_types::u8slice), -/// Frees any resources associated with this object given its this_arg pointer. -/// Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed. + /// Frees any resources associated with this object given its this_arg pointer. + /// Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed. pub free: Option, } unsafe impl Send for Filter {} diff --git a/lightning-c-bindings/src/ln/msgs.rs b/lightning-c-bindings/src/ln/msgs.rs index 7089593..4eb5b9d 100644 --- a/lightning-c-bindings/src/ln/msgs.rs +++ b/lightning-c-bindings/src/ln/msgs.rs @@ -4490,8 +4490,8 @@ pub struct ChannelMessageHandler { pub handle_error: extern "C" fn (this_arg: *const c_void, their_node_id: crate::c_types::PublicKey, msg: &crate::ln::msgs::ErrorMessage), /// Implementation of MessageSendEventsProvider for this object. pub MessageSendEventsProvider: crate::util::events::MessageSendEventsProvider, -/// Frees any resources associated with this object given its this_arg pointer. -/// Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed. + /// Frees any resources associated with this object given its this_arg pointer. + /// Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed. pub free: Option, } impl lightning::util::events::MessageSendEventsProvider for ChannelMessageHandler { @@ -4643,8 +4643,8 @@ pub struct RoutingMessageHandler { pub handle_query_short_channel_ids: extern "C" fn (this_arg: *const c_void, their_node_id: crate::c_types::PublicKey, msg: crate::ln::msgs::QueryShortChannelIds) -> crate::c_types::derived::CResult_NoneLightningErrorZ, /// Implementation of MessageSendEventsProvider for this object. pub MessageSendEventsProvider: crate::util::events::MessageSendEventsProvider, -/// Frees any resources associated with this object given its this_arg pointer. -/// Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed. + /// Frees any resources associated with this object given its this_arg pointer. + /// Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed. pub free: Option, } unsafe impl Send for RoutingMessageHandler {} diff --git a/lightning-c-bindings/src/ln/peer_handler.rs b/lightning-c-bindings/src/ln/peer_handler.rs index 6cb11f3..9cf6baa 100644 --- a/lightning-c-bindings/src/ln/peer_handler.rs +++ b/lightning-c-bindings/src/ln/peer_handler.rs @@ -512,8 +512,8 @@ pub struct SocketDescriptor { /// Note that the ultimate copy of the SocketDescriptor will have all function pointers the same as the original. /// May be NULL if no action needs to be taken, the this_arg pointer will be copied into the new SocketDescriptor. pub clone: Option *mut c_void>, -/// Frees any resources associated with this object given its this_arg pointer. -/// Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed. + /// Frees any resources associated with this object given its this_arg pointer. + /// Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed. pub free: Option, } impl std::cmp::Eq for SocketDescriptor {} diff --git a/lightning-c-bindings/src/util/events.rs b/lightning-c-bindings/src/util/events.rs index 3ec8def..905360b 100644 --- a/lightning-c-bindings/src/util/events.rs +++ b/lightning-c-bindings/src/util/events.rs @@ -1019,8 +1019,8 @@ pub struct MessageSendEventsProvider { /// in the process. #[must_use] pub get_and_clear_pending_msg_events: extern "C" fn (this_arg: *const c_void) -> crate::c_types::derived::CVec_MessageSendEventZ, -/// Frees any resources associated with this object given its this_arg pointer. -/// Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed. + /// Frees any resources associated with this object given its this_arg pointer. + /// Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed. pub free: Option, } @@ -1061,8 +1061,8 @@ pub struct EventsProvider { /// in the process. #[must_use] pub get_and_clear_pending_events: extern "C" fn (this_arg: *const c_void) -> crate::c_types::derived::CVec_EventZ, -/// Frees any resources associated with this object given its this_arg pointer. -/// Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed. + /// Frees any resources associated with this object given its this_arg pointer. + /// Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed. pub free: Option, } diff --git a/lightning-c-bindings/src/util/logger.rs b/lightning-c-bindings/src/util/logger.rs index 9099450..97874dd 100644 --- a/lightning-c-bindings/src/util/logger.rs +++ b/lightning-c-bindings/src/util/logger.rs @@ -95,8 +95,8 @@ pub struct Logger { pub this_arg: *mut c_void, /// Logs the `Record` pub log: extern "C" fn (this_arg: *const c_void, record: *const std::os::raw::c_char), -/// Frees any resources associated with this object given its this_arg pointer. -/// Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed. + /// Frees any resources associated with this object given its this_arg pointer. + /// Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed. pub free: Option, } unsafe impl Sync for Logger {}