From 880957ad4e3fc0ff681025f5e29c5eccf797c564 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sat, 10 May 2014 00:53:36 +0400 Subject: Move documentation from function declarations to definitions Uses a perl script to move it (scripts/movedocs.pl) --- src/nvim/api/vim.h | 107 ----------------------------------------------------- 1 file changed, 107 deletions(-) (limited to 'src/nvim/api/vim.h') diff --git a/src/nvim/api/vim.h b/src/nvim/api/vim.h index 4d1ac9023e..426acf7f50 100644 --- a/src/nvim/api/vim.h +++ b/src/nvim/api/vim.h @@ -6,165 +6,58 @@ #include "nvim/api/private/defs.h" -/// Send keys to vim input buffer, simulating user input. -/// -/// @param str The keys to send void vim_push_keys(String str); -/// Executes an ex-mode command str -/// -/// @param str The command str -/// @param[out] err Details of an error that may have occurred void vim_command(String str, Error *err); -/// Evaluates the expression str using the vim internal expression -/// evaluator (see |expression|). -/// Dictionaries and lists are recursively expanded. -/// -/// @param str The expression str -/// @param[out] err Details of an error that may have occurred -/// @return The expanded object Object vim_eval(String str, Error *err); -/// Calculates the number of display cells `str` occupies, tab is counted as -/// one cell. -/// -/// @param str Some text -/// @param[out] err Details of an error that may have occurred -/// @return The number of cells Integer vim_strwidth(String str, Error *err); -/// Returns a list of paths contained in 'runtimepath' -/// -/// @return The list of paths StringArray vim_list_runtime_paths(void); -/// Changes vim working directory -/// -/// @param dir The new working directory -/// @param[out] err Details of an error that may have occurred void vim_change_directory(String dir, Error *err); -/// Return the current line -/// -/// @param[out] err Details of an error that may have occurred -/// @return The current line string String vim_get_current_line(Error *err); -/// Delete the current line -/// -/// @param[out] err Details of an error that may have occurred void vim_del_current_line(Error *err); -/// Sets the current line -/// -/// @param line The line contents -/// @param[out] err Details of an error that may have occurred void vim_set_current_line(String line, Error *err); -/// Gets a global variable -/// -/// @param name The variable name -/// @param[out] err Details of an error that may have occurred -/// @return The variable value Object vim_get_var(String name, Error *err); -/// Sets a global variable. Passing 'nil' as value deletes the variable. -/// -/// @param name The variable name -/// @param value The variable value -/// @param[out] err Details of an error that may have occurred -/// @return the old value if any Object vim_set_var(String name, Object value, Error *err); -/// Gets a vim variable -/// -/// @param name The variable name -/// @param[out] err Details of an error that may have occurred -/// @return The variable value Object vim_get_vvar(String name, Error *err); -/// Get an option value string -/// -/// @param name The option name -/// @param[out] err Details of an error that may have occurred -/// @return The option value Object vim_get_option(String name, Error *err); -/// Sets an option value -/// -/// @param name The option name -/// @param value The new option value -/// @param[out] err Details of an error that may have occurred void vim_set_option(String name, Object value, Error *err); -/// Write a message to vim output buffer -/// -/// @param str The message void vim_out_write(String str); -/// Write a message to vim error buffer -/// -/// @param str The message void vim_err_write(String str); -/// Gets the current list of buffer handles -/// -/// @return The number of buffers BufferArray vim_get_buffers(void); -/// Return the current buffer -/// -/// @reqturn The buffer handle Buffer vim_get_current_buffer(void); -/// Sets the current buffer -/// -/// @param id The buffer handle -/// @param[out] err Details of an error that may have occurred void vim_set_current_buffer(Buffer buffer, Error *err); -/// Gets the current list of window handles -/// -/// @return The number of windows WindowArray vim_get_windows(void); -/// Return the current window -/// -/// @return The window handle Window vim_get_current_window(void); -/// Sets the current window -/// -/// @param handle The window handle void vim_set_current_window(Window window, Error *err); -/// Gets the current list of tabpage handles -/// -/// @return The number of tab pages TabpageArray vim_get_tabpages(void); -/// Return the current tab page -/// -/// @return The tab page handle Tabpage vim_get_current_tabpage(void); -/// Sets the current tab page -/// -/// @param handle The tab page handle -/// @param[out] err Details of an error that may have occurred void vim_set_current_tabpage(Tabpage tabpage, Error *err); -/// Subscribes to event broadcasts -/// -/// @param channel_id The channel id(passed automatically by the dispatcher) -/// @param event The event type string void vim_subscribe(uint64_t channel_id, String event); -/// Unsubscribes to event broadcasts -/// -/// @param channel_id The channel id(passed automatically by the dispatcher) -/// @param event The event type string void vim_unsubscribe(uint64_t channel_id, String event); #endif // NVIM_API_VIM_H -- cgit From 70929f7e1616bab2783cc5735c6061981cda8a0f Mon Sep 17 00:00:00 2001 From: ZyX Date: Sat, 10 May 2014 17:24:13 +0400 Subject: Add automatic generation of headers - The 'stripdecls.py' script replaces declarations in all headers by includes to generated headers. `ag '#\s*if(?!ndef NEOVIM_).*((?!#\s*endif).*\n)*#ifdef INCLUDE_GENERATED'` was used for this. - Add and integrate gendeclarations.lua into the build system to generate the required includes. - Add -Wno-unused-function - Made a bunch of old-style definitions ANSI This adds a requirement: all type and structure definitions must be present before INCLUDE_GENERATED_DECLARATIONS-protected include. Warning: mch_expandpath (path.h.generated.h) was moved manually. So far it is the only exception. --- src/nvim/api/vim.h | 58 +++--------------------------------------------------- 1 file changed, 3 insertions(+), 55 deletions(-) (limited to 'src/nvim/api/vim.h') diff --git a/src/nvim/api/vim.h b/src/nvim/api/vim.h index 426acf7f50..f15edb8548 100644 --- a/src/nvim/api/vim.h +++ b/src/nvim/api/vim.h @@ -6,59 +6,7 @@ #include "nvim/api/private/defs.h" -void vim_push_keys(String str); - -void vim_command(String str, Error *err); - -Object vim_eval(String str, Error *err); - -Integer vim_strwidth(String str, Error *err); - -StringArray vim_list_runtime_paths(void); - -void vim_change_directory(String dir, Error *err); - -String vim_get_current_line(Error *err); - -void vim_del_current_line(Error *err); - -void vim_set_current_line(String line, Error *err); - -Object vim_get_var(String name, Error *err); - -Object vim_set_var(String name, Object value, Error *err); - -Object vim_get_vvar(String name, Error *err); - -Object vim_get_option(String name, Error *err); - -void vim_set_option(String name, Object value, Error *err); - -void vim_out_write(String str); - -void vim_err_write(String str); - -BufferArray vim_get_buffers(void); - -Buffer vim_get_current_buffer(void); - -void vim_set_current_buffer(Buffer buffer, Error *err); - -WindowArray vim_get_windows(void); - -Window vim_get_current_window(void); - -void vim_set_current_window(Window window, Error *err); - -TabpageArray vim_get_tabpages(void); - -Tabpage vim_get_current_tabpage(void); - -void vim_set_current_tabpage(Tabpage tabpage, Error *err); - -void vim_subscribe(uint64_t channel_id, String event); - -void vim_unsubscribe(uint64_t channel_id, String event); - +#ifdef INCLUDE_GENERATED_DECLARATIONS +# include "api/vim.h.generated.h" +#endif #endif // NVIM_API_VIM_H - -- cgit