From: Matt Corallo Date: Mon, 4 Jan 2021 20:59:27 +0000 (-0500) Subject: - bindings updates X-Git-Url: http://git.bitcoin.ninja/?a=commitdiff_plain;h=a799027354249d97cbe6ac1126d5496c81119b4a;p=rust-lightning - bindings updates --- diff --git a/lightning-c-bindings/include/lightning.h b/lightning-c-bindings/include/lightning.h index 8eef0244e..4d0e85ee0 100644 --- a/lightning-c-bindings/include/lightning.h +++ b/lightning-c-bindings/include/lightning.h @@ -3962,7 +3962,7 @@ void Event_free(struct LDKEvent this_ptr); struct LDKEvent Event_clone(const struct LDKEvent *NONNULL_PTR orig); -LDKCVec_u8Z Event_write(const struct LDKEvent *obj); +LDKCVec_u8Z Event_write(const struct LDKEvent *NONNULL_PTR obj); void MessageSendEvent_free(struct LDKMessageSendEvent this_ptr); @@ -4354,7 +4354,7 @@ MUST_USE_RES struct LDKChannelConfig ChannelConfig_new(uint32_t fee_proportional MUST_USE_RES struct LDKChannelConfig ChannelConfig_default(void); -LDKCVec_u8Z ChannelConfig_write(const struct LDKChannelConfig *obj); +LDKCVec_u8Z ChannelConfig_write(const struct LDKChannelConfig *NONNULL_PTR obj); struct LDKChannelConfig ChannelConfig_read(struct LDKu8slice ser); @@ -4466,9 +4466,9 @@ void ChainMonitor_block_disconnected(const struct LDKChainMonitor *NONNULL_PTR t */ MUST_USE_RES struct LDKChainMonitor ChainMonitor_new(struct LDKFilter *chain_source, struct LDKBroadcasterInterface broadcaster, struct LDKLogger logger, struct LDKFeeEstimator feeest, struct LDKPersist persister); -struct LDKWatch ChainMonitor_as_Watch(const struct LDKChainMonitor *this_arg); +struct LDKWatch ChainMonitor_as_Watch(const struct LDKChainMonitor *NONNULL_PTR this_arg); -struct LDKEventsProvider ChainMonitor_as_EventsProvider(const struct LDKChainMonitor *this_arg); +struct LDKEventsProvider ChainMonitor_as_EventsProvider(const struct LDKChainMonitor *NONNULL_PTR this_arg); void ChannelMonitorUpdate_free(struct LDKChannelMonitorUpdate this_ptr); @@ -4508,7 +4508,7 @@ uint64_t ChannelMonitorUpdate_get_update_id(const struct LDKChannelMonitorUpdate */ void ChannelMonitorUpdate_set_update_id(struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr, uint64_t val); -LDKCVec_u8Z ChannelMonitorUpdate_write(const struct LDKChannelMonitorUpdate *obj); +LDKCVec_u8Z ChannelMonitorUpdate_write(const struct LDKChannelMonitorUpdate *NONNULL_PTR obj); LDKCResult_ChannelMonitorUpdateDecodeErrorZ ChannelMonitorUpdate_read(struct LDKu8slice ser); @@ -4524,13 +4524,13 @@ void HTLCUpdate_free(struct LDKHTLCUpdate this_ptr); struct LDKHTLCUpdate HTLCUpdate_clone(const struct LDKHTLCUpdate *NONNULL_PTR orig); -LDKCVec_u8Z HTLCUpdate_write(const struct LDKHTLCUpdate *obj); +LDKCVec_u8Z HTLCUpdate_write(const struct LDKHTLCUpdate *NONNULL_PTR obj); struct LDKHTLCUpdate HTLCUpdate_read(struct LDKu8slice ser); void ChannelMonitor_free(struct LDKChannelMonitor this_ptr); -LDKCVec_u8Z ChannelMonitor_write(const struct LDKChannelMonitor *obj); +LDKCVec_u8Z ChannelMonitor_write(const struct LDKChannelMonitor *NONNULL_PTR obj); /** * Updates a ChannelMonitor on the basis of some new information provided by the Channel @@ -4641,7 +4641,7 @@ MUST_USE_RES struct LDKOutPoint OutPoint_new(struct LDKThirtyTwoBytes txid_arg, */ MUST_USE_RES struct LDKThirtyTwoBytes OutPoint_to_channel_id(const struct LDKOutPoint *NONNULL_PTR this_arg); -LDKCVec_u8Z OutPoint_write(const struct LDKOutPoint *obj); +LDKCVec_u8Z OutPoint_write(const struct LDKOutPoint *NONNULL_PTR obj); struct LDKOutPoint OutPoint_read(struct LDKu8slice ser); @@ -4649,7 +4649,7 @@ void SpendableOutputDescriptor_free(struct LDKSpendableOutputDescriptor this_ptr struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_clone(const struct LDKSpendableOutputDescriptor *NONNULL_PTR orig); -LDKCVec_u8Z SpendableOutputDescriptor_write(const struct LDKSpendableOutputDescriptor *obj); +LDKCVec_u8Z SpendableOutputDescriptor_write(const struct LDKSpendableOutputDescriptor *NONNULL_PTR obj); LDKCResult_SpendableOutputDescriptorDecodeErrorZ SpendableOutputDescriptor_read(struct LDKu8slice ser); @@ -4776,9 +4776,9 @@ MUST_USE_RES struct LDKOutPoint InMemoryChannelKeys_funding_outpoint(const struc */ MUST_USE_RES struct LDKChannelTransactionParameters InMemoryChannelKeys_get_channel_parameters(const struct LDKInMemoryChannelKeys *NONNULL_PTR this_arg); -struct LDKChannelKeys InMemoryChannelKeys_as_ChannelKeys(const struct LDKInMemoryChannelKeys *this_arg); +struct LDKChannelKeys InMemoryChannelKeys_as_ChannelKeys(const struct LDKInMemoryChannelKeys *NONNULL_PTR this_arg); -LDKCVec_u8Z InMemoryChannelKeys_write(const struct LDKInMemoryChannelKeys *obj); +LDKCVec_u8Z InMemoryChannelKeys_write(const struct LDKInMemoryChannelKeys *NONNULL_PTR obj); LDKCResult_InMemoryChannelKeysDecodeErrorZ InMemoryChannelKeys_read(struct LDKu8slice ser); @@ -4816,7 +4816,7 @@ MUST_USE_RES struct LDKKeysManager KeysManager_new(const uint8_t (*seed)[32], en */ MUST_USE_RES struct LDKInMemoryChannelKeys KeysManager_derive_channel_keys(const struct LDKKeysManager *NONNULL_PTR this_arg, uint64_t channel_value_satoshis, uint64_t params_1, uint64_t params_2); -struct LDKKeysInterface KeysManager_as_KeysInterface(const struct LDKKeysManager *this_arg); +struct LDKKeysInterface KeysManager_as_KeysInterface(const struct LDKKeysManager *NONNULL_PTR this_arg); void ChannelManager_free(struct LDKChannelManager this_ptr); @@ -5149,9 +5149,9 @@ MUST_USE_RES struct LDKPublicKey ChannelManager_get_our_node_id(const struct LDK */ void ChannelManager_channel_monitor_updated(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKOutPoint *NONNULL_PTR funding_txo, uint64_t highest_applied_update_id); -struct LDKMessageSendEventsProvider ChannelManager_as_MessageSendEventsProvider(const struct LDKChannelManager *this_arg); +struct LDKMessageSendEventsProvider ChannelManager_as_MessageSendEventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg); -struct LDKEventsProvider ChannelManager_as_EventsProvider(const struct LDKChannelManager *this_arg); +struct LDKEventsProvider ChannelManager_as_EventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg); /** * Updates channel state based on transactions seen in a connected block. @@ -5166,9 +5166,9 @@ void ChannelManager_block_connected(const struct LDKChannelManager *NONNULL_PTR */ void ChannelManager_block_disconnected(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*header)[80]); -struct LDKChannelMessageHandler ChannelManager_as_ChannelMessageHandler(const struct LDKChannelManager *this_arg); +struct LDKChannelMessageHandler ChannelManager_as_ChannelMessageHandler(const struct LDKChannelManager *NONNULL_PTR this_arg); -LDKCVec_u8Z ChannelManager_write(const struct LDKChannelManager *obj); +LDKCVec_u8Z ChannelManager_write(const struct LDKChannelManager *NONNULL_PTR obj); void ChannelManagerReadArgs_free(struct LDKChannelManagerReadArgs this_ptr); @@ -6192,7 +6192,7 @@ void NetAddress_free(struct LDKNetAddress this_ptr); struct LDKNetAddress NetAddress_clone(const struct LDKNetAddress *NONNULL_PTR orig); -LDKCVec_u8Z NetAddress_write(const struct LDKNetAddress *obj); +LDKCVec_u8Z NetAddress_write(const struct LDKNetAddress *NONNULL_PTR obj); LDKCResult_CResult_NetAddressu8ZDecodeErrorZ Result_read(struct LDKu8slice ser); @@ -6787,129 +6787,129 @@ void ChannelMessageHandler_free(struct LDKChannelMessageHandler this_ptr); */ void RoutingMessageHandler_free(struct LDKRoutingMessageHandler this_ptr); -LDKCVec_u8Z AcceptChannel_write(const struct LDKAcceptChannel *obj); +LDKCVec_u8Z AcceptChannel_write(const struct LDKAcceptChannel *NONNULL_PTR obj); struct LDKAcceptChannel AcceptChannel_read(struct LDKu8slice ser); -LDKCVec_u8Z AnnouncementSignatures_write(const struct LDKAnnouncementSignatures *obj); +LDKCVec_u8Z AnnouncementSignatures_write(const struct LDKAnnouncementSignatures *NONNULL_PTR obj); struct LDKAnnouncementSignatures AnnouncementSignatures_read(struct LDKu8slice ser); -LDKCVec_u8Z ChannelReestablish_write(const struct LDKChannelReestablish *obj); +LDKCVec_u8Z ChannelReestablish_write(const struct LDKChannelReestablish *NONNULL_PTR obj); LDKCResult_ChannelReestablishDecodeErrorZ ChannelReestablish_read(struct LDKu8slice ser); -LDKCVec_u8Z ClosingSigned_write(const struct LDKClosingSigned *obj); +LDKCVec_u8Z ClosingSigned_write(const struct LDKClosingSigned *NONNULL_PTR obj); struct LDKClosingSigned ClosingSigned_read(struct LDKu8slice ser); -LDKCVec_u8Z CommitmentSigned_write(const struct LDKCommitmentSigned *obj); +LDKCVec_u8Z CommitmentSigned_write(const struct LDKCommitmentSigned *NONNULL_PTR obj); struct LDKCommitmentSigned CommitmentSigned_read(struct LDKu8slice ser); -LDKCVec_u8Z FundingCreated_write(const struct LDKFundingCreated *obj); +LDKCVec_u8Z FundingCreated_write(const struct LDKFundingCreated *NONNULL_PTR obj); struct LDKFundingCreated FundingCreated_read(struct LDKu8slice ser); -LDKCVec_u8Z FundingSigned_write(const struct LDKFundingSigned *obj); +LDKCVec_u8Z FundingSigned_write(const struct LDKFundingSigned *NONNULL_PTR obj); struct LDKFundingSigned FundingSigned_read(struct LDKu8slice ser); -LDKCVec_u8Z FundingLocked_write(const struct LDKFundingLocked *obj); +LDKCVec_u8Z FundingLocked_write(const struct LDKFundingLocked *NONNULL_PTR obj); struct LDKFundingLocked FundingLocked_read(struct LDKu8slice ser); -LDKCVec_u8Z Init_write(const struct LDKInit *obj); +LDKCVec_u8Z Init_write(const struct LDKInit *NONNULL_PTR obj); LDKCResult_InitDecodeErrorZ Init_read(struct LDKu8slice ser); -LDKCVec_u8Z OpenChannel_write(const struct LDKOpenChannel *obj); +LDKCVec_u8Z OpenChannel_write(const struct LDKOpenChannel *NONNULL_PTR obj); struct LDKOpenChannel OpenChannel_read(struct LDKu8slice ser); -LDKCVec_u8Z RevokeAndACK_write(const struct LDKRevokeAndACK *obj); +LDKCVec_u8Z RevokeAndACK_write(const struct LDKRevokeAndACK *NONNULL_PTR obj); struct LDKRevokeAndACK RevokeAndACK_read(struct LDKu8slice ser); -LDKCVec_u8Z Shutdown_write(const struct LDKShutdown *obj); +LDKCVec_u8Z Shutdown_write(const struct LDKShutdown *NONNULL_PTR obj); struct LDKShutdown Shutdown_read(struct LDKu8slice ser); -LDKCVec_u8Z UpdateFailHTLC_write(const struct LDKUpdateFailHTLC *obj); +LDKCVec_u8Z UpdateFailHTLC_write(const struct LDKUpdateFailHTLC *NONNULL_PTR obj); struct LDKUpdateFailHTLC UpdateFailHTLC_read(struct LDKu8slice ser); -LDKCVec_u8Z UpdateFailMalformedHTLC_write(const struct LDKUpdateFailMalformedHTLC *obj); +LDKCVec_u8Z UpdateFailMalformedHTLC_write(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR obj); struct LDKUpdateFailMalformedHTLC UpdateFailMalformedHTLC_read(struct LDKu8slice ser); -LDKCVec_u8Z UpdateFee_write(const struct LDKUpdateFee *obj); +LDKCVec_u8Z UpdateFee_write(const struct LDKUpdateFee *NONNULL_PTR obj); struct LDKUpdateFee UpdateFee_read(struct LDKu8slice ser); -LDKCVec_u8Z UpdateFulfillHTLC_write(const struct LDKUpdateFulfillHTLC *obj); +LDKCVec_u8Z UpdateFulfillHTLC_write(const struct LDKUpdateFulfillHTLC *NONNULL_PTR obj); struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_read(struct LDKu8slice ser); -LDKCVec_u8Z UpdateAddHTLC_write(const struct LDKUpdateAddHTLC *obj); +LDKCVec_u8Z UpdateAddHTLC_write(const struct LDKUpdateAddHTLC *NONNULL_PTR obj); struct LDKUpdateAddHTLC UpdateAddHTLC_read(struct LDKu8slice ser); -LDKCVec_u8Z Ping_write(const struct LDKPing *obj); +LDKCVec_u8Z Ping_write(const struct LDKPing *NONNULL_PTR obj); LDKCResult_PingDecodeErrorZ Ping_read(struct LDKu8slice ser); -LDKCVec_u8Z Pong_write(const struct LDKPong *obj); +LDKCVec_u8Z Pong_write(const struct LDKPong *NONNULL_PTR obj); LDKCResult_PongDecodeErrorZ Pong_read(struct LDKu8slice ser); -LDKCVec_u8Z UnsignedChannelAnnouncement_write(const struct LDKUnsignedChannelAnnouncement *obj); +LDKCVec_u8Z UnsignedChannelAnnouncement_write(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR obj); LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ UnsignedChannelAnnouncement_read(struct LDKu8slice ser); -LDKCVec_u8Z ChannelAnnouncement_write(const struct LDKChannelAnnouncement *obj); +LDKCVec_u8Z ChannelAnnouncement_write(const struct LDKChannelAnnouncement *NONNULL_PTR obj); struct LDKChannelAnnouncement ChannelAnnouncement_read(struct LDKu8slice ser); -LDKCVec_u8Z UnsignedChannelUpdate_write(const struct LDKUnsignedChannelUpdate *obj); +LDKCVec_u8Z UnsignedChannelUpdate_write(const struct LDKUnsignedChannelUpdate *NONNULL_PTR obj); LDKCResult_UnsignedChannelUpdateDecodeErrorZ UnsignedChannelUpdate_read(struct LDKu8slice ser); -LDKCVec_u8Z ChannelUpdate_write(const struct LDKChannelUpdate *obj); +LDKCVec_u8Z ChannelUpdate_write(const struct LDKChannelUpdate *NONNULL_PTR obj); struct LDKChannelUpdate ChannelUpdate_read(struct LDKu8slice ser); -LDKCVec_u8Z ErrorMessage_write(const struct LDKErrorMessage *obj); +LDKCVec_u8Z ErrorMessage_write(const struct LDKErrorMessage *NONNULL_PTR obj); LDKCResult_ErrorMessageDecodeErrorZ ErrorMessage_read(struct LDKu8slice ser); -LDKCVec_u8Z UnsignedNodeAnnouncement_write(const struct LDKUnsignedNodeAnnouncement *obj); +LDKCVec_u8Z UnsignedNodeAnnouncement_write(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR obj); LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ UnsignedNodeAnnouncement_read(struct LDKu8slice ser); -LDKCVec_u8Z NodeAnnouncement_write(const struct LDKNodeAnnouncement *obj); +LDKCVec_u8Z NodeAnnouncement_write(const struct LDKNodeAnnouncement *NONNULL_PTR obj); struct LDKNodeAnnouncement NodeAnnouncement_read(struct LDKu8slice ser); LDKCResult_QueryShortChannelIdsDecodeErrorZ QueryShortChannelIds_read(struct LDKu8slice ser); -LDKCVec_u8Z QueryShortChannelIds_write(const struct LDKQueryShortChannelIds *obj); +LDKCVec_u8Z QueryShortChannelIds_write(const struct LDKQueryShortChannelIds *NONNULL_PTR obj); LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ ReplyShortChannelIdsEnd_read(struct LDKu8slice ser); -LDKCVec_u8Z ReplyShortChannelIdsEnd_write(const struct LDKReplyShortChannelIdsEnd *obj); +LDKCVec_u8Z ReplyShortChannelIdsEnd_write(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR obj); LDKCResult_QueryChannelRangeDecodeErrorZ QueryChannelRange_read(struct LDKu8slice ser); -LDKCVec_u8Z QueryChannelRange_write(const struct LDKQueryChannelRange *obj); +LDKCVec_u8Z QueryChannelRange_write(const struct LDKQueryChannelRange *NONNULL_PTR obj); LDKCResult_ReplyChannelRangeDecodeErrorZ ReplyChannelRange_read(struct LDKu8slice ser); -LDKCVec_u8Z ReplyChannelRange_write(const struct LDKReplyChannelRange *obj); +LDKCVec_u8Z ReplyChannelRange_write(const struct LDKReplyChannelRange *NONNULL_PTR obj); LDKCResult_GossipTimestampFilterDecodeErrorZ GossipTimestampFilter_read(struct LDKu8slice ser); -LDKCVec_u8Z GossipTimestampFilter_write(const struct LDKGossipTimestampFilter *obj); +LDKCVec_u8Z GossipTimestampFilter_write(const struct LDKGossipTimestampFilter *NONNULL_PTR obj); void MessageHandler_free(struct LDKMessageHandler this_ptr); @@ -7173,7 +7173,7 @@ void TxCreationKeys_set_broadcaster_delayed_payment_key(struct LDKTxCreationKeys MUST_USE_RES struct LDKTxCreationKeys TxCreationKeys_new(struct LDKPublicKey per_commitment_point_arg, struct LDKPublicKey revocation_key_arg, struct LDKPublicKey broadcaster_htlc_key_arg, struct LDKPublicKey countersignatory_htlc_key_arg, struct LDKPublicKey broadcaster_delayed_payment_key_arg); -LDKCVec_u8Z TxCreationKeys_write(const struct LDKTxCreationKeys *obj); +LDKCVec_u8Z TxCreationKeys_write(const struct LDKTxCreationKeys *NONNULL_PTR obj); struct LDKTxCreationKeys TxCreationKeys_read(struct LDKu8slice ser); @@ -7251,7 +7251,7 @@ void ChannelPublicKeys_set_htlc_basepoint(struct LDKChannelPublicKeys *NONNULL_P MUST_USE_RES struct LDKChannelPublicKeys ChannelPublicKeys_new(struct LDKPublicKey funding_pubkey_arg, struct LDKPublicKey revocation_basepoint_arg, struct LDKPublicKey payment_point_arg, struct LDKPublicKey delayed_payment_basepoint_arg, struct LDKPublicKey htlc_basepoint_arg); -LDKCVec_u8Z ChannelPublicKeys_write(const struct LDKChannelPublicKeys *obj); +LDKCVec_u8Z ChannelPublicKeys_write(const struct LDKChannelPublicKeys *NONNULL_PTR obj); struct LDKChannelPublicKeys ChannelPublicKeys_read(struct LDKu8slice ser); @@ -7326,7 +7326,7 @@ const uint8_t (*HTLCOutputInCommitment_get_payment_hash(const struct LDKHTLCOutp */ void HTLCOutputInCommitment_set_payment_hash(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); -LDKCVec_u8Z HTLCOutputInCommitment_write(const struct LDKHTLCOutputInCommitment *obj); +LDKCVec_u8Z HTLCOutputInCommitment_write(const struct LDKHTLCOutputInCommitment *NONNULL_PTR obj); struct LDKHTLCOutputInCommitment HTLCOutputInCommitment_read(struct LDKu8slice ser); @@ -7454,11 +7454,11 @@ MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionPa */ MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_counterparty_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg); -LDKCVec_u8Z CounterpartyChannelTransactionParameters_write(const struct LDKCounterpartyChannelTransactionParameters *obj); +LDKCVec_u8Z CounterpartyChannelTransactionParameters_write(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR obj); struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_read(struct LDKu8slice ser); -LDKCVec_u8Z ChannelTransactionParameters_write(const struct LDKChannelTransactionParameters *obj); +LDKCVec_u8Z ChannelTransactionParameters_write(const struct LDKChannelTransactionParameters *NONNULL_PTR obj); struct LDKChannelTransactionParameters ChannelTransactionParameters_read(struct LDKu8slice ser); @@ -7512,7 +7512,7 @@ void HolderCommitmentTransaction_set_counterparty_sig(struct LDKHolderCommitment */ void HolderCommitmentTransaction_set_counterparty_htlc_sigs(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, LDKCVec_SignatureZ val); -LDKCVec_u8Z HolderCommitmentTransaction_write(const struct LDKHolderCommitmentTransaction *obj); +LDKCVec_u8Z HolderCommitmentTransaction_write(const struct LDKHolderCommitmentTransaction *NONNULL_PTR obj); struct LDKHolderCommitmentTransaction HolderCommitmentTransaction_read(struct LDKu8slice ser); @@ -7554,7 +7554,7 @@ void BuiltCommitmentTransaction_set_txid(struct LDKBuiltCommitmentTransaction *N MUST_USE_RES struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_new(struct LDKTransaction transaction_arg, struct LDKThirtyTwoBytes txid_arg); -LDKCVec_u8Z BuiltCommitmentTransaction_write(const struct LDKBuiltCommitmentTransaction *obj); +LDKCVec_u8Z BuiltCommitmentTransaction_write(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR obj); struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_read(struct LDKu8slice ser); @@ -7575,7 +7575,7 @@ void CommitmentTransaction_free(struct LDKCommitmentTransaction this_ptr); struct LDKCommitmentTransaction CommitmentTransaction_clone(const struct LDKCommitmentTransaction *NONNULL_PTR orig); -LDKCVec_u8Z CommitmentTransaction_write(const struct LDKCommitmentTransaction *obj); +LDKCVec_u8Z CommitmentTransaction_write(const struct LDKCommitmentTransaction *NONNULL_PTR obj); struct LDKCommitmentTransaction CommitmentTransaction_read(struct LDKu8slice ser); @@ -7743,7 +7743,7 @@ void Route_set_paths(struct LDKRoute *NONNULL_PTR this_ptr, LDKCVec_CVec_RouteHo MUST_USE_RES struct LDKRoute Route_new(LDKCVec_CVec_RouteHopZZ paths_arg); -LDKCVec_u8Z Route_write(const struct LDKRoute *obj); +LDKCVec_u8Z Route_write(const struct LDKRoute *NONNULL_PTR obj); LDKCResult_RouteDecodeErrorZ Route_read(struct LDKu8slice ser); @@ -7857,9 +7857,9 @@ MUST_USE_RES struct LDKLockedNetworkGraph NetGraphMsgHandler_read_locked_graph(c */ MUST_USE_RES struct LDKNetworkGraph LockedNetworkGraph_graph(const struct LDKLockedNetworkGraph *NONNULL_PTR this_arg); -struct LDKRoutingMessageHandler NetGraphMsgHandler_as_RoutingMessageHandler(const struct LDKNetGraphMsgHandler *this_arg); +struct LDKRoutingMessageHandler NetGraphMsgHandler_as_RoutingMessageHandler(const struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg); -struct LDKMessageSendEventsProvider NetGraphMsgHandler_as_MessageSendEventsProvider(const struct LDKNetGraphMsgHandler *this_arg); +struct LDKMessageSendEventsProvider NetGraphMsgHandler_as_MessageSendEventsProvider(const struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg); void DirectionalChannelInfo_free(struct LDKDirectionalChannelInfo this_ptr); @@ -7931,7 +7931,7 @@ struct LDKChannelUpdate DirectionalChannelInfo_get_last_update_message(const str */ void DirectionalChannelInfo_set_last_update_message(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdate val); -LDKCVec_u8Z DirectionalChannelInfo_write(const struct LDKDirectionalChannelInfo *obj); +LDKCVec_u8Z DirectionalChannelInfo_write(const struct LDKDirectionalChannelInfo *NONNULL_PTR obj); struct LDKDirectionalChannelInfo DirectionalChannelInfo_read(struct LDKu8slice ser); @@ -8003,7 +8003,7 @@ struct LDKChannelAnnouncement ChannelInfo_get_announcement_message(const struct */ void ChannelInfo_set_announcement_message(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelAnnouncement val); -LDKCVec_u8Z ChannelInfo_write(const struct LDKChannelInfo *obj); +LDKCVec_u8Z ChannelInfo_write(const struct LDKChannelInfo *NONNULL_PTR obj); struct LDKChannelInfo ChannelInfo_read(struct LDKu8slice ser); @@ -8037,7 +8037,7 @@ MUST_USE_RES struct LDKRoutingFees RoutingFees_new(uint32_t base_msat_arg, uint3 LDKCResult_RoutingFeesDecodeErrorZ RoutingFees_read(struct LDKu8slice ser); -LDKCVec_u8Z RoutingFees_write(const struct LDKRoutingFees *obj); +LDKCVec_u8Z RoutingFees_write(const struct LDKRoutingFees *NONNULL_PTR obj); void NodeAnnouncementInfo_free(struct LDKNodeAnnouncementInfo this_ptr); @@ -8110,7 +8110,7 @@ void NodeAnnouncementInfo_set_announcement_message(struct LDKNodeAnnouncementInf MUST_USE_RES struct LDKNodeAnnouncementInfo NodeAnnouncementInfo_new(struct LDKNodeFeatures features_arg, uint32_t last_update_arg, struct LDKThreeBytes rgb_arg, struct LDKThirtyTwoBytes alias_arg, LDKCVec_NetAddressZ addresses_arg, struct LDKNodeAnnouncement announcement_message_arg); -LDKCVec_u8Z NodeAnnouncementInfo_write(const struct LDKNodeAnnouncementInfo *obj); +LDKCVec_u8Z NodeAnnouncementInfo_write(const struct LDKNodeAnnouncementInfo *NONNULL_PTR obj); LDKCResult_NodeAnnouncementInfoDecodeErrorZ NodeAnnouncementInfo_read(struct LDKu8slice ser); @@ -8151,11 +8151,11 @@ void NodeInfo_set_announcement_info(struct LDKNodeInfo *NONNULL_PTR this_ptr, st MUST_USE_RES struct LDKNodeInfo NodeInfo_new(LDKCVec_u64Z channels_arg, struct LDKRoutingFees lowest_inbound_channel_fees_arg, struct LDKNodeAnnouncementInfo announcement_info_arg); -LDKCVec_u8Z NodeInfo_write(const struct LDKNodeInfo *obj); +LDKCVec_u8Z NodeInfo_write(const struct LDKNodeInfo *NONNULL_PTR obj); LDKCResult_NodeInfoDecodeErrorZ NodeInfo_read(struct LDKu8slice ser); -LDKCVec_u8Z NetworkGraph_write(const struct LDKNetworkGraph *obj); +LDKCVec_u8Z NetworkGraph_write(const struct LDKNetworkGraph *NONNULL_PTR obj); LDKCResult_NetworkGraphDecodeErrorZ NetworkGraph_read(struct LDKu8slice ser); diff --git a/lightning-c-bindings/src/chain/chainmonitor.rs b/lightning-c-bindings/src/chain/chainmonitor.rs index a0a1b7621..98543fd13 100644 --- a/lightning-c-bindings/src/chain/chainmonitor.rs +++ b/lightning-c-bindings/src/chain/chainmonitor.rs @@ -128,7 +128,7 @@ impl From for crate::chain::Watch { } } #[no_mangle] -pub extern "C" fn ChainMonitor_as_Watch(this_arg: *const ChainMonitor) -> crate::chain::Watch { +pub extern "C" fn ChainMonitor_as_Watch(this_arg: &ChainMonitor) -> crate::chain::Watch { crate::chain::Watch { this_arg: unsafe { (*this_arg).inner as *mut c_void }, free: None, @@ -168,7 +168,7 @@ impl From for crate::util::events::EventsProvider { } } #[no_mangle] -pub extern "C" fn ChainMonitor_as_EventsProvider(this_arg: *const ChainMonitor) -> crate::util::events::EventsProvider { +pub extern "C" fn ChainMonitor_as_EventsProvider(this_arg: &ChainMonitor) -> crate::util::events::EventsProvider { crate::util::events::EventsProvider { this_arg: unsafe { (*this_arg).inner as *mut c_void }, free: None, diff --git a/lightning-c-bindings/src/chain/channelmonitor.rs b/lightning-c-bindings/src/chain/channelmonitor.rs index ae3645556..111dff174 100644 --- a/lightning-c-bindings/src/chain/channelmonitor.rs +++ b/lightning-c-bindings/src/chain/channelmonitor.rs @@ -112,7 +112,7 @@ pub extern "C" fn ChannelMonitorUpdate_set_update_id(this_ptr: &mut ChannelMonit #[no_mangle] pub static CLOSED_CHANNEL_UPDATE_ID: u64 = lightning::chain::channelmonitor::CLOSED_CHANNEL_UPDATE_ID; #[no_mangle] -pub extern "C" fn ChannelMonitorUpdate_write(obj: *const ChannelMonitorUpdate) -> crate::c_types::derived::CVec_u8Z { +pub extern "C" fn ChannelMonitorUpdate_write(obj: &ChannelMonitorUpdate) -> crate::c_types::derived::CVec_u8Z { crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner }) } #[no_mangle] @@ -379,7 +379,7 @@ pub extern "C" fn HTLCUpdate_clone(orig: &HTLCUpdate) -> HTLCUpdate { HTLCUpdate { inner: Box::into_raw(Box::new(unsafe { &*orig.inner }.clone())), is_owned: true } } #[no_mangle] -pub extern "C" fn HTLCUpdate_write(obj: *const HTLCUpdate) -> crate::c_types::derived::CVec_u8Z { +pub extern "C" fn HTLCUpdate_write(obj: &HTLCUpdate) -> crate::c_types::derived::CVec_u8Z { crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) }) } #[no_mangle] @@ -448,7 +448,7 @@ impl ChannelMonitor { } } #[no_mangle] -pub extern "C" fn ChannelMonitor_write(obj: *const ChannelMonitor) -> crate::c_types::derived::CVec_u8Z { +pub extern "C" fn ChannelMonitor_write(obj: &ChannelMonitor) -> crate::c_types::derived::CVec_u8Z { crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner }) } #[no_mangle] diff --git a/lightning-c-bindings/src/chain/keysinterface.rs b/lightning-c-bindings/src/chain/keysinterface.rs index a3d40b3ef..01ba89456 100644 --- a/lightning-c-bindings/src/chain/keysinterface.rs +++ b/lightning-c-bindings/src/chain/keysinterface.rs @@ -225,7 +225,7 @@ pub extern "C" fn SpendableOutputDescriptor_clone(orig: &SpendableOutputDescript orig.clone() } #[no_mangle] -pub extern "C" fn SpendableOutputDescriptor_write(obj: *const SpendableOutputDescriptor) -> crate::c_types::derived::CVec_u8Z { +pub extern "C" fn SpendableOutputDescriptor_write(obj: &SpendableOutputDescriptor) -> crate::c_types::derived::CVec_u8Z { crate::c_types::serialize_obj(&unsafe { &*obj }.to_native()) } #[no_mangle] @@ -783,7 +783,7 @@ impl From for crate::chain::keysinterface::ChannelKey } } #[no_mangle] -pub extern "C" fn InMemoryChannelKeys_as_ChannelKeys(this_arg: *const InMemoryChannelKeys) -> crate::chain::keysinterface::ChannelKeys { +pub extern "C" fn InMemoryChannelKeys_as_ChannelKeys(this_arg: &InMemoryChannelKeys) -> crate::chain::keysinterface::ChannelKeys { crate::chain::keysinterface::ChannelKeys { this_arg: unsafe { (*this_arg).inner as *mut c_void }, free: None, @@ -882,7 +882,7 @@ extern "C" fn InMemoryChannelKeys_ChannelKeys_ready_channel(this_arg: *mut c_voi } #[no_mangle] -pub extern "C" fn InMemoryChannelKeys_write(obj: *const InMemoryChannelKeys) -> crate::c_types::derived::CVec_u8Z { +pub extern "C" fn InMemoryChannelKeys_write(obj: &InMemoryChannelKeys) -> crate::c_types::derived::CVec_u8Z { crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner }) } #[no_mangle] @@ -988,7 +988,7 @@ impl From for crate::chain::keysinterface::KeysInterface { } } #[no_mangle] -pub extern "C" fn KeysManager_as_KeysInterface(this_arg: *const KeysManager) -> crate::chain::keysinterface::KeysInterface { +pub extern "C" fn KeysManager_as_KeysInterface(this_arg: &KeysManager) -> crate::chain::keysinterface::KeysInterface { crate::chain::keysinterface::KeysInterface { this_arg: unsafe { (*this_arg).inner as *mut c_void }, free: None, diff --git a/lightning-c-bindings/src/chain/transaction.rs b/lightning-c-bindings/src/chain/transaction.rs index ff7aff7e9..d66709010 100644 --- a/lightning-c-bindings/src/chain/transaction.rs +++ b/lightning-c-bindings/src/chain/transaction.rs @@ -101,7 +101,7 @@ pub extern "C" fn OutPoint_to_channel_id(this_arg: &OutPoint) -> crate::c_types: } #[no_mangle] -pub extern "C" fn OutPoint_write(obj: *const OutPoint) -> crate::c_types::derived::CVec_u8Z { +pub extern "C" fn OutPoint_write(obj: &OutPoint) -> crate::c_types::derived::CVec_u8Z { crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) }) } #[no_mangle] diff --git a/lightning-c-bindings/src/ln/chan_utils.rs b/lightning-c-bindings/src/ln/chan_utils.rs index 5bd272070..64919ce88 100644 --- a/lightning-c-bindings/src/ln/chan_utils.rs +++ b/lightning-c-bindings/src/ln/chan_utils.rs @@ -208,7 +208,7 @@ pub extern "C" fn TxCreationKeys_new(mut per_commitment_point_arg: crate::c_type })), is_owned: true } } #[no_mangle] -pub extern "C" fn TxCreationKeys_write(obj: *const TxCreationKeys) -> crate::c_types::derived::CVec_u8Z { +pub extern "C" fn TxCreationKeys_write(obj: &TxCreationKeys) -> crate::c_types::derived::CVec_u8Z { crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) }) } #[no_mangle] @@ -363,7 +363,7 @@ pub extern "C" fn ChannelPublicKeys_new(mut funding_pubkey_arg: crate::c_types:: })), is_owned: true } } #[no_mangle] -pub extern "C" fn ChannelPublicKeys_write(obj: *const ChannelPublicKeys) -> crate::c_types::derived::CVec_u8Z { +pub extern "C" fn ChannelPublicKeys_write(obj: &ChannelPublicKeys) -> crate::c_types::derived::CVec_u8Z { crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) }) } #[no_mangle] @@ -515,7 +515,7 @@ pub extern "C" fn HTLCOutputInCommitment_set_payment_hash(this_ptr: &mut HTLCOut unsafe { &mut *this_ptr.inner }.payment_hash = ::lightning::ln::channelmanager::PaymentHash(val.data); } #[no_mangle] -pub extern "C" fn HTLCOutputInCommitment_write(obj: *const HTLCOutputInCommitment) -> crate::c_types::derived::CVec_u8Z { +pub extern "C" fn HTLCOutputInCommitment_write(obj: &HTLCOutputInCommitment) -> crate::c_types::derived::CVec_u8Z { crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) }) } #[no_mangle] @@ -805,7 +805,7 @@ pub extern "C" fn ChannelTransactionParameters_as_counterparty_broadcastable(thi } #[no_mangle] -pub extern "C" fn CounterpartyChannelTransactionParameters_write(obj: *const CounterpartyChannelTransactionParameters) -> crate::c_types::derived::CVec_u8Z { +pub extern "C" fn CounterpartyChannelTransactionParameters_write(obj: &CounterpartyChannelTransactionParameters) -> crate::c_types::derived::CVec_u8Z { crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) }) } #[no_mangle] @@ -821,7 +821,7 @@ pub extern "C" fn CounterpartyChannelTransactionParameters_read(ser: crate::c_ty } } #[no_mangle] -pub extern "C" fn ChannelTransactionParameters_write(obj: *const ChannelTransactionParameters) -> crate::c_types::derived::CVec_u8Z { +pub extern "C" fn ChannelTransactionParameters_write(obj: &ChannelTransactionParameters) -> crate::c_types::derived::CVec_u8Z { crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) }) } #[no_mangle] @@ -997,7 +997,7 @@ pub extern "C" fn HolderCommitmentTransaction_set_counterparty_htlc_sigs(this_pt unsafe { &mut *this_ptr.inner }.counterparty_htlc_sigs = local_val; } #[no_mangle] -pub extern "C" fn HolderCommitmentTransaction_write(obj: *const HolderCommitmentTransaction) -> crate::c_types::derived::CVec_u8Z { +pub extern "C" fn HolderCommitmentTransaction_write(obj: &HolderCommitmentTransaction) -> crate::c_types::derived::CVec_u8Z { crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) }) } #[no_mangle] @@ -1115,7 +1115,7 @@ pub extern "C" fn BuiltCommitmentTransaction_new(mut transaction_arg: crate::c_t })), is_owned: true } } #[no_mangle] -pub extern "C" fn BuiltCommitmentTransaction_write(obj: *const BuiltCommitmentTransaction) -> crate::c_types::derived::CVec_u8Z { +pub extern "C" fn BuiltCommitmentTransaction_write(obj: &BuiltCommitmentTransaction) -> crate::c_types::derived::CVec_u8Z { crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) }) } #[no_mangle] @@ -1210,7 +1210,7 @@ pub extern "C" fn CommitmentTransaction_clone(orig: &CommitmentTransaction) -> C CommitmentTransaction { inner: Box::into_raw(Box::new(unsafe { &*orig.inner }.clone())), is_owned: true } } #[no_mangle] -pub extern "C" fn CommitmentTransaction_write(obj: *const CommitmentTransaction) -> crate::c_types::derived::CVec_u8Z { +pub extern "C" fn CommitmentTransaction_write(obj: &CommitmentTransaction) -> crate::c_types::derived::CVec_u8Z { crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) }) } #[no_mangle] diff --git a/lightning-c-bindings/src/ln/channelmanager.rs b/lightning-c-bindings/src/ln/channelmanager.rs index 4d18ea1a1..ad183aa04 100644 --- a/lightning-c-bindings/src/ln/channelmanager.rs +++ b/lightning-c-bindings/src/ln/channelmanager.rs @@ -567,7 +567,7 @@ impl From for crate::util::events::MessageSendEventsProvid } } #[no_mangle] -pub extern "C" fn ChannelManager_as_MessageSendEventsProvider(this_arg: *const ChannelManager) -> crate::util::events::MessageSendEventsProvider { +pub extern "C" fn ChannelManager_as_MessageSendEventsProvider(this_arg: &ChannelManager) -> crate::util::events::MessageSendEventsProvider { crate::util::events::MessageSendEventsProvider { this_arg: unsafe { (*this_arg).inner as *mut c_void }, free: None, @@ -593,7 +593,7 @@ impl From for crate::util::events::EventsProvider { } } #[no_mangle] -pub extern "C" fn ChannelManager_as_EventsProvider(this_arg: *const ChannelManager) -> crate::util::events::EventsProvider { +pub extern "C" fn ChannelManager_as_EventsProvider(this_arg: &ChannelManager) -> crate::util::events::EventsProvider { crate::util::events::EventsProvider { this_arg: unsafe { (*this_arg).inner as *mut c_void }, free: None, @@ -635,7 +635,7 @@ impl From for crate::ln::msgs::ChannelMessageHandler { } } #[no_mangle] -pub extern "C" fn ChannelManager_as_ChannelMessageHandler(this_arg: *const ChannelManager) -> crate::ln::msgs::ChannelMessageHandler { +pub extern "C" fn ChannelManager_as_ChannelMessageHandler(this_arg: &ChannelManager) -> crate::ln::msgs::ChannelMessageHandler { crate::ln::msgs::ChannelMessageHandler { this_arg: unsafe { (*this_arg).inner as *mut c_void }, free: None, @@ -732,7 +732,7 @@ extern "C" fn ChannelManager_ChannelMessageHandler_get_and_clear_pending_msg_eve } #[no_mangle] -pub extern "C" fn ChannelManager_write(obj: *const ChannelManager) -> crate::c_types::derived::CVec_u8Z { +pub extern "C" fn ChannelManager_write(obj: &ChannelManager) -> crate::c_types::derived::CVec_u8Z { crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner }) } #[no_mangle] diff --git a/lightning-c-bindings/src/ln/msgs.rs b/lightning-c-bindings/src/ln/msgs.rs index 23520c4b6..071b2907d 100644 --- a/lightning-c-bindings/src/ln/msgs.rs +++ b/lightning-c-bindings/src/ln/msgs.rs @@ -2408,7 +2408,7 @@ pub extern "C" fn NetAddress_clone(orig: &NetAddress) -> NetAddress { orig.clone() } #[no_mangle] -pub extern "C" fn NetAddress_write(obj: *const NetAddress) -> crate::c_types::derived::CVec_u8Z { +pub extern "C" fn NetAddress_write(obj: &NetAddress) -> crate::c_types::derived::CVec_u8Z { crate::c_types::serialize_obj(&unsafe { &*obj }.to_native()) } #[no_mangle] @@ -4302,7 +4302,7 @@ impl Drop for RoutingMessageHandler { } } #[no_mangle] -pub extern "C" fn AcceptChannel_write(obj: *const AcceptChannel) -> crate::c_types::derived::CVec_u8Z { +pub extern "C" fn AcceptChannel_write(obj: &AcceptChannel) -> crate::c_types::derived::CVec_u8Z { crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) }) } #[no_mangle] @@ -4318,7 +4318,7 @@ pub extern "C" fn AcceptChannel_read(ser: crate::c_types::u8slice) -> AcceptChan } } #[no_mangle] -pub extern "C" fn AnnouncementSignatures_write(obj: *const AnnouncementSignatures) -> crate::c_types::derived::CVec_u8Z { +pub extern "C" fn AnnouncementSignatures_write(obj: &AnnouncementSignatures) -> crate::c_types::derived::CVec_u8Z { crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) }) } #[no_mangle] @@ -4334,7 +4334,7 @@ pub extern "C" fn AnnouncementSignatures_read(ser: crate::c_types::u8slice) -> A } } #[no_mangle] -pub extern "C" fn ChannelReestablish_write(obj: *const ChannelReestablish) -> crate::c_types::derived::CVec_u8Z { +pub extern "C" fn ChannelReestablish_write(obj: &ChannelReestablish) -> crate::c_types::derived::CVec_u8Z { crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner }) } #[no_mangle] @@ -4348,7 +4348,7 @@ pub extern "C" fn ChannelReestablish_read(ser: crate::c_types::u8slice) -> crate local_res } #[no_mangle] -pub extern "C" fn ClosingSigned_write(obj: *const ClosingSigned) -> crate::c_types::derived::CVec_u8Z { +pub extern "C" fn ClosingSigned_write(obj: &ClosingSigned) -> crate::c_types::derived::CVec_u8Z { crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) }) } #[no_mangle] @@ -4364,7 +4364,7 @@ pub extern "C" fn ClosingSigned_read(ser: crate::c_types::u8slice) -> ClosingSig } } #[no_mangle] -pub extern "C" fn CommitmentSigned_write(obj: *const CommitmentSigned) -> crate::c_types::derived::CVec_u8Z { +pub extern "C" fn CommitmentSigned_write(obj: &CommitmentSigned) -> crate::c_types::derived::CVec_u8Z { crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) }) } #[no_mangle] @@ -4380,7 +4380,7 @@ pub extern "C" fn CommitmentSigned_read(ser: crate::c_types::u8slice) -> Commitm } } #[no_mangle] -pub extern "C" fn FundingCreated_write(obj: *const FundingCreated) -> crate::c_types::derived::CVec_u8Z { +pub extern "C" fn FundingCreated_write(obj: &FundingCreated) -> crate::c_types::derived::CVec_u8Z { crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) }) } #[no_mangle] @@ -4396,7 +4396,7 @@ pub extern "C" fn FundingCreated_read(ser: crate::c_types::u8slice) -> FundingCr } } #[no_mangle] -pub extern "C" fn FundingSigned_write(obj: *const FundingSigned) -> crate::c_types::derived::CVec_u8Z { +pub extern "C" fn FundingSigned_write(obj: &FundingSigned) -> crate::c_types::derived::CVec_u8Z { crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) }) } #[no_mangle] @@ -4412,7 +4412,7 @@ pub extern "C" fn FundingSigned_read(ser: crate::c_types::u8slice) -> FundingSig } } #[no_mangle] -pub extern "C" fn FundingLocked_write(obj: *const FundingLocked) -> crate::c_types::derived::CVec_u8Z { +pub extern "C" fn FundingLocked_write(obj: &FundingLocked) -> crate::c_types::derived::CVec_u8Z { crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) }) } #[no_mangle] @@ -4428,7 +4428,7 @@ pub extern "C" fn FundingLocked_read(ser: crate::c_types::u8slice) -> FundingLoc } } #[no_mangle] -pub extern "C" fn Init_write(obj: *const Init) -> crate::c_types::derived::CVec_u8Z { +pub extern "C" fn Init_write(obj: &Init) -> crate::c_types::derived::CVec_u8Z { crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner }) } #[no_mangle] @@ -4442,7 +4442,7 @@ pub extern "C" fn Init_read(ser: crate::c_types::u8slice) -> crate::c_types::der local_res } #[no_mangle] -pub extern "C" fn OpenChannel_write(obj: *const OpenChannel) -> crate::c_types::derived::CVec_u8Z { +pub extern "C" fn OpenChannel_write(obj: &OpenChannel) -> crate::c_types::derived::CVec_u8Z { crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) }) } #[no_mangle] @@ -4458,7 +4458,7 @@ pub extern "C" fn OpenChannel_read(ser: crate::c_types::u8slice) -> OpenChannel } } #[no_mangle] -pub extern "C" fn RevokeAndACK_write(obj: *const RevokeAndACK) -> crate::c_types::derived::CVec_u8Z { +pub extern "C" fn RevokeAndACK_write(obj: &RevokeAndACK) -> crate::c_types::derived::CVec_u8Z { crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) }) } #[no_mangle] @@ -4474,7 +4474,7 @@ pub extern "C" fn RevokeAndACK_read(ser: crate::c_types::u8slice) -> RevokeAndAC } } #[no_mangle] -pub extern "C" fn Shutdown_write(obj: *const Shutdown) -> crate::c_types::derived::CVec_u8Z { +pub extern "C" fn Shutdown_write(obj: &Shutdown) -> crate::c_types::derived::CVec_u8Z { crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) }) } #[no_mangle] @@ -4490,7 +4490,7 @@ pub extern "C" fn Shutdown_read(ser: crate::c_types::u8slice) -> Shutdown { } } #[no_mangle] -pub extern "C" fn UpdateFailHTLC_write(obj: *const UpdateFailHTLC) -> crate::c_types::derived::CVec_u8Z { +pub extern "C" fn UpdateFailHTLC_write(obj: &UpdateFailHTLC) -> crate::c_types::derived::CVec_u8Z { crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) }) } #[no_mangle] @@ -4506,7 +4506,7 @@ pub extern "C" fn UpdateFailHTLC_read(ser: crate::c_types::u8slice) -> UpdateFai } } #[no_mangle] -pub extern "C" fn UpdateFailMalformedHTLC_write(obj: *const UpdateFailMalformedHTLC) -> crate::c_types::derived::CVec_u8Z { +pub extern "C" fn UpdateFailMalformedHTLC_write(obj: &UpdateFailMalformedHTLC) -> crate::c_types::derived::CVec_u8Z { crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) }) } #[no_mangle] @@ -4522,7 +4522,7 @@ pub extern "C" fn UpdateFailMalformedHTLC_read(ser: crate::c_types::u8slice) -> } } #[no_mangle] -pub extern "C" fn UpdateFee_write(obj: *const UpdateFee) -> crate::c_types::derived::CVec_u8Z { +pub extern "C" fn UpdateFee_write(obj: &UpdateFee) -> crate::c_types::derived::CVec_u8Z { crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) }) } #[no_mangle] @@ -4538,7 +4538,7 @@ pub extern "C" fn UpdateFee_read(ser: crate::c_types::u8slice) -> UpdateFee { } } #[no_mangle] -pub extern "C" fn UpdateFulfillHTLC_write(obj: *const UpdateFulfillHTLC) -> crate::c_types::derived::CVec_u8Z { +pub extern "C" fn UpdateFulfillHTLC_write(obj: &UpdateFulfillHTLC) -> crate::c_types::derived::CVec_u8Z { crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) }) } #[no_mangle] @@ -4554,7 +4554,7 @@ pub extern "C" fn UpdateFulfillHTLC_read(ser: crate::c_types::u8slice) -> Update } } #[no_mangle] -pub extern "C" fn UpdateAddHTLC_write(obj: *const UpdateAddHTLC) -> crate::c_types::derived::CVec_u8Z { +pub extern "C" fn UpdateAddHTLC_write(obj: &UpdateAddHTLC) -> crate::c_types::derived::CVec_u8Z { crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) }) } #[no_mangle] @@ -4570,7 +4570,7 @@ pub extern "C" fn UpdateAddHTLC_read(ser: crate::c_types::u8slice) -> UpdateAddH } } #[no_mangle] -pub extern "C" fn Ping_write(obj: *const Ping) -> crate::c_types::derived::CVec_u8Z { +pub extern "C" fn Ping_write(obj: &Ping) -> crate::c_types::derived::CVec_u8Z { crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner }) } #[no_mangle] @@ -4584,7 +4584,7 @@ pub extern "C" fn Ping_read(ser: crate::c_types::u8slice) -> crate::c_types::der local_res } #[no_mangle] -pub extern "C" fn Pong_write(obj: *const Pong) -> crate::c_types::derived::CVec_u8Z { +pub extern "C" fn Pong_write(obj: &Pong) -> crate::c_types::derived::CVec_u8Z { crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner }) } #[no_mangle] @@ -4598,7 +4598,7 @@ pub extern "C" fn Pong_read(ser: crate::c_types::u8slice) -> crate::c_types::der local_res } #[no_mangle] -pub extern "C" fn UnsignedChannelAnnouncement_write(obj: *const UnsignedChannelAnnouncement) -> crate::c_types::derived::CVec_u8Z { +pub extern "C" fn UnsignedChannelAnnouncement_write(obj: &UnsignedChannelAnnouncement) -> crate::c_types::derived::CVec_u8Z { crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner }) } #[no_mangle] @@ -4612,7 +4612,7 @@ pub extern "C" fn UnsignedChannelAnnouncement_read(ser: crate::c_types::u8slice) local_res } #[no_mangle] -pub extern "C" fn ChannelAnnouncement_write(obj: *const ChannelAnnouncement) -> crate::c_types::derived::CVec_u8Z { +pub extern "C" fn ChannelAnnouncement_write(obj: &ChannelAnnouncement) -> crate::c_types::derived::CVec_u8Z { crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) }) } #[no_mangle] @@ -4628,7 +4628,7 @@ pub extern "C" fn ChannelAnnouncement_read(ser: crate::c_types::u8slice) -> Chan } } #[no_mangle] -pub extern "C" fn UnsignedChannelUpdate_write(obj: *const UnsignedChannelUpdate) -> crate::c_types::derived::CVec_u8Z { +pub extern "C" fn UnsignedChannelUpdate_write(obj: &UnsignedChannelUpdate) -> crate::c_types::derived::CVec_u8Z { crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner }) } #[no_mangle] @@ -4642,7 +4642,7 @@ pub extern "C" fn UnsignedChannelUpdate_read(ser: crate::c_types::u8slice) -> cr local_res } #[no_mangle] -pub extern "C" fn ChannelUpdate_write(obj: *const ChannelUpdate) -> crate::c_types::derived::CVec_u8Z { +pub extern "C" fn ChannelUpdate_write(obj: &ChannelUpdate) -> crate::c_types::derived::CVec_u8Z { crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) }) } #[no_mangle] @@ -4658,7 +4658,7 @@ pub extern "C" fn ChannelUpdate_read(ser: crate::c_types::u8slice) -> ChannelUpd } } #[no_mangle] -pub extern "C" fn ErrorMessage_write(obj: *const ErrorMessage) -> crate::c_types::derived::CVec_u8Z { +pub extern "C" fn ErrorMessage_write(obj: &ErrorMessage) -> crate::c_types::derived::CVec_u8Z { crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner }) } #[no_mangle] @@ -4672,7 +4672,7 @@ pub extern "C" fn ErrorMessage_read(ser: crate::c_types::u8slice) -> crate::c_ty local_res } #[no_mangle] -pub extern "C" fn UnsignedNodeAnnouncement_write(obj: *const UnsignedNodeAnnouncement) -> crate::c_types::derived::CVec_u8Z { +pub extern "C" fn UnsignedNodeAnnouncement_write(obj: &UnsignedNodeAnnouncement) -> crate::c_types::derived::CVec_u8Z { crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner }) } #[no_mangle] @@ -4686,7 +4686,7 @@ pub extern "C" fn UnsignedNodeAnnouncement_read(ser: crate::c_types::u8slice) -> local_res } #[no_mangle] -pub extern "C" fn NodeAnnouncement_write(obj: *const NodeAnnouncement) -> crate::c_types::derived::CVec_u8Z { +pub extern "C" fn NodeAnnouncement_write(obj: &NodeAnnouncement) -> crate::c_types::derived::CVec_u8Z { crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) }) } #[no_mangle] @@ -4708,7 +4708,7 @@ pub extern "C" fn QueryShortChannelIds_read(ser: crate::c_types::u8slice) -> cra local_res } #[no_mangle] -pub extern "C" fn QueryShortChannelIds_write(obj: *const QueryShortChannelIds) -> crate::c_types::derived::CVec_u8Z { +pub extern "C" fn QueryShortChannelIds_write(obj: &QueryShortChannelIds) -> crate::c_types::derived::CVec_u8Z { crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner }) } #[no_mangle] @@ -4722,7 +4722,7 @@ pub extern "C" fn ReplyShortChannelIdsEnd_read(ser: crate::c_types::u8slice) -> local_res } #[no_mangle] -pub extern "C" fn ReplyShortChannelIdsEnd_write(obj: *const ReplyShortChannelIdsEnd) -> crate::c_types::derived::CVec_u8Z { +pub extern "C" fn ReplyShortChannelIdsEnd_write(obj: &ReplyShortChannelIdsEnd) -> crate::c_types::derived::CVec_u8Z { crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner }) } #[no_mangle] @@ -4736,7 +4736,7 @@ pub extern "C" fn QueryChannelRange_read(ser: crate::c_types::u8slice) -> crate: local_res } #[no_mangle] -pub extern "C" fn QueryChannelRange_write(obj: *const QueryChannelRange) -> crate::c_types::derived::CVec_u8Z { +pub extern "C" fn QueryChannelRange_write(obj: &QueryChannelRange) -> crate::c_types::derived::CVec_u8Z { crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner }) } #[no_mangle] @@ -4750,7 +4750,7 @@ pub extern "C" fn ReplyChannelRange_read(ser: crate::c_types::u8slice) -> crate: local_res } #[no_mangle] -pub extern "C" fn ReplyChannelRange_write(obj: *const ReplyChannelRange) -> crate::c_types::derived::CVec_u8Z { +pub extern "C" fn ReplyChannelRange_write(obj: &ReplyChannelRange) -> crate::c_types::derived::CVec_u8Z { crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner }) } #[no_mangle] @@ -4764,7 +4764,7 @@ pub extern "C" fn GossipTimestampFilter_read(ser: crate::c_types::u8slice) -> cr local_res } #[no_mangle] -pub extern "C" fn GossipTimestampFilter_write(obj: *const GossipTimestampFilter) -> crate::c_types::derived::CVec_u8Z { +pub extern "C" fn GossipTimestampFilter_write(obj: &GossipTimestampFilter) -> crate::c_types::derived::CVec_u8Z { crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner }) } #[no_mangle] diff --git a/lightning-c-bindings/src/routing/network_graph.rs b/lightning-c-bindings/src/routing/network_graph.rs index ccb4b1263..9c14a2f94 100644 --- a/lightning-c-bindings/src/routing/network_graph.rs +++ b/lightning-c-bindings/src/routing/network_graph.rs @@ -177,7 +177,7 @@ impl From for crate::ln::msgs::RoutingMessageHandler { } } #[no_mangle] -pub extern "C" fn NetGraphMsgHandler_as_RoutingMessageHandler(this_arg: *const NetGraphMsgHandler) -> crate::ln::msgs::RoutingMessageHandler { +pub extern "C" fn NetGraphMsgHandler_as_RoutingMessageHandler(this_arg: &NetGraphMsgHandler) -> crate::ln::msgs::RoutingMessageHandler { crate::ln::msgs::RoutingMessageHandler { this_arg: unsafe { (*this_arg).inner as *mut c_void }, free: None, @@ -280,7 +280,7 @@ impl From for crate::util::events::MessageSendEventsPr } } #[no_mangle] -pub extern "C" fn NetGraphMsgHandler_as_MessageSendEventsProvider(this_arg: *const NetGraphMsgHandler) -> crate::util::events::MessageSendEventsProvider { +pub extern "C" fn NetGraphMsgHandler_as_MessageSendEventsProvider(this_arg: &NetGraphMsgHandler) -> crate::util::events::MessageSendEventsProvider { crate::util::events::MessageSendEventsProvider { this_arg: unsafe { (*this_arg).inner as *mut c_void }, free: None, @@ -411,7 +411,7 @@ pub extern "C" fn DirectionalChannelInfo_set_last_update_message(this_ptr: &mut unsafe { &mut *this_ptr.inner }.last_update_message = local_val; } #[no_mangle] -pub extern "C" fn DirectionalChannelInfo_write(obj: *const DirectionalChannelInfo) -> crate::c_types::derived::CVec_u8Z { +pub extern "C" fn DirectionalChannelInfo_write(obj: &DirectionalChannelInfo) -> crate::c_types::derived::CVec_u8Z { crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) }) } #[no_mangle] @@ -544,7 +544,7 @@ pub extern "C" fn ChannelInfo_set_announcement_message(this_ptr: &mut ChannelInf unsafe { &mut *this_ptr.inner }.announcement_message = local_val; } #[no_mangle] -pub extern "C" fn ChannelInfo_write(obj: *const ChannelInfo) -> crate::c_types::derived::CVec_u8Z { +pub extern "C" fn ChannelInfo_write(obj: &ChannelInfo) -> crate::c_types::derived::CVec_u8Z { crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) }) } #[no_mangle] @@ -653,7 +653,7 @@ pub extern "C" fn RoutingFees_read(ser: crate::c_types::u8slice) -> crate::c_typ local_res } #[no_mangle] -pub extern "C" fn RoutingFees_write(obj: *const RoutingFees) -> crate::c_types::derived::CVec_u8Z { +pub extern "C" fn RoutingFees_write(obj: &RoutingFees) -> crate::c_types::derived::CVec_u8Z { crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner }) } #[no_mangle] @@ -788,7 +788,7 @@ pub extern "C" fn NodeAnnouncementInfo_new(mut features_arg: crate::ln::features })), is_owned: true } } #[no_mangle] -pub extern "C" fn NodeAnnouncementInfo_write(obj: *const NodeAnnouncementInfo) -> crate::c_types::derived::CVec_u8Z { +pub extern "C" fn NodeAnnouncementInfo_write(obj: &NodeAnnouncementInfo) -> crate::c_types::derived::CVec_u8Z { crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner }) } #[no_mangle] @@ -892,7 +892,7 @@ pub extern "C" fn NodeInfo_new(mut channels_arg: crate::c_types::derived::CVec_u })), is_owned: true } } #[no_mangle] -pub extern "C" fn NodeInfo_write(obj: *const NodeInfo) -> crate::c_types::derived::CVec_u8Z { +pub extern "C" fn NodeInfo_write(obj: &NodeInfo) -> crate::c_types::derived::CVec_u8Z { crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner }) } #[no_mangle] @@ -906,7 +906,7 @@ pub extern "C" fn NodeInfo_read(ser: crate::c_types::u8slice) -> crate::c_types: local_res } #[no_mangle] -pub extern "C" fn NetworkGraph_write(obj: *const NetworkGraph) -> crate::c_types::derived::CVec_u8Z { +pub extern "C" fn NetworkGraph_write(obj: &NetworkGraph) -> crate::c_types::derived::CVec_u8Z { crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner }) } #[no_mangle] diff --git a/lightning-c-bindings/src/routing/router.rs b/lightning-c-bindings/src/routing/router.rs index 1feb1c5a8..d3cd22f5f 100644 --- a/lightning-c-bindings/src/routing/router.rs +++ b/lightning-c-bindings/src/routing/router.rs @@ -222,7 +222,7 @@ pub extern "C" fn Route_new(mut paths_arg: crate::c_types::derived::CVec_CVec_Ro })), is_owned: true } } #[no_mangle] -pub extern "C" fn Route_write(obj: *const Route) -> crate::c_types::derived::CVec_u8Z { +pub extern "C" fn Route_write(obj: &Route) -> crate::c_types::derived::CVec_u8Z { crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner }) } #[no_mangle] diff --git a/lightning-c-bindings/src/util/config.rs b/lightning-c-bindings/src/util/config.rs index a9bcd6aee..37480e5d0 100644 --- a/lightning-c-bindings/src/util/config.rs +++ b/lightning-c-bindings/src/util/config.rs @@ -585,7 +585,7 @@ pub extern "C" fn ChannelConfig_default() -> ChannelConfig { ChannelConfig { inner: Box::into_raw(Box::new(Default::default())), is_owned: true } } #[no_mangle] -pub extern "C" fn ChannelConfig_write(obj: *const ChannelConfig) -> crate::c_types::derived::CVec_u8Z { +pub extern "C" fn ChannelConfig_write(obj: &ChannelConfig) -> crate::c_types::derived::CVec_u8Z { crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) }) } #[no_mangle] diff --git a/lightning-c-bindings/src/util/events.rs b/lightning-c-bindings/src/util/events.rs index d6fa40ffb..42aaecbc3 100644 --- a/lightning-c-bindings/src/util/events.rs +++ b/lightning-c-bindings/src/util/events.rs @@ -313,7 +313,7 @@ pub extern "C" fn Event_clone(orig: &Event) -> Event { orig.clone() } #[no_mangle] -pub extern "C" fn Event_write(obj: *const Event) -> crate::c_types::derived::CVec_u8Z { +pub extern "C" fn Event_write(obj: &Event) -> crate::c_types::derived::CVec_u8Z { crate::c_types::serialize_obj(&unsafe { &*obj }.to_native()) } /// An event generated by ChannelManager which indicates a message should be sent to a peer (or