aboutsummaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorkartofen <mladenovnasko0@gmail.com>2025-03-24 03:08:00 +0200
committerkartofen <mladenovnasko0@gmail.com>2025-03-24 03:08:00 +0200
commitd3598381289ac23217c472d5f48df3bea891ecf2 (patch)
tree5b249e2cd4348a28f00dc2404684dcf4be176c81 /main.c
first
Diffstat (limited to 'main.c')
-rw-r--r--main.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/main.c b/main.c
new file mode 100644
index 0000000..3ec1606
--- /dev/null
+++ b/main.c
@@ -0,0 +1,25 @@
+#include <stdio.h>
+#include "msgpack.h"
+
+#define BODY_SUCCESS printf("%s\n", msgpack_type_string[t])
+#define BODY_ERROR { \
+ printf("ERROR %s %s %s\n", msgpack_error_string[e], \
+ msgpack_type_string[t], msgpack_type_string[a]); \
+ return 1; \
+ }
+int main(void)
+{
+ // char buf[] = {0x0F};
+ // int b = 0;
+ // MSGPACK_CHECK2(msgpack_read_bool(&msgpack_init(buf, 1, NULL), &b),(t, e, a),
+ // BODY_SUCCESS, BODY_ERROR);
+ // printf("VALUE %d\n", b);
+
+ // char buf[] = {0xD3, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x01};
+ char buf[] = {0xCC, 0xFF};
+ union mp_int m; m.i = 0;
+ MSGPACK_CHECK2(msgpack_read_int(&msgpack_init(buf, sizeof(buf), NULL), &m),(t, e, a),
+ BODY_SUCCESS, BODY_ERROR);
+ printf("VALUE %llu\n", m.u);
+ return 0;
+}