From 94e33a425fb8743838e658c5da82257cb8705ebb Mon Sep 17 00:00:00 2001 From: heck Date: Thu, 23 Sep 2021 19:14:56 +0200 Subject: [PATCH] fix callbacks - they were missing all details from the c interface transport.h --- src/transport.hh | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/src/transport.hh b/src/transport.hh index af41907..e588d29 100644 --- a/src/transport.hh +++ b/src/transport.hh @@ -51,16 +51,37 @@ namespace pEp { // throw std::logic_error in case the transport is shut down // TODO: heck: "They" refers to the handlers, not the register functions // can we call them "register_" - virtual void signal_statuschange(std::function handler) = 0; + // equivalent of transport.h: + // typedef PEP_STATUS (*signal_statuschange_t)(PEP_transport_id id, PEP_transport_status_code tsc); + virtual void signal_statuschange( + std::function + handler) = 0; - virtual void signal_sendto_result( - std::function handler) = 0; + // equivalent of transport.h: + // typedef PEP_STATUS (*signal_sendto_result_t)( + // PEP_transport_id id, + // char* message_id, + // char* address, + // PEP_rating rating, + // PEP_transport_status_code tsc); + // TODO: libpEpDatatypes is missing pEpRating + virtual void signal_sendto_result(std::function handler) = 0; // Called on every message added to rx-queue // The message can be fetched using recvnext() // in case of callback_execution:::PEP_cbe_polling // This callback is not expected to be used - virtual void signal_incoming_message(std::function handler) = 0; + // equivalent of transport.h: + // typedef PEP_STATUS ( + // *signal_incoming_message_t)(PEP_transport_id id, PEP_transport_status_code tsc); + virtual void signal_incoming_message( + std::function + handler) = 0; virtual void configure(const Config& config) = 0; virtual void startup(const callback_execution& cbe = PEP_cbe_polling) = 0;