Removes 'proto' dir

See #137 for the issue.

Every header in the proto directory was:

* Given include guards in the form

    #ifndef NEOVIM_FILENAME_H
    #define NEOVIM_FILENAME_H
        ...
    #endif /* NEOVIM_FILENAM_H */

* Renamed from *.pro -> *.h
* Moved from src/proto/ to src/

This would have caused conficts with some existing headers in src/;
rather than merge these conflicts now (which is a whole other can of
worms involving multiple and conditional inclusion), any header in src/
with a conflicting name was renamed from *.h -> *_defs.h (which may or
may not actually describe its purpose, the change is purely a
namespacing issue).

Once all of these changes were made a script was developed to determine
what #includes needed to be added to each source file to describe its
dependencies and allow it to compile; because the script is so short
and I'll just list it here:

    #! /bin/bash

    cd $(dirname $0)

    # Scrapes `make` output for provided error messages and outputs #includes
    # needed to resolve them.
    #   $1 : part of the clang error message between filename and identifier
    list_missing_includes() {
        for file_missing_pair in $(CC=clang make 2>&1 >/dev/null | sed -n "s/\/\(.*\.[hc]\).*$1.*'\(.*\)'.*/\1:\2/p"); do
            fields=(${file_missing_pair//:/ })
            source_file=${fields[0]}
            missing_func=${fields[1]}
            # Try to find the declaration of the missing function.
            echo $(basename $source_file) \
                \#include \"$(grep -r "\b$missing_func __ARGS" | sed -n "s/.*\/\(.*\)\:.*/\1/p")\"
        # Remove duplicates
        done | sort | uniq
    }

    echo "Finding missing function prototypes..."
    list_missing_includes "implicit declaration of function"
    echo "Finding missing identifier declarations..."
    list_missing_includes "use of undeclared identifier"

Each list of required headers was added by hand in the following format:

    #include "vim.h"
    #include "*_defs.h"
    #include "filename.h"
    /* All other includes in same module here, in alphabetical order. */
    /* All includes from other modules (e.g. "os/*.h") here in alphabetical
     * order. */
This commit is contained in:
scott-linder
2014-02-25 15:41:16 -05:00
committed by Thiago de Arruda
parent 82e0636e78
commit 0ef90c13b7
119 changed files with 4197 additions and 3181 deletions

96
src/ex_cmds2.h Normal file
View File

@@ -0,0 +1,96 @@
#ifndef NEOVIM_EX_CMDS2_H
#define NEOVIM_EX_CMDS2_H
/* ex_cmds2.c */
void do_debug __ARGS((char_u *cmd));
void ex_debug __ARGS((exarg_T *eap));
void dbg_check_breakpoint __ARGS((exarg_T *eap));
int dbg_check_skipped __ARGS((exarg_T *eap));
void ex_breakadd __ARGS((exarg_T *eap));
void ex_debuggreedy __ARGS((exarg_T *eap));
void ex_breakdel __ARGS((exarg_T *eap));
void ex_breaklist __ARGS((exarg_T *eap));
linenr_T dbg_find_breakpoint __ARGS((int file, char_u *fname, linenr_T after));
int has_profiling __ARGS((int file, char_u *fname, int *fp));
void dbg_breakpoint __ARGS((char_u *name, linenr_T lnum));
void profile_start __ARGS((proftime_T *tm));
void profile_end __ARGS((proftime_T *tm));
void profile_sub __ARGS((proftime_T *tm, proftime_T *tm2));
char *profile_msg __ARGS((proftime_T *tm));
void profile_setlimit __ARGS((long msec, proftime_T *tm));
int profile_passed_limit __ARGS((proftime_T *tm));
void profile_zero __ARGS((proftime_T *tm));
void profile_divide __ARGS((proftime_T *tm, int count, proftime_T *tm2));
void profile_add __ARGS((proftime_T *tm, proftime_T *tm2));
void profile_self __ARGS((proftime_T *self, proftime_T *total,
proftime_T *children));
void profile_get_wait __ARGS((proftime_T *tm));
void profile_sub_wait __ARGS((proftime_T *tm, proftime_T *tma));
int profile_equal __ARGS((proftime_T *tm1, proftime_T *tm2));
int profile_cmp __ARGS((const proftime_T *tm1, const proftime_T *tm2));
void ex_profile __ARGS((exarg_T *eap));
char_u *get_profile_name __ARGS((expand_T *xp, int idx));
void set_context_in_profile_cmd __ARGS((expand_T *xp, char_u *arg));
void profile_dump __ARGS((void));
void script_prof_save __ARGS((proftime_T *tm));
void script_prof_restore __ARGS((proftime_T *tm));
void prof_inchar_enter __ARGS((void));
void prof_inchar_exit __ARGS((void));
int prof_def_func __ARGS((void));
int autowrite __ARGS((buf_T *buf, int forceit));
void autowrite_all __ARGS((void));
int check_changed __ARGS((buf_T *buf, int flags));
void browse_save_fname __ARGS((buf_T *buf));
void dialog_changed __ARGS((buf_T *buf, int checkall));
int can_abandon __ARGS((buf_T *buf, int forceit));
int check_changed_any __ARGS((int hidden));
int check_fname __ARGS((void));
int buf_write_all __ARGS((buf_T *buf, int forceit));
int get_arglist __ARGS((garray_T *gap, char_u *str));
int get_arglist_exp __ARGS((char_u *str, int *fcountp, char_u ***fnamesp,
int wig));
void set_arglist __ARGS((char_u *str));
void check_arg_idx __ARGS((win_T *win));
void ex_args __ARGS((exarg_T *eap));
void ex_previous __ARGS((exarg_T *eap));
void ex_rewind __ARGS((exarg_T *eap));
void ex_last __ARGS((exarg_T *eap));
void ex_argument __ARGS((exarg_T *eap));
void do_argfile __ARGS((exarg_T *eap, int argn));
void ex_next __ARGS((exarg_T *eap));
void ex_argedit __ARGS((exarg_T *eap));
void ex_argadd __ARGS((exarg_T *eap));
void ex_argdelete __ARGS((exarg_T *eap));
void ex_listdo __ARGS((exarg_T *eap));
void ex_compiler __ARGS((exarg_T *eap));
void ex_runtime __ARGS((exarg_T *eap));
int source_runtime __ARGS((char_u *name, int all));
int do_in_runtimepath __ARGS((char_u *name, int all, void (*callback)(
char_u *fname, void *ck), void *cookie));
void ex_options __ARGS((exarg_T *eap));
void ex_source __ARGS((exarg_T *eap));
linenr_T *source_breakpoint __ARGS((void *cookie));
int *source_dbg_tick __ARGS((void *cookie));
int source_level __ARGS((void *cookie));
int do_source __ARGS((char_u *fname, int check_other, int is_vimrc));
void ex_scriptnames __ARGS((exarg_T *eap));
void scriptnames_slash_adjust __ARGS((void));
char_u *get_scriptname __ARGS((scid_T id));
void free_scriptnames __ARGS((void));
char *fgets_cr __ARGS((char *s, int n, FILE *stream));
char_u *getsourceline __ARGS((int c, void *cookie, int indent));
void script_line_start __ARGS((void));
void script_line_exec __ARGS((void));
void script_line_end __ARGS((void));
void ex_scriptencoding __ARGS((exarg_T *eap));
void ex_finish __ARGS((exarg_T *eap));
void do_finish __ARGS((exarg_T *eap, int reanimate));
int source_finished __ARGS((char_u *(*fgetline)(int, void *, int), void *cookie));
void ex_checktime __ARGS((exarg_T *eap));
char_u *get_mess_lang __ARGS((void));
void set_lang_var __ARGS((void));
void ex_language __ARGS((exarg_T *eap));
void free_locales __ARGS((void));
char_u *get_lang_arg __ARGS((expand_T *xp, int idx));
char_u *get_locales __ARGS((expand_T *xp, int idx));
/* vim: set ft=c : */
#endif /* NEOVIM_EX_CMDS2_H */