aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/api/tabpage.c
diff options
context:
space:
mode:
authorThiago de Arruda <tpadilha84@gmail.com>2014-09-07 18:48:10 -0300
committerThiago de Arruda <tpadilha84@gmail.com>2014-09-12 13:25:28 -0300
commitd5a60d17fbca33ca96124288e69937a276d3abda (patch)
treefa849532d5b6fd2e54509fc8078d1e6797be9f3c /src/nvim/api/tabpage.c
parent505985b870b4b9d7cae07354518b28dd12ee5b6f (diff)
downloadrneovim-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/tabpage.c')
-rw-r--r--src/nvim/api/tabpage.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/nvim/api/tabpage.c b/src/nvim/api/tabpage.c
index 535722c087..901f9a6c1a 100644
--- a/src/nvim/api/tabpage.c
+++ b/src/nvim/api/tabpage.c
@@ -13,9 +13,9 @@
/// @param tabpage The tabpage
/// @param[out] err Details of an error that may have occurred
/// @return The number of windows in `tabpage`
-WindowArray tabpage_get_windows(Tabpage tabpage, Error *err)
+Array tabpage_get_windows(Tabpage tabpage, Error *err)
{
- WindowArray rv = ARRAY_DICT_INIT;
+ Array rv = ARRAY_DICT_INIT;
tabpage_T *tab = find_tab_by_handle(tabpage, err);
if (!tab) {
@@ -32,14 +32,14 @@ WindowArray tabpage_get_windows(Tabpage tabpage, Error *err)
rv.size++;
}
- rv.items = xmalloc(sizeof(Window) * rv.size);
+ rv.items = xmalloc(sizeof(Object) * rv.size);
size_t i = 0;
FOR_ALL_TAB_WINDOWS(tp, wp) {
if (tp != tab) {
break;
}
- rv.items[i++] = wp->handle;
+ rv.items[i++] = WINDOW_OBJ(wp->handle);
}
return rv;