From e536abc1e1f59d1ac012e1be576bf55175e95443 Mon Sep 17 00:00:00 2001 From: Björn Linse Date: Mon, 20 Jun 2016 14:40:57 +0200 Subject: api: Allow blacklist functions that shouldn't be accesible from eval Blacklist deprecated functions and functions depending on channel_id --- src/nvim/api/ui.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/nvim/api/ui.c') diff --git a/src/nvim/api/ui.c b/src/nvim/api/ui.c index 2b131443d3..5426ccc8aa 100644 --- a/src/nvim/api/ui.c +++ b/src/nvim/api/ui.c @@ -48,6 +48,7 @@ void remote_ui_disconnect(uint64_t channel_id) void nvim_ui_attach(uint64_t channel_id, Integer width, Integer height, Dictionary options, Error *err) + FUNC_API_NOEVAL { if (pmap_has(uint64_t)(connected_uis, channel_id)) { api_set_error(err, Exception, _("UI already attached for channel")); @@ -117,6 +118,7 @@ void ui_attach(uint64_t channel_id, Integer width, Integer height, } void nvim_ui_detach(uint64_t channel_id, Error *err) + FUNC_API_NOEVAL { if (!pmap_has(uint64_t)(connected_uis, channel_id)) { api_set_error(err, Exception, _("UI is not attached for channel")); @@ -133,6 +135,7 @@ void ui_detach(uint64_t channel_id, Error *err) void nvim_ui_try_resize(uint64_t channel_id, Integer width, Integer height, Error *err) + FUNC_API_NOEVAL { if (!pmap_has(uint64_t)(connected_uis, channel_id)) { api_set_error(err, Exception, _("UI is not attached for channel")); @@ -159,7 +162,9 @@ void ui_try_resize(uint64_t channel_id, Integer width, } void nvim_ui_set_option(uint64_t channel_id, String name, - Object value, Error *error) { + Object value, Error *error) + FUNC_API_NOEVAL +{ if (!pmap_has(uint64_t)(connected_uis, channel_id)) { api_set_error(error, Exception, _("UI is not attached for channel")); return; -- cgit From 1c22cab2fd283db49bfdbeaea490747574a36049 Mon Sep 17 00:00:00 2001 From: Björn Linse Date: Tue, 28 Jun 2016 21:45:19 +0200 Subject: api: consistently use nvim_ prefix and update documentation --- src/nvim/api/ui.c | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'src/nvim/api/ui.c') diff --git a/src/nvim/api/ui.c b/src/nvim/api/ui.c index 5426ccc8aa..56b41f1eea 100644 --- a/src/nvim/api/ui.c +++ b/src/nvim/api/ui.c @@ -127,11 +127,6 @@ void nvim_ui_detach(uint64_t channel_id, Error *err) remote_ui_disconnect(channel_id); } -/// @deprecated -void ui_detach(uint64_t channel_id, Error *err) -{ - nvim_ui_detach(channel_id, err); -} void nvim_ui_try_resize(uint64_t channel_id, Integer width, Integer height, Error *err) @@ -154,13 +149,6 @@ void nvim_ui_try_resize(uint64_t channel_id, Integer width, ui_refresh(); } -/// @deprecated -void ui_try_resize(uint64_t channel_id, Integer width, - Integer height, Error *err) -{ - nvim_ui_try_resize(channel_id, width, height, err); -} - void nvim_ui_set_option(uint64_t channel_id, String name, Object value, Error *error) FUNC_API_NOEVAL -- cgit