mirror of
https://github.com/neovim/neovim.git
synced 2025-09-11 13:58:18 +00:00
api: always use prefix FUNC_API, also change NOEVAL to REMOTE_ONLY
This commit is contained in:
@@ -53,7 +53,7 @@ void remote_ui_disconnect(uint64_t channel_id)
|
|||||||
|
|
||||||
void nvim_ui_attach(uint64_t channel_id, Integer width, Integer height,
|
void nvim_ui_attach(uint64_t channel_id, Integer width, Integer height,
|
||||||
Dictionary options, Error *err)
|
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)) {
|
if (pmap_has(uint64_t)(connected_uis, channel_id)) {
|
||||||
api_set_error(err, kErrorTypeException, "UI already attached for channel");
|
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)
|
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)) {
|
if (!pmap_has(uint64_t)(connected_uis, channel_id)) {
|
||||||
api_set_error(err, kErrorTypeException, "UI is not attached for channel");
|
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,
|
void nvim_ui_try_resize(uint64_t channel_id, Integer width,
|
||||||
Integer height, Error *err)
|
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)) {
|
if (!pmap_has(uint64_t)(connected_uis, channel_id)) {
|
||||||
api_set_error(err, kErrorTypeException, "UI is not attached for channel");
|
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,
|
void nvim_ui_set_option(uint64_t channel_id, String name,
|
||||||
Object value, Error *error)
|
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)) {
|
if (!pmap_has(uint64_t)(connected_uis, channel_id)) {
|
||||||
api_set_error(error, kErrorTypeException, "UI is not attached for channel");
|
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)
|
void scroll(Integer count)
|
||||||
FUNC_API_SINCE(3);
|
FUNC_API_SINCE(3);
|
||||||
void highlight_set(HlAttrs attrs)
|
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)
|
void put(String str)
|
||||||
FUNC_API_SINCE(3);
|
FUNC_API_SINCE(3);
|
||||||
void bell(void)
|
void bell(void)
|
||||||
@@ -45,7 +45,7 @@ void bell(void)
|
|||||||
void visual_bell(void)
|
void visual_bell(void)
|
||||||
FUNC_API_SINCE(3);
|
FUNC_API_SINCE(3);
|
||||||
void flush(void)
|
void flush(void)
|
||||||
FUNC_API_SINCE(3) REMOTE_IMPL;
|
FUNC_API_SINCE(3) FUNC_API_REMOTE_IMPL;
|
||||||
void update_fg(Integer fg)
|
void update_fg(Integer fg)
|
||||||
FUNC_API_SINCE(3);
|
FUNC_API_SINCE(3);
|
||||||
void update_bg(Integer bg)
|
void update_bg(Integer bg)
|
||||||
@@ -53,19 +53,19 @@ void update_bg(Integer bg)
|
|||||||
void update_sp(Integer sp)
|
void update_sp(Integer sp)
|
||||||
FUNC_API_SINCE(3);
|
FUNC_API_SINCE(3);
|
||||||
void suspend(void)
|
void suspend(void)
|
||||||
FUNC_API_SINCE(3) BRIDGE_IMPL;
|
FUNC_API_SINCE(3) FUNC_API_BRIDGE_IMPL;
|
||||||
void set_title(String title)
|
void set_title(String title)
|
||||||
FUNC_API_SINCE(3);
|
FUNC_API_SINCE(3);
|
||||||
void set_icon(String icon)
|
void set_icon(String icon)
|
||||||
FUNC_API_SINCE(3);
|
FUNC_API_SINCE(3);
|
||||||
|
|
||||||
void popupmenu_show(Array items, Integer selected, Integer row, Integer col)
|
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)
|
void popupmenu_hide(void)
|
||||||
FUNC_API_SINCE(3) REMOTE_ONLY;
|
FUNC_API_SINCE(3) FUNC_API_REMOTE_ONLY;
|
||||||
void popupmenu_select(Integer selected)
|
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)
|
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
|
#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 channel_id Channel id (passed automatically by the dispatcher)
|
||||||
/// @param event Event type string
|
/// @param event Event type string
|
||||||
void nvim_subscribe(uint64_t channel_id, String event)
|
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);
|
size_t length = (event.size < METHOD_MAXLEN ? event.size : METHOD_MAXLEN);
|
||||||
char e[METHOD_MAXLEN + 1];
|
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 channel_id Channel id (passed automatically by the dispatcher)
|
||||||
/// @param event Event type string
|
/// @param event Event type string
|
||||||
void nvim_unsubscribe(uint64_t channel_id, String event)
|
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 ?
|
size_t length = (event.size < METHOD_MAXLEN ?
|
||||||
event.size :
|
event.size :
|
||||||
@@ -722,7 +722,7 @@ Dictionary nvim_get_mode(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
Array nvim_get_api_info(uint64_t channel_id)
|
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;
|
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
|
/// 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.
|
/// error ocurred, the values from all preceding calls will still be returned.
|
||||||
Array nvim_call_atomic(uint64_t channel_id, Array calls, Error *err)
|
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 rv = ARRAY_DICT_INIT;
|
||||||
Array results = ARRAY_DICT_INIT;
|
Array results = ARRAY_DICT_INIT;
|
||||||
|
@@ -181,7 +181,7 @@
|
|||||||
#ifdef DEFINE_FUNC_ATTRIBUTES
|
#ifdef DEFINE_FUNC_ATTRIBUTES
|
||||||
# define FUNC_API_ASYNC
|
# define FUNC_API_ASYNC
|
||||||
# define FUNC_API_NOEXPORT
|
# define FUNC_API_NOEXPORT
|
||||||
# define FUNC_API_NOEVAL
|
# define FUNC_API_REMOTE_ONLY
|
||||||
# define FUNC_API_SINCE(X)
|
# define FUNC_API_SINCE(X)
|
||||||
# define FUNC_API_DEPRECATED_SINCE(X)
|
# define FUNC_API_DEPRECATED_SINCE(X)
|
||||||
# define FUNC_ATTR_MALLOC REAL_FATTR_MALLOC
|
# define FUNC_ATTR_MALLOC REAL_FATTR_MALLOC
|
||||||
|
@@ -40,10 +40,9 @@ local c_proto = Ct(
|
|||||||
'deprecated_since') ^ -1) *
|
'deprecated_since') ^ -1) *
|
||||||
(fill * Cg((P('FUNC_API_ASYNC') * Cc(true)), 'async') ^ -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_NOEXPORT') * Cc(true)), 'noexport') ^ -1) *
|
||||||
(fill * Cg((P('FUNC_API_NOEVAL') * Cc(true)), 'noeval') ^ -1) *
|
(fill * Cg((P('FUNC_API_REMOTE_ONLY') * Cc(true)), 'remote_only') ^ -1) *
|
||||||
(fill * Cg((P('REMOTE_ONLY') * Cc(true)), 'remote_only') ^ -1) *
|
(fill * Cg((P('FUNC_API_REMOTE_IMPL') * Cc(true)), 'remote_impl') ^ -1) *
|
||||||
(fill * Cg((P('REMOTE_IMPL') * Cc(true)), 'remote_impl') ^ -1) *
|
(fill * Cg((P('FUNC_API_BRIDGE_IMPL') * Cc(true)), 'bridge_impl') ^ -1) *
|
||||||
(fill * Cg((P('BRIDGE_IMPL') * Cc(true)), 'bridge_impl') ^ -1) *
|
|
||||||
fill * P(';')
|
fill * P(';')
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@@ -105,7 +105,7 @@ for i,f in ipairs(shallowcopy(functions)) do
|
|||||||
ismethod = true
|
ismethod = true
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
f.noeval = true
|
f.remote_only = true
|
||||||
f.since = 0
|
f.since = 0
|
||||||
f.deprecated_since = 1
|
f.deprecated_since = 1
|
||||||
end
|
end
|
||||||
@@ -127,7 +127,7 @@ for i,f in ipairs(shallowcopy(functions)) do
|
|||||||
newf.return_type = "Object"
|
newf.return_type = "Object"
|
||||||
end
|
end
|
||||||
newf.impl_name = f.name
|
newf.impl_name = f.name
|
||||||
newf.noeval = true
|
newf.remote_only = true
|
||||||
newf.since = 0
|
newf.since = 0
|
||||||
newf.deprecated_since = 1
|
newf.deprecated_since = 1
|
||||||
functions[#functions+1] = newf
|
functions[#functions+1] = newf
|
||||||
@@ -432,7 +432,7 @@ local function process_function(fn)
|
|||||||
end
|
end
|
||||||
|
|
||||||
for _, fn in ipairs(functions) do
|
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)
|
process_function(fn)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@@ -25,7 +25,7 @@ local gperfpipe = io.open(funcsfname .. '.gperf', 'wb')
|
|||||||
local funcs = require('eval').funcs
|
local funcs = require('eval').funcs
|
||||||
local metadata = mpack.unpack(io.open(arg[3], 'rb'):read("*all"))
|
local metadata = mpack.unpack(io.open(arg[3], 'rb'):read("*all"))
|
||||||
for i,fun in ipairs(metadata) do
|
for i,fun in ipairs(metadata) do
|
||||||
if not fun.noeval then
|
if not fun.remote_only then
|
||||||
funcs[fun.name] = {
|
funcs[fun.name] = {
|
||||||
args=#fun.parameters,
|
args=#fun.parameters,
|
||||||
func='api_wrapper',
|
func='api_wrapper',
|
||||||
|
Reference in New Issue
Block a user