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

69
src/ops.h Normal file
View File

@@ -0,0 +1,69 @@
#ifndef NEOVIM_OPS_H
#define NEOVIM_OPS_H
/* ops.c */
int get_op_type __ARGS((int char1, int char2));
int op_on_lines __ARGS((int op));
int get_op_char __ARGS((int optype));
int get_extra_op_char __ARGS((int optype));
void op_shift __ARGS((oparg_T *oap, int curs_top, int amount));
void shift_line __ARGS((int left, int round, int amount, int call_changed_bytes));
void op_reindent __ARGS((oparg_T *oap, int (*how)(void)));
int get_expr_register __ARGS((void));
void set_expr_line __ARGS((char_u *new_line));
char_u *get_expr_line __ARGS((void));
char_u *get_expr_line_src __ARGS((void));
int valid_yank_reg __ARGS((int regname, int writing));
void get_yank_register __ARGS((int regname, int writing));
int may_get_selection __ARGS((int regname));
void *get_register __ARGS((int name, int copy));
void put_register __ARGS((int name, void *reg));
void free_register __ARGS((void *reg));
int yank_register_mline __ARGS((int regname));
int do_record __ARGS((int c));
int do_execreg __ARGS((int regname, int colon, int addcr, int silent));
int insert_reg __ARGS((int regname, int literally));
int get_spec_reg __ARGS((int regname, char_u **argp, int *allocated, int errmsg));
int cmdline_paste_reg __ARGS((int regname, int literally, int remcr));
void adjust_clip_reg __ARGS((int *rp));
int op_delete __ARGS((oparg_T *oap));
int op_replace __ARGS((oparg_T *oap, int c));
void op_tilde __ARGS((oparg_T *oap));
int swapchar __ARGS((int op_type, pos_T *pos));
void op_insert __ARGS((oparg_T *oap, long count1));
int op_change __ARGS((oparg_T *oap));
void init_yank __ARGS((void));
void clear_registers __ARGS((void));
int op_yank __ARGS((oparg_T *oap, int deleting, int mess));
void do_put __ARGS((int regname, int dir, long count, int flags));
void adjust_cursor_eol __ARGS((void));
int preprocs_left __ARGS((void));
int get_register_name __ARGS((int num));
void ex_display __ARGS((exarg_T *eap));
int do_join __ARGS((long count, int insert_space, int save_undo,
int use_formatoptions));
void op_format __ARGS((oparg_T *oap, int keep_cursor));
void op_formatexpr __ARGS((oparg_T *oap));
int fex_format __ARGS((linenr_T lnum, long count, int c));
void format_lines __ARGS((linenr_T line_count, int avoid_fex));
int paragraph_start __ARGS((linenr_T lnum));
int do_addsub __ARGS((int command, linenr_T Prenum1));
int read_viminfo_register __ARGS((vir_T *virp, int force));
void write_viminfo_registers __ARGS((FILE *fp));
void x11_export_final_selection __ARGS((void));
void clip_free_selection __ARGS((VimClipboard *cbd));
void clip_get_selection __ARGS((VimClipboard *cbd));
void clip_yank_selection __ARGS((int type, char_u *str, long len,
VimClipboard *cbd));
int clip_convert_selection __ARGS((char_u **str, long_u *len, VimClipboard *cbd));
void dnd_yank_drag_data __ARGS((char_u *str, long len));
char_u get_reg_type __ARGS((int regname, long *reglen));
char_u *get_reg_contents __ARGS((int regname, int allowexpr, int expr_src));
void write_reg_contents __ARGS((int name, char_u *str, int maxlen,
int must_append));
void write_reg_contents_ex __ARGS((int name, char_u *str, int maxlen,
int must_append, int yank_type,
long block_len));
void clear_oparg __ARGS((oparg_T *oap));
void cursor_pos_info __ARGS((void));
/* vim: set ft=c : */
#endif /* NEOVIM_OPS_H */