diff options
author | ZyX <kp-pav@ya.ru> | 2014-05-10 17:24:13 +0400 |
---|---|---|
committer | Thiago de Arruda <tpadilha84@gmail.com> | 2014-06-02 11:04:17 -0300 |
commit | 70929f7e1616bab2783cc5735c6061981cda8a0f (patch) | |
tree | 4a947af96fa0bac749f843a41e7b6593dd2659c0 /src/nvim/indent_c.c | |
parent | 880957ad4e3fc0ff681025f5e29c5eccf797c564 (diff) | |
download | rneovim-70929f7e1616bab2783cc5735c6061981cda8a0f.tar.gz rneovim-70929f7e1616bab2783cc5735c6061981cda8a0f.tar.bz2 rneovim-70929f7e1616bab2783cc5735c6061981cda8a0f.zip |
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.
Diffstat (limited to 'src/nvim/indent_c.c')
-rw-r--r-- | src/nvim/indent_c.c | 41 |
1 files changed, 3 insertions, 38 deletions
diff --git a/src/nvim/indent_c.c b/src/nvim/indent_c.c index 631ef06d01..aeac5e0b8b 100644 --- a/src/nvim/indent_c.c +++ b/src/nvim/indent_c.c @@ -13,9 +13,10 @@ #include "nvim/strings.h" -static char_u *skip_string(char_u *p); -static pos_T *ind_find_start_comment(void); +#ifdef INCLUDE_GENERATED_DECLARATIONS +# include "indent_c.c.generated.h" +#endif /* * Find the start of a comment, not knowing if we are in a comment right now. * Search starts at w_cursor.lnum and goes backwards. @@ -109,7 +110,6 @@ static char_u *skip_string(char_u *p) * Below "XXX" means that this function may unlock the current line. */ -int cin_is_cinword(char_u *line); /* * Return TRUE if the string "line" starts with a word from 'cinwords'. @@ -139,41 +139,6 @@ int cin_is_cinword(char_u *line) } -static char_u *cin_skipcomment(char_u *); -static int cin_nocode(char_u *); -static pos_T *find_line_comment(void); -static int cin_islabel_skip(char_u **); -static int cin_isdefault(char_u *); -static char_u *after_label(char_u *l); -static int get_indent_nolabel(linenr_T lnum); -static int skip_label(linenr_T, char_u **pp); -static int cin_first_id_amount(void); -static int cin_get_equal_amount(linenr_T lnum); -static int cin_ispreproc(char_u *); -static int cin_ispreproc_cont(char_u **pp, linenr_T *lnump); -static int cin_iscomment(char_u *); -static int cin_islinecomment(char_u *); -static int cin_isterminated(char_u *, int, int); -static int cin_isinit(void); -static int cin_isfuncdecl(char_u **, linenr_T, linenr_T); -static int cin_isif(char_u *); -static int cin_iselse(char_u *); -static int cin_isdo(char_u *); -static int cin_iswhileofdo(char_u *, linenr_T); -static int cin_is_if_for_while_before_offset(char_u *line, int *poffset); -static int cin_iswhileofdo_end(int terminated); -static int cin_isbreak(char_u *); -static int cin_is_cpp_baseclass(colnr_T *col); -static int get_baseclass_amount(int col); -static int cin_ends_in(char_u *, char_u *, char_u *); -static int cin_starts_with(char_u *s, char *word); -static int cin_skip2pos(pos_T *trypos); -static pos_T *find_start_brace(void); -static pos_T *find_match_paren(int); -static int corr_ind_maxparen(pos_T *startpos); -static int find_last_paren(char_u *l, int start, int end); -static int find_match(int lookfor, linenr_T ourscope); -static int cin_is_cpp_namespace(char_u *); /* * Skip over white space and C comments within the line. |