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.
This commit is contained in:
ZyX
2014-05-10 17:24:13 +04:00
committed by Thiago de Arruda
parent 880957ad4e
commit 70929f7e16
154 changed files with 2190 additions and 6184 deletions

View File

@@ -1838,59 +1838,9 @@ static char *(p_fdm_values[]) = {"manual", "expr", "marker", "indent", "syntax",
static char *(p_fcl_values[]) = {"all", NULL};
static char *(p_cot_values[]) = {"menu", "menuone", "longest", "preview", NULL};
static void set_option_default(int, int opt_flags, int compatible);
static void set_options_default(int opt_flags);
static char_u *term_bg_default(void);
static void did_set_option(int opt_idx, int opt_flags, int new_value);
static char_u *illegal_char(char_u *, int);
static int string_to_key(char_u *arg);
static char_u *check_cedit(void);
static void did_set_title(int icon);
static char_u *option_expand(int opt_idx, char_u *val);
static void didset_options(void);
static void check_string_option(char_u **pp);
static long_u *insecure_flag(int opt_idx, int opt_flags);
static void set_string_option_global(int opt_idx, char_u **varp);
static char_u *set_string_option(int opt_idx, char_u *value,
int opt_flags);
static char_u *did_set_string_option(int opt_idx, char_u **varp,
int new_value_alloced,
char_u *oldval, char_u *errbuf,
int opt_flags);
static char_u *set_chars_option(char_u **varp);
static int int_cmp(const void *a, const void *b);
static char_u *compile_cap_prog(synblock_T *synblock);
static void set_option_scriptID_idx(int opt_idx, int opt_flags, int id);
static char_u *set_bool_option(int opt_idx, char_u *varp, int value,
int opt_flags);
static char_u *set_num_option(int opt_idx, char_u *varp, long value,
char_u *errbuf, size_t errbuflen,
int opt_flags);
static void check_redraw(long_u flags);
static int findoption(char_u *);
static int find_key_option(char_u *);
static void showoptions(int all, int opt_flags);
static int optval_default(struct vimoption *, char_u *varp);
static void showoneopt(struct vimoption *, int opt_flags);
static int put_setstring(FILE *fd, char *cmd, char *name, char_u **valuep,
int expand);
static int put_setnum(FILE *fd, char *cmd, char *name, long *valuep);
static int put_setbool(FILE *fd, char *cmd, char *name, int value);
static int istermoption(struct vimoption *);
static char_u *get_varp_scope(struct vimoption *p, int opt_flags);
static char_u *get_varp(struct vimoption *);
static void option_value2string(struct vimoption *, int opt_flags);
static int wc_use_keyname(char_u *varp, long *wcp);
static void langmap_init(void);
static void langmap_set(void);
static void paste_option_changed(void);
static void compatible_set(void);
static void fill_breakat_flags(void);
static int opt_strings_flags(char_u *val, char **values,
unsigned *flagp,
int list);
static int check_opt_strings(char_u *val, char **values, int);
static int check_opt_wim(void);
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "option.c.generated.h"
#endif
/*
* Initialize the options, first part.
@@ -3688,7 +3638,6 @@ static long_u *insecure_flag(int opt_idx, int opt_flags)
return &options[opt_idx].flags;
}
static void redraw_titles(void);
/*
* Redraw the window title and/or tab page text later.
@@ -7572,7 +7521,6 @@ typedef struct {
} langmap_entry_T;
static garray_T langmap_mapga;
static void langmap_set_entry(int from, int to);
/*
* Search for an entry in "langmap_mapga" for "from". If found set the "to"