aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/api/private/defs.h
diff options
context:
space:
mode:
authorThiago de Arruda <tpadilha84@gmail.com>2014-09-07 20:40:07 -0300
committerThiago de Arruda <tpadilha84@gmail.com>2014-09-12 13:25:28 -0300
commit2f566c83d9eee4a8097c9a18eb58dcef6adf894e (patch)
treea2e5ce0f973daab14237b66e8c023fe381a34e10 /src/nvim/api/private/defs.h
parentd5a60d17fbca33ca96124288e69937a276d3abda (diff)
downloadrneovim-2f566c83d9eee4a8097c9a18eb58dcef6adf894e.tar.gz
rneovim-2f566c83d9eee4a8097c9a18eb58dcef6adf894e.tar.bz2
rneovim-2f566c83d9eee4a8097c9a18eb58dcef6adf894e.zip
api/msgpack-rpc: Parse type information from api/private/defs.h
Enhance msgpack-gen.lua to extract custom api type codes from the ObjectType enum in api/private/defs.h. The type information is made available from the api metadata and clients can use to correctly serialize/deserialize these types using msgpack EXT type.
Diffstat (limited to 'src/nvim/api/private/defs.h')
-rw-r--r--src/nvim/api/private/defs.h20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/nvim/api/private/defs.h b/src/nvim/api/private/defs.h
index 071563a628..689594f231 100644
--- a/src/nvim/api/private/defs.h
+++ b/src/nvim/api/private/defs.h
@@ -49,32 +49,36 @@ typedef struct {
} Dictionary;
typedef enum {
+// The following comments are markers that msgpack-gen.lua uses to extract
+// types, don't remove!
+// start custom types
+ kObjectTypePosition,
+ kObjectTypeBuffer,
+ kObjectTypeWindow,
+ kObjectTypeTabpage,
+// end custom types
kObjectTypeNil,
kObjectTypeBoolean,
kObjectTypeInteger,
kObjectTypeFloat,
kObjectTypeString,
- kObjectTypeBuffer,
- kObjectTypeWindow,
- kObjectTypeTabpage,
kObjectTypeArray,
kObjectTypeDictionary,
- kObjectTypePosition,
} ObjectType;
struct object {
ObjectType type;
union {
+ Position position;
+ Buffer buffer;
+ Window window;
+ Tabpage tabpage;
Boolean boolean;
Integer integer;
Float floating;
String string;
- Buffer buffer;
- Window window;
- Tabpage tabpage;
Array array;
Dictionary dictionary;
- Position position;
} data;
};