mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
Add empty implementations of the remote API
This commit is contained in:
parent
a68ca46382
commit
eab3a4fafb
112
src/api.c
Normal file
112
src/api.c
Normal file
@ -0,0 +1,112 @@
|
|||||||
|
#include <stdint.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#include "api.h"
|
||||||
|
|
||||||
|
void api_push_keys(char *str)
|
||||||
|
{
|
||||||
|
abort();
|
||||||
|
}
|
||||||
|
|
||||||
|
void api_command(char *str)
|
||||||
|
{
|
||||||
|
abort();
|
||||||
|
}
|
||||||
|
|
||||||
|
void api_eval(char *str)
|
||||||
|
{
|
||||||
|
abort();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t api_bind_eval(char *str)
|
||||||
|
{
|
||||||
|
abort();
|
||||||
|
}
|
||||||
|
|
||||||
|
char **api_list_runtime_paths()
|
||||||
|
{
|
||||||
|
abort();
|
||||||
|
}
|
||||||
|
|
||||||
|
char **api_list_buffers(void)
|
||||||
|
{
|
||||||
|
abort();
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
char **api_list_windows(void)
|
||||||
|
{
|
||||||
|
abort();
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
char **api_list_tabpages(void)
|
||||||
|
{
|
||||||
|
abort();
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
char *api_get_current_line(void)
|
||||||
|
{
|
||||||
|
abort();
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t api_get_current_buffer(void)
|
||||||
|
{
|
||||||
|
abort();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t api_get_current_window(void)
|
||||||
|
{
|
||||||
|
abort();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t api_get_current_tabpage(void)
|
||||||
|
{
|
||||||
|
abort();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void api_set_current_line(char *line)
|
||||||
|
{
|
||||||
|
abort();
|
||||||
|
}
|
||||||
|
|
||||||
|
void api_set_current_buffer(uint32_t id)
|
||||||
|
{
|
||||||
|
abort();
|
||||||
|
}
|
||||||
|
|
||||||
|
void api_set_current_window(uint32_t id)
|
||||||
|
{
|
||||||
|
abort();
|
||||||
|
}
|
||||||
|
|
||||||
|
void api_set_current_tabpage(uint32_t id)
|
||||||
|
{
|
||||||
|
abort();
|
||||||
|
}
|
||||||
|
|
||||||
|
char *api_get_option(char *name)
|
||||||
|
{
|
||||||
|
abort();
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
void api_set_option(char *name, char *value)
|
||||||
|
{
|
||||||
|
abort();
|
||||||
|
}
|
||||||
|
|
||||||
|
void api_out_write(char *str)
|
||||||
|
{
|
||||||
|
abort();
|
||||||
|
}
|
||||||
|
|
||||||
|
void api_err_write(char *str)
|
||||||
|
{
|
||||||
|
abort();
|
||||||
|
}
|
114
src/api.h
Normal file
114
src/api.h
Normal file
@ -0,0 +1,114 @@
|
|||||||
|
#ifndef NEOVIM_API_H
|
||||||
|
#define NEOVIM_API_H
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
/// Send keys to vim input buffer, simulating user input.
|
||||||
|
///
|
||||||
|
/// @param str The keys to send
|
||||||
|
void api_push_keys(char *str);
|
||||||
|
|
||||||
|
/// Executes an ex-mode command str
|
||||||
|
///
|
||||||
|
/// @param str The command str
|
||||||
|
void api_command(char *str);
|
||||||
|
|
||||||
|
/// Evaluates the expression str using the vim internal expression
|
||||||
|
/// evaluator (see |expression|). Returns the expression result as:
|
||||||
|
/// - a string if the Vim expression evaluates to a string or number
|
||||||
|
/// - a list if the Vim expression evaluates to a Vim list
|
||||||
|
/// - a dictionary if the Vim expression evaluates to a Vim dictionary
|
||||||
|
/// Dictionaries and lists are recursively expanded.
|
||||||
|
///
|
||||||
|
/// @param str The expression str
|
||||||
|
void api_eval(char *str);
|
||||||
|
|
||||||
|
/// Like eval, but returns special object ids that can be used to interact
|
||||||
|
/// with the real objects remotely.
|
||||||
|
//
|
||||||
|
/// @param str The expression str
|
||||||
|
uint32_t api_bind_eval(char *str);
|
||||||
|
|
||||||
|
/// Returns a list of paths contained in 'runtimepath'
|
||||||
|
///
|
||||||
|
/// @return The list of paths
|
||||||
|
char **api_list_runtime_paths(void);
|
||||||
|
|
||||||
|
/// Return a list of buffers
|
||||||
|
///
|
||||||
|
/// @return the list of buffers
|
||||||
|
char **api_list_buffers(void);
|
||||||
|
|
||||||
|
/// Return a list of windows
|
||||||
|
///
|
||||||
|
/// @return the list of windows
|
||||||
|
char **api_list_windows(void);
|
||||||
|
|
||||||
|
/// Return a list of tabpages
|
||||||
|
///
|
||||||
|
/// @return the list of tabpages
|
||||||
|
char **api_list_tabpages(void);
|
||||||
|
|
||||||
|
/// Return the current line
|
||||||
|
///
|
||||||
|
/// @return The current line
|
||||||
|
char *api_get_current_line(void);
|
||||||
|
|
||||||
|
/// Return the current buffer
|
||||||
|
///
|
||||||
|
/// @return The current buffer
|
||||||
|
uint32_t api_get_current_buffer(void);
|
||||||
|
|
||||||
|
/// Return the current window
|
||||||
|
///
|
||||||
|
/// @return The current window
|
||||||
|
uint32_t api_get_current_window(void);
|
||||||
|
|
||||||
|
/// Return the current tabpage
|
||||||
|
///
|
||||||
|
/// @return The current tabpage
|
||||||
|
uint32_t api_get_current_tabpage(void);
|
||||||
|
|
||||||
|
/// Sets the current line
|
||||||
|
///
|
||||||
|
/// @param line The line contents
|
||||||
|
void api_set_current_line(char *line);
|
||||||
|
|
||||||
|
/// Sets the current buffer
|
||||||
|
///
|
||||||
|
/// @param id The buffer id
|
||||||
|
void api_set_current_buffer(uint32_t id);
|
||||||
|
|
||||||
|
/// Sets the current window
|
||||||
|
///
|
||||||
|
/// @param id The window id
|
||||||
|
void api_set_current_window(uint32_t id);
|
||||||
|
|
||||||
|
/// Sets the current tabpage
|
||||||
|
///
|
||||||
|
/// @param id The tabpage id
|
||||||
|
void api_set_current_tabpage(uint32_t id);
|
||||||
|
|
||||||
|
/// Get an option value string
|
||||||
|
///
|
||||||
|
/// @param name The option name
|
||||||
|
char *api_get_option(char *name);
|
||||||
|
|
||||||
|
/// Get an option value string
|
||||||
|
///
|
||||||
|
/// @param name The option name
|
||||||
|
/// @param value The new option value
|
||||||
|
void api_set_option(char *name, char *value);
|
||||||
|
|
||||||
|
/// Write a message to vim output buffer
|
||||||
|
///
|
||||||
|
/// @param str The message
|
||||||
|
void api_out_write(char *str);
|
||||||
|
|
||||||
|
/// Write a message to vim error buffer
|
||||||
|
///
|
||||||
|
/// @param str The message
|
||||||
|
void api_err_write(char *str);
|
||||||
|
|
||||||
|
#endif // NEOVIM_API_H
|
||||||
|
|
Loading…
Reference in New Issue
Block a user