aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/api/private/defs.h
diff options
context:
space:
mode:
authorThiago de Arruda <tpadilha84@gmail.com>2014-09-12 11:24:01 -0300
committerThiago de Arruda <tpadilha84@gmail.com>2014-09-12 13:50:07 -0300
commit545acf2024ea2653ae6937d570a37aa0340caa5e (patch)
tree7440aa48e60919082e235ea0ff1a550ba1904d5c /src/nvim/api/private/defs.h
parentcd2e46c0785d40b9ea15f6d722a3fad54c007b9b (diff)
downloadrneovim-545acf2024ea2653ae6937d570a37aa0340caa5e.tar.gz
rneovim-545acf2024ea2653ae6937d570a37aa0340caa5e.tar.bz2
rneovim-545acf2024ea2653ae6937d570a37aa0340caa5e.zip
api metadata: Allow typed container information in api functions
Adapt gendeclarations.lua/msgpack-gen.lua to allow the `ArrayOf(...)` and `DictionaryOf(...)` types in function headers. These are simple macros that expand to Array and Dictionary respectively, but the information is kept in the metadata object, which is useful for building clients in statically typed languages.
Diffstat (limited to 'src/nvim/api/private/defs.h')
-rw-r--r--src/nvim/api/private/defs.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/nvim/api/private/defs.h b/src/nvim/api/private/defs.h
index cf559a372e..2dd229ec5f 100644
--- a/src/nvim/api/private/defs.h
+++ b/src/nvim/api/private/defs.h
@@ -10,6 +10,11 @@
#define OBJECT_INIT { .type = kObjectTypeNil }
#define REMOTE_TYPE(type) typedef uint64_t type
+#ifdef INCLUDE_GENERATED_DECLARATIONS
+ #define ArrayOf(...) Array
+ #define DictionaryOf(...) Dictionary
+#endif
+
// Basic types
typedef struct {
char msg[256];