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
vb@572
     1
#include "pEp_internal.h"
vb@572
     2
#include "sync_internal.h"
vb@572
     3
vb@572
     4
#include <memory.h>
vb@572
     5
#include <assert.h>
vb@572
     6
vb@572
     7
vb@572
     8
PEP_sync_callbacks_t PEP_sync_callbacks = { NULL, NULL, NULL };
vb@572
     9
vb@572
    10
DYNAMIC_API PEP_STATUS register_sync_callbacks(
vb@572
    11
        PEP_SESSION session,
vb@572
    12
        sendBeacon_t sendBeacon,
vb@572
    13
        sendHandshakeRequest_t sendHandshakeRequest,
vb@572
    14
        showHandshake_t showHandshake
vb@572
    15
    )
vb@572
    16
{
vb@572
    17
    PEP_sync_callbacks.sendBeacon = sendBeacon;
vb@572
    18
    PEP_sync_callbacks.sendHandshakeRequest = sendHandshakeRequest;
vb@572
    19
    PEP_sync_callbacks.showHandshake = showHandshake;
vb@572
    20
vb@572
    21
    return PEP_STATUS_OK;
vb@572
    22
}
vb@572
    23
vb@572
    24
DYNAMIC_API void unregister_sync_callbacks(PEP_SESSION session) {
vb@572
    25
    PEP_sync_callbacks.sendBeacon = NULL;
vb@572
    26
    PEP_sync_callbacks.sendHandshakeRequest = NULL;
vb@572
    27
    PEP_sync_callbacks.showHandshake = NULL;
vb@572
    28
}
vb@572
    29