We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent efc27e8 commit 5da1abbCopy full SHA for 5da1abb
example/c/simple_c.c
@@ -1,6 +1,14 @@
1
#include <msgpack.h>
2
#include <stdio.h>
3
4
+void print(char const* buf, unsigned int len)
5
+{
6
+ size_t i = 0;
7
+ for(; i < len ; ++i)
8
+ printf("%02x ", 0xff & buf[i]);
9
+ printf("\n");
10
+}
11
+
12
int main(void)
13
{
14
msgpack_sbuffer sbuf;
@@ -20,6 +28,8 @@ int main(void)
20
28
msgpack_pack_str(&pk, 7);
21
29
msgpack_pack_str_body(&pk, "example", 7);
22
30
31
+ print(sbuf.data, sbuf.size);
32
23
33
/* deserialize the buffer into msgpack_object instance. */
24
34
/* deserialized object is valid during the msgpack_zone instance alive. */
25
35
msgpack_zone_init(&mempool, 2048);
@@ -35,4 +45,3 @@ int main(void)
45
36
46
return 0;
37
47
}
38
-
0 commit comments