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

@@ -236,32 +236,9 @@ typedef enum {
, UB_SAME_DIR /* update the B0_SAME_DIR flag */
} upd_block0_T;
static int ml_check_b0_id(ZERO_BL *b0p);
static void ml_upd_block0(buf_T *buf, upd_block0_T what);
static void set_b0_fname(ZERO_BL *, buf_T *buf);
static void set_b0_dir_flag(ZERO_BL *b0p, buf_T *buf);
static void add_b0_fenc(ZERO_BL *b0p, buf_T *buf);
static time_t swapfile_info(char_u *);
static int recov_file_names(char_u **, char_u *, int prepend_dot);
static int ml_append_int(buf_T *, linenr_T, char_u *, colnr_T, int, int);
static int ml_delete_int(buf_T *, linenr_T, int);
static char_u *findswapname(buf_T *, char_u **, char_u *);
static void ml_flush_line(buf_T *);
static bhdr_T *ml_new_data(memfile_T *, int, int);
static bhdr_T *ml_new_ptr(memfile_T *);
static bhdr_T *ml_find_line(buf_T *, linenr_T, int);
static int ml_add_stack(buf_T *);
static void ml_lineadd(buf_T *, int);
static int b0_magic_wrong(ZERO_BL *);
#ifdef CHECK_INODE
static int fnamecmp_ino(char_u *, char_u *, long);
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "memline.c.generated.h"
#endif
static void long_to_char(long, char_u *);
static long char_to_long(char_u *);
#if defined(UNIX) || defined(WIN3264)
static char_u *make_percent_swname(char_u *dir, char_u *name);
#endif
static void ml_updatechunk(buf_T *buf, long line, long len, int updtype);
/*
* Open a new memline for "buf".
@@ -3186,7 +3163,6 @@ get_file_in_dir (
return retval;
}
static void attention_message(buf_T *buf, char_u *fname);
/*
* Print the ATTENTION message: info about an existing swap file.
@@ -3237,7 +3213,6 @@ attention_message (
--no_wait_return;
}
static int do_swapexists(buf_T *buf, char_u *fname);
/*
* Trigger the SwapExists autocommands.