summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2018-08-17 13:09:56 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2018-08-17 13:09:56 -0700
commit0194c9ad72b35fbf73b1b546663699ea2060a6b0 (patch)
tree239139a5896b77a2ff05d7d4a8cd79cd9ca1ef90
parentMerge branch 'es/want-color-fd-defensive' (diff)
parentsubmodule.h: drop extern from function declaration (diff)
downloadtgif-0194c9ad72b35fbf73b1b546663699ea2060a6b0.tar.xz
Merge branch 'nd/no-extern'
Noiseword "extern" has been removed from function decls in the header files. * nd/no-extern: submodule.h: drop extern from function declaration revision.h: drop extern from function declaration repository.h: drop extern from function declaration rerere.h: drop extern from function declaration line-range.h: drop extern from function declaration diff.h: remove extern from function declaration diffcore.h: drop extern from function declaration convert.h: drop 'extern' from function declaration cache-tree.h: drop extern from function declaration blame.h: drop extern on func declaration attr.h: drop extern from function declaration apply.h: drop extern on func declaration
-rw-r--r--apply.h23
-rw-r--r--attr.h24
-rw-r--r--blame.h28
-rw-r--r--cache-tree.h2
-rw-r--r--convert.h56
-rw-r--r--diff.h120
-rw-r--r--diffcore.h50
-rw-r--r--line-range.h12
-rw-r--r--repository.h25
-rw-r--r--rerere.h14
-rw-r--r--revision.h69
-rw-r--r--submodule.h112
12 files changed, 269 insertions, 266 deletions
diff --git a/apply.h b/apply.h
index b80d8ba736..01963b5ec4 100644
--- a/apply.h
+++ b/apply.h
@@ -111,14 +111,14 @@ struct apply_state {
int applied_after_fixing_ws;
};
-extern int apply_parse_options(int argc, const char **argv,
- struct apply_state *state,
- int *force_apply, int *options,
- const char * const *apply_usage);
-extern int init_apply_state(struct apply_state *state,
- const char *prefix);
-extern void clear_apply_state(struct apply_state *state);
-extern int check_apply_state(struct apply_state *state, int force_apply);
+int apply_parse_options(int argc, const char **argv,
+ struct apply_state *state,
+ int *force_apply, int *options,
+ const char * const *apply_usage);
+int init_apply_state(struct apply_state *state,
+ const char *prefix);
+void clear_apply_state(struct apply_state *state);
+int check_apply_state(struct apply_state *state, int force_apply);
/*
* Some aspects of the apply behavior are controlled by the following
@@ -127,9 +127,8 @@ extern int check_apply_state(struct apply_state *state, int force_apply);
#define APPLY_OPT_INACCURATE_EOF (1<<0) /* accept inaccurate eof */
#define APPLY_OPT_RECOUNT (1<<1) /* accept inaccurate line count */
-extern int apply_all_patches(struct apply_state *state,
- int argc,
- const char **argv,
- int options);
+int apply_all_patches(struct apply_state *state,
+ int argc, const char **argv,
+ int options);
#endif
diff --git a/attr.h b/attr.h
index 442d464db6..46340010bb 100644
--- a/attr.h
+++ b/attr.h
@@ -42,31 +42,31 @@ struct attr_check {
struct attr_stack *stack;
};
-extern struct attr_check *attr_check_alloc(void);
-extern struct attr_check *attr_check_initl(const char *, ...);
-extern struct attr_check *attr_check_dup(const struct attr_check *check);
+struct attr_check *attr_check_alloc(void);
+struct attr_check *attr_check_initl(const char *, ...);
+struct attr_check *attr_check_dup(const struct attr_check *check);
-extern struct attr_check_item *attr_check_append(struct attr_check *check,
- const struct git_attr *attr);
+struct attr_check_item *attr_check_append(struct attr_check *check,
+ const struct git_attr *attr);
-extern void attr_check_reset(struct attr_check *check);
-extern void attr_check_clear(struct attr_check *check);
-extern void attr_check_free(struct attr_check *check);
+void attr_check_reset(struct attr_check *check);
+void attr_check_clear(struct attr_check *check);
+void attr_check_free(struct attr_check *check);
/*
* Return the name of the attribute represented by the argument. The
* return value is a pointer to a null-delimited string that is part
* of the internal data structure; it should not be modified or freed.
*/
-extern const char *git_attr_name(const struct git_attr *);
+const char *git_attr_name(const struct git_attr *);
-extern int git_check_attr(const char *path, struct attr_check *check);
+int git_check_attr(const char *path, struct attr_check *check);
/*
* Retrieve all attributes that apply to the specified path.
* check holds the attributes and their values.
*/
-extern void git_all_attrs(const char *path, struct attr_check *check);
+void git_all_attrs(const char *path, struct attr_check *check);
enum git_attr_direction {
GIT_ATTR_CHECKIN,
@@ -76,6 +76,6 @@ enum git_attr_direction {
void git_attr_set_direction(enum git_attr_direction new_direction,
struct index_state *istate);
-extern void attr_start(void);
+void attr_start(void);
#endif /* ATTR_H */
diff --git a/blame.h b/blame.h
index 2092f9529c..9b5240fb6d 100644
--- a/blame.h
+++ b/blame.h
@@ -159,18 +159,22 @@ static inline struct blame_origin *blame_origin_incref(struct blame_origin *o)
o->refcnt++;
return o;
}
-extern void blame_origin_decref(struct blame_origin *o);
-
-extern void blame_coalesce(struct blame_scoreboard *sb);
-extern void blame_sort_final(struct blame_scoreboard *sb);
-extern unsigned blame_entry_score(struct blame_scoreboard *sb, struct blame_entry *e);
-extern void assign_blame(struct blame_scoreboard *sb, int opt);
-extern const char *blame_nth_line(struct blame_scoreboard *sb, long lno);
-
-extern void init_scoreboard(struct blame_scoreboard *sb);
-extern void setup_scoreboard(struct blame_scoreboard *sb, const char *path, struct blame_origin **orig);
-
-extern struct blame_entry *blame_entry_prepend(struct blame_entry *head, long start, long end, struct blame_origin *o);
+void blame_origin_decref(struct blame_origin *o);
+
+void blame_coalesce(struct blame_scoreboard *sb);
+void blame_sort_final(struct blame_scoreboard *sb);
+unsigned blame_entry_score(struct blame_scoreboard *sb, struct blame_entry *e);
+void assign_blame(struct blame_scoreboard *sb, int opt);
+const char *blame_nth_line(struct blame_scoreboard *sb, long lno);
+
+void init_scoreboard(struct blame_scoreboard *sb);
+void setup_scoreboard(struct blame_scoreboard *sb,
+ const char *path,
+ struct blame_origin **orig);
+
+struct blame_entry *blame_entry_prepend(struct blame_entry *head,
+ long start, long end,
+ struct blame_origin *o);
extern struct blame_origin *get_blame_suspects(struct commit *commit);
diff --git a/cache-tree.h b/cache-tree.h
index cfd5328cc9..9799e894f7 100644
--- a/cache-tree.h
+++ b/cache-tree.h
@@ -51,6 +51,6 @@ int write_index_as_tree(struct object_id *oid, struct index_state *index_state,
int write_cache_as_tree(struct object_id *oid, int flags, const char *prefix);
void prime_cache_tree(struct index_state *, struct tree *);
-extern int cache_tree_matches_traversal(struct cache_tree *, struct name_entry *ent, struct traverse_info *info);
+int cache_tree_matches_traversal(struct cache_tree *, struct name_entry *ent, struct traverse_info *info);
#endif
diff --git a/convert.h b/convert.h
index 01385d9288..0a0fa15b58 100644
--- a/convert.h
+++ b/convert.h
@@ -57,35 +57,36 @@ struct delayed_checkout {
extern enum eol core_eol;
extern char *check_roundtrip_encoding;
-extern const char *get_cached_convert_stats_ascii(const struct index_state *istate,
- const char *path);
-extern const char *get_wt_convert_stats_ascii(const char *path);
-extern const char *get_convert_attr_ascii(const char *path);
+const char *get_cached_convert_stats_ascii(const struct index_state *istate,
+ const char *path);
+const char *get_wt_convert_stats_ascii(const char *path);
+const char *get_convert_attr_ascii(const char *path);
/* returns 1 if *dst was used */
-extern int convert_to_git(const struct index_state *istate,
- const char *path, const char *src, size_t len,
- struct strbuf *dst, int conv_flags);
-extern int convert_to_working_tree(const char *path, const char *src,
- size_t len, struct strbuf *dst);
-extern int async_convert_to_working_tree(const char *path, const char *src,
- size_t len, struct strbuf *dst,
- void *dco);
-extern int async_query_available_blobs(const char *cmd, struct string_list *available_paths);
-extern int renormalize_buffer(const struct index_state *istate,
- const char *path, const char *src, size_t len,
- struct strbuf *dst);
+int convert_to_git(const struct index_state *istate,
+ const char *path, const char *src, size_t len,
+ struct strbuf *dst, int conv_flags);
+int convert_to_working_tree(const char *path, const char *src,
+ size_t len, struct strbuf *dst);
+int async_convert_to_working_tree(const char *path, const char *src,
+ size_t len, struct strbuf *dst,
+ void *dco);
+int async_query_available_blobs(const char *cmd,
+ struct string_list *available_paths);
+int renormalize_buffer(const struct index_state *istate,
+ const char *path, const char *src, size_t len,
+ struct strbuf *dst);
static inline int would_convert_to_git(const struct index_state *istate,
const char *path)
{
return convert_to_git(istate, path, NULL, 0, NULL, 0);
}
/* Precondition: would_convert_to_git_filter_fd(path) == true */
-extern void convert_to_git_filter_fd(const struct index_state *istate,
- const char *path, int fd,
- struct strbuf *dst,
- int conv_flags);
-extern int would_convert_to_git_filter_fd(const char *path);
+void convert_to_git_filter_fd(const struct index_state *istate,
+ const char *path, int fd,
+ struct strbuf *dst,
+ int conv_flags);
+int would_convert_to_git_filter_fd(const char *path);
/*****************************************************************
*
@@ -95,9 +96,10 @@ extern int would_convert_to_git_filter_fd(const char *path);
struct stream_filter; /* opaque */
-extern struct stream_filter *get_stream_filter(const char *path, const struct object_id *);
-extern void free_stream_filter(struct stream_filter *);
-extern int is_null_stream_filter(struct stream_filter *);
+struct stream_filter *get_stream_filter(const char *path,
+ const struct object_id *);
+void free_stream_filter(struct stream_filter *);
+int is_null_stream_filter(struct stream_filter *);
/*
* Use as much input up to *isize_p and fill output up to *osize_p;
@@ -111,8 +113,8 @@ extern int is_null_stream_filter(struct stream_filter *);
* such filters know there is no more input coming and it is time for
* them to produce the remaining output based on the buffered input.
*/
-extern int stream_filter(struct stream_filter *,
- const char *input, size_t *isize_p,
- char *output, size_t *osize_p);
+int stream_filter(struct stream_filter *,
+ const char *input, size_t *isize_p,
+ char *output, size_t *osize_p);
#endif /* CONVERT_H */
diff --git a/diff.h b/diff.h
index a14895bb82..20c697dbfe 100644
--- a/diff.h
+++ b/diff.h
@@ -258,15 +258,15 @@ const char *diff_line_prefix(struct diff_options *);
extern const char mime_boundary_leader[];
-extern struct combine_diff_path *diff_tree_paths(
+struct combine_diff_path *diff_tree_paths(
struct combine_diff_path *p, const struct object_id *oid,
const struct object_id **parents_oid, int nparent,
struct strbuf *base, struct diff_options *opt);
-extern int diff_tree_oid(const struct object_id *old_oid,
- const struct object_id *new_oid,
- const char *base, struct diff_options *opt);
-extern int diff_root_tree_oid(const struct object_id *new_oid, const char *base,
- struct diff_options *opt);
+int diff_tree_oid(const struct object_id *old_oid,
+ const struct object_id *new_oid,
+ const char *base, struct diff_options *opt);
+int diff_root_tree_oid(const struct object_id *new_oid, const char *base,
+ struct diff_options *opt);
struct combine_diff_path {
struct combine_diff_path *next;
@@ -283,33 +283,33 @@ struct combine_diff_path {
st_add4(sizeof(struct combine_diff_path), (l), 1, \
st_mult(sizeof(struct combine_diff_parent), (n)))
-extern void show_combined_diff(struct combine_diff_path *elem, int num_parent,
- int dense, struct rev_info *);
+void show_combined_diff(struct combine_diff_path *elem, int num_parent,
+ int dense, struct rev_info *);
-extern void diff_tree_combined(const struct object_id *oid, const struct oid_array *parents, int dense, struct rev_info *rev);
+void diff_tree_combined(const struct object_id *oid, const struct oid_array *parents, int dense, struct rev_info *rev);
-extern void diff_tree_combined_merge(const struct commit *commit, int dense, struct rev_info *rev);
+void diff_tree_combined_merge(const struct commit *commit, int dense, struct rev_info *rev);
void diff_set_mnemonic_prefix(struct diff_options *options, const char *a, const char *b);
-extern int diff_can_quit_early(struct diff_options *);
+int diff_can_quit_early(struct diff_options *);
-extern void diff_addremove(struct diff_options *,
- int addremove,
- unsigned mode,
- const struct object_id *oid,
- int oid_valid,
- const char *fullpath, unsigned dirty_submodule);
+void diff_addremove(struct diff_options *,
+ int addremove,
+ unsigned mode,
+ const struct object_id *oid,
+ int oid_valid,
+ const char *fullpath, unsigned dirty_submodule);
-extern void diff_change(struct diff_options *,
- unsigned mode1, unsigned mode2,
- const struct object_id *old_oid,
- const struct object_id *new_oid,
- int old_oid_valid, int new_oid_valid,
- const char *fullpath,
- unsigned dirty_submodule1, unsigned dirty_submodule2);
+void diff_change(struct diff_options *,
+ unsigned mode1, unsigned mode2,
+ const struct object_id *old_oid,
+ const struct object_id *new_oid,
+ int old_oid_valid, int new_oid_valid,
+ const char *fullpath,
+ unsigned dirty_submodule1, unsigned dirty_submodule2);
-extern struct diff_filepair *diff_unmerge(struct diff_options *, const char *path);
+struct diff_filepair *diff_unmerge(struct diff_options *, const char *path);
#define DIFF_SETUP_REVERSE 1
#define DIFF_SETUP_USE_CACHE 2
@@ -319,17 +319,17 @@ extern struct diff_filepair *diff_unmerge(struct diff_options *, const char *pat
* Poor man's alternative to parse-option, to allow both stuck form
* (--option=value) and separate form (--option value).
*/
-extern int parse_long_opt(const char *opt, const char **argv,
- const char **optarg);
-
-extern int git_diff_basic_config(const char *var, const char *value, void *cb);
-extern int git_diff_heuristic_config(const char *var, const char *value, void *cb);
-extern void init_diff_ui_defaults(void);
-extern int git_diff_ui_config(const char *var, const char *value, void *cb);
-extern void diff_setup(struct diff_options *);
-extern int diff_opt_parse(struct diff_options *, const char **, int, const char *);
-extern void diff_setup_done(struct diff_options *);
-extern int git_config_rename(const char *var, const char *value);
+int parse_long_opt(const char *opt, const char **argv,
+ const char **optarg);
+
+int git_diff_basic_config(const char *var, const char *value, void *cb);
+int git_diff_heuristic_config(const char *var, const char *value, void *cb);
+void init_diff_ui_defaults(void);
+int git_diff_ui_config(const char *var, const char *value, void *cb);
+void diff_setup(struct diff_options *);
+int diff_opt_parse(struct diff_options *, const char **, int, const char *);
+void diff_setup_done(struct diff_options *);
+int git_config_rename(const char *var, const char *value);
#define DIFF_DETECT_RENAME 1
#define DIFF_DETECT_COPY 2
@@ -347,8 +347,8 @@ extern int git_config_rename(const char *var, const char *value);
#define DIFF_PICKAXE_IGNORE_CASE 32
-extern void diffcore_std(struct diff_options *);
-extern void diffcore_fix_diff_index(struct diff_options *);
+void diffcore_std(struct diff_options *);
+void diffcore_fix_diff_index(struct diff_options *);
#define COMMON_DIFF_OPTIONS_HELP \
"\ncommon diff options:\n" \
@@ -378,9 +378,9 @@ extern void diffcore_fix_diff_index(struct diff_options *);
" show all files diff when -S is used and hit is found.\n" \
" -a --text treat all files as text.\n"
-extern int diff_queue_is_empty(void);
-extern void diff_flush(struct diff_options*);
-extern void diff_warn_rename_limit(const char *varname, int needed, int degraded_cc);
+int diff_queue_is_empty(void);
+void diff_flush(struct diff_options*);
+void diff_warn_rename_limit(const char *varname, int needed, int degraded_cc);
/* diff-raw status letters */
#define DIFF_STATUS_ADDED 'A'
@@ -402,24 +402,24 @@ extern void diff_warn_rename_limit(const char *varname, int needed, int degraded
* This is different from find_unique_abbrev() in that
* it stuffs the result with dots for alignment.
*/
-extern const char *diff_aligned_abbrev(const struct object_id *sha1, int);
+const char *diff_aligned_abbrev(const struct object_id *sha1, int);
/* do not report anything on removed paths */
#define DIFF_SILENT_ON_REMOVED 01
/* report racily-clean paths as modified */
#define DIFF_RACY_IS_MODIFIED 02
-extern int run_diff_files(struct rev_info *revs, unsigned int option);
-extern int run_diff_index(struct rev_info *revs, int cached);
+int run_diff_files(struct rev_info *revs, unsigned int option);
+int run_diff_index(struct rev_info *revs, int cached);
-extern int do_diff_cache(const struct object_id *, struct diff_options *);
-extern int diff_flush_patch_id(struct diff_options *, struct object_id *, int);
+int do_diff_cache(const struct object_id *, struct diff_options *);
+int diff_flush_patch_id(struct diff_options *, struct object_id *, int);
-extern int diff_result_code(struct diff_options *, int);
+int diff_result_code(struct diff_options *, int);
-extern void diff_no_index(struct rev_info *, int, const char **);
+void diff_no_index(struct rev_info *, int, const char **);
-extern int index_differs_from(const char *def, const struct diff_flags *flags,
- int ita_invisible_in_index);
+int index_differs_from(const char *def, const struct diff_flags *flags,
+ int ita_invisible_in_index);
/*
* Fill the contents of the filespec "df", respecting any textconv defined by
@@ -432,30 +432,30 @@ extern int index_differs_from(const char *def, const struct diff_flags *flags,
* struct. If it is non-NULL, then "outbuf" points to a newly allocated buffer
* that should be freed by the caller.
*/
-extern size_t fill_textconv(struct userdiff_driver *driver,
- struct diff_filespec *df,
- char **outbuf);
+size_t fill_textconv(struct userdiff_driver *driver,
+ struct diff_filespec *df,
+ char **outbuf);
/*
* Look up the userdiff driver for the given filespec, and return it if
* and only if it has textconv enabled (otherwise return NULL). The result
* can be passed to fill_textconv().
*/
-extern struct userdiff_driver *get_textconv(struct diff_filespec *one);
+struct userdiff_driver *get_textconv(struct diff_filespec *one);
/*
* Prepare diff_filespec and convert it using diff textconv API
* if the textconv driver exists.
* Return 1 if the conversion succeeds, 0 otherwise.
*/
-extern int textconv_object(const char *path, unsigned mode, const struct object_id *oid, int oid_valid, char **buf, unsigned long *buf_size);
+int textconv_object(const char *path, unsigned mode, const struct object_id *oid, int oid_valid, char **buf, unsigned long *buf_size);
-extern int parse_rename_score(const char **cp_p);
+int parse_rename_score(const char **cp_p);
-extern long parse_algorithm_value(const char *value);
+long parse_algorithm_value(const char *value);
-extern void print_stat_summary(FILE *fp, int files,
- int insertions, int deletions);
-extern void setup_diff_pager(struct diff_options *);
+void print_stat_summary(FILE *fp, int files,
+ int insertions, int deletions);
+void setup_diff_pager(struct diff_options *);
#endif /* DIFF_H */
diff --git a/diffcore.h b/diffcore.h
index a30da161da..81281a398b 100644
--- a/diffcore.h
+++ b/diffcore.h
@@ -50,17 +50,17 @@ struct diff_filespec {
struct userdiff_driver *driver;
};
-extern struct diff_filespec *alloc_filespec(const char *);
-extern void free_filespec(struct diff_filespec *);
-extern void fill_filespec(struct diff_filespec *, const struct object_id *,
- int, unsigned short);
+struct diff_filespec *alloc_filespec(const char *);
+void free_filespec(struct diff_filespec *);
+void fill_filespec(struct diff_filespec *, const struct object_id *,
+ int, unsigned short);
#define CHECK_SIZE_ONLY 1
#define CHECK_BINARY 2
-extern int diff_populate_filespec(struct diff_filespec *, unsigned int);
-extern void diff_free_filespec_data(struct diff_filespec *);
-extern void diff_free_filespec_blob(struct diff_filespec *);
-extern int diff_filespec_is_binary(struct diff_filespec *);
+int diff_populate_filespec(struct diff_filespec *, unsigned int);
+void diff_free_filespec_data(struct diff_filespec *);
+void diff_free_filespec_blob(struct diff_filespec *);
+int diff_filespec_is_binary(struct diff_filespec *);
struct diff_filepair {
struct diff_filespec *one;
@@ -86,9 +86,9 @@ struct diff_filepair {
#define DIFF_PAIR_MODE_CHANGED(p) ((p)->one->mode != (p)->two->mode)
-extern void diff_free_filepair(struct diff_filepair *);
+void diff_free_filepair(struct diff_filepair *);
-extern int diff_unmodified_pair(struct diff_filepair *);
+int diff_unmodified_pair(struct diff_filepair *);
struct diff_queue_struct {
struct diff_filepair **queue;
@@ -102,16 +102,16 @@ struct diff_queue_struct {
} while (0)
extern struct diff_queue_struct diff_queued_diff;
-extern struct diff_filepair *diff_queue(struct diff_queue_struct *,
- struct diff_filespec *,
- struct diff_filespec *);
-extern void diff_q(struct diff_queue_struct *, struct diff_filepair *);
+struct diff_filepair *diff_queue(struct diff_queue_struct *,
+ struct diff_filespec *,
+ struct diff_filespec *);
+void diff_q(struct diff_queue_struct *, struct diff_filepair *);
-extern void diffcore_break(int);
-extern void diffcore_rename(struct diff_options *);
-extern void diffcore_merge_broken(void);
-extern void diffcore_pickaxe(struct diff_options *);
-extern void diffcore_order(const char *orderfile);
+void diffcore_break(int);
+void diffcore_rename(struct diff_options *);
+void diffcore_merge_broken(void);
+void diffcore_pickaxe(struct diff_options *);
+void diffcore_order(const char *orderfile);
/* low-level interface to diffcore_order */
struct obj_order {
@@ -138,11 +138,11 @@ void diff_debug_queue(const char *, struct diff_queue_struct *);
#define diff_debug_queue(a,b) do { /* nothing */ } while (0)
#endif
-extern int diffcore_count_changes(struct diff_filespec *src,
- struct diff_filespec *dst,
- void **src_count_p,
- void **dst_count_p,
- unsigned long *src_copied,
- unsigned long *literal_added);
+int diffcore_count_changes(struct diff_filespec *src,
+ struct diff_filespec *dst,
+ void **src_count_p,
+ void **dst_count_p,
+ unsigned long *src_copied,
+ unsigned long *literal_added);
#endif
diff --git a/line-range.h b/line-range.h
index 83ba3c25e8..d3c54e45aa 100644
--- a/line-range.h
+++ b/line-range.h
@@ -19,11 +19,11 @@
typedef const char *(*nth_line_fn_t)(void *data, long lno);
-extern int parse_range_arg(const char *arg,
- nth_line_fn_t nth_line_cb,
- void *cb_data, long lines, long anchor,
- long *begin, long *end,
- const char *path);
+int parse_range_arg(const char *arg,
+ nth_line_fn_t nth_line_cb,
+ void *cb_data, long lines, long anchor,
+ long *begin, long *end,
+ const char *path);
/*
* Scan past a range argument that could be parsed by
@@ -34,6 +34,6 @@ extern int parse_range_arg(const char *arg,
* NULL in case the argument is obviously malformed.
*/
-extern const char *skip_range_arg(const char *arg);
+const char *skip_range_arg(const char *arg);
#endif /* LINE_RANGE_H */
diff --git a/repository.h b/repository.h
index b9413be50c..58961037c4 100644
--- a/repository.h
+++ b/repository.h
@@ -108,19 +108,16 @@ struct set_gitdir_args {
const char *alternate_db;
};
-extern void repo_set_gitdir(struct repository *repo,
- const char *root,
- const struct set_gitdir_args *extra_args);
-extern void repo_set_worktree(struct repository *repo, const char *path);
-extern void repo_set_hash_algo(struct repository *repo, int algo);
-extern void initialize_the_repository(void);
-extern int repo_init(struct repository *r,
- const char *gitdir,
- const char *worktree);
-extern int repo_submodule_init(struct repository *submodule,
- struct repository *superproject,
- const char *path);
-extern void repo_clear(struct repository *repo);
+void repo_set_gitdir(struct repository *repo, const char *root,
+ const struct set_gitdir_args *extra_args);
+void repo_set_worktree(struct repository *repo, const char *path);
+void repo_set_hash_algo(struct repository *repo, int algo);
+void initialize_the_repository(void);
+int repo_init(struct repository *r, const char *gitdir, const char *worktree);
+int repo_submodule_init(struct repository *submodule,
+ struct repository *superproject,
+ const char *path);
+void repo_clear(struct repository *repo);
/*
* Populates the repository's index from its index_file, an index struct will
@@ -130,6 +127,6 @@ extern void repo_clear(struct repository *repo);
* than zero if an error occured. If the repository's index has already been
* populated then the number of entries will simply be returned.
*/
-extern int repo_read_index(struct repository *repo);
+int repo_read_index(struct repository *repo);
#endif /* REPOSITORY_H */
diff --git a/rerere.h b/rerere.h
index c2961feaaa..cd948f28f4 100644
--- a/rerere.h
+++ b/rerere.h
@@ -22,19 +22,19 @@ struct rerere_id {
int variant;
};
-extern int setup_rerere(struct string_list *, int);
-extern int rerere(int);
+int setup_rerere(struct string_list *, int);
+int rerere(int);
/*
* Given the conflict ID and the name of a "file" used for replaying
* the recorded resolution (e.g. "preimage", "postimage"), return the
* path to that filesystem entity. With "file" specified with NULL,
* return the path to the directory that houses these files.
*/
-extern const char *rerere_path(const struct rerere_id *, const char *file);
-extern int rerere_forget(struct pathspec *);
-extern int rerere_remaining(struct string_list *);
-extern void rerere_clear(struct string_list *);
-extern void rerere_gc(struct string_list *);
+const char *rerere_path(const struct rerere_id *, const char *file);
+int rerere_forget(struct pathspec *);
+int rerere_remaining(struct string_list *);
+void rerere_clear(struct string_list *);
+void rerere_gc(struct string_list *);
#define OPT_RERERE_AUTOUPDATE(v) OPT_UYN(0, "rerere-autoupdate", (v), \
N_("update the index with reused conflict resolution if possible"))
diff --git a/revision.h b/revision.h
index c599c34da9..51bb57d889 100644
--- a/revision.h
+++ b/revision.h
@@ -230,7 +230,7 @@ struct rev_info {
struct revision_sources *sources;
};
-extern int ref_excluded(struct string_list *, const char *path);
+int ref_excluded(struct string_list *, const char *path);
void clear_ref_exclusion(struct string_list **);
void add_ref_exclusion(struct string_list **, const char *exclude);
@@ -252,39 +252,39 @@ struct setup_revision_opt {
unsigned revarg_opt;
};
-extern void init_revisions(struct rev_info *revs, const char *prefix);
-extern int setup_revisions(int argc, const char **argv, struct rev_info *revs,
- struct setup_revision_opt *);
-extern void parse_revision_opt(struct rev_info *revs, struct parse_opt_ctx_t *ctx,
- const struct option *options,
- const char * const usagestr[]);
+void init_revisions(struct rev_info *revs, const char *prefix);
+int setup_revisions(int argc, const char **argv, struct rev_info *revs,
+ struct setup_revision_opt *);
+void parse_revision_opt(struct rev_info *revs, struct parse_opt_ctx_t *ctx,
+ const struct option *options,
+ const char * const usagestr[]);
#define REVARG_CANNOT_BE_FILENAME 01
#define REVARG_COMMITTISH 02
-extern int handle_revision_arg(const char *arg, struct rev_info *revs,
- int flags, unsigned revarg_opt);
+int handle_revision_arg(const char *arg, struct rev_info *revs,
+ int flags, unsigned revarg_opt);
-extern void reset_revision_walk(void);
-extern int prepare_revision_walk(struct rev_info *revs);
-extern struct commit *get_revision(struct rev_info *revs);
-extern char *get_revision_mark(const struct rev_info *revs,
- const struct commit *commit);
-extern void put_revision_mark(const struct rev_info *revs,
- const struct commit *commit);
+void reset_revision_walk(void);
+int prepare_revision_walk(struct rev_info *revs);
+struct commit *get_revision(struct rev_info *revs);
+char *get_revision_mark(const struct rev_info *revs,
+ const struct commit *commit);
+void put_revision_mark(const struct rev_info *revs,
+ const struct commit *commit);
-extern void mark_parents_uninteresting(struct commit *commit);
-extern void mark_tree_uninteresting(struct tree *tree);
+void mark_parents_uninteresting(struct commit *commit);
+void mark_tree_uninteresting(struct tree *tree);
-extern void show_object_with_name(FILE *, struct object *, const char *);
+void show_object_with_name(FILE *, struct object *, const char *);
-extern void add_pending_object(struct rev_info *revs,
- struct object *obj, const char *name);
-extern void add_pending_oid(struct rev_info *revs,
- const char *name, const struct object_id *oid,
- unsigned int flags);
+void add_pending_object(struct rev_info *revs,
+ struct object *obj, const char *name);
+void add_pending_oid(struct rev_info *revs,
+ const char *name, const struct object_id *oid,
+ unsigned int flags);
-extern void add_head_to_pending(struct rev_info *);
-extern void add_reflogs_to_pending(struct rev_info *, unsigned int flags);
-extern void add_index_objects_to_pending(struct rev_info *, unsigned int flags);
+void add_head_to_pending(struct rev_info *);
+void add_reflogs_to_pending(struct rev_info *, unsigned int flags);
+void add_index_objects_to_pending(struct rev_info *, unsigned int flags);
enum commit_action {
commit_ignore,
@@ -292,10 +292,10 @@ enum commit_action {
commit_error
};
-extern enum commit_action get_commit_action(struct rev_info *revs,
- struct commit *commit);
-extern enum commit_action simplify_commit(struct rev_info *revs,
- struct commit *commit);
+enum commit_action get_commit_action(struct rev_info *revs,
+ struct commit *commit);
+enum commit_action simplify_commit(struct rev_info *revs,
+ struct commit *commit);
enum rewrite_result {
rewrite_one_ok,
@@ -305,8 +305,9 @@ enum rewrite_result {
typedef enum rewrite_result (*rewrite_parent_fn_t)(struct rev_info *revs, struct commit **pp);
-extern int rewrite_parents(struct rev_info *revs, struct commit *commit,
- rewrite_parent_fn_t rewrite_parent);
+int rewrite_parents(struct rev_info *revs,
+ struct commit *commit,
+ rewrite_parent_fn_t rewrite_parent);
/*
* The log machinery saves the original parent list so that
@@ -317,6 +318,6 @@ extern int rewrite_parents(struct rev_info *revs, struct commit *commit,
* get_saved_parents() will transparently return commit->parents if
* history simplification is off.
*/
-extern struct commit_list *get_saved_parents(struct rev_info *revs, const struct commit *commit);
+struct commit_list *get_saved_parents(struct rev_info *revs, const struct commit *commit);
#endif
diff --git a/submodule.h b/submodule.h
index 4644683e6c..c98cd983e1 100644
--- a/submodule.h
+++ b/submodule.h
@@ -33,62 +33,62 @@ struct submodule_update_strategy {
};
#define SUBMODULE_UPDATE_STRATEGY_INIT {SM_UPDATE_UNSPECIFIED, NULL}
-extern int is_gitmodules_unmerged(const struct index_state *istate);
-extern int is_staging_gitmodules_ok(struct index_state *istate);
-extern int update_path_in_gitmodules(const char *oldpath, const char *newpath);
-extern int remove_path_from_gitmodules(const char *path);
-extern void stage_updated_gitmodules(struct index_state *istate);
-extern void set_diffopt_flags_from_submodule_config(struct diff_options *,
- const char *path);
-extern int git_default_submodule_config(const char *var, const char *value, void *cb);
+int is_gitmodules_unmerged(const struct index_state *istate);
+int is_staging_gitmodules_ok(struct index_state *istate);
+int update_path_in_gitmodules(const char *oldpath, const char *newpath);
+int remove_path_from_gitmodules(const char *path);
+void stage_updated_gitmodules(struct index_state *istate);
+void set_diffopt_flags_from_submodule_config(struct diff_options *,
+ const char *path);
+int git_default_submodule_config(const char *var, const char *value, void *cb);
struct option;
int option_parse_recurse_submodules_worktree_updater(const struct option *opt,
const char *arg, int unset);
-extern int is_submodule_active(struct repository *repo, const char *path);
+int is_submodule_active(struct repository *repo, const char *path);
/*
* Determine if a submodule has been populated at a given 'path' by checking if
* the <path>/.git resolves to a valid git repository.
* If return_error_code is NULL, die on error.
* Otherwise the return error code is the same as of resolve_gitdir_gently.
*/
-extern int is_submodule_populated_gently(const char *path, int *return_error_code);
-extern void die_in_unpopulated_submodule(const struct index_state *istate,
- const char *prefix);
-extern void die_path_inside_submodule(const struct index_state *istate,
- const struct pathspec *ps);
-extern enum submodule_update_type parse_submodule_update_type(const char *value);
-extern int parse_submodule_update_strategy(const char *value,
- struct submodule_update_strategy *dst);
-extern const char *submodule_strategy_to_string(const struct submodule_update_strategy *s);
-extern void handle_ignore_submodules_arg(struct diff_options *, const char *);
-extern void show_submodule_summary(struct diff_options *o, const char *path,
- struct object_id *one, struct object_id *two,
- unsigned dirty_submodule);
-extern void show_submodule_inline_diff(struct diff_options *o, const char *path,
- struct object_id *one, struct object_id *two,
- unsigned dirty_submodule);
+int is_submodule_populated_gently(const char *path, int *return_error_code);
+void die_in_unpopulated_submodule(const struct index_state *istate,
+ const char *prefix);
+void die_path_inside_submodule(const struct index_state *istate,
+ const struct pathspec *ps);
+enum submodule_update_type parse_submodule_update_type(const char *value);
+int parse_submodule_update_strategy(const char *value,
+ struct submodule_update_strategy *dst);
+const char *submodule_strategy_to_string(const struct submodule_update_strategy *s);
+void handle_ignore_submodules_arg(struct diff_options *, const char *);
+void show_submodule_summary(struct diff_options *o, const char *path,
+ struct object_id *one, struct object_id *two,
+ unsigned dirty_submodule);
+void show_submodule_inline_diff(struct diff_options *o, const char *path,
+ struct object_id *one, struct object_id *two,
+ unsigned dirty_submodule);
<