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/menu.c | 30 +++++++----------------------- 1 file changed, 7 insertions(+), 23 deletions(-) (limited to 'src/nvim/menu.c') diff --git a/src/nvim/menu.c b/src/nvim/menu.c index 0f86a65bb5..f1e305f625 100644 --- a/src/nvim/menu.c +++ b/src/nvim/menu.c @@ -32,29 +32,13 @@ #define MENUDEPTH 10 /* maximum depth of menus */ -static int add_menu_path(char_u *, vimmenu_T *, int *, char_u *); -static int menu_nable_recurse(vimmenu_T *menu, char_u *name, int modes, - int enable); -static int remove_menu(vimmenu_T **, char_u *, int, int silent); -static void free_menu(vimmenu_T **menup); -static void free_menu_string(vimmenu_T *, int); -static int show_menus(char_u *, int); -static void show_menus_recursive(vimmenu_T *, int, int); -static int menu_name_equal(char_u *name, vimmenu_T *menu); -static int menu_namecmp(char_u *name, char_u *mname); -static int get_menu_cmd_modes(char_u *, int, int *, int *); -static char_u *popup_mode_name(char_u *name, int idx); -static char_u *menu_text(char_u *text, int *mnemonic, char_u **actext); - - -static int menu_is_hidden(char_u *name); -static int menu_is_tearoff(char_u *name); - -static char_u *menu_skip_part(char_u *p); -static char_u *menutrans_lookup(char_u *name, int len); -static void menu_unescape_name(char_u *p); - -static char_u *menu_translate_tab_and_shift(char_u *arg_start); + +#ifdef INCLUDE_GENERATED_DECLARATIONS +# include "menu.c.generated.h" +#endif + + + /* The character for each menu mode */ static char_u menu_mode_chars[] = {'n', 'v', 's', 'o', 'i', 'c', 't'}; -- cgit