p≡p engine fork for my own dirty testing of stuff
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
1.2 KiB

8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
  1. #pragma once
  2. #include "pEpEngine.h"
  3. #include "message.h"
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7. typedef enum _PEP_transports {
  8. // auto transport chooses transport per message automatically
  9. PEP_trans_auto = 0,
  10. // PEP_trans_email,
  11. // PEP_trans_whatsapp,
  12. PEP_trans__count
  13. } PEP_transports;
  14. typedef struct _PEP_transport_t PEP_transport_t;
  15. typedef PEP_STATUS (*sendto_t)(PEP_SESSION session, const message *msg);
  16. typedef PEP_STATUS (*readnext_t)(PEP_SESSION session, message **msg,
  17. PEP_transport_t **via);
  18. struct _PEP_transport_t {
  19. uint8_t id; // transport ID
  20. sendto_t sendto; // sendto function
  21. readnext_t readnext; // readnext function
  22. bool long_message_supported; // flag if this transport supports
  23. // long messages
  24. bool formatted_message_supported; // flag if this transport supports
  25. // formatted messages
  26. PEP_text_format native_text_format; // native format of the transport
  27. };
  28. typedef uint64_t transports_mask;
  29. #ifdef __cplusplus
  30. }
  31. #endif