merge
authorEdouard Tisserant
Wed, 11 May 2016 17:30:03 +0200
changeset 6014811189c7f9a
parent 600 92d2ea181098
parent 599 d2a023827e42
child 603 8bff69e425d3
merge
     1.1 --- a/src/pEp_internal.h	Wed May 11 17:24:40 2016 +0200
     1.2 +++ b/src/pEp_internal.h	Wed May 11 17:30:03 2016 +0200
     1.3 @@ -111,9 +111,10 @@
     1.4      sqlite3_stmt *own_key_is_listed;
     1.5      sqlite3_stmt *own_key_retrieve;
     1.6  
     1.7 -    
     1.8 +    // callbacks   
     1.9      examine_identity_t examine_identity;
    1.10      void *examine_management;
    1.11 +    void *sync_obj;
    1.12  
    1.13      // runtime config
    1.14  
     2.1 --- a/src/sync.c	Wed May 11 17:24:40 2016 +0200
     2.2 +++ b/src/sync.c	Wed May 11 17:30:03 2016 +0200
     2.3 @@ -8,10 +8,13 @@
     2.4  PEP_sync_callbacks_t PEP_sync_callbacks = { NULL, NULL };
     2.5  
     2.6  DYNAMIC_API PEP_STATUS register_sync_callbacks(
     2.7 +        PEP_SESSION session,
     2.8 +        void *obj,
     2.9          messageToSend_t messageToSend,
    2.10          showHandshake_t showHandshake
    2.11      )
    2.12  {
    2.13 +    session->sync_obj = obj;
    2.14      PEP_sync_callbacks.messageToSend = messageToSend;
    2.15      PEP_sync_callbacks.showHandshake = showHandshake;
    2.16  
     3.1 --- a/src/sync.h	Wed May 11 17:24:40 2016 +0200
     3.2 +++ b/src/sync.h	Wed May 11 17:30:03 2016 +0200
     3.3 @@ -14,12 +14,13 @@
     3.4  // messageToSend() - send a beacon message
     3.5  //
     3.6  //  parameters:
     3.7 -//      beacon (in)     message struct with beacon message to send
     3.8 +//      obj (in)        object handle (implementation defined)
     3.9 +//      msg (in)        message struct with message to send
    3.10  //
    3.11  //  return value:
    3.12  //      must return PEP_STATUS_OK or any other value on error
    3.13  
    3.14 -typedef PEP_STATUS (*messageToSend_t)(message beacon);
    3.15 +typedef PEP_STATUS (*messageToSend_t)(void *obj, const message *msg);
    3.16  
    3.17  
    3.18  typedef enum _sync_handshake_result {
    3.19 @@ -31,6 +32,7 @@
    3.20  // showHandshake() - do a handshake and deliver the result
    3.21  //
    3.22  //  parameters:
    3.23 +//      obj (in)        object handle (implementation defined)
    3.24  //      self (in)       own identity
    3.25  //      partner (in)    identity of partner
    3.26  //
    3.27 @@ -38,15 +40,18 @@
    3.28  //      result of handshake
    3.29  
    3.30  typedef sync_handshake_result (*showHandshake_t)(
    3.31 -        pEp_identity self,
    3.32 -        pEp_identity partner
    3.33 +        void *obj,
    3.34 +        const pEp_identity *self,
    3.35 +        const pEp_identity *partner
    3.36      );
    3.37  
    3.38  
    3.39  // register_sync_callbacks() - register adapter's callbacks
    3.40  //
    3.41  //  parameters:
    3.42 -//      messageToSend (in)             callback for sending beacon
    3.43 +//      session (in)                session where to store obj handle
    3.44 +//      obj (in)                    object handle (implementation defined)
    3.45 +//      messageToSend (in)          callback for sending message
    3.46  //      showHandshake (in)          callback for doing the handshake
    3.47  //
    3.48  //  return value:
    3.49 @@ -56,6 +61,8 @@
    3.50  //      call that BEFORE you're using any other part of the engine
    3.51  
    3.52  DYNAMIC_API PEP_STATUS register_sync_callbacks(
    3.53 +        PEP_SESSION session,
    3.54 +        void *obj,
    3.55          messageToSend_t messageToSend,
    3.56          showHandshake_t showHandshake
    3.57      );