mirror of
https://github.com/neovim/neovim.git
synced 2024-12-31 17:13:26 -07:00
api: always use prefix FUNC_API, also change NOEVAL to REMOTE_ONLY
This commit is contained in:
parent
3adcc0c50b
commit
2d5920ae1a
@ -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");
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
@ -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(';')
|
||||
)
|
||||
|
||||
|
@ -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
|
||||
|
@ -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',
|
||||
|
Loading…
Reference in New Issue
Block a user