diff options
author | Thiago de Arruda <tpadilha84@gmail.com> | 2014-09-07 18:48:10 -0300 |
---|---|---|
committer | Thiago de Arruda <tpadilha84@gmail.com> | 2014-09-12 13:25:28 -0300 |
commit | d5a60d17fbca33ca96124288e69937a276d3abda (patch) | |
tree | fa849532d5b6fd2e54509fc8078d1e6797be9f3c /src/nvim/api/private/defs.h | |
parent | 505985b870b4b9d7cae07354518b28dd12ee5b6f (diff) | |
download | rneovim-d5a60d17fbca33ca96124288e69937a276d3abda.tar.gz rneovim-d5a60d17fbca33ca96124288e69937a276d3abda.tar.bz2 rneovim-d5a60d17fbca33ca96124288e69937a276d3abda.zip |
api/msgpack-rpc: Remove specialized array types
Specialized array types(BufferArray, WindowArray, etc) were added to the API for
two main reasons:
- msgpack used to lack a way of serializing appliaction-specific types and there
was no obvious way of making an API function accept/return arrays of custom
objects such as buffers(which are represented as integers, so clients didn't
have a way to distinguish from normal numbers)
- Let clients in statically-typed languages that support generics have a better
typed API
With msgpack 2.0 EXT type the first item is no longer a factor and this commit
starts by removing the specialized array types. The second item will be
addressed in the future by making the API metadata return extra useful
information for statically-typed languages.
Diffstat (limited to 'src/nvim/api/private/defs.h')
-rw-r--r-- | src/nvim/api/private/defs.h | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/src/nvim/api/private/defs.h b/src/nvim/api/private/defs.h index b049412014..071563a628 100644 --- a/src/nvim/api/private/defs.h +++ b/src/nvim/api/private/defs.h @@ -11,12 +11,6 @@ #define POSITION_INIT { .row = 0, .col = 0 } #define REMOTE_TYPE(type) typedef uint64_t type -#define TYPED_ARRAY_OF(type) \ - typedef struct { \ - type *items; \ - size_t size; \ - } type##Array - // Basic types typedef struct { char msg[256]; @@ -38,11 +32,6 @@ REMOTE_TYPE(Tabpage); typedef struct object Object; -TYPED_ARRAY_OF(Buffer); -TYPED_ARRAY_OF(Window); -TYPED_ARRAY_OF(Tabpage); -TYPED_ARRAY_OF(String); - typedef struct { Integer row, col; } Position; @@ -71,10 +60,6 @@ typedef enum { kObjectTypeArray, kObjectTypeDictionary, kObjectTypePosition, - kObjectTypeStringArray, - kObjectTypeBufferArray, - kObjectTypeWindowArray, - kObjectTypeTabpageArray, } ObjectType; struct object { @@ -90,10 +75,6 @@ struct object { Array array; Dictionary dictionary; Position position; - StringArray stringarray; - BufferArray bufferarray; - WindowArray windowarray; - TabpageArray tabpagearray; } data; }; |