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

@@ -91,23 +91,14 @@ struct builtin_term {
/* start of keys that are not directly used by Vim but can be mapped */
#define BT_EXTRA_KEYS 0x101
static struct builtin_term *find_builtin_term(char_u *name);
static void parse_builtin_tcap(char_u *s);
static void term_color(char_u *s, int n);
static void gather_termleader(void);
static void req_codes_from_term(void);
static void req_more_codes_from_term(void);
static void got_code_from_term(char_u *code, int len);
static void check_for_codes_from_term(void);
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "term.c.generated.h"
#endif
#if defined(FEAT_GUI) \
|| (defined(FEAT_MOUSE) && (!defined(UNIX) || defined(FEAT_MOUSE_XTERM) \
|| defined(FEAT_MOUSE_GPM) || defined(FEAT_SYSMOUSE)))
static int get_bytes_from_buf(char_u *, char_u *, int);
#endif
static void del_termcode_idx(int idx);
static int term_is_builtin(char_u *name);
static int term_7to8bit(char_u *p);
static void switch_to_8bit(void);
#ifdef HAVE_TGETENT
static char_u *tgetent_error(char_u *, char_u *);
@@ -1216,7 +1207,6 @@ static void parse_builtin_tcap(char_u *term)
}
}
}
static void set_color_count(int nr);
/*
* Set number of colors.
@@ -1939,7 +1929,6 @@ char_u *tltoa(unsigned long i)
* minimal tgoto() implementation.
* no padding and we only parse for %i %d and %+char
*/
static char *tgoto(char *, int, int);
static char *tgoto(char *cm, int x, int y)
{
@@ -2064,7 +2053,6 @@ void out_char(unsigned c)
out_flush();
}
static void out_char_nf(unsigned);
/*
* out_char_nf(c): like out_char(), but don't flush when p_wd is set
@@ -2321,8 +2309,6 @@ void ttest(int pairs)
}
#if defined(FEAT_GUI) || defined(PROTO)
static int get_long_from_buf(char_u *buf, long_u *val);
/*
* Interpret the next string of bytes in buf as a long integer, with the most
* significant byte first. Note that it is assumed that buf has been through
@@ -2922,7 +2908,6 @@ static struct termcode {
static int tc_max_len = 0; /* number of entries that termcodes[] can hold */
static int tc_len = 0; /* current number of entries in termcodes[] */
static int termcode_star(char_u *code, int len);
void clear_termcodes(void)
{