aboutsummaryrefslogtreecommitdiff
path: root/scripts/msgpack-gen.lua
diff options
context:
space:
mode:
authorThiago de Arruda <tpadilha84@gmail.com>2014-05-26 13:39:08 -0300
committerThiago de Arruda <tpadilha84@gmail.com>2014-05-26 14:02:12 -0300
commit139c7ffdc785b19297e8c3b2d2586dfa284f97a5 (patch)
tree79426fb6758f3206b5ae07de2d8eb3b364c5fb5f /scripts/msgpack-gen.lua
parent7a00caf7c40e8526db2c75cd4c1445b624023728 (diff)
downloadrneovim-139c7ffdc785b19297e8c3b2d2586dfa284f97a5.tar.gz
rneovim-139c7ffdc785b19297e8c3b2d2586dfa284f97a5.tar.bz2
rneovim-139c7ffdc785b19297e8c3b2d2586dfa284f97a5.zip
API: Events: Return channel id from the API discover request
This refactors msgapck_rpc_{dipatch,call} to receive the channel id as argument. Now the discovery request returns the [id, metadata] array.
Diffstat (limited to 'scripts/msgpack-gen.lua')
-rw-r--r--scripts/msgpack-gen.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/scripts/msgpack-gen.lua b/scripts/msgpack-gen.lua
index d303fde2fc..3cc1558fd7 100644
--- a/scripts/msgpack-gen.lua
+++ b/scripts/msgpack-gen.lua
@@ -111,7 +111,7 @@ end
output:write([[
};
-void msgpack_rpc_dispatch(msgpack_object *req, msgpack_packer *res)
+void msgpack_rpc_dispatch(uint64_t id, msgpack_object *req, msgpack_packer *res)
{
Error error = { .set = false };
uint64_t method_id = (uint32_t)req->via.array.ptr[2].via.u64;
@@ -119,7 +119,9 @@ void msgpack_rpc_dispatch(msgpack_object *req, msgpack_packer *res)
switch (method_id) {
case 0:
msgpack_pack_nil(res);
- // The result is the `msgpack_metadata` byte array
+ // The result is the [channel_id, metadata] array
+ msgpack_pack_array(res, 2);
+ msgpack_pack_uint64(res, id);
msgpack_pack_raw(res, sizeof(msgpack_metadata));
msgpack_pack_raw_body(res, msgpack_metadata, sizeof(msgpack_metadata));
return;