src/transport.h
author Krista Grothoff <krista@pep-project.org>
Mon, 13 Feb 2017 22:13:48 +0100
branchenigmail-color-tests
changeset 1582 7dd855780eef
parent 1513 e7f7e42385b5
permissions -rw-r--r--
closing branch
vb@1513
     1
// This file is under GNU General Public License 3.0
vb@1513
     2
// see LICENSE.txt
vb@1513
     3
vb@23
     4
#pragma once
vb@23
     5
vb@23
     6
#include "pEpEngine.h"
vb@99
     7
#include "message.h"
vb@29
     8
vb@48
     9
#ifdef __cplusplus
vb@48
    10
extern "C" {
vb@48
    11
#endif
vb@48
    12
vb@23
    13
typedef enum _PEP_transports {
vb@37
    14
    // auto transport chooses transport per message automatically
vb@23
    15
    PEP_trans_auto = 0,
vb@28
    16
//    PEP_trans_email,
vb@28
    17
//    PEP_trans_whatsapp,
vb@23
    18
vb@23
    19
    PEP_trans__count
vb@23
    20
} PEP_transports;
vb@23
    21
vb@23
    22
typedef struct _PEP_transport_t PEP_transport_t;
vb@23
    23
vb@29
    24
typedef PEP_STATUS (*sendto_t)(PEP_SESSION session, const message *msg);
vb@39
    25
typedef PEP_STATUS (*readnext_t)(PEP_SESSION session, message **msg,
vb@39
    26
        PEP_transport_t **via);
vb@23
    27
vb@23
    28
struct _PEP_transport_t {
vb@39
    29
    uint8_t id;                             // transport ID
vb@39
    30
    sendto_t sendto;                        // sendto function
vb@39
    31
    readnext_t readnext;                    // readnext function
vb@39
    32
    bool long_message_supported;            // flag if this transport supports
vb@39
    33
                                            // long messages
vb@39
    34
    bool formatted_message_supported;       // flag if this transport supports
vb@39
    35
                                            // formatted messages
vb@81
    36
    PEP_text_format native_text_format;     // native format of the transport
vb@23
    37
};
vb@23
    38
vb@259
    39
extern PEP_transport_t transports[PEP_trans__count];
vb@259
    40
vb@23
    41
typedef uint64_t transports_mask;
vb@28
    42
vb@48
    43
#ifdef __cplusplus
vb@48
    44
}
vb@48
    45
#endif
vb@37
    46