src/transport.h
author Roker <roker@pep-project.org>
Tue, 20 Sep 2016 15:54:57 +0200
branchroker-linux
changeset 1168 4d4e3ecbaf8b
parent 259 71d6c073fda4
child 1513 e7f7e42385b5
permissions -rw-r--r--
merge "default" into my branch
vb@23
     1
#pragma once
vb@23
     2
vb@23
     3
#include "pEpEngine.h"
vb@99
     4
#include "message.h"
vb@29
     5
vb@48
     6
#ifdef __cplusplus
vb@48
     7
extern "C" {
vb@48
     8
#endif
vb@48
     9
vb@23
    10
typedef enum _PEP_transports {
vb@37
    11
    // auto transport chooses transport per message automatically
vb@23
    12
    PEP_trans_auto = 0,
vb@28
    13
//    PEP_trans_email,
vb@28
    14
//    PEP_trans_whatsapp,
vb@23
    15
vb@23
    16
    PEP_trans__count
vb@23
    17
} PEP_transports;
vb@23
    18
vb@23
    19
typedef struct _PEP_transport_t PEP_transport_t;
vb@23
    20
vb@29
    21
typedef PEP_STATUS (*sendto_t)(PEP_SESSION session, const message *msg);
vb@39
    22
typedef PEP_STATUS (*readnext_t)(PEP_SESSION session, message **msg,
vb@39
    23
        PEP_transport_t **via);
vb@23
    24
vb@23
    25
struct _PEP_transport_t {
vb@39
    26
    uint8_t id;                             // transport ID
vb@39
    27
    sendto_t sendto;                        // sendto function
vb@39
    28
    readnext_t readnext;                    // readnext function
vb@39
    29
    bool long_message_supported;            // flag if this transport supports
vb@39
    30
                                            // long messages
vb@39
    31
    bool formatted_message_supported;       // flag if this transport supports
vb@39
    32
                                            // formatted messages
vb@81
    33
    PEP_text_format native_text_format;     // native format of the transport
vb@23
    34
};
vb@23
    35
vb@259
    36
extern PEP_transport_t transports[PEP_trans__count];
vb@259
    37
vb@23
    38
typedef uint64_t transports_mask;
vb@28
    39
vb@48
    40
#ifdef __cplusplus
vb@48
    41
}
vb@48
    42
#endif
vb@37
    43