From d3598381289ac23217c472d5f48df3bea891ecf2 Mon Sep 17 00:00:00 2001 From: kartofen Date: Mon, 24 Mar 2025 03:08:00 +0200 Subject: first --- main.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 main.c (limited to 'main.c') 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 +#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; +} -- cgit v1.2.3