aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/api/vim.c
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/vim.c
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/vim.c')
-rw-r--r--src/nvim/api/vim.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/nvim/api/vim.c b/src/nvim/api/vim.c
index c0a9fe3410..43f2aafdc8 100644
--- a/src/nvim/api/vim.c
+++ b/src/nvim/api/vim.c
@@ -149,7 +149,7 @@ Integer vim_strwidth(String str, Error *err)
/// Returns a list of paths contained in 'runtimepath'
///
/// @return The list of paths
-Array vim_list_runtime_paths(void)
+ArrayOf(String) vim_list_runtime_paths(void)
{
Array rv = ARRAY_DICT_INIT;
uint8_t *rtp = p_rtp;
@@ -321,7 +321,7 @@ void vim_report_error(String str)
/// Gets the current list of buffer handles
///
/// @return The number of buffers
-Array vim_get_buffers(void)
+ArrayOf(Buffer) vim_get_buffers(void)
{
Array rv = ARRAY_DICT_INIT;
buf_T *b = firstbuf;
@@ -381,7 +381,7 @@ void vim_set_current_buffer(Buffer buffer, Error *err)
/// Gets the current list of window handles
///
/// @return The number of windows
-Array vim_get_windows(void)
+ArrayOf(Window) vim_get_windows(void)
{
Array rv = ARRAY_DICT_INIT;
tabpage_T *tp;
@@ -437,7 +437,7 @@ void vim_set_current_window(Window window, Error *err)
/// Gets the current list of tabpage handles
///
/// @return The number of tab pages
-Array vim_get_tabpages(void)
+ArrayOf(Tabpage) vim_get_tabpages(void)
{
Array rv = ARRAY_DICT_INIT;
tabpage_T *tp = first_tabpage;