diff options
author | scott-linder <scott.b.linder@wmich.edu> | 2014-02-25 15:41:16 -0500 |
---|---|---|
committer | Thiago de Arruda <tpadilha84@gmail.com> | 2014-02-26 04:17:27 -0300 |
commit | 0ef90c13b72b74928bfb3c183c7a5bd7240b51ad (patch) | |
tree | b342ba525a153962f928e01fde7518398a4859c3 /src/fileio.h | |
parent | 82e0636e788f131d46451805f6c46e2d4f8496a9 (diff) | |
download | rneovim-0ef90c13b72b74928bfb3c183c7a5bd7240b51ad.tar.gz rneovim-0ef90c13b72b74928bfb3c183c7a5bd7240b51ad.tar.bz2 rneovim-0ef90c13b72b74928bfb3c183c7a5bd7240b51ad.zip |
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. */
Diffstat (limited to 'src/fileio.h')
-rw-r--r-- | src/fileio.h | 85 |
1 files changed, 85 insertions, 0 deletions
diff --git a/src/fileio.h b/src/fileio.h new file mode 100644 index 0000000000..add97d37d6 --- /dev/null +++ b/src/fileio.h @@ -0,0 +1,85 @@ +#ifndef NEOVIM_FILEIO_H +#define NEOVIM_FILEIO_H +/* fileio.c */ +void filemess __ARGS((buf_T *buf, char_u *name, char_u *s, int attr)); +int readfile __ARGS((char_u *fname, char_u *sfname, linenr_T from, + linenr_T lines_to_skip, linenr_T lines_to_read, exarg_T * + eap, + int flags)); +int prep_exarg __ARGS((exarg_T *eap, buf_T *buf)); +void set_file_options __ARGS((int set_options, exarg_T *eap)); +void set_forced_fenc __ARGS((exarg_T *eap)); +int prepare_crypt_read __ARGS((FILE *fp)); +char_u *prepare_crypt_write __ARGS((buf_T *buf, int *lenp)); +int check_file_readonly __ARGS((char_u *fname, int perm)); +int buf_write __ARGS((buf_T *buf, char_u *fname, char_u *sfname, linenr_T start, + linenr_T end, exarg_T *eap, int append, int forceit, + int reset_changed, + int filtering)); +void msg_add_fname __ARGS((buf_T *buf, char_u *fname)); +void msg_add_lines __ARGS((int insert_space, long lnum, off_t nchars)); +char_u *shorten_fname1 __ARGS((char_u *full_path)); +char_u *shorten_fname __ARGS((char_u *full_path, char_u *dir_name)); +void shorten_fnames __ARGS((int force)); +void shorten_filenames __ARGS((char_u **fnames, int count)); +char_u *modname __ARGS((char_u *fname, char_u *ext, int prepend_dot)); +char_u *buf_modname __ARGS((int shortname, char_u *fname, char_u *ext, + int prepend_dot)); +int vim_fgets __ARGS((char_u *buf, int size, FILE *fp)); +int tag_fgets __ARGS((char_u *buf, int size, FILE *fp)); +int vim_rename __ARGS((char_u *from, char_u *to)); +int check_timestamps __ARGS((int focus)); +int buf_check_timestamp __ARGS((buf_T *buf, int focus)); +void buf_reload __ARGS((buf_T *buf, int orig_mode)); +void buf_store_time __ARGS((buf_T *buf, struct stat *st, char_u *fname)); +void write_lnum_adjust __ARGS((linenr_T offset)); +void vim_deltempdir __ARGS((void)); +char_u *vim_tempname __ARGS((int extra_char)); +void forward_slash __ARGS((char_u *fname)); +void aubuflocal_remove __ARGS((buf_T *buf)); +int au_has_group __ARGS((char_u *name)); +void do_augroup __ARGS((char_u *arg, int del_group)); +void free_all_autocmds __ARGS((void)); +int check_ei __ARGS((void)); +char_u *au_event_disable __ARGS((char *what)); +void au_event_restore __ARGS((char_u *old_ei)); +void do_autocmd __ARGS((char_u *arg, int forceit)); +int do_doautocmd __ARGS((char_u *arg, int do_msg)); +void ex_doautoall __ARGS((exarg_T *eap)); +int check_nomodeline __ARGS((char_u **argp)); +void aucmd_prepbuf __ARGS((aco_save_T *aco, buf_T *buf)); +void aucmd_restbuf __ARGS((aco_save_T *aco)); +int apply_autocmds __ARGS((event_T event, char_u *fname, char_u *fname_io, + int force, + buf_T *buf)); +int apply_autocmds_retval __ARGS((event_T event, char_u *fname, char_u * + fname_io, int force, buf_T *buf, + int *retval)); +int has_cursorhold __ARGS((void)); +int trigger_cursorhold __ARGS((void)); +int has_cursormoved __ARGS((void)); +int has_cursormovedI __ARGS((void)); +int has_textchanged __ARGS((void)); +int has_textchangedI __ARGS((void)); +int has_insertcharpre __ARGS((void)); +void block_autocmds __ARGS((void)); +void unblock_autocmds __ARGS((void)); +int is_autocmd_blocked __ARGS((void)); +char_u *getnextac __ARGS((int c, void *cookie, int indent)); +int has_autocmd __ARGS((event_T event, char_u *sfname, buf_T *buf)); +char_u *get_augroup_name __ARGS((expand_T *xp, int idx)); +char_u *set_context_in_autocmd __ARGS((expand_T *xp, char_u *arg, int doautocmd)); +char_u *get_event_name __ARGS((expand_T *xp, int idx)); +int autocmd_supported __ARGS((char_u *name)); +int au_exists __ARGS((char_u *arg)); +int match_file_pat __ARGS((char_u *pattern, regprog_T *prog, char_u *fname, + char_u *sfname, char_u *tail, + int allow_dirs)); +int match_file_list __ARGS((char_u *list, char_u *sfname, char_u *ffname)); +char_u *file_pat_to_reg_pat __ARGS((char_u *pat, char_u *pat_end, + char *allow_dirs, + int no_bslash)); +long read_eintr __ARGS((int fd, void *buf, size_t bufsize)); +long write_eintr __ARGS((int fd, void *buf, size_t bufsize)); +/* vim: set ft=c : */ +#endif /* NEOVIM_FILEIO_H */ |