summaryrefslogtreecommitdiff
path: root/c/object.h
diff options
context:
space:
mode:
Diffstat (limited to 'c/object.h')
-rw-r--r--c/object.h32
1 files changed, 24 insertions, 8 deletions
diff --git a/c/object.h b/c/object.h
index 1b60c57..b590ebe 100644
--- a/c/object.h
+++ b/c/object.h
@@ -41,19 +41,31 @@ typedef enum {
struct _msgpack_object;
+struct _msgpack_object_kv;
+
+typedef struct {
+ uint32_t size;
+ struct _msgpack_object* ptr;
+} msgpack_object_array;
+
+typedef struct {
+ uint32_t size;
+ struct _msgpack_object_kv* ptr;
+} msgpack_object_map;
+
+typedef struct {
+ uint32_t size;
+ const char* ptr;
+} msgpack_object_raw;
+
typedef union {
bool boolean;
uint64_t u64;
int64_t i64;
double dec;
- struct {
- struct _msgpack_object* ptr;
- uint32_t size;
- } container;
- struct {
- const char* ptr;
- uint32_t size;
- } ref;
+ msgpack_object_array array;
+ msgpack_object_map map;
+ msgpack_object_raw raw;
} msgpack_object_union;
typedef struct _msgpack_object {
@@ -61,6 +73,10 @@ typedef struct _msgpack_object {
msgpack_object_union via;
} msgpack_object;
+typedef struct _msgpack_object_kv {
+ msgpack_object key;
+ msgpack_object val;
+} msgpack_object_kv;
typedef enum {
MSGPACK_OBJECT_PARSE_SUCCESS = 0,