diff options
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 25 |
1 files changed, 25 insertions, 0 deletions
@@ -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; +} |