summaryrefslogtreecommitdiff
path: root/code/ecp/core.h
diff options
context:
space:
mode:
authorUros Majstorovic <majstor@majstor.org>2018-01-17 18:42:47 +0100
committerUros Majstorovic <majstor@majstor.org>2018-01-17 18:42:47 +0100
commit1425f72c38fe23a9d3fcda583a7da1e7315acfc3 (patch)
tree2731c1f5b9e0c76e0a0775f6eddf81fd90b0817d /code/ecp/core.h
parent97a7e6617f8ad06b7bff495603200b853766ecc8 (diff)
build system improved
Diffstat (limited to 'code/ecp/core.h')
-rw-r--r--code/ecp/core.h49
1 files changed, 25 insertions, 24 deletions
diff --git a/code/ecp/core.h b/code/ecp/core.h
index 0248814..244df4d 100644
--- a/code/ecp/core.h
+++ b/code/ecp/core.h
@@ -1,3 +1,14 @@
+#include <sys/types.h>
+#include <stddef.h>
+#include <stdint.h>
+#include <string.h>
+
+#include "config.h"
+
+#ifdef ECP_WITH_PTHREAD
+#include <pthread.h>
+#endif
+
#define ECP_OK 0
#define ECP_ITER_NEXT 1
@@ -84,20 +95,6 @@
#define ecp_conn_is_reg(conn) ((conn->flags) & ECP_CONN_FLAG_REG)
#define ecp_conn_is_open(conn) ((conn->flags) & ECP_CONN_FLAG_OPEN)
-#include "config.h"
-
-#include <sys/types.h>
-#include <stddef.h>
-#include <stdint.h>
-
-struct ECPBuffer;
-struct ECP2Buffer;
-struct ECPContext;
-struct ECPSocket;
-struct ECPConnection;
-struct ECPSeqItem;
-struct ECPFragIter;
-
// typedef long ssize_t;
typedef uint32_t ecp_ack_t;
@@ -134,11 +131,22 @@ typedef uint32_t ecp_seq_t;
#define ECP_SIZE_PLD_RAW_BUF(X,T,P) (ECP_SIZE_PLD(X,T)+((P) ? ((P)->pcount+1)*(ECP_SIZE_PKT_HDR+ECP_SIZE_MSG_BUF(T,P)+ECP_AEAD_SIZE_TAG) : 0))
#define ECP_SIZE_PKT_RAW_BUF(X,T,P) (ECP_SIZE_PLD_RAW_BUF(X,T,P)+ECP_SIZE_PKT_HDR+ECP_AEAD_SIZE_TAG)
-#ifdef ECP_WITH_PTHREAD
-#include <pthread.h>
+#ifdef ECP_DEBUG
+#include <stdio.h>
+#define DPRINT(cnd, format, ...) { if (cnd) { fprintf (stderr, format, __VA_ARGS__); } }
+#else
+#define DPRINT(cnd, format, ...) {}
#endif
-#include "posix/transport.h"
+struct ECPBuffer;
+struct ECP2Buffer;
+struct ECPContext;
+struct ECPSocket;
+struct ECPConnection;
+struct ECPSeqItem;
+struct ECPFragIter;
+
+#include "platform/transport.h"
#include "crypto/crypto.h"
#include "timer.h"
@@ -146,13 +154,6 @@ typedef uint32_t ecp_seq_t;
#include "rbuf.h"
#endif
-#ifdef ECP_DEBUG
-#include <stdio.h>
-#define DPRINT(cnd, format, ...) { if (cnd) { fprintf (stderr, format, __VA_ARGS__); } }
-#else
-#define DPRINT(cnd, format, ...) {}
-#endif
-
typedef int ecp_rng_t (void *, size_t);
typedef int ecp_conn_handler_new_t (struct ECPSocket *s, struct ECPConnection *p, unsigned char *msg, size_t sz, struct ECPConnection **c);