diff options
author | Björn Linse <bjorn.linse@gmail.com> | 2017-05-10 10:29:43 +0200 |
---|---|---|
committer | Björn Linse <bjorn.linse@gmail.com> | 2017-05-10 17:37:34 +0200 |
commit | 2d5920ae1ada751811e04bcc8d3a8fe4f890617a (patch) | |
tree | 294effe35254d53766dfe2358415f26e8dd61cb9 /src | |
parent | 3adcc0c50bd40e80928f1c96a908ce65def16fe9 (diff) | |
download | rneovim-2d5920ae1ada751811e04bcc8d3a8fe4f890617a.tar.gz rneovim-2d5920ae1ada751811e04bcc8d3a8fe4f890617a.tar.bz2 rneovim-2d5920ae1ada751811e04bcc8d3a8fe4f890617a.zip |
api: always use prefix FUNC_API, also change NOEVAL to REMOTE_ONLY
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/api/ui.c | 8 | ||||
-rw-r--r-- | src/nvim/api/ui_events.in.h | 14 | ||||
-rw-r--r-- | src/nvim/api/vim.c | 8 | ||||
-rw-r--r-- | src/nvim/func_attr.h | 2 | ||||
-rw-r--r-- | src/nvim/generators/c_grammar.lua | 7 | ||||
-rw-r--r-- | src/nvim/generators/gen_api_dispatch.lua | 6 | ||||
-rw-r--r-- | src/nvim/generators/gen_eval.lua | 2 |
7 files changed, 23 insertions, 24 deletions
diff --git a/src/nvim/api/ui.c b/src/nvim/api/ui.c index 29d077da82..1b29f2fc78 100644 --- a/src/nvim/api/ui.c +++ b/src/nvim/api/ui.c @@ -53,7 +53,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_SINCE(1) FUNC_API_NOEVAL + FUNC_API_SINCE(1) FUNC_API_REMOTE_ONLY { if (pmap_has(uint64_t)(connected_uis, channel_id)) { api_set_error(err, kErrorTypeException, "UI already attached for channel"); @@ -125,7 +125,7 @@ void ui_attach(uint64_t channel_id, Integer width, Integer height, } void nvim_ui_detach(uint64_t channel_id, Error *err) - FUNC_API_SINCE(1) FUNC_API_NOEVAL + FUNC_API_SINCE(1) FUNC_API_REMOTE_ONLY { if (!pmap_has(uint64_t)(connected_uis, channel_id)) { api_set_error(err, kErrorTypeException, "UI is not attached for channel"); @@ -137,7 +137,7 @@ void nvim_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_SINCE(1) FUNC_API_NOEVAL + FUNC_API_SINCE(1) FUNC_API_REMOTE_ONLY { if (!pmap_has(uint64_t)(connected_uis, channel_id)) { api_set_error(err, kErrorTypeException, "UI is not attached for channel"); @@ -158,7 +158,7 @@ void nvim_ui_try_resize(uint64_t channel_id, Integer width, void nvim_ui_set_option(uint64_t channel_id, String name, Object value, Error *error) - FUNC_API_SINCE(1) FUNC_API_NOEVAL + FUNC_API_SINCE(1) FUNC_API_REMOTE_ONLY { if (!pmap_has(uint64_t)(connected_uis, channel_id)) { api_set_error(error, kErrorTypeException, "UI is not attached for channel"); diff --git a/src/nvim/api/ui_events.in.h b/src/nvim/api/ui_events.in.h index 02c81e649b..45d04335e4 100644 --- a/src/nvim/api/ui_events.in.h +++ b/src/nvim/api/ui_events.in.h @@ -37,7 +37,7 @@ void set_scroll_region(Integer top, Integer bot, Integer left, Integer right) void scroll(Integer count) FUNC_API_SINCE(3); void highlight_set(HlAttrs attrs) - FUNC_API_SINCE(3) REMOTE_IMPL BRIDGE_IMPL; + FUNC_API_SINCE(3) FUNC_API_REMOTE_IMPL FUNC_API_BRIDGE_IMPL; void put(String str) FUNC_API_SINCE(3); void bell(void) @@ -45,7 +45,7 @@ void bell(void) void visual_bell(void) FUNC_API_SINCE(3); void flush(void) - FUNC_API_SINCE(3) REMOTE_IMPL; + FUNC_API_SINCE(3) FUNC_API_REMOTE_IMPL; void update_fg(Integer fg) FUNC_API_SINCE(3); void update_bg(Integer bg) @@ -53,19 +53,19 @@ void update_bg(Integer bg) void update_sp(Integer sp) FUNC_API_SINCE(3); void suspend(void) - FUNC_API_SINCE(3) BRIDGE_IMPL; + FUNC_API_SINCE(3) FUNC_API_BRIDGE_IMPL; void set_title(String title) FUNC_API_SINCE(3); void set_icon(String icon) FUNC_API_SINCE(3); void popupmenu_show(Array items, Integer selected, Integer row, Integer col) - FUNC_API_SINCE(3) REMOTE_ONLY; + FUNC_API_SINCE(3) FUNC_API_REMOTE_ONLY; void popupmenu_hide(void) - FUNC_API_SINCE(3) REMOTE_ONLY; + FUNC_API_SINCE(3) FUNC_API_REMOTE_ONLY; void popupmenu_select(Integer selected) - FUNC_API_SINCE(3) REMOTE_ONLY; + FUNC_API_SINCE(3) FUNC_API_REMOTE_ONLY; void tabline_update(Tabpage current, Array tabs) - FUNC_API_SINCE(3) REMOTE_ONLY; + FUNC_API_SINCE(3) FUNC_API_REMOTE_ONLY; #endif // NVIM_API_UI_EVENTS_IN_H diff --git a/src/nvim/api/vim.c b/src/nvim/api/vim.c index 12e8194c15..d0bb840b8d 100644 --- a/src/nvim/api/vim.c +++ b/src/nvim/api/vim.c @@ -659,7 +659,7 @@ void nvim_set_current_tabpage(Tabpage tabpage, Error *err) /// @param channel_id Channel id (passed automatically by the dispatcher) /// @param event Event type string void nvim_subscribe(uint64_t channel_id, String event) - FUNC_API_SINCE(1) FUNC_API_NOEVAL + FUNC_API_SINCE(1) FUNC_API_REMOTE_ONLY { size_t length = (event.size < METHOD_MAXLEN ? event.size : METHOD_MAXLEN); char e[METHOD_MAXLEN + 1]; @@ -673,7 +673,7 @@ void nvim_subscribe(uint64_t channel_id, String event) /// @param channel_id Channel id (passed automatically by the dispatcher) /// @param event Event type string void nvim_unsubscribe(uint64_t channel_id, String event) - FUNC_API_SINCE(1) FUNC_API_NOEVAL + FUNC_API_SINCE(1) FUNC_API_REMOTE_ONLY { size_t length = (event.size < METHOD_MAXLEN ? event.size : @@ -722,7 +722,7 @@ Dictionary nvim_get_mode(void) } Array nvim_get_api_info(uint64_t channel_id) - FUNC_API_SINCE(1) FUNC_API_ASYNC FUNC_API_NOEVAL + FUNC_API_SINCE(1) FUNC_API_ASYNC FUNC_API_REMOTE_ONLY { Array rv = ARRAY_DICT_INIT; @@ -755,7 +755,7 @@ Array nvim_get_api_info(uint64_t channel_id) /// which resulted in an error, the error type and the error message. If an /// error ocurred, the values from all preceding calls will still be returned. Array nvim_call_atomic(uint64_t channel_id, Array calls, Error *err) - FUNC_API_SINCE(1) FUNC_API_NOEVAL + FUNC_API_SINCE(1) FUNC_API_REMOTE_ONLY { Array rv = ARRAY_DICT_INIT; Array results = ARRAY_DICT_INIT; diff --git a/src/nvim/func_attr.h b/src/nvim/func_attr.h index 1049b5b7a6..9146a1a8ea 100644 --- a/src/nvim/func_attr.h +++ b/src/nvim/func_attr.h @@ -181,7 +181,7 @@ #ifdef DEFINE_FUNC_ATTRIBUTES # define FUNC_API_ASYNC # define FUNC_API_NOEXPORT -# define FUNC_API_NOEVAL +# define FUNC_API_REMOTE_ONLY # define FUNC_API_SINCE(X) # define FUNC_API_DEPRECATED_SINCE(X) # define FUNC_ATTR_MALLOC REAL_FATTR_MALLOC diff --git a/src/nvim/generators/c_grammar.lua b/src/nvim/generators/c_grammar.lua index 5c52ec5930..d3047e1a9c 100644 --- a/src/nvim/generators/c_grammar.lua +++ b/src/nvim/generators/c_grammar.lua @@ -40,10 +40,9 @@ local c_proto = Ct( 'deprecated_since') ^ -1) * (fill * Cg((P('FUNC_API_ASYNC') * Cc(true)), 'async') ^ -1) * (fill * Cg((P('FUNC_API_NOEXPORT') * Cc(true)), 'noexport') ^ -1) * - (fill * Cg((P('FUNC_API_NOEVAL') * Cc(true)), 'noeval') ^ -1) * - (fill * Cg((P('REMOTE_ONLY') * Cc(true)), 'remote_only') ^ -1) * - (fill * Cg((P('REMOTE_IMPL') * Cc(true)), 'remote_impl') ^ -1) * - (fill * Cg((P('BRIDGE_IMPL') * Cc(true)), 'bridge_impl') ^ -1) * + (fill * Cg((P('FUNC_API_REMOTE_ONLY') * Cc(true)), 'remote_only') ^ -1) * + (fill * Cg((P('FUNC_API_REMOTE_IMPL') * Cc(true)), 'remote_impl') ^ -1) * + (fill * Cg((P('FUNC_API_BRIDGE_IMPL') * Cc(true)), 'bridge_impl') ^ -1) * fill * P(';') ) diff --git a/src/nvim/generators/gen_api_dispatch.lua b/src/nvim/generators/gen_api_dispatch.lua index 7adefbfc15..b01321e713 100644 --- a/src/nvim/generators/gen_api_dispatch.lua +++ b/src/nvim/generators/gen_api_dispatch.lua @@ -105,7 +105,7 @@ for i,f in ipairs(shallowcopy(functions)) do ismethod = true end else - f.noeval = true + f.remote_only = true f.since = 0 f.deprecated_since = 1 end @@ -127,7 +127,7 @@ for i,f in ipairs(shallowcopy(functions)) do newf.return_type = "Object" end newf.impl_name = f.name - newf.noeval = true + newf.remote_only = true newf.since = 0 newf.deprecated_since = 1 functions[#functions+1] = newf @@ -432,7 +432,7 @@ local function process_function(fn) end for _, fn in ipairs(functions) do - if not fn.noeval or fn.name:sub(1, 4) == '_vim' then + if not fn.remote_only or fn.name:sub(1, 4) == '_vim' then process_function(fn) end end diff --git a/src/nvim/generators/gen_eval.lua b/src/nvim/generators/gen_eval.lua index b17ecb1a0c..23435a1d0b 100644 --- a/src/nvim/generators/gen_eval.lua +++ b/src/nvim/generators/gen_eval.lua @@ -25,7 +25,7 @@ local gperfpipe = io.open(funcsfname .. '.gperf', 'wb') local funcs = require('eval').funcs local metadata = mpack.unpack(io.open(arg[3], 'rb'):read("*all")) for i,fun in ipairs(metadata) do - if not fun.noeval then + if not fun.remote_only then funcs[fun.name] = { args=#fun.parameters, func='api_wrapper', |