src/transport.h
author vb
Mon, 01 Sep 2014 20:56:05 +0200
changeset 28 7fc9fc3e680c
parent 23 dba569e54163
child 29 31881fe94d3c
permissions -rw-r--r--
...
vb@23
     1
#pragma once
vb@23
     2
vb@23
     3
#include "pEpEngine.h"
vb@23
     4
vb@23
     5
typedef enum _PEP_transports {
vb@23
     6
    PEP_trans_auto = 0,
vb@28
     7
//    PEP_trans_email,
vb@28
     8
//    PEP_trans_whatsapp,
vb@23
     9
vb@23
    10
    PEP_trans__count
vb@23
    11
} PEP_transports;
vb@23
    12
vb@23
    13
typedef struct _PEP_transport_t PEP_transport_t;
vb@23
    14
vb@23
    15
typedef PEP_STATUS (*sendto_t)(PEP_SESSION session, const pEp_identity *address, const char *shortmsg, const char *longmsg, const char *longmsg_formatted);
vb@23
    16
typedef PEP_STATUS (*readnext_t)(PEP_SESSION session, pEp_identity *from, pEp_identity *reached, char **shortmsg, size_t shortmsg_size, char ** longmsg, size_t longmsg_size, char ** longmsg_formatted, size_t longmsg_formatted_size, PEP_transport_t **via);
vb@23
    17
vb@23
    18
struct _PEP_transport_t {
vb@23
    19
    uint8_t id;
vb@23
    20
    sendto_t sendto;
vb@23
    21
    readnext_t readnext;
vb@23
    22
};
vb@23
    23
vb@23
    24
typedef uint64_t transports_mask;
vb@28
    25
vb@28
    26
PEP_STATUS init_transport_system(PEP_SESSION session);
vb@28
    27
void release_transport_system(PEP_SESSION session);