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

@@ -90,30 +90,10 @@ struct block_def {
colnr_T start_char_vcols; /* number of vcols of pre-block char */
};
static void shift_block(oparg_T *oap, int amount);
static void block_insert(oparg_T *oap, char_u *s, int b_insert,
struct block_def*bdp);
static int stuff_yank(int, char_u *);
static void put_reedit_in_typebuf(int silent);
static int put_in_typebuf(char_u *s, int esc, int colon,
int silent);
static void stuffescaped(char_u *arg, int literally);
static void mb_adjust_opend(oparg_T *oap);
static void free_yank(long);
static void free_yank_all(void);
static void yank_copy_line(struct block_def *bd, long y_idx);
static void dis_msg(char_u *p, int skip_esc);
static char_u *skip_comment(char_u *line, int process,
int include_space,
int *is_comment);
static void block_prep(oparg_T *oap, struct block_def *, linenr_T, int);
static void str_to_reg(struct yankreg *y_ptr, int type, char_u *str,
long len,
long blocklen);
static int ends_in_white(linenr_T lnum);
static int same_leader(linenr_T lnum, int, char_u *, int, char_u *);
static int fmt_check_par(linenr_T, int *, char_u **, int do_comments);
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "ops.c.generated.h"
#endif
/*
* The names of operators.
* IMPORTANT: Index must correspond with defines in vim.h!!!
@@ -566,9 +546,7 @@ static void block_insert(oparg_T *oap, char_u *s, int b_insert, struct block_def
/*
* op_reindent - handle reindenting a block of lines.
*/
void op_reindent(oap, how)
oparg_T *oap;
int (*how)(void);
void op_reindent(oparg_T *oap, Indenter how)
{
long i;
char_u *l;
@@ -778,7 +756,7 @@ void *
get_register (
int name,
int copy /* make a copy, if FALSE make register empty. */
)
) FUNC_ATTR_NONNULL_RET
{
get_yank_register(name, 0);
@@ -1861,7 +1839,6 @@ int op_replace(oparg_T *oap, int c)
return OK;
}
static int swapchars(int op_type, pos_T *pos, int length);
/*
* Handle the (non-standard vi) tilde operator. Also for "gu", "gU" and "g?".
@@ -4193,7 +4170,6 @@ static void block_prep(oparg_T *oap, struct block_def *bdp, linenr_T lnum, int i
bdp->textstart = pstart;
}
static void reverse_line(char_u *s);
static void reverse_line(char_u *s)
{
@@ -4903,9 +4879,6 @@ void clear_oparg(oparg_T *oap)
memset(oap, 0, sizeof(oparg_T));
}
static long line_count_info(char_u *line, long *wc, long *cc,
long limit,
int eol_size);
/*
* Count the number of bytes, characters and "words" in a line.