summaryrefslogtreecommitdiffstats
path: root/protocol.h
diff options
context:
space:
mode:
authorFinn Behrens <me@kloenk.de>2021-02-27 01:04:32 +0100
committerFinn Behrens <me@kloenk.de>2021-02-27 01:04:32 +0100
commita4ee0c62392998b710b941047ce6f324e4531457 (patch)
tree06f4acd47d6b332266cb5dccafc76c2b86a17e0e /protocol.h
parent03a59a6b035c26456784916793fa674b4b36b4c5 (diff)
downloadmcc-a4ee0c62392998b710b941047ce6f324e4531457.tar.gz
mcc-a4ee0c62392998b710b941047ce6f324e4531457.tar.xz
mcc-a4ee0c62392998b710b941047ce6f324e4531457.zip
send_package
Diffstat (limited to 'protocol.h')
-rw-r--r--protocol.h15
1 files changed, 4 insertions, 11 deletions
diff --git a/protocol.h b/protocol.h
index 9d6f509..edb2881 100644
--- a/protocol.h
+++ b/protocol.h
@@ -14,7 +14,7 @@
#include <stdio.h>
#include <errno.h>
-#define PROTOCOL_VERSION 0
+#define PROTOCOL_VERSION 9
// MARK: - Helpers
#if defined(__APPLE__)
@@ -46,15 +46,8 @@
if (func < 0) \
return func; \
x += func;*/
-#define check_add(func) check_addx(func, counter)
-
-int inline check_addx(int func, int *x)
-{
- if (func < 0)
- return func;
- *x += func;
- return 0;
-}
+#define check_add(func) check_addx(func, &counter)
+int check_addx(int func, int *x);
// MARK: - READ
@@ -91,7 +84,7 @@ typedef struct {
int read_position(position_t *dest, uint8_t *src);
// string
-int read_string_malloc(char *dest, uint8_t *src);
+int read_string_malloc(char **dest, uint8_t *src);
// MARK: - WRITE
// MARK: VAR