src/sync.c
author Volker Birk <vb@pep-project.org>
Tue, 03 May 2016 15:50:40 +0200
changeset 572 3077e2489dfe
child 573 28b0d3154f0f
permissions -rw-r--r--
sync API
     1 #include "pEp_internal.h"
     2 #include "sync_internal.h"
     3 
     4 #include <memory.h>
     5 #include <assert.h>
     6 
     7 
     8 PEP_sync_callbacks_t PEP_sync_callbacks = { NULL, NULL, NULL };
     9 
    10 DYNAMIC_API PEP_STATUS register_sync_callbacks(
    11         PEP_SESSION session,
    12         sendBeacon_t sendBeacon,
    13         sendHandshakeRequest_t sendHandshakeRequest,
    14         showHandshake_t showHandshake
    15     )
    16 {
    17     PEP_sync_callbacks.sendBeacon = sendBeacon;
    18     PEP_sync_callbacks.sendHandshakeRequest = sendHandshakeRequest;
    19     PEP_sync_callbacks.showHandshake = showHandshake;
    20 
    21     return PEP_STATUS_OK;
    22 }
    23 
    24 DYNAMIC_API void unregister_sync_callbacks(PEP_SESSION session) {
    25     PEP_sync_callbacks.sendBeacon = NULL;
    26     PEP_sync_callbacks.sendHandshakeRequest = NULL;
    27     PEP_sync_callbacks.showHandshake = NULL;
    28 }
    29