*.[ch]: remove extern from function declarations using spatch

There has been a push to remove extern from function declarations. Remove some instances of "extern" for function declarations which are caught by Coccinelle. Note that Coccinelle has some difficulty with processing functions with `__attribute__` or varargs so some `extern` declarations are left behind to be dealt with in a future patch. This was the Coccinelle patch used: @@ type T; identifier f; @@ - extern T f(...); and it was run with: $ git ls-files \*.{c,h} | grep -v ^compat/ | xargs spatch --sp-file contrib/coccinelle/noextern.cocci --in-place Files under `compat/` are intentionally excluded as some are directly copied from external sources and we should avoid churning them as much as possible. Signed-off-by: Denton Liu <liu.denton@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Denton Liu committed Apr 29, 2019 at 04:28 UTC 554544276a604c144df45efcb060c80aa322088c
70 files changed +885 -885
advice.h
+1 -1
@@ -31,7 +31,7 @@ int git_default_advice_config(const char *var, const char *value);
31 __attribute__((format (printf, 1, 2)))
32 void advise(const char *advice, ...);
33 int error_resolve_conflict(const char *me);
34 -extern void NORETURN die_resolve_conflict(const char *me);
34 +void NORETURN die_resolve_conflict(const char *me);
35 void NORETURN die_conclude_merge(void);
36 void detach_advice(const char *new_name);
37
archive.h
+7 -7
@@ -23,7 +23,7 @@ struct archiver_args {
23
24 /* main api */
25
26 -extern int write_archive(int argc, const char **argv, const char *prefix,
26 +int write_archive(int argc, const char **argv, const char *prefix,
27 struct repository *repo,
28 const char *name_hint, int remote);
29
@@ -39,19 +39,19 @@ struct archiver {
39 unsigned flags;
40 void *data;
41 };
42 -extern void register_archiver(struct archiver *);
42 +void register_archiver(struct archiver *);
43
44 -extern void init_tar_archiver(void);
45 -extern void init_zip_archiver(void);
46 -extern void init_archivers(void);
44 +void init_tar_archiver(void);
45 +void init_zip_archiver(void);
46 +void init_archivers(void);
47
48 typedef int (*write_archive_entry_fn_t)(struct archiver_args *args,
49 const struct object_id *oid,
50 const char *path, size_t pathlen,
51 unsigned int mode);
52
53 -extern int write_archive_entries(struct archiver_args *args, write_archive_entry_fn_t write_entry);
54 -extern void *object_file_to_archive(const struct archiver_args *args,
53 +int write_archive_entries(struct archiver_args *args, write_archive_entry_fn_t write_entry);
54 +void *object_file_to_archive(const struct archiver_args *args,
55 const char *path, const struct object_id *oid,
56 unsigned int mode, enum object_type *type,
57 unsigned long *sizep);
bisect.h
+6 -6
@@ -11,10 +11,10 @@ struct repository;
11 * Otherwise, it will be either all non-SAMETREE commits or the single
12 * best commit, as chosen by `find_all`.
13 */
14 -extern void find_bisection(struct commit_list **list, int *reaches, int *all,
14 +void find_bisection(struct commit_list **list, int *reaches, int *all,
15 int find_all);
16
17 -extern struct commit_list *filter_skipped(struct commit_list *list,
17 +struct commit_list *filter_skipped(struct commit_list *list,
18 struct commit_list **tried,
19 int show_all,
20 int *count,
@@ -31,14 +31,14 @@ struct rev_list_info {
31 const char *header_prefix;
32 };
33
34 -extern int bisect_next_all(struct repository *r,
34 +int bisect_next_all(struct repository *r,
35 const char *prefix,
36 int no_checkout);
37
38 -extern int estimate_bisect_steps(int all);
38 +int estimate_bisect_steps(int all);
39
40 -extern void read_bisect_terms(const char **bad, const char **good);
40 +void read_bisect_terms(const char **bad, const char **good);
41
42 -extern int bisect_clean_state(void);
42 +int bisect_clean_state(void);
43
44 #endif
blame.h
+1 -1
@@ -177,6 +177,6 @@ struct blame_entry *blame_entry_prepend(struct blame_entry *head,
177 long start, long end,
178 struct blame_origin *o);
179
180 -extern struct blame_origin *get_blame_suspects(struct commit *commit);
180 +struct blame_origin *get_blame_suspects(struct commit *commit);
181
182 #endif /* BLAME_H */
branch.h
+6 -6
@@ -50,7 +50,7 @@ void create_branch(struct repository *r,
50 * Return 1 if the named branch already exists; return 0 otherwise.
51 * Fill ref with the full refname for the branch.
52 */
53 -extern int validate_branchname(const char *name, struct strbuf *ref);
53 +int validate_branchname(const char *name, struct strbuf *ref);
54
55 /*
56 * Check if a branch 'name' can be created as a new branch; die otherwise.
@@ -58,7 +58,7 @@ extern int validate_branchname(const char *name, struct strbuf *ref);
58 * Return 1 if the named branch already exists; return 0 otherwise.
59 * Fill ref with the full refname for the branch.
60 */
61 -extern int validate_new_branchname(const char *name, struct strbuf *ref, int force);
61 +int validate_new_branchname(const char *name, struct strbuf *ref, int force);
62
63 /*
64 * Remove information about the state of working on the current
@@ -72,26 +72,26 @@ void remove_branch_state(struct repository *r);
72 * Returns 0 on success.
73 */
74 #define BRANCH_CONFIG_VERBOSE 01
75 -extern int install_branch_config(int flag, const char *local, const char *origin, const char *remote);
75 +int install_branch_config(int flag, const char *local, const char *origin, const char *remote);
76
77 /*
78 * Read branch description
79 */
80 -extern int read_branch_desc(struct strbuf *, const char *branch_name);
80 +int read_branch_desc(struct strbuf *, const char *branch_name);
81
82 /*
83 * Check if a branch is checked out in the main worktree or any linked
84 * worktree and die (with a message describing its checkout location) if
85 * it is.
86 */
87 -extern void die_if_checked_out(const char *branch, int ignore_current_worktree);
87 +void die_if_checked_out(const char *branch, int ignore_current_worktree);
88
89 /*
90 * Update all per-worktree HEADs pointing at the old ref to point the new ref.
91 * This will be used when renaming a branch. Returns 0 if successful, non-zero
92 * otherwise.
93 */
94 -extern int replace_each_worktree_head_symref(const char *oldref, const char *newref,
94 +int replace_each_worktree_head_symref(const char *oldref, const char *newref,
95 const char *logmsg);
96
97 #endif
builtin.h
+126 -126
@@ -102,7 +102,7 @@ extern const char git_more_info_string[];
102 #define PRUNE_PACKED_DRY_RUN 01
103 #define PRUNE_PACKED_VERBOSE 02
104
105 -extern void prune_packed_objects(int);
105 +void prune_packed_objects(int);
106
107 struct fmt_merge_msg_opts {
108 unsigned add_title:1,
@@ -110,7 +110,7 @@ struct fmt_merge_msg_opts {
110 int shortlog_len;
111 };
112
113 -extern int fmt_merge_msg(struct strbuf *in, struct strbuf *out,
113 +int fmt_merge_msg(struct strbuf *in, struct strbuf *out,
114 struct fmt_merge_msg_opts *);
115
116 /**
@@ -123,131 +123,131 @@ extern int fmt_merge_msg(struct strbuf *in, struct strbuf *out,
123 * You should most likely use a default of 0 or 1. "Punt" (-1) could be useful
124 * to be able to fall back to some historical compatibility name.
125 */
126 -extern void setup_auto_pager(const char *cmd, int def);
126 +void setup_auto_pager(const char *cmd, int def);
127
128 -extern int is_builtin(const char *s);
128 +int is_builtin(const char *s);
129
130 -extern int cmd_add(int argc, const char **argv, const char *prefix);
131 -extern int cmd_am(int argc, const char **argv, const char *prefix);
132 -extern int cmd_annotate(int argc, const char **argv, const char *prefix);
133 -extern int cmd_apply(int argc, const char **argv, const char *prefix);
134 -extern int cmd_archive(int argc, const char **argv, const char *prefix);
135 -extern int cmd_bisect__helper(int argc, const char **argv, const char *prefix);
136 -extern int cmd_blame(int argc, const char **argv, const char *prefix);
137 -extern int cmd_branch(int argc, const char **argv, const char *prefix);
138 -extern int cmd_bundle(int argc, const char **argv, const char *prefix);
139 -extern int cmd_cat_file(int argc, const char **argv, const char *prefix);
140 -extern int cmd_checkout(int argc, const char **argv, const char *prefix);
141 -extern int cmd_checkout_index(int argc, const char **argv, const char *prefix);
142 -extern int cmd_check_attr(int argc, const char **argv, const char *prefix);
143 -extern int cmd_check_ignore(int argc, const char **argv, const char *prefix);
144 -extern int cmd_check_mailmap(int argc, const char **argv, const char *prefix);
145 -extern int cmd_check_ref_format(int argc, const char **argv, const char *prefix);
146 -extern int cmd_cherry(int argc, const char **argv, const char *prefix);
147 -extern int cmd_cherry_pick(int argc, const char **argv, const char *prefix);
148 -extern int cmd_clone(int argc, const char **argv, const char *prefix);
149 -extern int cmd_clean(int argc, const char **argv, const char *prefix);
150 -extern int cmd_column(int argc, const char **argv, const char *prefix);
151 -extern int cmd_commit(int argc, const char **argv, const char *prefix);
152 -extern int cmd_commit_graph(int argc, const char **argv, const char *prefix);
153 -extern int cmd_commit_tree(int argc, const char **argv, const char *prefix);
154 -extern int cmd_config(int argc, const char **argv, const char *prefix);
155 -extern int cmd_count_objects(int argc, const char **argv, const char *prefix);
156 -extern int cmd_credential(int argc, const char **argv, const char *prefix);
157 -extern int cmd_describe(int argc, const char **argv, const char *prefix);
158 -extern int cmd_diff_files(int argc, const char **argv, const char *prefix);
159 -extern int cmd_diff_index(int argc, const char **argv, const char *prefix);
160 -extern int cmd_diff(int argc, const char **argv, const char *prefix);
161 -extern int cmd_diff_tree(int argc, const char **argv, const char *prefix);
162 -extern int cmd_difftool(int argc, const char **argv, const char *prefix);
163 -extern int cmd_fast_export(int argc, const char **argv, const char *prefix);
164 -extern int cmd_fetch(int argc, const char **argv, const char *prefix);
165 -extern int cmd_fetch_pack(int argc, const char **argv, const char *prefix);
166 -extern int cmd_fmt_merge_msg(int argc, const char **argv, const char *prefix);
167 -extern int cmd_for_each_ref(int argc, const char **argv, const char *prefix);
168 -extern int cmd_format_patch(int argc, const char **argv, const char *prefix);
169 -extern int cmd_fsck(int argc, const char **argv, const char *prefix);
170 -extern int cmd_gc(int argc, const char **argv, const char *prefix);
171 -extern int cmd_get_tar_commit_id(int argc, const char **argv, const char *prefix);
172 -extern int cmd_grep(int argc, const char **argv, const char *prefix);
173 -extern int cmd_hash_object(int argc, const char **argv, const char *prefix);
174 -extern int cmd_help(int argc, const char **argv, const char *prefix);
175 -extern int cmd_index_pack(int argc, const char **argv, const char *prefix);
176 -extern int cmd_init_db(int argc, const char **argv, const char *prefix);
177 -extern int cmd_interpret_trailers(int argc, const char **argv, const char *prefix);
178 -extern int cmd_log(int argc, const char **argv, const char *prefix);
179 -extern int cmd_log_reflog(int argc, const char **argv, const char *prefix);
180 -extern int cmd_ls_files(int argc, const char **argv, const char *prefix);
181 -extern int cmd_ls_tree(int argc, const char **argv, const char *prefix);
182 -extern int cmd_ls_remote(int argc, const char **argv, const char *prefix);
183 -extern int cmd_mailinfo(int argc, const char **argv, const char *prefix);
184 -extern int cmd_mailsplit(int argc, const char **argv, const char *prefix);
185 -extern int cmd_merge(int argc, const char **argv, const char *prefix);
186 -extern int cmd_merge_base(int argc, const char **argv, const char *prefix);
187 -extern int cmd_merge_index(int argc, const char **argv, const char *prefix);
188 -extern int cmd_merge_ours(int argc, const char **argv, const char *prefix);
189 -extern int cmd_merge_file(int argc, const char **argv, const char *prefix);
190 -extern int cmd_merge_recursive(int argc, const char **argv, const char *prefix);
191 -extern int cmd_merge_tree(int argc, const char **argv, const char *prefix);
192 -extern int cmd_mktag(int argc, const char **argv, const char *prefix);
193 -extern int cmd_mktree(int argc, const char **argv, const char *prefix);
194 -extern int cmd_multi_pack_index(int argc, const char **argv, const char *prefix);
195 -extern int cmd_mv(int argc, const char **argv, const char *prefix);
196 -extern int cmd_name_rev(int argc, const char **argv, const char *prefix);
197 -extern int cmd_notes(int argc, const char **argv, const char *prefix);
198 -extern int cmd_pack_objects(int argc, const char **argv, const char *prefix);
199 -extern int cmd_pack_redundant(int argc, const char **argv, const char *prefix);
200 -extern int cmd_patch_id(int argc, const char **argv, const char *prefix);
201 -extern int cmd_prune(int argc, const char **argv, const char *prefix);
202 -extern int cmd_prune_packed(int argc, const char **argv, const char *prefix);
203 -extern int cmd_pull(int argc, const char **argv, const char *prefix);
204 -extern int cmd_push(int argc, const char **argv, const char *prefix);
205 -extern int cmd_range_diff(int argc, const char **argv, const char *prefix);
206 -extern int cmd_read_tree(int argc, const char **argv, const char *prefix);
207 -extern int cmd_rebase(int argc, const char **argv, const char *prefix);
208 -extern int cmd_rebase__interactive(int argc, const char **argv, const char *prefix);
209 -extern int cmd_receive_pack(int argc, const char **argv, const char *prefix);
210 -extern int cmd_reflog(int argc, const char **argv, const char *prefix);
211 -extern int cmd_remote(int argc, const char **argv, const char *prefix);
212 -extern int cmd_remote_ext(int argc, const char **argv, const char *prefix);
213 -extern int cmd_remote_fd(int argc, const char **argv, const char *prefix);
214 -extern int cmd_repack(int argc, const char **argv, const char *prefix);
215 -extern int cmd_rerere(int argc, const char **argv, const char *prefix);
216 -extern int cmd_reset(int argc, const char **argv, const char *prefix);
217 -extern int cmd_rev_list(int argc, const char **argv, const char *prefix);
218 -extern int cmd_rev_parse(int argc, const char **argv, const char *prefix);
219 -extern int cmd_revert(int argc, const char **argv, const char *prefix);
220 -extern int cmd_rm(int argc, const char **argv, const char *prefix);
221 -extern int cmd_send_pack(int argc, const char **argv, const char *prefix);
222 -extern int cmd_serve(int argc, const char **argv, const char *prefix);
223 -extern int cmd_shortlog(int argc, const char **argv, const char *prefix);
224 -extern int cmd_show(int argc, const char **argv, const char *prefix);
225 -extern int cmd_show_branch(int argc, const char **argv, const char *prefix);
226 -extern int cmd_show_index(int argc, const char **argv, const char *prefix);
227 -extern int cmd_status(int argc, const char **argv, const char *prefix);
228 -extern int cmd_stripspace(int argc, const char **argv, const char *prefix);
229 -extern int cmd_submodule__helper(int argc, const char **argv, const char *prefix);
230 -extern int cmd_symbolic_ref(int argc, const char **argv, const char *prefix);
231 -extern int cmd_tag(int argc, const char **argv, const char *prefix);
232 -extern int cmd_tar_tree(int argc, const char **argv, const char *prefix);
233 -extern int cmd_unpack_file(int argc, const char **argv, const char *prefix);
234 -extern int cmd_unpack_objects(int argc, const char **argv, const char *prefix);
235 -extern int cmd_update_index(int argc, const char **argv, const char *prefix);
236 -extern int cmd_update_ref(int argc, const char **argv, const char *prefix);
237 -extern int cmd_update_server_info(int argc, const char **argv, const char *prefix);
238 -extern int cmd_upload_archive(int argc, const char **argv, const char *prefix);
239 -extern int cmd_upload_archive_writer(int argc, const char **argv, const char *prefix);
240 -extern int cmd_upload_pack(int argc, const char **argv, const char *prefix);
241 -extern int cmd_var(int argc, const char **argv, const char *prefix);
242 -extern int cmd_verify_commit(int argc, const char **argv, const char *prefix);
243 -extern int cmd_verify_tag(int argc, const char **argv, const char *prefix);
244 -extern int cmd_version(int argc, const char **argv, const char *prefix);
245 -extern int cmd_whatchanged(int argc, const char **argv, const char *prefix);
246 -extern int cmd_worktree(int argc, const char **argv, const char *prefix);
247 -extern int cmd_write_tree(int argc, const char **argv, const char *prefix);
248 -extern int cmd_verify_pack(int argc, const char **argv, const char *prefix);
249 -extern int cmd_show_ref(int argc, const char **argv, const char *prefix);
250 -extern int cmd_pack_refs(int argc, const char **argv, const char *prefix);
251 -extern int cmd_replace(int argc, const char **argv, const char *prefix);
130 +int cmd_add(int argc, const char **argv, const char *prefix);
131 +int cmd_am(int argc, const char **argv, const char *prefix);
132 +int cmd_annotate(int argc, const char **argv, const char *prefix);
133 +int cmd_apply(int argc, const char **argv, const char *prefix);
134 +int cmd_archive(int argc, const char **argv, const char *prefix);
135 +int cmd_bisect__helper(int argc, const char **argv, const char *prefix);
136 +int cmd_blame(int argc, const char **argv, const char *prefix);
137 +int cmd_branch(int argc, const char **argv, const char *prefix);
138 +int cmd_bundle(int argc, const char **argv, const char *prefix);
139 +int cmd_cat_file(int argc, const char **argv, const char *prefix);
140 +int cmd_checkout(int argc, const char **argv, const char *prefix);
141 +int cmd_checkout_index(int argc, const char **argv, const char *prefix);
142 +int cmd_check_attr(int argc, const char **argv, const char *prefix);
143 +int cmd_check_ignore(int argc, const char **argv, const char *prefix);
144 +int cmd_check_mailmap(int argc, const char **argv, const char *prefix);
145 +int cmd_check_ref_format(int argc, const char **argv, const char *prefix);
146 +int cmd_cherry(int argc, const char **argv, const char *prefix);
147 +int cmd_cherry_pick(int argc, const char **argv, const char *prefix);
148 +int cmd_clone(int argc, const char **argv, const char *prefix);
149 +int cmd_clean(int argc, const char **argv, const char *prefix);
150 +int cmd_column(int argc, const char **argv, const char *prefix);
151 +int cmd_commit(int argc, const char **argv, const char *prefix);
152 +int cmd_commit_graph(int argc, const char **argv, const char *prefix);
153 +int cmd_commit_tree(int argc, const char **argv, const char *prefix);
154 +int cmd_config(int argc, const char **argv, const char *prefix);
155 +int cmd_count_objects(int argc, const char **argv, const char *prefix);
156 +int cmd_credential(int argc, const char **argv, const char *prefix);
157 +int cmd_describe(int argc, const char **argv, const char *prefix);
158 +int cmd_diff_files(int argc, const char **argv, const char *prefix);
159 +int cmd_diff_index(int argc, const char **argv, const char *prefix);
160 +int cmd_diff(int argc, const char **argv, const char *prefix);
161 +int cmd_diff_tree(int argc, const char **argv, const char *prefix);
162 +int cmd_difftool(int argc, const char **argv, const char *prefix);
163 +int cmd_fast_export(int argc, const char **argv, const char *prefix);
164 +int cmd_fetch(int argc, const char **argv, const char *prefix);
165 +int cmd_fetch_pack(int argc, const char **argv, const char *prefix);
166 +int cmd_fmt_merge_msg(int argc, const char **argv, const char *prefix);
167 +int cmd_for_each_ref(int argc, const char **argv, const char *prefix);
168 +int cmd_format_patch(int argc, const char **argv, const char *prefix);
169 +int cmd_fsck(int argc, const char **argv, const char *prefix);
170 +int cmd_gc(int argc, const char **argv, const char *prefix);
171 +int cmd_get_tar_commit_id(int argc, const char **argv, const char *prefix);
172 +int cmd_grep(int argc, const char **argv, const char *prefix);
173 +int cmd_hash_object(int argc, const char **argv, const char *prefix);
174 +int cmd_help(int argc, const char **argv, const char *prefix);
175 +int cmd_index_pack(int argc, const char **argv, const char *prefix);
176 +int cmd_init_db(int argc, const char **argv, const char *prefix);
177 +int cmd_interpret_trailers(int argc, const char **argv, const char *prefix);
178 +int cmd_log(int argc, const char **argv, const char *prefix);
179 +int cmd_log_reflog(int argc, const char **argv, const char *prefix);
180 +int cmd_ls_files(int argc, const char **argv, const char *prefix);
181 +int cmd_ls_tree(int argc, const char **argv, const char *prefix);
182 +int cmd_ls_remote(int argc, const char **argv, const char *prefix);
183 +int cmd_mailinfo(int argc, const char **argv, const char *prefix);
184 +int cmd_mailsplit(int argc, const char **argv, const char *prefix);
185 +int cmd_merge(int argc, const char **argv, const char *prefix);
186 +int cmd_merge_base(int argc, const char **argv, const char *prefix);
187 +int cmd_merge_index(int argc, const char **argv, const char *prefix);
188 +int cmd_merge_ours(int argc, const char **argv, const char *prefix);
189 +int cmd_merge_file(int argc, const char **argv, const char *prefix);
190 +int cmd_merge_recursive(int argc, const char **argv, const char *prefix);
191 +int cmd_merge_tree(int argc, const char **argv, const char *prefix);
192 +int cmd_mktag(int argc, const char **argv, const char *prefix);
193 +int cmd_mktree(int argc, const char **argv, const char *prefix);
194 +int cmd_multi_pack_index(int argc, const char **argv, const char *prefix);
195 +int cmd_mv(int argc, const char **argv, const char *prefix);
196 +int cmd_name_rev(int argc, const char **argv, const char *prefix);
197 +int cmd_notes(int argc, const char **argv, const char *prefix);
198 +int cmd_pack_objects(int argc, const char **argv, const char *prefix);
199 +int cmd_pack_redundant(int argc, const char **argv, const char *prefix);
200 +int cmd_patch_id(int argc, const char **argv, const char *prefix);
201 +int cmd_prune(int argc, const char **argv, const char *prefix);
202 +int cmd_prune_packed(int argc, const char **argv, const char *prefix);
203 +int cmd_pull(int argc, const char **argv, const char *prefix);
204 +int cmd_push(int argc, const char **argv, const char *prefix);
205 +int cmd_range_diff(int argc, const char **argv, const char *prefix);
206 +int cmd_read_tree(int argc, const char **argv, const char *prefix);
207 +int cmd_rebase(int argc, const char **argv, const char *prefix);
208 +int cmd_rebase__interactive(int argc, const char **argv, const char *prefix);
209 +int cmd_receive_pack(int argc, const char **argv, const char *prefix);
210 +int cmd_reflog(int argc, const char **argv, const char *prefix);
211 +int cmd_remote(int argc, const char **argv, const char *prefix);
212 +int cmd_remote_ext(int argc, const char **argv, const char *prefix);
213 +int cmd_remote_fd(int argc, const char **argv, const char *prefix);
214 +int cmd_repack(int argc, const char **argv, const char *prefix);
215 +int cmd_rerere(int argc, const char **argv, const char *prefix);
216 +int cmd_reset(int argc, const char **argv, const char *prefix);
217 +int cmd_rev_list(int argc, const char **argv, const char *prefix);
218 +int cmd_rev_parse(int argc, const char **argv, const char *prefix);
219 +int cmd_revert(int argc, const char **argv, const char *prefix);
220 +int cmd_rm(int argc, const char **argv, const char *prefix);
221 +int cmd_send_pack(int argc, const char **argv, const char *prefix);
222 +int cmd_serve(int argc, const char **argv, const char *prefix);
223 +int cmd_shortlog(int argc, const char **argv, const char *prefix);
224 +int cmd_show(int argc, const char **argv, const char *prefix);
225 +int cmd_show_branch(int argc, const char **argv, const char *prefix);
226 +int cmd_show_index(int argc, const char **argv, const char *prefix);
227 +int cmd_status(int argc, const char **argv, const char *prefix);
228 +int cmd_stripspace(int argc, const char **argv, const char *prefix);
229 +int cmd_submodule__helper(int argc, const char **argv, const char *prefix);
230 +int cmd_symbolic_ref(int argc, const char **argv, const char *prefix);
231 +int cmd_tag(int argc, const char **argv, const char *prefix);
232 +int cmd_tar_tree(int argc, const char **argv, const char *prefix);
233 +int cmd_unpack_file(int argc, const char **argv, const char *prefix);
234 +int cmd_unpack_objects(int argc, const char **argv, const char *prefix);
235 +int cmd_update_index(int argc, const char **argv, const char *prefix);
236 +int cmd_update_ref(int argc, const char **argv, const char *prefix);
237 +int cmd_update_server_info(int argc, const char **argv, const char *prefix);
238 +int cmd_upload_archive(int argc, const char **argv, const char *prefix);
239 +int cmd_upload_archive_writer(int argc, const char **argv, const char *prefix);
240 +int cmd_upload_pack(int argc, const char **argv, const char *prefix);
241 +int cmd_var(int argc, const char **argv, const char *prefix);
242 +int cmd_verify_commit(int argc, const char **argv, const char *prefix);
243 +int cmd_verify_tag(int argc, const char **argv, const char *prefix);
244 +int cmd_version(int argc, const char **argv, const char *prefix);
245 +int cmd_whatchanged(int argc, const char **argv, const char *prefix);
246 +int cmd_worktree(int argc, const char **argv, const char *prefix);
247 +int cmd_write_tree(int argc, const char **argv, const char *prefix);
248 +int cmd_verify_pack(int argc, const char **argv, const char *prefix);
249 +int cmd_show_ref(int argc, const char **argv, const char *prefix);
250 +int cmd_pack_refs(int argc, const char **argv, const char *prefix);
251 +int cmd_replace(int argc, const char **argv, const char *prefix);
252
253 #endif
bulk-checkin.h
+3 -3
@@ -6,11 +6,11 @@
6
7 #include "cache.h"
8
9 -extern int index_bulk_checkin(struct object_id *oid,
9 +int index_bulk_checkin(struct object_id *oid,
10 int fd, size_t size, enum object_type type,
11 const char *path, unsigned flags);
12
13 -extern void plug_bulk_checkin(void);
14 -extern void unplug_bulk_checkin(void);
13 +void plug_bulk_checkin(void);
14 +void unplug_bulk_checkin(void);
15
16 #endif
cache.h
+170 -170
@@ -350,10 +350,10 @@ struct index_state {
350 };
351
352 /* Name hashing */
353 -extern int test_lazy_init_name_hash(struct index_state *istate, int try_threaded);
354 -extern void add_name_hash(struct index_state *istate, struct cache_entry *ce);
355 -extern void remove_name_hash(struct index_state *istate, struct cache_entry *ce);
356 -extern void free_name_hash(struct index_state *istate);
353 +int test_lazy_init_name_hash(struct index_state *istate, int try_threaded);
354 +void add_name_hash(struct index_state *istate, struct cache_entry *ce);
355 +void remove_name_hash(struct index_state *istate, struct cache_entry *ce);
356 +void free_name_hash(struct index_state *istate);
357
358
359 /* Cache entry creation and cleanup */
@@ -543,7 +543,7 @@ static inline enum object_type object_type(unsigned int mode)
543 */
544 extern const char * const local_repo_env[];
545
546 -extern void setup_git_env(const char *git_dir);
546 +void setup_git_env(const char *git_dir);
547
548 /*
549 * Returns true iff we have a configured git repository (either via
@@ -552,29 +552,29 @@ extern void setup_git_env(const char *git_dir);
552 int have_git_dir(void);
553
554 extern int is_bare_repository_cfg;
555 -extern int is_bare_repository(void);
556 -extern int is_inside_git_dir(void);
555 +int is_bare_repository(void);
556 +int is_inside_git_dir(void);
557 extern char *git_work_tree_cfg;
558 -extern int is_inside_work_tree(void);
559 -extern const char *get_git_dir(void);
560 -extern const char *get_git_common_dir(void);
561 -extern char *get_object_directory(void);
562 -extern char *get_index_file(void);
563 -extern char *get_graft_file(struct repository *r);
564 -extern void set_git_dir(const char *path);
565 -extern int get_common_dir_noenv(struct strbuf *sb, const char *gitdir);
566 -extern int get_common_dir(struct strbuf *sb, const char *gitdir);
567 -extern const char *get_git_namespace(void);
568 -extern const char *strip_namespace(const char *namespaced_ref);
569 -extern const char *get_super_prefix(void);
570 -extern const char *get_git_work_tree(void);
558 +int is_inside_work_tree(void);
559 +const char *get_git_dir(void);
560 +const char *get_git_common_dir(void);
561 +char *get_object_directory(void);
562 +char *get_index_file(void);
563 +char *get_graft_file(struct repository *r);
564 +void set_git_dir(const char *path);
565 +int get_common_dir_noenv(struct strbuf *sb, const char *gitdir);
566 +int get_common_dir(struct strbuf *sb, const char *gitdir);
567 +const char *get_git_namespace(void);
568 +const char *strip_namespace(const char *namespaced_ref);
569 +const char *get_super_prefix(void);
570 +const char *get_git_work_tree(void);
571
572 /*
573 * Return true if the given path is a git directory; note that this _just_
574 * looks at the directory itself. If you want to know whether "foo/.git"
575 * is a repository, you must feed that path, not just "foo".
576 */
577 -extern int is_git_directory(const char *path);
577 +int is_git_directory(const char *path);
578
579 /*
580 * Return 1 if the given path is the root of a git repository or
@@ -586,7 +586,7 @@ extern int is_git_directory(const char *path);
586 * as we usually consider sub-repos precious, and would prefer to err on the
587 * side of not disrupting or deleting them.
588 */
589 -extern int is_nonbare_repository_dir(struct strbuf *path);
589 +int is_nonbare_repository_dir(struct strbuf *path);
590
591 #define READ_GITFILE_ERR_STAT_FAILED 1
592 #define READ_GITFILE_ERR_NOT_A_FILE 2
@@ -596,17 +596,17 @@ extern int is_nonbare_repository_dir(struct strbuf *path);
596 #define READ_GITFILE_ERR_NO_PATH 6
597 #define READ_GITFILE_ERR_NOT_A_REPO 7
598 #define READ_GITFILE_ERR_TOO_LARGE 8
599 -extern void read_gitfile_error_die(int error_code, const char *path, const char *dir);
600 -extern const char *read_gitfile_gently(const char *path, int *return_error_code);
599 +void read_gitfile_error_die(int error_code, const char *path, const char *dir);
600 +const char *read_gitfile_gently(const char *path, int *return_error_code);
601 #define read_gitfile(path) read_gitfile_gently((path), NULL)
602 -extern const char *resolve_gitdir_gently(const char *suspect, int *return_error_code);
602 +const char *resolve_gitdir_gently(const char *suspect, int *return_error_code);
603 #define resolve_gitdir(path) resolve_gitdir_gently((path), NULL)
604
605 -extern void set_git_work_tree(const char *tree);
605 +void set_git_work_tree(const char *tree);
606
607 #define ALTERNATE_DB_ENVIRONMENT "GIT_ALTERNATE_OBJECT_DIRECTORIES"
608
609 -extern void setup_work_tree(void);
609 +void setup_work_tree(void);
610 /*
611 * Find the commondir and gitdir of the repository that contains the current
612 * working directory, without changing the working directory or other global
@@ -615,12 +615,12 @@ extern void setup_work_tree(void);
615 * both have the same result appended to the buffer. The return value is
616 * either 0 upon success and non-zero if no repository was found.
617 */
618 -extern int discover_git_directory(struct strbuf *commondir,
618 +int discover_git_directory(struct strbuf *commondir,
619 struct strbuf *gitdir);
620 -extern const char *setup_git_directory_gently(int *);
621 -extern const char *setup_git_directory(void);
622 -extern char *prefix_path(const char *prefix, int len, const char *path);
623 -extern char *prefix_path_gently(const char *prefix, int len, int *remaining, const char *path);
620 +const char *setup_git_directory_gently(int *);
621 +const char *setup_git_directory(void);
622 +char *prefix_path(const char *prefix, int len, const char *path);
623 +char *prefix_path_gently(const char *prefix, int len, int *remaining, const char *path);
624
625 /*
626 * Concatenate "prefix" (if len is non-zero) and "path", with no
@@ -632,23 +632,23 @@ extern char *prefix_path_gently(const char *prefix, int len, int *remaining, con
632 * The return value is always a newly allocated string (even if the
633 * prefix was empty).
634 */
635 -extern char *prefix_filename(const char *prefix, const char *path);
635 +char *prefix_filename(const char *prefix, const char *path);
636
637 -extern int check_filename(const char *prefix, const char *name);
638 -extern void verify_filename(const char *prefix,
637 +int check_filename(const char *prefix, const char *name);
638 +void verify_filename(const char *prefix,
639 const char *name,
640 int diagnose_misspelt_rev);
641 -extern void verify_non_filename(const char *prefix, const char *name);
642 -extern int path_inside_repo(const char *prefix, const char *path);
641 +void verify_non_filename(const char *prefix, const char *name);
642 +int path_inside_repo(const char *prefix, const char *path);
643
644 #define INIT_DB_QUIET 0x0001
645 #define INIT_DB_EXIST_OK 0x0002
646
647 -extern int init_db(const char *git_dir, const char *real_git_dir,
647 +int init_db(const char *git_dir, const char *real_git_dir,
648 const char *template_dir, unsigned int flags);
649
650 -extern void sanitize_stdfds(void);
651 -extern int daemonize(void);
650 +void sanitize_stdfds(void);
651 +int daemonize(void);
652
653 #define alloc_nr(x) (((x)+16)*3/2)
654
@@ -672,14 +672,14 @@ extern int daemonize(void);
672
673 /* Initialize and use the cache information */
674 struct lock_file;
675 -extern void preload_index(struct index_state *index,
675 +void preload_index(struct index_state *index,
676 const struct pathspec *pathspec,
677 unsigned int refresh_flags);
678 -extern int do_read_index(struct index_state *istate, const char *path,
678 +int do_read_index(struct index_state *istate, const char *path,
679 int must_exist); /* for testting only! */
680 -extern int read_index_from(struct index_state *, const char *path,
680 +int read_index_from(struct index_state *, const char *path,
681 const char *gitdir);
682 -extern int is_index_unborn(struct index_state *);
682 +int is_index_unborn(struct index_state *);
683
684 /* For use with `write_locked_index()`. */
685 #define COMMIT_LOCK (1 << 0)
@@ -704,11 +704,11 @@ extern int is_index_unborn(struct index_state *);
704 * If `SKIP_IF_UNCHANGED` is given and the index is unchanged, nothing
705 * is written (and the lock is rolled back if `COMMIT_LOCK` is given).
706 */
707 -extern int write_locked_index(struct index_state *, struct lock_file *lock, unsigned flags);
707 +int write_locked_index(struct index_state *, struct lock_file *lock, unsigned flags);
708
709 -extern int discard_index(struct index_state *);
710 -extern void move_index_extensions(struct index_state *dst, struct index_state *src);
711 -extern int unmerged_index(const struct index_state *);
709 +int discard_index(struct index_state *);
710 +void move_index_extensions(struct index_state *dst, struct index_state *src);
711 +int unmerged_index(const struct index_state *);
712
713 /**
714 * Returns 1 if istate differs from tree, 0 otherwise. If tree is NULL,
@@ -717,15 +717,15 @@ extern int unmerged_index(const struct index_state *);
717 * provided, the space-separated list of files that differ will be appended
718 * to it.
719 */
720 -extern int repo_index_has_changes(struct repository *repo,
720 +int repo_index_has_changes(struct repository *repo,
721 struct tree *tree,
722 struct strbuf *sb);
723
724 -extern int verify_path(const char *path, unsigned mode);
725 -extern int strcmp_offset(const char *s1, const char *s2, size_t *first_change);
726 -extern int index_dir_exists(struct index_state *istate, const char *name, int namelen);
727 -extern void adjust_dirname_case(struct index_state *istate, char *name);
728 -extern struct cache_entry *index_file_exists(struct index_state *istate, const char *name, int namelen, int igncase);
724 +int verify_path(const char *path, unsigned mode);
725 +int strcmp_offset(const char *s1, const char *s2, size_t *first_change);
726 +int index_dir_exists(struct index_state *istate, const char *name, int namelen);
727 +void adjust_dirname_case(struct index_state *istate, char *name);
728 +struct cache_entry *index_file_exists(struct index_state *istate, const char *name, int namelen, int igncase);
729
730 /*
731 * Searches for an entry defined by name and namelen in the given index.
@@ -744,7 +744,7 @@ extern struct cache_entry *index_file_exists(struct index_state *istate, const c
744 * index_name_pos(&index, "f", 1) -> -3
745 * index_name_pos(&index, "g", 1) -> -5
746 */
747 -extern int index_name_pos(const struct index_state *, const char *name, int namelen);
747 +int index_name_pos(const struct index_state *, const char *name, int namelen);
748
749 #define ADD_CACHE_OK_TO_ADD 1 /* Ok to add */
750 #define ADD_CACHE_OK_TO_REPLACE 2 /* Ok to replace file/directory */
@@ -753,14 +753,14 @@ extern int index_name_pos(const struct index_state *, const char *name, int name
753 #define ADD_CACHE_NEW_ONLY 16 /* Do not replace existing ones */
754 #define ADD_CACHE_KEEP_CACHE_TREE 32 /* Do not invalidate cache-tree */
755 #define ADD_CACHE_RENORMALIZE 64 /* Pass along HASH_RENORMALIZE */
756 -extern int add_index_entry(struct index_state *, struct cache_entry *ce, int option);
757 -extern void rename_index_entry_at(struct index_state *, int pos, const char *new_name);
756 +int add_index_entry(struct index_state *, struct cache_entry *ce, int option);
757 +void rename_index_entry_at(struct index_state *, int pos, const char *new_name);
758
759 /* Remove entry, return true if there are more entries to go. */
760 -extern int remove_index_entry_at(struct index_state *, int pos);
760 +int remove_index_entry_at(struct index_state *, int pos);
761
762 -extern void remove_marked_cache_entries(struct index_state *istate, int invalidate);
763 -extern int remove_file_from_index(struct index_state *, const char *path);
762 +void remove_marked_cache_entries(struct index_state *istate, int invalidate);
763 +int remove_file_from_index(struct index_state *, const char *path);
764 #define ADD_CACHE_VERBOSE 1
765 #define ADD_CACHE_PRETEND 2
766 #define ADD_CACHE_IGNORE_ERRORS 4
@@ -775,14 +775,14 @@ extern int remove_file_from_index(struct index_state *, const char *path);
775 * the latter will do necessary lstat(2) internally before
776 * calling the former.
777 */
778 -extern int add_to_index(struct index_state *, const char *path, struct stat *, int flags);
779 -extern int add_file_to_index(struct index_state *, const char *path, int flags);
778 +int add_to_index(struct index_state *, const char *path, struct stat *, int flags);
779 +int add_file_to_index(struct index_state *, const char *path, int flags);
780
781 -extern int chmod_index_entry(struct index_state *, struct cache_entry *ce, char flip);
782 -extern int ce_same_name(const struct cache_entry *a, const struct cache_entry *b);
783 -extern void set_object_name_for_intent_to_add_entry(struct cache_entry *ce);
784 -extern int index_name_is_other(const struct index_state *, const char *, int);
785 -extern void *read_blob_data_from_index(const struct index_state *, const char *, unsigned long *);
781 +int chmod_index_entry(struct index_state *, struct cache_entry *ce, char flip);
782 +int ce_same_name(const struct cache_entry *a, const struct cache_entry *b);
783 +void set_object_name_for_intent_to_add_entry(struct cache_entry *ce);
784 +int index_name_is_other(const struct index_state *, const char *, int);
785 +void *read_blob_data_from_index(const struct index_state *, const char *, unsigned long *);
786
787 /* do stat comparison even if CE_VALID is true */
788 #define CE_MATCH_IGNORE_VALID 01
@@ -796,22 +796,22 @@ extern void *read_blob_data_from_index(const struct index_state *, const char *,
796 #define CE_MATCH_REFRESH 0x10
797 /* don't refresh_fsmonitor state or do stat comparison even if CE_FSMONITOR_VALID is true */
798 #define CE_MATCH_IGNORE_FSMONITOR 0X20
799 -extern int is_racy_timestamp(const struct index_state *istate,
799 +int is_racy_timestamp(const struct index_state *istate,
800 const struct cache_entry *ce);
801 -extern int ie_match_stat(struct index_state *, const struct cache_entry *, struct stat *, unsigned int);
802 -extern int ie_modified(struct index_state *, const struct cache_entry *, struct stat *, unsigned int);
801 +int ie_match_stat(struct index_state *, const struct cache_entry *, struct stat *, unsigned int);
802 +int ie_modified(struct index_state *, const struct cache_entry *, struct stat *, unsigned int);
803
804 #define HASH_WRITE_OBJECT 1
805 #define HASH_FORMAT_CHECK 2
806 #define HASH_RENORMALIZE 4
807 -extern int index_fd(struct index_state *istate, struct object_id *oid, int fd, struct stat *st, enum object_type type, const char *path, unsigned flags);
808 -extern int index_path(struct index_state *istate, struct object_id *oid, const char *path, struct stat *st, unsigned flags);
807 +int index_fd(struct index_state *istate, struct object_id *oid, int fd, struct stat *st, enum object_type type, const char *path, unsigned flags);
808 +int index_path(struct index_state *istate, struct object_id *oid, const char *path, struct stat *st, unsigned flags);
809
810 /*
811 * Record to sd the data from st that we use to check whether a file
812 * might have changed.
813 */
814 -extern void fill_stat_data(struct stat_data *sd, struct stat *st);
814 +void fill_stat_data(struct stat_data *sd, struct stat *st);
815
816 /*
817 * Return 0 if st is consistent with a file not having been changed
@@ -819,11 +819,11 @@ extern void fill_stat_data(struct stat_data *sd, struct stat *st);
819 * combination of MTIME_CHANGED, CTIME_CHANGED, OWNER_CHANGED,
820 * INODE_CHANGED, and DATA_CHANGED.
821 */
822 -extern int match_stat_data(const struct stat_data *sd, struct stat *st);
823 -extern int match_stat_data_racy(const struct index_state *istate,
822 +int match_stat_data(const struct stat_data *sd, struct stat *st);
823 +int match_stat_data_racy(const struct index_state *istate,
824 const struct stat_data *sd, struct stat *st);
825
826 -extern void fill_stat_cache_info(struct cache_entry *ce, struct stat *st);
826 +void fill_stat_cache_info(struct cache_entry *ce, struct stat *st);
827
828 #define REFRESH_REALLY 0x0001 /* ignore_valid */
829 #define REFRESH_UNMERGED 0x0002 /* allow unmerged */
@@ -832,10 +832,10 @@ extern void fill_stat_cache_info(struct cache_entry *ce, struct stat *st);
832 #define REFRESH_IGNORE_SUBMODULES 0x0010 /* ignore submodules */
833 #define REFRESH_IN_PORCELAIN 0x0020 /* user friendly output, not "needs update" */
834 #define REFRESH_PROGRESS 0x0040 /* show progress bar if stderr is tty */
835 -extern int refresh_index(struct index_state *, unsigned int flags, const struct pathspec *pathspec, char *seen, const char *header_msg);
836 -extern struct cache_entry *refresh_cache_entry(struct index_state *, struct cache_entry *, unsigned int);
835 +int refresh_index(struct index_state *, unsigned int flags, const struct pathspec *pathspec, char *seen, const char *header_msg);
836 +struct cache_entry *refresh_cache_entry(struct index_state *, struct cache_entry *, unsigned int);
837
838 -extern void set_alternate_index_output(const char *);
838 +void set_alternate_index_output(const char *);
839
840 extern int verify_index_checksum;
841 extern int verify_ce_order;
@@ -1020,7 +1020,7 @@ int verify_repository_format(const struct repository_format *format,
1020 * set_git_dir() before calling this, and use it only for "are we in a valid
1021 * repo?".
1022 */
1023 -extern void check_repository_format(void);
1023 +void check_repository_format(void);
1024
1025 #define MTIME_CHANGED 0x0001
1026 #define CTIME_CHANGED 0x0002
@@ -1045,8 +1045,8 @@ extern void check_repository_format(void);
1045 * Note that while this version avoids the static buffer, it is not fully
1046 * reentrant, as it calls into other non-reentrant git code.
1047 */
1048 -extern const char *find_unique_abbrev(const struct object_id *oid, int len);
1049 -extern int find_unique_abbrev_r(char *hex, const struct object_id *oid, int len);
1048 +const char *find_unique_abbrev(const struct object_id *oid, int len);
1049 +int find_unique_abbrev_r(char *hex, const struct object_id *oid, int len);
1050
1051 extern const unsigned char null_sha1[GIT_MAX_RAWSZ];
1052 extern const struct object_id null_oid;
@@ -1242,7 +1242,7 @@ typedef int create_file_fn(const char *path, void *cb);
1242 int raceproof_create_file(const char *path, create_file_fn fn, void *cb);
1243
1244 int mkdir_in_gitdir(const char *path);
1245 -extern char *expand_user_path(const char *path, int real_home);
1245 +char *expand_user_path(const char *path, int real_home);
1246 const char *enter_repo(const char *path, int strict);
1247 static inline int is_absolute_path(const char *path)
1248 {
@@ -1286,26 +1286,26 @@ int looks_like_command_line_option(const char *str);
1286 * "$XDG_CONFIG_HOME/git/$filename" if $XDG_CONFIG_HOME is non-empty, otherwise
1287 * "$HOME/.config/git/$filename". Return NULL upon error.
1288 */
1289 -extern char *xdg_config_home(const char *filename);
1289 +char *xdg_config_home(const char *filename);
1290
1291 /**
1292 * Return a newly allocated string with the evaluation of
1293 * "$XDG_CACHE_HOME/git/$filename" if $XDG_CACHE_HOME is non-empty, otherwise
1294 * "$HOME/.cache/git/$filename". Return NULL upon error.
1295 */
1296 -extern char *xdg_cache_home(const char *filename);
1296 +char *xdg_cache_home(const char *filename);
1297
1298 -extern int git_open_cloexec(const char *name, int flags);
1298 +int git_open_cloexec(const char *name, int flags);
1299 #define git_open(name) git_open_cloexec(name, O_RDONLY)
1300 -extern int unpack_loose_header(git_zstream *stream, unsigned char *map, unsigned long mapsize, void *buffer, unsigned long bufsiz);
1301 -extern int parse_loose_header(const char *hdr, unsigned long *sizep);
1300 +int unpack_loose_header(git_zstream *stream, unsigned char *map, unsigned long mapsize, void *buffer, unsigned long bufsiz);
1301 +int parse_loose_header(const char *hdr, unsigned long *sizep);
1302
1303 -extern int check_object_signature(const struct object_id *oid, void *buf, unsigned long size, const char *type);
1303 +int check_object_signature(const struct object_id *oid, void *buf, unsigned long size, const char *type);
1304
1305 -extern int finalize_object_file(const char *tmpfile, const char *filename);
1305 +int finalize_object_file(const char *tmpfile, const char *filename);
1306
1307 /* Helper to check and "touch" a file */
1308 -extern int check_and_freshen_file(const char *fn, int freshen);
1308 +int check_and_freshen_file(const char *fn, int freshen);
1309
1310 extern const signed char hexval_table[256];
1311 static inline unsigned int hexval(unsigned char c)
@@ -1378,21 +1378,21 @@ enum get_oid_result {
1378 */
1379 };
1380
1381 -extern int get_oid(const char *str, struct object_id *oid);
1382 -extern int get_oid_commit(const char *str, struct object_id *oid);
1383 -extern int get_oid_committish(const char *str, struct object_id *oid);
1384 -extern int get_oid_tree(const char *str, struct object_id *oid);
1385 -extern int get_oid_treeish(const char *str, struct object_id *oid);
1386 -extern int get_oid_blob(const char *str, struct object_id *oid);
1387 -extern void maybe_die_on_misspelt_object_name(const char *name, const char *prefix);
1388 -extern enum get_oid_result get_oid_with_context(struct repository *repo, const char *str,
1381 +int get_oid(const char *str, struct object_id *oid);
1382 +int get_oid_commit(const char *str, struct object_id *oid);
1383 +int get_oid_committish(const char *str, struct object_id *oid);
1384 +int get_oid_tree(const char *str, struct object_id *oid);
1385 +int get_oid_treeish(const char *str, struct object_id *oid);
1386 +int get_oid_blob(const char *str, struct object_id *oid);
1387 +void maybe_die_on_misspelt_object_name(const char *name, const char *prefix);
1388 +enum get_oid_result get_oid_with_context(struct repository *repo, const char *str,
1389 unsigned flags, struct object_id *oid,
1390 struct object_context *oc);
1391
1392 typedef int each_abbrev_fn(const struct object_id *oid, void *);
1393 -extern int for_each_abbrev(const char *prefix, each_abbrev_fn, void *);
1393 +int for_each_abbrev(const char *prefix, each_abbrev_fn, void *);
1394
1395 -extern int set_disambiguate_hint_config(const char *var, const char *value);
1395 +int set_disambiguate_hint_config(const char *var, const char *value);
1396
1397 /*
1398 * Try to read a SHA1 in hexadecimal format from the 40 characters
@@ -1401,15 +1401,15 @@ extern int set_disambiguate_hint_config(const char *var, const char *value);
1401 * input, so it is safe to pass this function an arbitrary
1402 * null-terminated string.
1403 */
1404 -extern int get_sha1_hex(const char *hex, unsigned char *sha1);
1405 -extern int get_oid_hex(const char *hex, struct object_id *sha1);
1404 +int get_sha1_hex(const char *hex, unsigned char *sha1);
1405 +int get_oid_hex(const char *hex, struct object_id *sha1);
1406
1407 /*
1408 * Read `len` pairs of hexadecimal digits from `hex` and write the
1409 * values to `binary` as `len` bytes. Return 0 on success, or -1 if
1410 * the input does not consist of hex digits).
1411 */
1412 -extern int hex_to_bytes(unsigned char *binary, const char *hex, size_t len);
1412 +int hex_to_bytes(unsigned char *binary, const char *hex, size_t len);
1413
1414 /*
1415 * Convert a binary hash to its hex equivalent. The `_r` variant is reentrant,
@@ -1437,7 +1437,7 @@ char *oid_to_hex(const struct object_id *oid); /* same static buffer */
1437 * other invalid character. end is only updated on success; otherwise, it is
1438 * unmodified.
1439 */
1440 -extern int parse_oid_hex(const char *hex, struct object_id *oid, const char **end);
1440 +int parse_oid_hex(const char *hex, struct object_id *oid, const char **end);
1441
1442 /*
1443 * This reads short-hand syntax that not only evaluates to a commit
@@ -1468,23 +1468,23 @@ extern int parse_oid_hex(const char *hex, struct object_id *oid, const char **en
1468 #define INTERPRET_BRANCH_LOCAL (1<<0)
1469 #define INTERPRET_BRANCH_REMOTE (1<<1)
1470 #define INTERPRET_BRANCH_HEAD (1<<2)
1471 -extern int interpret_branch_name(const char *str, int len, struct strbuf *,
1471 +int interpret_branch_name(const char *str, int len, struct strbuf *,
1472 unsigned allowed);
1473 -extern int get_oid_mb(const char *str, struct object_id *oid);
1473 +int get_oid_mb(const char *str, struct object_id *oid);
1474
1475 -extern int validate_headref(const char *ref);
1475 +int validate_headref(const char *ref);
1476
1477 -extern int base_name_compare(const char *name1, int len1, int mode1, const char *name2, int len2, int mode2);
1478 -extern int df_name_compare(const char *name1, int len1, int mode1, const char *name2, int len2, int mode2);
1479 -extern int name_compare(const char *name1, size_t len1, const char *name2, size_t len2);
1480 -extern int cache_name_stage_compare(const char *name1, int len1, int stage1, const char *name2, int len2, int stage2);
1477 +int base_name_compare(const char *name1, int len1, int mode1, const char *name2, int len2, int mode2);
1478 +int df_name_compare(const char *name1, int len1, int mode1, const char *name2, int len2, int mode2);
1479 +int name_compare(const char *name1, size_t len1, const char *name2, size_t len2);
1480 +int cache_name_stage_compare(const char *name1, int len1, int stage1, const char *name2, int len2, int stage2);
1481
1482 -extern void *read_object_with_reference(const struct object_id *oid,
1482 +void *read_object_with_reference(const struct object_id *oid,
1483 const char *required_type,
1484 unsigned long *size,
1485 struct object_id *oid_ret);
1486
1487 -extern struct object *peel_to_type(const char *name, int namelen,
1487 +struct object *peel_to_type(const char *name, int namelen,
1488 struct object *o, enum object_type);
1489
1490 enum date_mode_type {
@@ -1539,20 +1539,20 @@ enum want_ident {
1539 WANT_COMMITTER_IDENT
1540 };
1541
1542 -extern const char *git_author_info(int);
1543 -extern const char *git_committer_info(int);
1544 -extern const char *fmt_ident(const char *name, const char *email,
1542 +const char *git_author_info(int);
1543 +const char *git_committer_info(int);
1544 +const char *fmt_ident(const char *name, const char *email,
1545 enum want_ident whose_ident,
1546 const char *date_str, int);
1547 -extern const char *fmt_name(enum want_ident);
1548 -extern const char *ident_default_name(void);
1549 -extern const char *ident_default_email(void);
1550 -extern const char *git_editor(void);
1551 -extern const char *git_sequence_editor(void);
1552 -extern const char *git_pager(int stdout_is_tty);
1553 -extern int is_terminal_dumb(void);
1554 -extern int git_ident_config(const char *, const char *, void *);
1555 -extern void reset_ident_date(void);
1547 +const char *fmt_name(enum want_ident);
1548 +const char *ident_default_name(void);
1549 +const char *ident_default_email(void);
1550 +const char *git_editor(void);
1551 +const char *git_sequence_editor(void);
1552 +const char *git_pager(int stdout_is_tty);
1553 +int is_terminal_dumb(void);
1554 +int git_ident_config(const char *, const char *, void *);
1555 +void reset_ident_date(void);
1556
1557 struct ident_split {
1558 const char *name_begin;
@@ -1568,7 +1568,7 @@ struct ident_split {
1568 * Signals an success with 0, but time part of the result may be NULL
1569 * if the input lacks timestamp and zone
1570 */
1571 -extern int split_ident_line(struct ident_split *, const char *, int);
1571 +int split_ident_line(struct ident_split *, const char *, int);
1572
1573 /*
1574 * Like show_date, but pull the timestamp and tz parameters from
@@ -1585,7 +1585,7 @@ const char *show_ident_date(const struct ident_split *id,
1585 * Because there are two fields, we must choose one as the primary key; we
1586 * currently arbitrarily pick the email.
1587 */
1588 -extern int ident_cmp(const struct ident_split *, const struct ident_split *);
1588 +int ident_cmp(const struct ident_split *, const struct ident_split *);
1589
1590 struct checkout {
1591 struct index_state *istate;
@@ -1601,14 +1601,14 @@ struct checkout {
1601 #define CHECKOUT_INIT { NULL, "" }
1602
1603 #define TEMPORARY_FILENAME_LENGTH 25
1604 -extern int checkout_entry(struct cache_entry *ce, const struct checkout *state, char *topath, int *nr_checkouts);
1605 -extern void enable_delayed_checkout(struct checkout *state);
1606 -extern int finish_delayed_checkout(struct checkout *state, int *nr_checkouts);
1604 +int checkout_entry(struct cache_entry *ce, const struct checkout *state, char *topath, int *nr_checkouts);
1605 +void enable_delayed_checkout(struct checkout *state);
1606 +int finish_delayed_checkout(struct checkout *state, int *nr_checkouts);
1607 /*
1608 * Unlink the last component and schedule the leading directories for
1609 * removal, such that empty directories get removed.
1610 */
1611 -extern void unlink_entry(const struct cache_entry *ce);
1611 +void unlink_entry(const struct cache_entry *ce);
1612
1613 struct cache_def {
1614 struct strbuf path;
@@ -1622,12 +1622,12 @@ static inline void cache_def_clear(struct cache_def *cache)
1622 strbuf_release(&cache->path);
1623 }
1624
1625 -extern int has_symlink_leading_path(const char *name, int len);
1626 -extern int threaded_has_symlink_leading_path(struct cache_def *, const char *, int);
1627 -extern int check_leading_path(const char *name, int len);
1628 -extern int has_dirs_only_path(const char *name, int len, int prefix_len);
1629 -extern void schedule_dir_for_removal(const char *name, int len);
1630 -extern void remove_scheduled_dirs(void);
1625 +int has_symlink_leading_path(const char *name, int len);
1626 +int threaded_has_symlink_leading_path(struct cache_def *, const char *, int);
1627 +int check_leading_path(const char *name, int len);
1628 +int has_dirs_only_path(const char *name, int len, int prefix_len);
1629 +void schedule_dir_for_removal(const char *name, int len);
1630 +void remove_scheduled_dirs(void);
1631
1632 struct pack_window {
1633 struct pack_window *next;
@@ -1649,14 +1649,14 @@ struct pack_entry {
1649 * usual "XXXXXX" trailer, and the resulting filename is written into the
1650 * "template" buffer. Returns the open descriptor.
1651 */
1652 -extern int odb_mkstemp(struct strbuf *temp_filename, const char *pattern);
1652 +int odb_mkstemp(struct strbuf *temp_filename, const char *pattern);
1653
1654 /*
1655 * Create a pack .keep file named "name" (which should generally be the output
1656 * of odb_pack_name). Returns a file descriptor opened for writing, or -1 on
1657 * error.
1658 */
1659 -extern int odb_pack_keep(const char *name);
1659 +int odb_pack_keep(const char *name);
1660
1661 /*
1662 * Set this to 0 to prevent oid_object_info_extended() from fetching missing
@@ -1667,10 +1667,10 @@ extern int odb_pack_keep(const char *name);
1667 extern int fetch_if_missing;
1668
1669 /* Dumb servers support */
1670 -extern int update_server_info(int);
1670 +int update_server_info(int);
1671
1672 -extern const char *get_log_output_encoding(void);
1673 -extern const char *get_commit_output_encoding(void);
1672 +const char *get_log_output_encoding(void);
1673 +const char *get_commit_output_encoding(void);
1674
1675 /*
1676 * This is a hack for test programs like test-dump-untracked-cache to
@@ -1679,8 +1679,8 @@ extern const char *get_commit_output_encoding(void);
1679 */
1680 extern int ignore_untracked_cache_config;
1681
1682 -extern int committer_ident_sufficiently_given(void);
1683 -extern int author_ident_sufficiently_given(void);
1682 +int committer_ident_sufficiently_given(void);
1683 +int author_ident_sufficiently_given(void);
1684
1685 extern const char *git_commit_encoding;
1686 extern const char *git_log_output_encoding;
@@ -1688,22 +1688,22 @@ extern const char *git_mailmap_file;
1688 extern const char *git_mailmap_blob;
1689
1690 /* IO helper functions */
1691 -extern void maybe_flush_or_die(FILE *, const char *);
1691 +void maybe_flush_or_die(FILE *, const char *);
1692 __attribute__((format (printf, 2, 3)))
1693 extern void fprintf_or_die(FILE *, const char *fmt, ...);
1694
1695 #define COPY_READ_ERROR (-2)
1696 #define COPY_WRITE_ERROR (-3)
1697 -extern int copy_fd(int ifd, int ofd);
1698 -extern int copy_file(const char *dst, const char *src, int mode);
1699 -extern int copy_file_with_time(const char *dst, const char *src, int mode);
1697 +int copy_fd(int ifd, int ofd);
1698 +int copy_file(const char *dst, const char *src, int mode);
1699 +int copy_file_with_time(const char *dst, const char *src, int mode);
1700
1701 -extern void write_or_die(int fd, const void *buf, size_t count);
1702 -extern void fsync_or_die(int fd, const char *);
1701 +void write_or_die(int fd, const void *buf, size_t count);
1702 +void fsync_or_die(int fd, const char *);
1703
1704 -extern ssize_t read_in_full(int fd, void *buf, size_t count);
1705 -extern ssize_t write_in_full(int fd, const void *buf, size_t count);
1706 -extern ssize_t pread_in_full(int fd, void *buf, size_t count, off_t offset);
1704 +ssize_t read_in_full(int fd, void *buf, size_t count);
1705 +ssize_t write_in_full(int fd, const void *buf, size_t count);
1706 +ssize_t pread_in_full(int fd, void *buf, size_t count, off_t offset);
1707
1708 static inline ssize_t write_str_in_full(int fd, const char *str)
1709 {
@@ -1714,7 +1714,7 @@ static inline ssize_t write_str_in_full(int fd, const char *str)
1714 * Open (and truncate) the file at path, write the contents of buf to it,
1715 * and close it. Dies if any errors are encountered.
1716 */
1717 -extern void write_file_buf(const char *path, const char *buf, size_t len);
1717 +void write_file_buf(const char *path, const char *buf, size_t len);
1718
1719 /**
1720 * Like write_file_buf(), but format the contents into a buffer first.
@@ -1727,13 +1727,13 @@ __attribute__((format (printf, 2, 3)))
1727 extern void write_file(const char *path, const char *fmt, ...);
1728
1729 /* pager.c */
1730 -extern void setup_pager(void);
1731 -extern int pager_in_use(void);
1730 +void setup_pager(void);
1731 +int pager_in_use(void);
1732 extern int pager_use_color;
1733 -extern int term_columns(void);
1734 -extern int decimal_width(uintmax_t);
1735 -extern int check_pager_config(const char *cmd);
1736 -extern void prepare_pager_args(struct child_process *, const char *pager);
1733 +int term_columns(void);
1734 +int decimal_width(uintmax_t);
1735 +int check_pager_config(const char *cmd);
1736 +void prepare_pager_args(struct child_process *, const char *pager);
1737
1738 extern const char *editor_program;
1739 extern const char *askpass_program;
@@ -1777,13 +1777,13 @@ void shift_tree_by(const struct object_id *, const struct object_id *, struct ob
1777 /* All WS_* -- when extended, adapt diff.c emit_symbol */
1778 #define WS_RULE_MASK 07777
1779 extern unsigned whitespace_rule_cfg;
1780 -extern unsigned whitespace_rule(struct index_state *, const char *);
1781 -extern unsigned parse_whitespace_rule(const char *);
1782 -extern unsigned ws_check(const char *line, int len, unsigned ws_rule);
1783 -extern void ws_check_emit(const char *line, int len, unsigned ws_rule, FILE *stream, const char *set, const char *reset, const char *ws);
1784 -extern char *whitespace_error_string(unsigned ws);
1785 -extern void ws_fix_copy(struct strbuf *, const char *, int, unsigned, int *);
1786 -extern int ws_blank_line(const char *line, int len, unsigned ws_rule);
1780 +unsigned whitespace_rule(struct index_state *, const char *);
1781 +unsigned parse_whitespace_rule(const char *);
1782 +unsigned ws_check(const char *line, int len, unsigned ws_rule);
1783 +void ws_check_emit(const char *line, int len, unsigned ws_rule, FILE *stream, const char *set, const char *reset, const char *ws);
1784 +char *whitespace_error_string(unsigned ws);
1785 +void ws_fix_copy(struct strbuf *, const char *, int, unsigned, int *);
1786 +int ws_blank_line(const char *line, int len, unsigned ws_rule);
1787 #define ws_tab_width(rule) ((rule) & WS_TAB_WIDTH_MASK)
1788
1789 /* ls-files */
@@ -1853,9 +1853,9 @@ void safe_create_dir(const char *dir, int share);
1853 * Should we print an ellipsis after an abbreviated SHA-1 value
1854 * when doing diff-raw output or indicating a detached HEAD?
1855 */
1856 -extern int print_sha1_ellipsis(void);
1856 +int print_sha1_ellipsis(void);
1857
1858 /* Return 1 if the file is empty or does not exists, 0 otherwise. */
1859 -extern int is_empty_or_missing_file(const char *filename);
1859 +int is_empty_or_missing_file(const char *filename);
1860
1861 #endif /* CACHE_H */
checkout.h
+1 -1
@@ -8,7 +8,7 @@
8 * tracking branch. Return the name of the remote if such a branch
9 * exists, NULL otherwise.
10 */
11 -extern const char *unique_tracking_name(const char *name,
11 +const char *unique_tracking_name(const char *name,
12 struct object_id *oid,
13 int *dwim_remotes_matched);
14
column.h
+6 -6
@@ -27,20 +27,20 @@ struct column_options {
27 };
28
29 struct option;
30 -extern int parseopt_column_callback(const struct option *, const char *, int);
31 -extern int git_column_config(const char *var, const char *value,
30 +int parseopt_column_callback(const struct option *, const char *, int);
31 +int git_column_config(const char *var, const char *value,
32 const char *command, unsigned int *colopts);
33 -extern int finalize_colopts(unsigned int *colopts, int stdout_is_tty);
33 +int finalize_colopts(unsigned int *colopts, int stdout_is_tty);
34 static inline int column_active(unsigned int colopts)
35 {
36 return (colopts & COL_ENABLE_MASK) == COL_ENABLED;
37 }
38
39 struct string_list;
40 -extern void print_columns(const struct string_list *list, unsigned int colopts,
40 +void print_columns(const struct string_list *list, unsigned int colopts,
41 const struct column_options *opts);
42
43 -extern int run_column_filter(int colopts, const struct column_options *);
44 -extern int stop_column_filter(void);
43 +int run_column_filter(int colopts, const struct column_options *);
44 +int stop_column_filter(void);
45
46 #endif
commit.h
+35 -35
@@ -177,8 +177,8 @@ void free_commit_list(struct commit_list *list);
177
178 struct rev_info; /* in revision.h, it circularly uses enum cmit_fmt */
179
180 -extern int has_non_ascii(const char *text);
181 -extern const char *logmsg_reencode(const struct commit *commit,
180 +int has_non_ascii(const char *text);
181 +const char *logmsg_reencode(const struct commit *commit,
182 char **commit_encoding,
183 const char *output_encoding);
184 const char *repo_logmsg_reencode(struct repository *r,
@@ -189,7 +189,7 @@ const char *repo_logmsg_reencode(struct repository *r,
189 #define logmsg_reencode(c, enc, out) repo_logmsg_reencode(the_repository, c, enc, out)
190 #endif
191
192 -extern const char *skip_blank_lines(const char *msg);
192 +const char *skip_blank_lines(const char *msg);
193
194 /** Removes the first commit from a list sorted by date, and adds all
195 * of its parents.
@@ -240,22 +240,22 @@ struct commit *get_fork_point(const char *refname, struct commit *commit);
240
241 struct oid_array;
242 struct ref;
243 -extern int register_shallow(struct repository *r, const struct object_id *oid);
244 -extern int unregister_shallow(const struct object_id *oid);
245 -extern int for_each_commit_graft(each_commit_graft_fn, void *);
246 -extern int is_repository_shallow(struct repository *r);
247 -extern struct commit_list *get_shallow_commits(struct object_array *heads,
243 +int register_shallow(struct repository *r, const struct object_id *oid);
244 +int unregister_shallow(const struct object_id *oid);
245 +int for_each_commit_graft(each_commit_graft_fn, void *);
246 +int is_repository_shallow(struct repository *r);
247 +struct commit_list *get_shallow_commits(struct object_array *heads,
248 int depth, int shallow_flag, int not_shallow_flag);
249 -extern struct commit_list *get_shallow_commits_by_rev_list(
249 +struct commit_list *get_shallow_commits_by_rev_list(
250 int ac, const char **av, int shallow_flag, int not_shallow_flag);
251 -extern void set_alternate_shallow_file(struct repository *r, const char *path, int override);
252 -extern int write_shallow_commits(struct strbuf *out, int use_pack_protocol,
251 +void set_alternate_shallow_file(struct repository *r, const char *path, int override);
252 +int write_shallow_commits(struct strbuf *out, int use_pack_protocol,
253 const struct oid_array *extra);
254 -extern void setup_alternate_shallow(struct lock_file *shallow_lock,
254 +void setup_alternate_shallow(struct lock_file *shallow_lock,
255 const char **alternate_shallow_file,
256 const struct oid_array *extra);
257 -extern const char *setup_temporary_shallow(const struct oid_array *extra);
258 -extern void advertise_shallow_grafts(int);
257 +const char *setup_temporary_shallow(const struct oid_array *extra);
258 +void advertise_shallow_grafts(int);
259
260 struct shallow_info {
261 struct oid_array *shallow;
@@ -272,20 +272,20 @@ struct shallow_info {
272 int nr_commits;
273 };
274
275 -extern void prepare_shallow_info(struct shallow_info *, struct oid_array *);
276 -extern void clear_shallow_info(struct shallow_info *);
277 -extern void remove_nonexistent_theirs_shallow(struct shallow_info *);
278 -extern void assign_shallow_commits_to_refs(struct shallow_info *info,
275 +void prepare_shallow_info(struct shallow_info *, struct oid_array *);
276 +void clear_shallow_info(struct shallow_info *);
277 +void remove_nonexistent_theirs_shallow(struct shallow_info *);
278 +void assign_shallow_commits_to_refs(struct shallow_info *info,
279 uint32_t **used,
280 int *ref_status);
281 -extern int delayed_reachability_test(struct shallow_info *si, int c);
281 +int delayed_reachability_test(struct shallow_info *si, int c);
282 #define PRUNE_SHOW_ONLY 1
283 #define PRUNE_QUICK 2
284 -extern void prune_shallow(unsigned options);
284 +void prune_shallow(unsigned options);
285 extern struct trace_key trace_shallow;
286
287 -extern int interactive_add(int argc, const char **argv, const char *prefix, int patch);
288 -extern int run_add_interactive(const char *revision, const char *patch_mode,
287 +int interactive_add(int argc, const char **argv, const char *prefix, int patch);
288 +int run_add_interactive(const char *revision, const char *patch_mode,
289 const struct pathspec *pathspec);
290
291 struct commit_extra_header {
@@ -295,24 +295,24 @@ struct commit_extra_header {
295 size_t len;
296 };
297
298 -extern void append_merge_tag_headers(struct commit_list *parents,
298 +void append_merge_tag_headers(struct commit_list *parents,
299 struct commit_extra_header ***tail);
300
301 -extern int commit_tree(const char *msg, size_t msg_len,
301 +int commit_tree(const char *msg, size_t msg_len,
302 const struct object_id *tree,
303 struct commit_list *parents, struct object_id *ret,
304 const char *author, const char *sign_commit);
305
306 -extern int commit_tree_extended(const char *msg, size_t msg_len,
306 +int commit_tree_extended(const char *msg, size_t msg_len,
307 const struct object_id *tree,
308 struct commit_list *parents,
309 struct object_id *ret, const char *author,
310 const char *sign_commit,
311 struct commit_extra_header *);
312
313 -extern struct commit_extra_header *read_commit_extra_headers(struct commit *, const char **);
313 +struct commit_extra_header *read_commit_extra_headers(struct commit *, const char **);
314
315 -extern void free_commit_extra_headers(struct commit_extra_header *extra);
315 +void free_commit_extra_headers(struct commit_extra_header *extra);
316
317 /*
318 * Search the commit object contents given by "msg" for the header "key".
@@ -322,23 +322,23 @@ extern void free_commit_extra_headers(struct commit_extra_header *extra);
322 * Note that some headers (like mergetag) may be multi-line. It is the caller's
323 * responsibility to parse further in this case!
324 */
325 -extern const char *find_commit_header(const char *msg, const char *key,
325 +const char *find_commit_header(const char *msg, const char *key,
326 size_t *out_len);
327
328 /* Find the end of the log message, the right place for a new trailer. */
329 -extern size_t ignore_non_trailer(const char *buf, size_t len);
329 +size_t ignore_non_trailer(const char *buf, size_t len);
330
331 typedef int (*each_mergetag_fn)(struct commit *commit, struct commit_extra_header *extra,
332 void *cb_data);
333
334 -extern int for_each_mergetag(each_mergetag_fn fn, struct commit *commit, void *data);
334 +int for_each_mergetag(each_mergetag_fn fn, struct commit *commit, void *data);
335
336 struct merge_remote_desc {
337 struct object *obj; /* the named object, could be a tag */
338 char name[FLEX_ARRAY];
339 };
340 -extern struct merge_remote_desc *merge_remote_util(struct commit *);
341 -extern void set_merge_remote_desc(struct commit *commit,
340 +struct merge_remote_desc *merge_remote_util(struct commit *);
341 +void set_merge_remote_desc(struct commit *commit,
342 const char *name, struct object *obj);
343
344 /*
@@ -348,9 +348,9 @@ extern void set_merge_remote_desc(struct commit *commit,
348 */
349 struct commit *get_merge_parent(const char *name);
350
351 -extern int parse_signed_commit(const struct commit *commit,
351 +int parse_signed_commit(const struct commit *commit,
352 struct strbuf *message, struct strbuf *signature);
353 -extern int remove_signature(struct strbuf *buf);
353 +int remove_signature(struct strbuf *buf);
354
355 /*
356 * Check the signature of the given commit. The result of the check is stored
@@ -359,7 +359,7 @@ extern int remove_signature(struct strbuf *buf);
359 * at all. This may allocate memory for sig->gpg_output, sig->gpg_status,
360 * sig->signer and sig->key.
361 */
362 -extern int check_commit_signature(const struct commit *commit, struct signature_check *sigc);
362 +int check_commit_signature(const struct commit *commit, struct signature_check *sigc);
363
364 /* record author-date for each commit object */
365 struct author_date_slab;
config.h
+91 -91
@@ -68,62 +68,62 @@ struct config_options {
68 };
69
70 typedef int (*config_fn_t)(const char *, const char *, void *);
71 -extern int git_default_config(const char *, const char *, void *);
72 -extern int git_config_from_file(config_fn_t fn, const char *, void *);
73 -extern int git_config_from_file_with_options(config_fn_t fn, const char *,
71 +int git_default_config(const char *, const char *, void *);
72 +int git_config_from_file(config_fn_t fn, const char *, void *);
73 +int git_config_from_file_with_options(config_fn_t fn, const char *,
74 void *,
75 const struct config_options *);
76 -extern int git_config_from_mem(config_fn_t fn,
76 +int git_config_from_mem(config_fn_t fn,
77 const enum config_origin_type,
78 const char *name,
79 const char *buf, size_t len,
80 void *data, const struct config_options *opts);
81 -extern int git_config_from_blob_oid(config_fn_t fn, const char *name,
81 +int git_config_from_blob_oid(config_fn_t fn, const char *name,
82 const struct object_id *oid, void *data);
83 -extern void git_config_push_parameter(const char *text);
84 -extern int git_config_from_parameters(config_fn_t fn, void *data);
85 -extern void read_early_config(config_fn_t cb, void *data);
86 -extern void git_config(config_fn_t fn, void *);
87 -extern int config_with_options(config_fn_t fn, void *,
83 +void git_config_push_parameter(const char *text);
84 +int git_config_from_parameters(config_fn_t fn, void *data);
85 +void read_early_config(config_fn_t cb, void *data);
86 +void git_config(config_fn_t fn, void *);
87 +int config_with_options(config_fn_t fn, void *,
88 struct git_config_source *config_source,
89 const struct config_options *opts);
90 -extern int git_parse_ssize_t(const char *, ssize_t *);
91 -extern int git_parse_ulong(const char *, unsigned long *);
92 -extern int git_parse_maybe_bool(const char *);
93 -extern int git_config_int(const char *, const char *);
94 -extern int64_t git_config_int64(const char *, const char *);
95 -extern unsigned long git_config_ulong(const char *, const char *);
96 -extern ssize_t git_config_ssize_t(const char *, const char *);
97 -extern int git_config_bool_or_int(const char *, const char *, int *);
98 -extern int git_config_bool(const char *, const char *);
99 -extern int git_config_string(const char **, const char *, const char *);
100 -extern int git_config_pathname(const char **, const char *, const char *);
101 -extern int git_config_expiry_date(timestamp_t *, const char *, const char *);
102 -extern int git_config_color(char *, const char *, const char *);
103 -extern int git_config_set_in_file_gently(const char *, const char *, const char *);
104 -extern void git_config_set_in_file(const char *, const char *, const char *);
105 -extern int git_config_set_gently(const char *, const char *);
106 -extern void git_config_set(const char *, const char *);
107 -extern int git_config_parse_key(const char *, char **, int *);
108 -extern int git_config_key_is_valid(const char *key);
109 -extern int git_config_set_multivar_gently(const char *, const char *, const char *, int);
110 -extern void git_config_set_multivar(const char *, const char *, const char *, int);
111 -extern int git_config_set_multivar_in_file_gently(const char *, const char *, const char *, const char *, int);
112 -extern void git_config_set_multivar_in_file(const char *, const char *, const char *, const char *, int);
113 -extern int git_config_rename_section(const char *, const char *);
114 -extern int git_config_rename_section_in_file(const char *, const char *, const char *);
115 -extern int git_config_copy_section(const char *, const char *);
116 -extern int git_config_copy_section_in_file(const char *, const char *, const char *);
117 -extern const char *git_etc_gitconfig(void);
118 -extern int git_env_bool(const char *, int);
119 -extern unsigned long git_env_ulong(const char *, unsigned long);
120 -extern int git_config_system(void);
121 -extern int config_error_nonbool(const char *);
90 +int git_parse_ssize_t(const char *, ssize_t *);
91 +int git_parse_ulong(const char *, unsigned long *);
92 +int git_parse_maybe_bool(const char *);
93 +int git_config_int(const char *, const char *);
94 +int64_t git_config_int64(const char *, const char *);
95 +unsigned long git_config_ulong(const char *, const char *);
96 +ssize_t git_config_ssize_t(const char *, const char *);
97 +int git_config_bool_or_int(const char *, const char *, int *);
98 +int git_config_bool(const char *, const char *);
99 +int git_config_string(const char **, const char *, const char *);
100 +int git_config_pathname(const char **, const char *, const char *);
101 +int git_config_expiry_date(timestamp_t *, const char *, const char *);
102 +int git_config_color(char *, const char *, const char *);
103 +int git_config_set_in_file_gently(const char *, const char *, const char *);
104 +void git_config_set_in_file(const char *, const char *, const char *);
105 +int git_config_set_gently(const char *, const char *);
106 +void git_config_set(const char *, const char *);
107 +int git_config_parse_key(const char *, char **, int *);
108 +int git_config_key_is_valid(const char *key);
109 +int git_config_set_multivar_gently(const char *, const char *, const char *, int);
110 +void git_config_set_multivar(const char *, const char *, const char *, int);
111 +int git_config_set_multivar_in_file_gently(const char *, const char *, const char *, const char *, int);
112 +void git_config_set_multivar_in_file(const char *, const char *, const char *, const char *, int);
113 +int git_config_rename_section(const char *, const char *);
114 +int git_config_rename_section_in_file(const char *, const char *, const char *);
115 +int git_config_copy_section(const char *, const char *);
116 +int git_config_copy_section_in_file(const char *, const char *, const char *);
117 +const char *git_etc_gitconfig(void);
118 +int git_env_bool(const char *, int);
119 +unsigned long git_env_ulong(const char *, unsigned long);
120 +int git_config_system(void);
121 +int config_error_nonbool(const char *);
122 #if defined(__GNUC__)
123 #define config_error_nonbool(s) (config_error_nonbool(s), const_error())
124 #endif
125
126 -extern int git_config_parse_parameter(const char *, config_fn_t fn, void *data);
126 +int git_config_parse_parameter(const char *, config_fn_t fn, void *data);
127
128 enum config_scope {
129 CONFIG_SCOPE_UNKNOWN = 0,
@@ -133,9 +133,9 @@ enum config_scope {
133 CONFIG_SCOPE_CMDLINE,
134 };
135
136 -extern enum config_scope current_config_scope(void);
137 -extern const char *current_config_origin_type(void);
138 -extern const char *current_config_name(void);
136 +enum config_scope current_config_scope(void);
137 +const char *current_config_origin_type(void);
138 +const char *current_config_name(void);
139
140 struct config_include_data {
141 int depth;
@@ -144,7 +144,7 @@ struct config_include_data {
144 const struct config_options *opts;
145 };
146 #define CONFIG_INCLUDE_INIT { 0 }
147 -extern int git_config_include(const char *name, const char *value, void *data);
147 +int git_config_include(const char *name, const char *value, void *data);
148
149 /*
150 * Match and parse a config key of the form:
@@ -159,7 +159,7 @@ extern int git_config_include(const char *name, const char *value, void *data);
159 * If the subsection pointer-to-pointer passed in is NULL, returns 0 only if
160 * there is no subsection at all.
161 */
162 -extern int parse_config_key(const char *var,
162 +int parse_config_key(const char *var,
163 const char *section,
164 const char **subsection, int *subsection_len,
165 const char **key);
@@ -192,71 +192,71 @@ struct config_set {
192 struct configset_list list;
193 };
194
195 -extern void git_configset_init(struct config_set *cs);
196 -extern int git_configset_add_file(struct config_set *cs, const char *filename);
197 -extern const struct string_list *git_configset_get_value_multi(struct config_set *cs, const char *key);
198 -extern void git_configset_clear(struct config_set *cs);
195 +void git_configset_init(struct config_set *cs);
196 +int git_configset_add_file(struct config_set *cs, const char *filename);
197 +const struct string_list *git_configset_get_value_multi(struct config_set *cs, const char *key);
198 +void git_configset_clear(struct config_set *cs);
199
200 /*
201 * These functions return 1 if not found, and 0 if found, leaving the found
202 * value in the 'dest' pointer.
203 */
204 -extern int git_configset_get_value(struct config_set *cs, const char *key, const char **dest);
205 -extern int git_configset_get_string_const(struct config_set *cs, const char *key, const char **dest);
206 -extern int git_configset_get_string(struct config_set *cs, const char *key, char **dest);
207 -extern int git_configset_get_int(struct config_set *cs, const char *key, int *dest);
208 -extern int git_configset_get_ulong(struct config_set *cs, const char *key, unsigned long *dest);
209 -extern int git_configset_get_bool(struct config_set *cs, const char *key, int *dest);
210 -extern int git_configset_get_bool_or_int(struct config_set *cs, const char *key, int *is_bool, int *dest);
211 -extern int git_configset_get_maybe_bool(struct config_set *cs, const char *key, int *dest);
212 -extern int git_configset_get_pathname(struct config_set *cs, const char *key, const char **dest);
204 +int git_configset_get_value(struct config_set *cs, const char *key, const char **dest);
205 +int git_configset_get_string_const(struct config_set *cs, const char *key, const char **dest);
206 +int git_configset_get_string(struct config_set *cs, const char *key, char **dest);
207 +int git_configset_get_int(struct config_set *cs, const char *key, int *dest);
208 +int git_configset_get_ulong(struct config_set *cs, const char *key, unsigned long *dest);
209 +int git_configset_get_bool(struct config_set *cs, const char *key, int *dest);
210 +int git_configset_get_bool_or_int(struct config_set *cs, const char *key, int *is_bool, int *dest);
211 +int git_configset_get_maybe_bool(struct config_set *cs, const char *key, int *dest);
212 +int git_configset_get_pathname(struct config_set *cs, const char *key, const char **dest);
213
214 /* Functions for reading a repository's config */
215 struct repository;
216 -extern void repo_config(struct repository *repo, config_fn_t fn, void *data);
217 -extern int repo_config_get_value(struct repository *repo,
216 +void repo_config(struct repository *repo, config_fn_t fn, void *data);
217 +int repo_config_get_value(struct repository *repo,
218 const char *key, const char **value);
219 -extern const struct string_list *repo_config_get_value_multi(struct repository *repo,
219 +const struct string_list *repo_config_get_value_multi(struct repository *repo,
220 const char *key);
221 -extern int repo_config_get_string_const(struct repository *repo,
221 +int repo_config_get_string_const(struct repository *repo,
222 const char *key, const char **dest);
223 -extern int repo_config_get_string(struct repository *repo,
223 +int repo_config_get_string(struct repository *repo,
224 const char *key, char **dest);
225 -extern int repo_config_get_int(struct repository *repo,
225 +int repo_config_get_int(struct repository *repo,
226 const char *key, int *dest);
227 -extern int repo_config_get_ulong(struct repository *repo,
227 +int repo_config_get_ulong(struct repository *repo,
228 const char *key, unsigned long *dest);
229 -extern int repo_config_get_bool(struct repository *repo,
229 +int repo_config_get_bool(struct repository *repo,
230 const char *key, int *dest);
231 -extern int repo_config_get_bool_or_int(struct repository *repo,
231 +int repo_config_get_bool_or_int(struct repository *repo,
232 const char *key, int *is_bool, int *dest);
233 -extern int repo_config_get_maybe_bool(struct repository *repo,
233 +int repo_config_get_maybe_bool(struct repository *repo,
234 const char *key, int *dest);
235 -extern int repo_config_get_pathname(struct repository *repo,
235 +int repo_config_get_pathname(struct repository *repo,
236 const char *key, const char **dest);
237
238 -extern int git_config_get_value(const char *key, const char **value);
239 -extern const struct string_list *git_config_get_value_multi(const char *key);
240 -extern void git_config_clear(void);
241 -extern int git_config_get_string_const(const char *key, const char **dest);
242 -extern int git_config_get_string(const char *key, char **dest);
243 -extern int git_config_get_int(const char *key, int *dest);
244 -extern int git_config_get_ulong(const char *key, unsigned long *dest);
245 -extern int git_config_get_bool(const char *key, int *dest);
246 -extern int git_config_get_bool_or_int(const char *key, int *is_bool, int *dest);
247 -extern int git_config_get_maybe_bool(const char *key, int *dest);
248 -extern int git_config_get_pathname(const char *key, const char **dest);
249 -extern int git_config_get_index_threads(int *dest);
250 -extern int git_config_get_untracked_cache(void);
251 -extern int git_config_get_split_index(void);
252 -extern int git_config_get_max_percent_split_change(void);
253 -extern int git_config_get_fsmonitor(void);
238 +int git_config_get_value(const char *key, const char **value);
239 +const struct string_list *git_config_get_value_multi(const char *key);
240 +void git_config_clear(void);
241 +int git_config_get_string_const(const char *key, const char **dest);
242 +int git_config_get_string(const char *key, char **dest);
243 +int git_config_get_int(const char *key, int *dest);
244 +int git_config_get_ulong(const char *key, unsigned long *dest);
245 +int git_config_get_bool(const char *key, int *dest);
246 +int git_config_get_bool_or_int(const char *key, int *is_bool, int *dest);
247 +int git_config_get_maybe_bool(const char *key, int *dest);
248 +int git_config_get_pathname(const char *key, const char **dest);
249 +int git_config_get_index_threads(int *dest);
250 +int git_config_get_untracked_cache(void);
251 +int git_config_get_split_index(void);
252 +int git_config_get_max_percent_split_change(void);
253 +int git_config_get_fsmonitor(void);
254
255 /* This dies if the configured or default date is in the future */
256 -extern int git_config_get_expiry(const char *key, const char **output);
256 +int git_config_get_expiry(const char *key, const char **output);
257
258 /* parse either "this many days" integer, or "5.days.ago" approxidate */
259 -extern int git_config_get_expiry_in_days(const char *key, timestamp_t *, timestamp_t now);
259 +int git_config_get_expiry_in_days(const char *key, timestamp_t *, timestamp_t now);
260
261 struct key_value_info {
262 const char *filename;
@@ -266,7 +266,7 @@ struct key_value_info {
266 };
267
268 extern NORETURN void git_die_config(const char *key, const char *err, ...) __attribute__((format(printf, 2, 3)));
269 -extern NORETURN void git_die_config_linenr(const char *key, const char *filename, int linenr);
269 +NORETURN void git_die_config_linenr(const char *key, const char *filename, int linenr);
270
271 #define LOOKUP_CONFIG(mapping, var) \
272 lookup_config(mapping, ARRAY_SIZE(mapping), var)
connect.h
+10 -10
@@ -7,19 +7,19 @@
7 #define CONNECT_DIAG_URL (1u << 1)
8 #define CONNECT_IPV4 (1u << 2)
9 #define CONNECT_IPV6 (1u << 3)
10 -extern struct child_process *git_connect(int fd[2], const char *url, const char *prog, int flags);
11 -extern int finish_connect(struct child_process *conn);
12 -extern int git_connection_is_socket(struct child_process *conn);
13 -extern int server_supports(const char *feature);
14 -extern int parse_feature_request(const char *features, const char *feature);
15 -extern const char *server_feature_value(const char *feature, int *len_ret);
16 -extern int url_is_local_not_ssh(const char *url);
10 +struct child_process *git_connect(int fd[2], const char *url, const char *prog, int flags);
11 +int finish_connect(struct child_process *conn);
12 +int git_connection_is_socket(struct child_process *conn);
13 +int server_supports(const char *feature);
14 +int parse_feature_request(const char *features, const char *feature);
15 +const char *server_feature_value(const char *feature, int *len_ret);
16 +int url_is_local_not_ssh(const char *url);
17
18 struct packet_reader;
19 -extern enum protocol_version discover_version(struct packet_reader *reader);
19 +enum protocol_version discover_version(struct packet_reader *reader);
20
21 -extern int server_supports_v2(const char *c, int die_on_error);
22 -extern int server_supports_feature(const char *c, const char *feature,
21 +int server_supports_v2(const char *c, int die_on_error);
22 +int server_supports_feature(const char *c, const char *feature,
23 int die_on_error);
24
25 #endif
csum-file.h
+10 -10
@@ -25,22 +25,22 @@ struct hashfile_checkpoint {
25 git_hash_ctx ctx;
26 };
27
28 -extern void hashfile_checkpoint(struct hashfile *, struct hashfile_checkpoint *);
29 -extern int hashfile_truncate(struct hashfile *, struct hashfile_checkpoint *);
28 +void hashfile_checkpoint(struct hashfile *, struct hashfile_checkpoint *);
29 +int hashfile_truncate(struct hashfile *, struct hashfile_checkpoint *);
30
31 /* finalize_hashfile flags */
32 #define CSUM_CLOSE 1
33 #define CSUM_FSYNC 2
34 #define CSUM_HASH_IN_STREAM 4
35
36 -extern struct hashfile *hashfd(int fd, const char *name);
37 -extern struct hashfile *hashfd_check(const char *name);
38 -extern struct hashfile *hashfd_throughput(int fd, const char *name, struct progress *tp);
39 -extern int finalize_hashfile(struct hashfile *, unsigned char *, unsigned int);
40 -extern void hashwrite(struct hashfile *, const void *, unsigned int);
41 -extern void hashflush(struct hashfile *f);
42 -extern void crc32_begin(struct hashfile *);
43 -extern uint32_t crc32_end(struct hashfile *);
36 +struct hashfile *hashfd(int fd, const char *name);
37 +struct hashfile *hashfd_check(const char *name);
38 +struct hashfile *hashfd_throughput(int fd, const char *name, struct progress *tp);
39 +int finalize_hashfile(struct hashfile *, unsigned char *, unsigned int);
40 +void hashwrite(struct hashfile *, const void *, unsigned int);
41 +void hashflush(struct hashfile *f);
42 +void crc32_begin(struct hashfile *);
43 +uint32_t crc32_end(struct hashfile *);
44
45 static inline void hashwrite_u8(struct hashfile *f, uint8_t data)
46 {
decorate.h
+2 -2
@@ -50,12 +50,12 @@ struct decoration {
50 * NULL), returning the previously associated pointer. If there is no previous
51 * association, this function returns NULL.
52 */
53 -extern void *add_decoration(struct decoration *n, const struct object *obj, void *decoration);
53 +void *add_decoration(struct decoration *n, const struct object *obj, void *decoration);
54
55 /*
56 * Return the pointer associated to the given object. If there is no
57 * association, this function returns NULL.
58 */
59 -extern void *lookup_decoration(struct decoration *n, const struct object *obj);
59 +void *lookup_decoration(struct decoration *n, const struct object *obj);
60
61 #endif
delta.h
+5 -5
@@ -13,7 +13,7 @@ struct delta_index;
13 * before free_delta_index() is called. The returned pointer must be freed
14 * using free_delta_index().
15 */
16 -extern struct delta_index *
16 +struct delta_index *
17 create_delta_index(const void *buf, unsigned long bufsize);
18
19 /*
@@ -21,14 +21,14 @@ create_delta_index(const void *buf, unsigned long bufsize);
21 *
22 * Given pointer must be what create_delta_index() returned, or NULL.
23 */
24 -extern void free_delta_index(struct delta_index *index);
24 +void free_delta_index(struct delta_index *index);
25
26 /*
27 * sizeof_delta_index: returns memory usage of delta index
28 *
29 * Given pointer must be what create_delta_index() returned, or NULL.
30 */
31 -extern unsigned long sizeof_delta_index(struct delta_index *index);
31 +unsigned long sizeof_delta_index(struct delta_index *index);
32
33 /*
34 * create_delta: create a delta from given index for the given buffer
@@ -40,7 +40,7 @@ extern unsigned long sizeof_delta_index(struct delta_index *index);
40 * returned and *delta_size is updated with its size. The returned buffer
41 * must be freed by the caller.
42 */
43 -extern void *
43 +void *
44 create_delta(const struct delta_index *index,
45 const void *buf, unsigned long bufsize,
46 unsigned long *delta_size, unsigned long max_delta_size);
@@ -75,7 +75,7 @@ diff_delta(const void *src_buf, unsigned long src_bufsize,
75 * *trg_bufsize is updated with its size. On failure a NULL pointer is
76 * returned. The returned buffer must be freed by the caller.
77 */
78 -extern void *patch_delta(const void *src_buf, unsigned long src_size,
78 +void *patch_delta(const void *src_buf, unsigned long src_size,
79 const void *delta_buf, unsigned long delta_size,
80 unsigned long *dst_size);
81
dir.h
+35 -35
@@ -202,7 +202,7 @@ struct dir_struct {
202 };
203
204 /*Count the number of slashes for string s*/
205 -extern int count_slashes(const char *s);
205 +int count_slashes(const char *s);
206
207 /*
208 * The ordering of these constants is significant, with
@@ -213,24 +213,24 @@ extern int count_slashes(const char *s);
213 #define MATCHED_RECURSIVELY 1
214 #define MATCHED_FNMATCH 2
215 #define MATCHED_EXACTLY 3
216 -extern int simple_length(const char *match);
217 -extern int no_wildcard(const char *string);
218 -extern char *common_prefix(const struct pathspec *pathspec);
219 -extern int match_pathspec(const struct index_state *istate,
216 +int simple_length(const char *match);
217 +int no_wildcard(const char *string);
218 +char *common_prefix(const struct pathspec *pathspec);
219 +int match_pathspec(const struct index_state *istate,
220 const struct pathspec *pathspec,
221 const char *name, int namelen,
222 int prefix, char *seen, int is_dir);
223 -extern int report_path_error(const char *ps_matched, const struct pathspec *pathspec, const char *prefix);
224 -extern int within_depth(const char *name, int namelen, int depth, int max_depth);
223 +int report_path_error(const char *ps_matched, const struct pathspec *pathspec, const char *prefix);
224 +int within_depth(const char *name, int namelen, int depth, int max_depth);
225
226 -extern int fill_directory(struct dir_struct *dir,
226 +int fill_directory(struct dir_struct *dir,
227 struct index_state *istate,
228 const struct pathspec *pathspec);
229 -extern int read_directory(struct dir_struct *, struct index_state *istate,
229 +int read_directory(struct dir_struct *, struct index_state *istate,
230 const char *path, int len,
231 const struct pathspec *pathspec);
232
233 -extern int is_excluded_from_list(const char *pathname, int pathlen,
233 +int is_excluded_from_list(const char *pathname, int pathlen,
234 const char *basename, int *dtype,
235 struct exclude_list *el,
236 struct index_state *istate);
@@ -242,37 +242,37 @@ struct dir_entry *dir_add_ignored(struct dir_struct *dir,
242 * these implement the matching logic for dir.c:excluded_from_list and
243 * attr.c:path_matches()
244 */
245 -extern int match_basename(const char *, int,
245 +int match_basename(const char *, int,
246 const char *, int, int, unsigned);
247 -extern int match_pathname(const char *, int,
247 +int match_pathname(const char *, int,
248 const char *, int,
249 const char *, int, int, unsigned);
250
251 -extern struct exclude *last_exclude_matching(struct dir_struct *dir,
251 +struct exclude *last_exclude_matching(struct dir_struct *dir,
252 struct index_state *istate,
253 const char *name, int *dtype);
254
255 -extern int is_excluded(struct dir_struct *dir,
255 +int is_excluded(struct dir_struct *dir,
256 struct index_state *istate,
257 const char *name, int *dtype);
258
259 -extern struct exclude_list *add_exclude_list(struct dir_struct *dir,
259 +struct exclude_list *add_exclude_list(struct dir_struct *dir,
260 int group_type, const char *src);
261 -extern int add_excludes_from_file_to_list(const char *fname, const char *base, int baselen,
261 +int add_excludes_from_file_to_list(const char *fname, const char *base, int baselen,
262 struct exclude_list *el, struct index_state *istate);
263 -extern void add_excludes_from_file(struct dir_struct *, const char *fname);
264 -extern int add_excludes_from_blob_to_list(struct object_id *oid,
263 +void add_excludes_from_file(struct dir_struct *, const char *fname);
264 +int add_excludes_from_blob_to_list(struct object_id *oid,
265 const char *base, int baselen,
266 struct exclude_list *el);
267 -extern void parse_exclude_pattern(const char **string, int *patternlen, unsigned *flags, int *nowildcardlen);
268 -extern void add_exclude(const char *string, const char *base,
267 +void parse_exclude_pattern(const char **string, int *patternlen, unsigned *flags, int *nowildcardlen);
268 +void add_exclude(const char *string, const char *base,
269 int baselen, struct exclude_list *el, int srcpos);
270 -extern void clear_exclude_list(struct exclude_list *el);
271 -extern void clear_directory(struct dir_struct *dir);
272 -extern int file_exists(const char *);
270 +void clear_exclude_list(struct exclude_list *el);
271 +void clear_directory(struct dir_struct *dir);
272 +int file_exists(const char *);
273
274 -extern int is_inside_dir(const char *dir);
275 -extern int dir_inside_of(const char *subdir, const char *dir);
274 +int is_inside_dir(const char *dir);
275 +int dir_inside_of(const char *subdir, const char *dir);
276
277 static inline int is_dot_or_dotdot(const char *name)
278 {
@@ -281,9 +281,9 @@ static inline int is_dot_or_dotdot(const char *name)
281 (name[1] == '.' && name[2] == '\0')));
282 }
283
284 -extern int is_empty_dir(const char *dir);
284 +int is_empty_dir(const char *dir);
285
286 -extern void setup_standard_excludes(struct dir_struct *dir);
286 +void setup_standard_excludes(struct dir_struct *dir);
287
288
289 /* Constants for remove_dir_recursively: */
@@ -311,23 +311,23 @@ extern void setup_standard_excludes(struct dir_struct *dir);
311 * This function uses path as temporary scratch space, but restores it
312 * before returning.
313 */
314 -extern int remove_dir_recursively(struct strbuf *path, int flag);
314 +int remove_dir_recursively(struct strbuf *path, int flag);
315
316 /* tries to remove the path with empty directories along it, ignores ENOENT */
317 -extern int remove_path(const char *path);
317 +int remove_path(const char *path);
318
319 -extern int fspathcmp(const char *a, const char *b);
320 -extern int fspathncmp(const char *a, const char *b, size_t count);
319 +int fspathcmp(const char *a, const char *b);
320 +int fspathncmp(const char *a, const char *b, size_t count);
321
322 /*
323 * The prefix part of pattern must not contains wildcards.
324 */
325 struct pathspec_item;
326 -extern int git_fnmatch(const struct pathspec_item *item,
326 +int git_fnmatch(const struct pathspec_item *item,
327 const char *pattern, const char *string,
328 int prefix);
329
330 -extern int submodule_path_match(const struct index_state *istate,
330 +int submodule_path_match(const struct index_state *istate,
331 const struct pathspec *ps,
332 const char *submodule_name,
333 char *seen);
@@ -372,10 +372,10 @@ void remove_untracked_cache(struct index_state *istate);
372 * When `recurse_into_nested` is set, recurse into any nested submodules,
373 * connecting them as well.
374 */
375 -extern void connect_work_tree_and_git_dir(const char *work_tree,
375 +void connect_work_tree_and_git_dir(const char *work_tree,
376 const char *git_dir,
377 int recurse_into_nested);
378 -extern void relocate_gitdir(const char *path,
378 +void relocate_gitdir(const char *path,
379 const char *old_git_dir,
380 const char *new_git_dir);
381 #endif
exec-cmd.h
+7 -7
@@ -3,14 +3,14 @@
3
4 struct argv_array;
5
6 -extern void git_set_exec_path(const char *exec_path);
7 -extern void git_resolve_executable_dir(const char *path);
8 -extern const char *git_exec_path(void);
9 -extern void setup_path(void);
10 -extern const char **prepare_git_cmd(struct argv_array *out, const char **argv);
11 -extern int execv_git_cmd(const char **argv); /* NULL terminated */
6 +void git_set_exec_path(const char *exec_path);
7 +void git_resolve_executable_dir(const char *path);
8 +const char *git_exec_path(void);
9 +void setup_path(void);
10 +const char **prepare_git_cmd(struct argv_array *out, const char **argv);
11 +int execv_git_cmd(const char **argv); /* NULL terminated */
12 LAST_ARG_MUST_BE_NULL
13 extern int execl_git_cmd(const char *cmd, ...);
14 -extern char *system_path(const char *path);
14 +char *system_path(const char *path);
15
16 #endif /* GIT_EXEC_CMD_H */
fmt-merge-msg.h
+1 -1
@@ -2,6 +2,6 @@
2 #define FMT_MERGE_MSG_H
3
4 extern int merge_log_config;
5 -extern int fmt_merge_msg_config(const char *key, const char *value, void *cb);
5 +int fmt_merge_msg_config(const char *key, const char *value, void *cb);
6
7 #endif /* FMT_MERGE_MSG_H */
fsmonitor.h
+7 -7
@@ -10,31 +10,31 @@ extern struct trace_key trace_fsmonitor;
10 * Read the fsmonitor index extension and (if configured) restore the
11 * CE_FSMONITOR_VALID state.
12 */
13 -extern int read_fsmonitor_extension(struct index_state *istate, const void *data, unsigned long sz);
13 +int read_fsmonitor_extension(struct index_state *istate, const void *data, unsigned long sz);
14
15 /*
16 * Fill the fsmonitor_dirty ewah bits with their state from the index,
17 * before it is split during writing.
18 */
19 -extern void fill_fsmonitor_bitmap(struct index_state *istate);
19 +void fill_fsmonitor_bitmap(struct index_state *istate);
20
21 /*
22 * Write the CE_FSMONITOR_VALID state into the fsmonitor index
23 * extension. Reads from the fsmonitor_dirty ewah in the index.
24 */
25 -extern void write_fsmonitor_extension(struct strbuf *sb, struct index_state *istate);
25 +void write_fsmonitor_extension(struct strbuf *sb, struct index_state *istate);
26
27 /*
28 * Add/remove the fsmonitor index extension
29 */
30 -extern void add_fsmonitor(struct index_state *istate);
31 -extern void remove_fsmonitor(struct index_state *istate);
30 +void add_fsmonitor(struct index_state *istate);
31 +void remove_fsmonitor(struct index_state *istate);
32
33 /*
34 * Add/remove the fsmonitor index extension as necessary based on the current
35 * core.fsmonitor setting.
36 */
37 -extern void tweak_fsmonitor(struct index_state *istate);
37 +void tweak_fsmonitor(struct index_state *istate);
38
39 /*
40 * Run the configured fsmonitor integration script and clear the
@@ -42,7 +42,7 @@ extern void tweak_fsmonitor(struct index_state *istate);
42 * any corresponding untracked cache directory structures. Optimized to only
43 * run the first time it is called.
44 */
45 -extern void refresh_fsmonitor(struct index_state *istate);
45 +void refresh_fsmonitor(struct index_state *istate);
46
47 /*
48 * Set the given cache entries CE_FSMONITOR_VALID bit. This should be
gettext.h
+4 -4
@@ -28,11 +28,11 @@
28
29 #define FORMAT_PRESERVING(n) __attribute__((format_arg(n)))
30
31 -extern int use_gettext_poison(void);
31 +int use_gettext_poison(void);
32
33 #ifndef NO_GETTEXT
34 -extern void git_setup_gettext(void);
35 -extern int gettext_width(const char *s);
34 +void git_setup_gettext(void);
35 +int gettext_width(const char *s);
36 #else
37 static inline void git_setup_gettext(void)
38 {
@@ -87,6 +87,6 @@ const char *Q_(const char *msgid, const char *plu, unsigned long n)
87 #endif
88
89 const char *get_preferred_languages(void);
90 -extern int is_utf8_locale(void);
90 +int is_utf8_locale(void);
91
92 #endif
git-compat-util.h
+54 -54
@@ -249,7 +249,7 @@ typedef unsigned long uintptr_t;
249
250 #ifdef MKDIR_WO_TRAILING_SLASH
251 #define mkdir(a,b) compat_mkdir_wo_trailing_slash((a),(b))
252 -extern int compat_mkdir_wo_trailing_slash(const char*, mode_t);
252 +int compat_mkdir_wo_trailing_slash(const char*, mode_t);
253 #endif
254
255 #ifdef NO_STRUCT_ITIMERVAL
@@ -267,9 +267,9 @@ struct itimerval {
267 #include <libgen.h>
268 #else
269 #define basename gitbasename
270 -extern char *gitbasename(char *);
270 +char *gitbasename(char *);
271 #define dirname gitdirname
272 -extern char *gitdirname(char *);
272 +char *gitdirname(char *);
273 #endif
274
275 #ifndef NO_ICONV
@@ -446,8 +446,8 @@ static inline char *git_find_last_dir_sep(const char *path)
446 struct strbuf;
447
448 /* General helper functions */
449 -extern void vreportf(const char *prefix, const char *err, va_list params);
450 -extern NORETURN void usage(const char *err);
449 +void vreportf(const char *prefix, const char *err, va_list params);
450 +NORETURN void usage(const char *err);
451 extern NORETURN void usagef(const char *err, ...) __attribute__((format (printf, 1, 2)));
452 extern NORETURN void die(const char *err, ...) __attribute__((format (printf, 1, 2)));
453 extern NORETURN void die_errno(const char *err, ...) __attribute__((format (printf, 1, 2)));
@@ -482,15 +482,15 @@ static inline int const_error(void)
482 #define error_errno(...) (error_errno(__VA_ARGS__), const_error())
483 #endif
484
485 -extern void set_die_routine(NORETURN_PTR void (*routine)(const char *err, va_list params));
486 -extern void set_error_routine(void (*routine)(const char *err, va_list params));
485 +void set_die_routine(NORETURN_PTR void (*routine)(const char *err, va_list params));
486 +void set_error_routine(void (*routine)(const char *err, va_list params));
487 extern void (*get_error_routine(void))(const char *err, va_list params);
488 -extern void set_warn_routine(void (*routine)(const char *warn, va_list params));
488 +void set_warn_routine(void (*routine)(const char *warn, va_list params));
489 extern void (*get_warn_routine(void))(const char *warn, va_list params);
490 -extern void set_die_is_recursing_routine(int (*routine)(void));
490 +void set_die_is_recursing_routine(int (*routine)(void));
491
492 -extern int starts_with(const char *str, const char *prefix);
493 -extern int istarts_with(const char *str, const char *prefix);
492 +int starts_with(const char *str, const char *prefix);
493 +int istarts_with(const char *str, const char *prefix);
494
495 /*
496 * If the string "str" begins with the string found in "prefix", return 1.
@@ -613,8 +613,8 @@ static inline int ends_with(const char *str, const char *suffix)
613
614 #define mmap git_mmap
615 #define munmap git_munmap
616 -extern void *git_mmap(void *start, size_t length, int prot, int flags, int fd, off_t offset);
617 -extern int git_munmap(void *start, size_t length);
616 +void *git_mmap(void *start, size_t length, int prot, int flags, int fd, off_t offset);
617 +int git_munmap(void *start, size_t length);
618
619 #else /* NO_MMAP || USE_WIN32_MMAP */
620
@@ -668,17 +668,17 @@ extern int git_munmap(void *start, size_t length);
668 #undef stat
669 #endif
670 #define stat(path, buf) git_stat(path, buf)
671 -extern int git_stat(const char *, struct stat *);
671 +int git_stat(const char *, struct stat *);
672 #ifdef fstat
673 #undef fstat
674 #endif
675 #define fstat(fd, buf) git_fstat(fd, buf)
676 -extern int git_fstat(int, struct stat *);
676 +int git_fstat(int, struct stat *);
677 #ifdef lstat
678 #undef lstat
679 #endif
680 #define lstat(path, buf) git_lstat(path, buf)
681 -extern int git_lstat(const char *, struct stat *);
681 +int git_lstat(const char *, struct stat *);
682 #endif
683
684 #define DEFAULT_PACKED_GIT_LIMIT \
@@ -686,50 +686,50 @@ extern int git_lstat(const char *, struct stat *);
686
687 #ifdef NO_PREAD
688 #define pread git_pread
689 -extern ssize_t git_pread(int fd, void *buf, size_t count, off_t offset);
689 +ssize_t git_pread(int fd, void *buf, size_t count, off_t offset);
690 #endif
691 /*
692 * Forward decl that will remind us if its twin in cache.h changes.
693 * This function is used in compat/pread.c. But we can't include
694 * cache.h there.
695 */
696 -extern ssize_t read_in_full(int fd, void *buf, size_t count);
696 +ssize_t read_in_full(int fd, void *buf, size_t count);
697
698 #ifdef NO_SETENV
699 #define setenv gitsetenv
700 -extern int gitsetenv(const char *, const char *, int);
700 +int gitsetenv(const char *, const char *, int);
701 #endif
702
703 #ifdef NO_MKDTEMP
704 #define mkdtemp gitmkdtemp
705 -extern char *gitmkdtemp(char *);
705 +char *gitmkdtemp(char *);
706 #endif
707
708 #ifdef NO_UNSETENV
709 #define unsetenv gitunsetenv
710 -extern void gitunsetenv(const char *);
710 +void gitunsetenv(const char *);
711 #endif
712
713 #ifdef NO_STRCASESTR
714 #define strcasestr gitstrcasestr
715 -extern char *gitstrcasestr(const char *haystack, const char *needle);
715 +char *gitstrcasestr(const char *haystack, const char *needle);
716 #endif
717
718 #ifdef NO_STRLCPY
719 #define strlcpy gitstrlcpy
720 -extern size_t gitstrlcpy(char *, const char *, size_t);
720 +size_t gitstrlcpy(char *, const char *, size_t);
721 #endif
722
723 #ifdef NO_STRTOUMAX
724 #define strtoumax gitstrtoumax
725 -extern uintmax_t gitstrtoumax(const char *, char **, int);
725 +uintmax_t gitstrtoumax(const char *, char **, int);
726 #define strtoimax gitstrtoimax
727 -extern intmax_t gitstrtoimax(const char *, char **, int);
727 +intmax_t gitstrtoimax(const char *, char **, int);
728 #endif
729
730 #ifdef NO_HSTRERROR
731 #define hstrerror githstrerror
732 -extern const char *githstrerror(int herror);
732 +const char *githstrerror(int herror);
733 #endif
734
735 #ifdef NO_MEMMEM
@@ -761,7 +761,7 @@ char *gitstrdup(const char *s);
761 # endif
762 # define fopen(a,b) git_fopen(a,b)
763 # endif
764 -extern FILE *git_fopen(const char*, const char*);
764 +FILE *git_fopen(const char*, const char*);
765 #endif
766
767 #ifdef SNPRINTF_RETURNS_BOGUS
@@ -775,7 +775,7 @@ extern int git_snprintf(char *str, size_t maxsize,
775 #undef vsnprintf
776 #endif
777 #define vsnprintf git_vsnprintf
778 -extern int git_vsnprintf(char *str, size_t maxsize,
778 +int git_vsnprintf(char *str, size_t maxsize,
779 const char *format, va_list ap);
780 #endif
781
@@ -805,11 +805,11 @@ const char *inet_ntop(int af, const void *src, char *dst, size_t size);
805
806 #ifdef NO_PTHREADS
807 #define atexit git_atexit
808 -extern int git_atexit(void (*handler)(void));
808 +int git_atexit(void (*handler)(void));
809 #endif
810
811 typedef void (*try_to_free_t)(size_t);
812 -extern try_to_free_t set_try_to_free_routine(try_to_free_t);
812 +try_to_free_t set_try_to_free_routine(try_to_free_t);
813
814 static inline size_t st_add(size_t a, size_t b)
815 {
@@ -845,28 +845,28 @@ static inline size_t st_sub(size_t a, size_t b)
845 # define xalloca(size) (xmalloc(size))
846 # define xalloca_free(p) (free(p))
847 #endif
848 -extern char *xstrdup(const char *str);
849 -extern void *xmalloc(size_t size);
850 -extern void *xmallocz(size_t size);
851 -extern void *xmallocz_gently(size_t size);
852 -extern void *xmemdupz(const void *data, size_t len);
853 -extern char *xstrndup(const char *str, size_t len);
854 -extern void *xrealloc(void *ptr, size_t size);
855 -extern void *xcalloc(size_t nmemb, size_t size);
856 -extern void *xmmap(void *start, size_t length, int prot, int flags, int fd, off_t offset);
857 -extern void *xmmap_gently(void *start, size_t length, int prot, int flags, int fd, off_t offset);
848 +char *xstrdup(const char *str);
849 +void *xmalloc(size_t size);
850 +void *xmallocz(size_t size);
851 +void *xmallocz_gently(size_t size);
852 +void *xmemdupz(const void *data, size_t len);
853 +char *xstrndup(const char *str, size_t len);
854 +void *xrealloc(void *ptr, size_t size);
855 +void *xcalloc(size_t nmemb, size_t size);
856 +void *xmmap(void *start, size_t length, int prot, int flags, int fd, off_t offset);
857 +void *xmmap_gently(void *start, size_t length, int prot, int flags, int fd, off_t offset);
858 extern int xopen(const char *path, int flags, ...);
859 -extern ssize_t xread(int fd, void *buf, size_t len);
860 -extern ssize_t xwrite(int fd, const void *buf, size_t len);
861 -extern ssize_t xpread(int fd, void *buf, size_t len, off_t offset);
862 -extern int xdup(int fd);
863 -extern FILE *xfopen(const char *path, const char *mode);
864 -extern FILE *xfdopen(int fd, const char *mode);
865 -extern int xmkstemp(char *temp_filename);
866 -extern int xmkstemp_mode(char *temp_filename, int mode);
867 -extern char *xgetcwd(void);
868 -extern FILE *fopen_for_writing(const char *path);
869 -extern FILE *fopen_or_warn(const char *path, const char *mode);
859 +ssize_t xread(int fd, void *buf, size_t len);
860 +ssize_t xwrite(int fd, const void *buf, size_t len);
861 +ssize_t xpread(int fd, void *buf, size_t len, off_t offset);
862 +int xdup(int fd);
863 +FILE *xfopen(const char *path, const char *mode);
864 +FILE *xfdopen(int fd, const char *mode);
865 +int xmkstemp(char *temp_filename);
866 +int xmkstemp_mode(char *temp_filename, int mode);
867 +char *xgetcwd(void);
868 +FILE *fopen_for_writing(const char *path);
869 +FILE *fopen_or_warn(const char *path, const char *mode);
870
871 /*
872 * FREE_AND_NULL(ptr) is like free(ptr) followed by ptr = NULL. Note
@@ -972,7 +972,7 @@ extern int xsnprintf(char *dst, size_t max, const char *fmt, ...);
972 #define HOST_NAME_MAX 256
973 #endif
974
975 -extern int xgethostname(char *buf, size_t len);
975 +int xgethostname(char *buf, size_t len);
976
977 /* in ctype.c, for kwset users */
978 extern const unsigned char tolower_trans_tbl[256];
@@ -1257,7 +1257,7 @@ static inline int is_missing_file_error(int errno_)
1257 return (errno_ == ENOENT || errno_ == ENOTDIR);
1258 }
1259
1260 -extern int cmd_main(int, const char **);
1260 +int cmd_main(int, const char **);
1261
1262 /*
1263 * Intercept all calls to exit() and route them to trace2 to
@@ -1280,7 +1280,7 @@ int trace2_cmd_exit_fl(const char *file, int line, int code);
1280 * an annotation, and does nothing in non-leak-checking builds.
1281 */
1282 #ifdef SUPPRESS_ANNOTATED_LEAKS
1283 -extern void unleak_memory(const void *ptr, size_t len);
1283 +void unleak_memory(const void *ptr, size_t len);
1284 #define UNLEAK(var) unleak_memory(&(var), sizeof(var))
1285 #else
1286 #define UNLEAK(var) do {} while (0)
grep.h
+11 -11
@@ -186,17 +186,17 @@ struct grep_opt {
186 void *output_priv;
187 };
188
189 -extern void init_grep_defaults(struct repository *);
190 -extern int grep_config(const char *var, const char *value, void *);
191 -extern void grep_init(struct grep_opt *, struct repository *repo, const char *prefix);
189 +void init_grep_defaults(struct repository *);
190 +int grep_config(const char *var, const char *value, void *);
191 +void grep_init(struct grep_opt *, struct repository *repo, const char *prefix);
192 void grep_commit_pattern_type(enum grep_pattern_type, struct grep_opt *opt);
193
194 -extern void append_grep_pat(struct grep_opt *opt, const char *pat, size_t patlen, const char *origin, int no, enum grep_pat_token t);
195 -extern void append_grep_pattern(struct grep_opt *opt, const char *pat, const char *origin, int no, enum grep_pat_token t);
196 -extern void append_header_grep_pattern(struct grep_opt *, enum grep_header_field, const char *);
197 -extern void compile_grep_patterns(struct grep_opt *opt);
198 -extern void free_grep_patterns(struct grep_opt *opt);
199 -extern int grep_buffer(struct grep_opt *opt, char *buf, unsigned long size);
194 +void append_grep_pat(struct grep_opt *opt, const char *pat, size_t patlen, const char *origin, int no, enum grep_pat_token t);
195 +void append_grep_pattern(struct grep_opt *opt, const char *pat, const char *origin, int no, enum grep_pat_token t);
196 +void append_header_grep_pattern(struct grep_opt *, enum grep_header_field, const char *);
197 +void compile_grep_patterns(struct grep_opt *opt);
198 +void free_grep_patterns(struct grep_opt *opt);
199 +int grep_buffer(struct grep_opt *opt, char *buf, unsigned long size);
200
201 struct grep_source {
202 char *name;
@@ -226,8 +226,8 @@ void grep_source_load_driver(struct grep_source *gs,
226
227 int grep_source(struct grep_opt *opt, struct grep_source *gs);
228
229 -extern struct grep_opt *grep_opt_dup(const struct grep_opt *opt);
230 -extern int grep_threads_ok(const struct grep_opt *opt);
229 +struct grep_opt *grep_opt_dup(const struct grep_opt *opt);
230 +int grep_threads_ok(const struct grep_opt *opt);
231
232 /*
233 * Mutex used around access to the attributes machinery if
hashmap.h
+15 -15
@@ -104,11 +104,11 @@
104 * `memihash_cont` is a variant of `memihash` that allows a computation to be
105 * continued with another chunk of data.
106 */
107 -extern unsigned int strhash(const char *buf);
108 -extern unsigned int strihash(const char *buf);
109 -extern unsigned int memhash(const void *buf, size_t len);
110 -extern unsigned int memihash(const void *buf, size_t len);
111 -extern unsigned int memihash_cont(unsigned int hash_seed, const void *buf, size_t len);
107 +unsigned int strhash(const char *buf);
108 +unsigned int strihash(const char *buf);
109 +unsigned int memhash(const void *buf, size_t len);
110 +unsigned int memihash(const void *buf, size_t len);
111 +unsigned int memihash_cont(unsigned int hash_seed, const void *buf, size_t len);
112
113 /*
114 * Converts a cryptographic hash (e.g. SHA-1) into an int-sized hash code
@@ -216,7 +216,7 @@ struct hashmap {
216 * parameter may be used to preallocate a sufficiently large table and thus
217 * prevent expensive resizing. If 0, the table is dynamically resized.
218 */
219 -extern void hashmap_init(struct hashmap *map,
219 +void hashmap_init(struct hashmap *map,
220 hashmap_cmp_fn equals_function,
221 const void *equals_function_data,
222 size_t initial_size);
@@ -227,7 +227,7 @@ extern void hashmap_init(struct hashmap *map,
227 * If `free_entries` is true, each hashmap_entry in the map is freed as well
228 * using stdlibs free().
229 */
230 -extern void hashmap_free(struct hashmap *map, int free_entries);
230 +void hashmap_free(struct hashmap *map, int free_entries);
231
232 /* hashmap_entry functions */
233
@@ -284,7 +284,7 @@ static inline unsigned int hashmap_get_size(struct hashmap *map)
284 * If an entry with matching hash code is found, `key` and `keydata` are passed
285 * to `hashmap_cmp_fn` to decide whether the entry matches the key.
286 */
287 -extern void *hashmap_get(const struct hashmap *map, const void *key,
287 +void *hashmap_get(const struct hashmap *map, const void *key,
288 const void *keydata);
289
290 /*
@@ -316,7 +316,7 @@ static inline void *hashmap_get_from_hash(const struct hashmap *map,
316 * `entry` is the hashmap_entry to start the search from, obtained via a previous
317 * call to `hashmap_get` or `hashmap_get_next`.
318 */
319 -extern void *hashmap_get_next(const struct hashmap *map, const void *entry);
319 +void *hashmap_get_next(const struct hashmap *map, const void *entry);
320
321 /*
322 * Adds a hashmap entry. This allows to add duplicate entries (i.e.
@@ -325,7 +325,7 @@ extern void *hashmap_get_next(const struct hashmap *map, const void *entry);
325 * `map` is the hashmap structure.
326 * `entry` is the entry to add.
327 */
328 -extern void hashmap_add(struct hashmap *map, void *entry);
328 +void hashmap_add(struct hashmap *map, void *entry);
329
330 /*
331 * Adds or replaces a hashmap entry. If the hashmap contains duplicate
@@ -335,7 +335,7 @@ extern void hashmap_add(struct hashmap *map, void *entry);
335 * `entry` is the entry to add or replace.
336 * Returns the replaced entry, or NULL if not found (i.e. the entry was added).
337 */
338 -extern void *hashmap_put(struct hashmap *map, void *entry);
338 +void *hashmap_put(struct hashmap *map, void *entry);
339
340 /*
341 * Removes a hashmap entry matching the specified key. If the hashmap contains
@@ -344,7 +344,7 @@ extern void *hashmap_put(struct hashmap *map, void *entry);
344 *
345 * Argument explanation is the same as in `hashmap_get`.
346 */
347 -extern void *hashmap_remove(struct hashmap *map, const void *key,
347 +void *hashmap_remove(struct hashmap *map, const void *key,
348 const void *keydata);
349
350 /*
@@ -365,10 +365,10 @@ struct hashmap_iter {
365 };
366
367 /* Initializes a `hashmap_iter` structure. */
368 -extern void hashmap_iter_init(struct hashmap *map, struct hashmap_iter *iter);
368 +void hashmap_iter_init(struct hashmap *map, struct hashmap_iter *iter);
369
370 /* Returns the next hashmap_entry, or NULL if there are no more entries. */
371 -extern void *hashmap_iter_next(struct hashmap_iter *iter);
371 +void *hashmap_iter_next(struct hashmap_iter *iter);
372
373 /* Initializes the iterator and returns the first entry, if any. */
374 static inline void *hashmap_iter_first(struct hashmap *map,
@@ -429,7 +429,7 @@ static inline void hashmap_enable_item_counting(struct hashmap *map)
429 *
430 * Uses a hashmap to store the pool of interned strings.
431 */
432 -extern const void *memintern(const void *data, size_t len);
432 +const void *memintern(const void *data, size_t len);
433 static inline const char *strintern(const char *string)
434 {
435 return memintern(string, strlen(string));
help.h
+15 -15
@@ -19,31 +19,31 @@ static inline void mput_char(char c, unsigned int num)
19 putchar(c);
20 }
21
22 -extern void list_common_cmds_help(void);
23 -extern void list_all_cmds_help(void);
24 -extern void list_common_guides_help(void);
25 -extern void list_config_help(int for_human);
22 +void list_common_cmds_help(void);
23 +void list_all_cmds_help(void);
24 +void list_common_guides_help(void);
25 +void list_config_help(int for_human);
26
27 -extern void list_all_main_cmds(struct string_list *list);
28 -extern void list_all_other_cmds(struct string_list *list);
29 -extern void list_cmds_by_category(struct string_list *list,
27 +void list_all_main_cmds(struct string_list *list);
28 +void list_all_other_cmds(struct string_list *list);
29 +void list_cmds_by_category(struct string_list *list,
30 const char *category);
31 -extern void list_cmds_by_config(struct string_list *list);
32 -extern const char *help_unknown_cmd(const char *cmd);
33 -extern void load_command_list(const char *prefix,
31 +void list_cmds_by_config(struct string_list *list);
32 +const char *help_unknown_cmd(const char *cmd);
33 +void load_command_list(const char *prefix,
34 struct cmdnames *main_cmds,
35 struct cmdnames *other_cmds);
36 -extern void add_cmdname(struct cmdnames *cmds, const char *name, int len);
36 +void add_cmdname(struct cmdnames *cmds, const char *name, int len);
37 /* Here we require that excludes is a sorted list. */
38 -extern void exclude_cmds(struct cmdnames *cmds, struct cmdnames *excludes);
39 -extern int is_in_cmdlist(struct cmdnames *cmds, const char *name);
40 -extern void list_commands(unsigned int colopts, struct cmdnames *main_cmds, struct cmdnames *other_cmds);
38 +void exclude_cmds(struct cmdnames *cmds, struct cmdnames *excludes);
39 +int is_in_cmdlist(struct cmdnames *cmds, const char *name);
40 +void list_commands(unsigned int colopts, struct cmdnames *main_cmds, struct cmdnames *other_cmds);
41
42 /*
43 * call this to die(), when it is suspected that the user mistyped a
44 * ref to the command, to give suggested "correct" refs.
45 */
46 -extern void help_unknown_ref(const char *ref, const char *cmd, const char *error);
46 +void help_unknown_ref(const char *ref, const char *cmd, const char *error);
47
48 static inline void list_config_item(struct string_list *list,
49 const char *prefix,
http.h
+26 -26
@@ -75,18 +75,18 @@ struct buffer {
75 };
76
77 /* Curl request read/write callbacks */
78 -extern size_t fread_buffer(char *ptr, size_t eltsize, size_t nmemb, void *strbuf);
79 -extern size_t fwrite_buffer(char *ptr, size_t eltsize, size_t nmemb, void *strbuf);
80 -extern size_t fwrite_null(char *ptr, size_t eltsize, size_t nmemb, void *strbuf);
78 +size_t fread_buffer(char *ptr, size_t eltsize, size_t nmemb, void *strbuf);
79 +size_t fwrite_buffer(char *ptr, size_t eltsize, size_t nmemb, void *strbuf);
80 +size_t fwrite_null(char *ptr, size_t eltsize, size_t nmemb, void *strbuf);
81 #ifndef NO_CURL_IOCTL
82 -extern curlioerr ioctl_buffer(CURL *handle, int cmd, void *clientp);
82 +curlioerr ioctl_buffer(CURL *handle, int cmd, void *clientp);
83 #endif
84
85 /* Slot lifecycle functions */
86 -extern struct active_request_slot *get_active_slot(void);
87 -extern int start_active_slot(struct active_request_slot *slot);
88 -extern void run_active_slot(struct active_request_slot *slot);
89 -extern void finish_all_active_slots(void);
86 +struct active_request_slot *get_active_slot(void);
87 +int start_active_slot(struct active_request_slot *slot);
88 +void run_active_slot(struct active_request_slot *slot);
89 +void finish_all_active_slots(void);
90
91 /*
92 * This will run one slot to completion in a blocking manner, similar to how
@@ -98,15 +98,15 @@ int run_one_slot(struct active_request_slot *slot,
98 struct slot_results *results);
99
100 #ifdef USE_CURL_MULTI
101 -extern void fill_active_slots(void);
102 -extern void add_fill_function(void *data, int (*fill)(void *));
103 -extern void step_active_slots(void);
101 +void fill_active_slots(void);
102 +void add_fill_function(void *data, int (*fill)(void *));
103 +void step_active_slots(void);
104 #endif
105
106 -extern void http_init(struct remote *remote, const char *url,
106 +void http_init(struct remote *remote, const char *url,
107 int proactive_auth);
108 -extern void http_cleanup(void);
109 -extern struct curl_slist *http_copy_default_headers(void);
108 +void http_cleanup(void);
109 +struct curl_slist *http_copy_default_headers(void);
110
111 extern long int git_curl_ipresolve;
112 extern int active_requests;
@@ -146,10 +146,10 @@ void normalize_curl_result(CURLcode *result, long http_code, char *errorstr,
146 size_t errorlen);
147
148 /* Helpers for modifying and creating URLs */
149 -extern void append_remote_object_url(struct strbuf *buf, const char *url,
149 +void append_remote_object_url(struct strbuf *buf, const char *url,
150 const char *hex,
151 int only_two_digit_prefix);
152 -extern char *get_remote_object_url(const char *url, const char *hex,
152 +char *get_remote_object_url(const char *url, const char *hex,
153 int only_two_digit_prefix);
154
155 /* Options for http_get_*() */
@@ -204,10 +204,10 @@ struct http_get_options {
204 */
205 int http_get_strbuf(const char *url, struct strbuf *result, struct http_get_options *options);
206
207 -extern int http_fetch_ref(const char *base, struct ref *ref);
207 +int http_fetch_ref(const char *base, struct ref *ref);
208
209 /* Helpers for fetching packs */
210 -extern int http_get_info_packs(const char *base_url,
210 +int http_get_info_packs(const char *base_url,
211 struct packed_git **packs_head);
212
213 struct http_pack_request {
@@ -219,10 +219,10 @@ struct http_pack_request {
219 struct active_request_slot *slot;
220 };
221
222 -extern struct http_pack_request *new_http_pack_request(
222 +struct http_pack_request *new_http_pack_request(
223 struct packed_git *target, const char *base_url);
224 -extern int finish_http_pack_request(struct http_pack_request *preq);
225 -extern void release_http_pack_request(struct http_pack_request *preq);
224 +int finish_http_pack_request(struct http_pack_request *preq);
225 +void release_http_pack_request(struct http_pack_request *preq);
226
227 /* Helpers for fetching object */
228 struct http_object_request {
@@ -241,12 +241,12 @@ struct http_object_request {
241 struct active_request_slot *slot;
242 };
243
244 -extern struct http_object_request *new_http_object_request(
244 +struct http_object_request *new_http_object_request(
245 const char *base_url, const struct object_id *oid);
246 -extern void process_http_object_request(struct http_object_request *freq);
247 -extern int finish_http_object_request(struct http_object_request *freq);
248 -extern void abort_http_object_request(struct http_object_request *freq);
249 -extern void release_http_object_request(struct http_object_request *freq);
246 +void process_http_object_request(struct http_object_request *freq);
247 +int finish_http_object_request(struct http_object_request *freq);
248 +void abort_http_object_request(struct http_object_request *freq);
249 +void release_http_object_request(struct http_object_request *freq);
250
251 /* setup routine for curl_easy_setopt CURLOPT_DEBUGFUNCTION */
252 void setup_curl_trace(CURL *handle);
kwset.h
+5 -5
@@ -37,16 +37,16 @@ typedef struct kwset_t* kwset_t;
37 if enough memory cannot be obtained. The argument if non-NULL
38 specifies a table of character translations to be applied to all
39 pattern and search text. */
40 -extern kwset_t kwsalloc(unsigned char const *);
40 +kwset_t kwsalloc(unsigned char const *);
41
42 /* Incrementally extend the keyword set to include the given string.
43 Return NULL for success, or an error message. Remember an index
44 number for each keyword included in the set. */
45 -extern const char *kwsincr(kwset_t, char const *, size_t);
45 +const char *kwsincr(kwset_t, char const *, size_t);
46
47 /* When the keyword set has been completely built, prepare it for
48 use. Return NULL for success, or an error message. */
49 -extern const char *kwsprep(kwset_t);
49 +const char *kwsprep(kwset_t);
50
51 /* Search through the given buffer for a member of the keyword set.
52 Return a pointer to the leftmost longest match found, or NULL if
@@ -54,8 +54,8 @@ extern const char *kwsprep(kwset_t);
54 the matching substring in the integer it points to. Similarly,
55 if foundindex is non-NULL, store the index of the particular
56 keyword found therein. */
57 -extern size_t kwsexec(kwset_t, char const *, size_t, struct kwsmatch *);
57 +size_t kwsexec(kwset_t, char const *, size_t, struct kwsmatch *);
58
59 /* Deallocate the given keyword set and all its associated storage. */
60 -extern void kwsfree(kwset_t);
60 +void kwsfree(kwset_t);
61
line-log.h
+8 -8
@@ -25,17 +25,17 @@ struct diff_ranges {
25 struct range_set target;
26 };
27
28 -extern void range_set_init(struct range_set *, size_t prealloc);
29 -extern void range_set_release(struct range_set *);
28 +void range_set_init(struct range_set *, size_t prealloc);
29 +void range_set_release(struct range_set *);
30 /* Range includes start; excludes end */
31 -extern void range_set_append_unsafe(struct range_set *, long start, long end);
31 +void range_set_append_unsafe(struct range_set *, long start, long end);
32 /* New range must begin at or after end of last added range */
33 -extern void range_set_append(struct range_set *, long start, long end);
33 +void range_set_append(struct range_set *, long start, long end);
34 /*
35 * In-place pass of sorting and merging the ranges in the range set,
36 * to sort and make the ranges disjoint.
37 */
38 -extern void sort_and_merge_range_set(struct range_set *);
38 +void sort_and_merge_range_set(struct range_set *);
39
40 /* Linked list of interesting files and their associated ranges. The
41 * list must be kept sorted by path.
@@ -54,10 +54,10 @@ struct line_log_data {
54 struct diff_ranges diff;
55 };
56
57 -extern void line_log_init(struct rev_info *rev, const char *prefix, struct string_list *args);
57 +void line_log_init(struct rev_info *rev, const char *prefix, struct string_list *args);
58
59 -extern int line_log_filter(struct rev_info *rev);
59 +int line_log_filter(struct rev_info *rev);
60
61 -extern int line_log_print(struct rev_info *rev, struct commit *commit);
61 +int line_log_print(struct rev_info *rev, struct commit *commit);
62
63 #endif /* LINE_LOG_H */
lockfile.h
+5 -5
@@ -159,7 +159,7 @@ struct lock_file {
159 * timeout_ms is -1, retry indefinitely. The flags argument and error
160 * handling are described above.
161 */
162 -extern int hold_lock_file_for_update_timeout(
162 +int hold_lock_file_for_update_timeout(
163 struct lock_file *lk, const char *path,
164 int flags, long timeout_ms);
165
@@ -188,7 +188,7 @@ static inline int is_lock_file_locked(struct lock_file *lk)
188 * of `hold_lock_file_for_update()` to lock `path`. `err` should be the
189 * `errno` set by the failing call.
190 */
191 -extern void unable_to_lock_message(const char *path, int err,
191 +void unable_to_lock_message(const char *path, int err,
192 struct strbuf *buf);
193
194 /*
@@ -197,7 +197,7 @@ extern void unable_to_lock_message(const char *path, int err,
197 * `errno` set by the failing
198 * call.
199 */
200 -extern NORETURN void unable_to_lock_die(const char *path, int err);
200 +NORETURN void unable_to_lock_die(const char *path, int err);
201
202 /*
203 * Associate a stdio stream with the lockfile (which must still be
@@ -234,7 +234,7 @@ static inline FILE *get_lock_file_fp(struct lock_file *lk)
234 * Return the path of the file that is locked by the specified
235 * lock_file object. The caller must free the memory.
236 */
237 -extern char *get_locked_file_path(struct lock_file *lk);
237 +char *get_locked_file_path(struct lock_file *lk);
238
239 /*
240 * If the lockfile is still open, close it (and the file pointer if it
@@ -282,7 +282,7 @@ static inline int reopen_lock_file(struct lock_file *lk)
282 * call `commit_lock_file()` for a `lock_file` object that is not
283 * currently locked.
284 */
285 -extern int commit_lock_file(struct lock_file *lk);
285 +int commit_lock_file(struct lock_file *lk);
286
287 /*
288 * Like `commit_lock_file()`, but rename the lockfile to the provided
ls-refs.h
+1 -1
@@ -4,7 +4,7 @@
4 struct repository;
5 struct argv_array;
6 struct packet_reader;
7 -extern int ls_refs(struct repository *r, struct argv_array *keys,
7 +int ls_refs(struct repository *r, struct argv_array *keys,
8 struct packet_reader *request);
9
10 #endif /* LS_REFS_H */
mailinfo.h
+3 -3
@@ -39,8 +39,8 @@ struct mailinfo {
39 int input_error;
40 };
41
42 -extern void setup_mailinfo(struct mailinfo *);
43 -extern int mailinfo(struct mailinfo *, const char *msg, const char *patch);
44 -extern void clear_mailinfo(struct mailinfo *);
42 +void setup_mailinfo(struct mailinfo *);
43 +int mailinfo(struct mailinfo *, const char *msg, const char *patch);
44 +void clear_mailinfo(struct mailinfo *);
45
46 #endif /* MAILINFO_H */
merge-blobs.h
+1 -1
@@ -4,7 +4,7 @@
4 struct blob;
5 struct index_state;
6
7 -extern void *merge_blobs(struct index_state *, const char *,
7 +void *merge_blobs(struct index_state *, const char *,
8 struct blob *, struct blob *,
9 struct blob *, unsigned long *);
10
object-store.h
+8 -8
@@ -162,7 +162,7 @@ const char *loose_object_path(struct repository *r, struct strbuf *buf,
162 void *map_loose_object(struct repository *r, const struct object_id *oid,
163 unsigned long *size);
164
165 -extern void *read_object_file_extended(struct repository *r,
165 +void *read_object_file_extended(struct repository *r,
166 const struct object_id *oid,
167 enum object_type *type,
168 unsigned long *size, int lookup_replace);
@@ -180,20 +180,20 @@ static inline void *repo_read_object_file(struct repository *r,
180 /* Read and unpack an object file into memory, write memory to an object file */
181 int oid_object_info(struct repository *r, const struct object_id *, unsigned long *);
182
183 -extern int hash_object_file(const void *buf, unsigned long len,
183 +int hash_object_file(const void *buf, unsigned long len,
184 const char *type, struct object_id *oid);
185
186 -extern int write_object_file(const void *buf, unsigned long len,
186 +int write_object_file(const void *buf, unsigned long len,
187 const char *type, struct object_id *oid);
188
189 -extern int hash_object_file_literally(const void *buf, unsigned long len,
189 +int hash_object_file_literally(const void *buf, unsigned long len,
190 const char *type, struct object_id *oid,
191 unsigned flags);
192
193 -extern int pretend_object_file(void *, unsigned long, enum object_type,
193 +int pretend_object_file(void *, unsigned long, enum object_type,
194 struct object_id *oid);
195
196 -extern int force_object_loose(const struct object_id *oid, time_t mtime);
196 +int force_object_loose(const struct object_id *oid, time_t mtime);
197
198 /*
199 * Open the loose object at path, check its hash, and return the contents,
@@ -227,9 +227,9 @@ int repo_has_object_file_with_flags(struct repository *r,
227 * with the specified name. This function does not respect replace
228 * references.
229 */
230 -extern int has_loose_object_nonlocal(const struct object_id *);
230 +int has_loose_object_nonlocal(const struct object_id *);
231
232 -extern void assert_oid_type(const struct object_id *oid, enum object_type expect);
232 +void assert_oid_type(const struct object_id *oid, enum object_type expect);
233
234 struct object_info {
235 /* Request */
object.h
+6 -6
@@ -90,19 +90,19 @@ struct object {
90 struct object_id oid;
91 };
92
93 -extern const char *type_name(unsigned int type);
94 -extern int type_from_string_gently(const char *str, ssize_t, int gentle);
93 +const char *type_name(unsigned int type);
94 +int type_from_string_gently(const char *str, ssize_t, int gentle);
95 #define type_from_string(str) type_from_string_gently(str, -1, 0)
96
97 /*
98 * Return the current number of buckets in the object hashmap.
99 */
100 -extern unsigned int get_max_object_index(void);
100 +unsigned int get_max_object_index(void);
101
102 /*
103 * Return the object from the specified bucket in the object hashmap.
104 */
105 -extern struct object *get_indexed_object(unsigned int);
105 +struct object *get_indexed_object(unsigned int);
106
107 /*
108 * This can be used to see if we have heard of the object before, but
@@ -118,7 +118,7 @@ extern struct object *get_indexed_object(unsigned int);
118 */
119 struct object *lookup_object(struct repository *r, const unsigned char *sha1);
120
121 -extern void *create_object(struct repository *r, const unsigned char *sha1, void *obj);
121 +void *create_object(struct repository *r, const unsigned char *sha1, void *obj);
122
123 void *object_as_type(struct repository *r, struct object *obj, enum object_type type, int quiet);
124
@@ -189,6 +189,6 @@ void clear_object_flags(unsigned flags);
189 /*
190 * Clear the specified object flags from all in-core commit objects.
191 */
192 -extern void clear_commit_marks_all(unsigned int flags);
192 +void clear_commit_marks_all(unsigned int flags);
193
194 #endif /* OBJECT_H */
oidmap.h
+5 -5
@@ -33,7 +33,7 @@ struct oidmap {
33 * parameter may be used to preallocate a sufficiently large table and thus
34 * prevent expensive resizing. If 0, the table is dynamically resized.
35 */
36 -extern void oidmap_init(struct oidmap *map, size_t initial_size);
36 +void oidmap_init(struct oidmap *map, size_t initial_size);
37
38 /*
39 * Frees an oidmap structure and allocated memory.
@@ -41,12 +41,12 @@ extern void oidmap_init(struct oidmap *map, size_t initial_size);
41 * If `free_entries` is true, each oidmap_entry in the map is freed as well
42 * using stdlibs free().
43 */
44 -extern void oidmap_free(struct oidmap *map, int free_entries);
44 +void oidmap_free(struct oidmap *map, int free_entries);
45
46 /*
47 * Returns the oidmap entry for the specified oid, or NULL if not found.
48 */
49 -extern void *oidmap_get(const struct oidmap *map,
49 +void *oidmap_get(const struct oidmap *map,
50 const struct object_id *key);
51
52 /*
@@ -57,14 +57,14 @@ extern void *oidmap_get(const struct oidmap *map,
57 *
58 * Returns the replaced entry, or NULL if not found (i.e. the entry was added).
59 */
60 -extern void *oidmap_put(struct oidmap *map, void *entry);
60 +void *oidmap_put(struct oidmap *map, void *entry);
61
62 /*
63 * Removes an oidmap entry matching the specified oid.
64 *
65 * Returns the removed entry, or NULL if not found.
66 */
67 -extern void *oidmap_remove(struct oidmap *map, const struct object_id *key);
67 +void *oidmap_remove(struct oidmap *map, const struct object_id *key);
68
69
70 struct oidmap_iter {
pack.h
+12 -12
@@ -55,7 +55,7 @@ struct pack_idx_option {
55 uint32_t *anomaly;
56 };
57
58 -extern void reset_pack_idx_option(struct pack_idx_option *);
58 +void reset_pack_idx_option(struct pack_idx_option *);
59
60 /*
61 * Packed object index header
@@ -79,28 +79,28 @@ struct progress;
79 /* Note, the data argument could be NULL if object type is blob */
80 typedef int (*verify_fn)(const struct object_id *, enum object_type, unsigned long, void*, int*);
81
82 -extern const char *write_idx_file(const char *index_name, struct pack_idx_entry **objects, int nr_objects, const struct pack_idx_option *, const unsigned char *sha1);
83 -extern int check_pack_crc(struct packed_git *p, struct pack_window **w_curs, off_t offset, off_t len, unsigned int nr);
84 -extern int verify_pack_index(struct packed_git *);
85 -extern int verify_pack(struct repository *, struct packed_git *, verify_fn fn, struct progress *, uint32_t);
86 -extern off_t write_pack_header(struct hashfile *f, uint32_t);
87 -extern void fixup_pack_header_footer(int, unsigned char *, const char *, uint32_t, unsigned char *, off_t);
88 -extern char *index_pack_lockfile(int fd);
82 +const char *write_idx_file(const char *index_name, struct pack_idx_entry **objects, int nr_objects, const struct pack_idx_option *, const unsigned char *sha1);
83 +int check_pack_crc(struct packed_git *p, struct pack_window **w_curs, off_t offset, off_t len, unsigned int nr);
84 +int verify_pack_index(struct packed_git *);
85 +int verify_pack(struct repository *, struct packed_git *, verify_fn fn, struct progress *, uint32_t);
86 +off_t write_pack_header(struct hashfile *f, uint32_t);
87 +void fixup_pack_header_footer(int, unsigned char *, const char *, uint32_t, unsigned char *, off_t);
88 +char *index_pack_lockfile(int fd);
89
90 /*
91 * The "hdr" output buffer should be at least this big, which will handle sizes
92 * up to 2^67.
93 */
94 #define MAX_PACK_OBJECT_HEADER 10
95 -extern int encode_in_pack_object_header(unsigned char *hdr, int hdr_len,
95 +int encode_in_pack_object_header(unsigned char *hdr, int hdr_len,
96 enum object_type, uintmax_t);
97
98 #define PH_ERROR_EOF (-1)
99 #define PH_ERROR_PACK_SIGNATURE (-2)
100 #define PH_ERROR_PROTOCOL (-3)
101 -extern int read_pack_header(int fd, struct pack_header *);
101 +int read_pack_header(int fd, struct pack_header *);
102
103 -extern struct hashfile *create_tmp_packfile(char **pack_tmp_name);
104 -extern void finish_tmp_packfile(struct strbuf *name_buffer, const char *pack_tmp_name, struct pack_idx_entry **written_list, uint32_t nr_written, struct pack_idx_option *pack_idx_opts, unsigned char sha1[]);
103 +struct hashfile *create_tmp_packfile(char **pack_tmp_name);
104 +void finish_tmp_packfile(struct strbuf *name_buffer, const char *pack_tmp_name, struct pack_idx_entry **written_list, uint32_t nr_written, struct pack_idx_option *pack_idx_opts, unsigned char sha1[]);
105
106 #endif
packfile.h
+37 -37
@@ -15,23 +15,23 @@ struct object_info;
15 *
16 * Example: odb_pack_name(out, sha1, "idx") => ".git/objects/pack/pack-1234..idx"
17 */
18 -extern char *odb_pack_name(struct strbuf *buf, const unsigned char *sha1, const char *ext);
18 +char *odb_pack_name(struct strbuf *buf, const unsigned char *sha1, const char *ext);
19
20 /*
21 * Return the name of the (local) packfile with the specified sha1 in
22 * its name. The return value is a pointer to memory that is
23 * overwritten each time this function is called.
24 */
25 -extern char *sha1_pack_name(const unsigned char *sha1);
25 +char *sha1_pack_name(const unsigned char *sha1);
26
27 /*
28 * Return the name of the (local) pack index file with the specified
29 * sha1 in its name. The return value is a pointer to memory that is
30 * overwritten each time this function is called.
31 */
32 -extern char *sha1_pack_index_name(const unsigned char *sha1);
32 +char *sha1_pack_index_name(const unsigned char *sha1);
33
34 -extern struct packed_git *parse_pack_index(unsigned char *sha1, const char *idx_path);
34 +struct packed_git *parse_pack_index(unsigned char *sha1, const char *idx_path);
35
36 typedef void each_file_in_pack_dir_fn(const char *full_path, size_t full_path_len,
37 const char *file_pach, void *data);
@@ -45,8 +45,8 @@ void for_each_file_in_pack_dir(const char *objdir,
45 #define PACKDIR_FILE_GARBAGE 4
46 extern void (*report_garbage)(unsigned seen_bits, const char *path);
47
48 -extern void reprepare_packed_git(struct repository *r);
49 -extern void install_packed_git(struct repository *r, struct packed_git *pack);
48 +void reprepare_packed_git(struct repository *r);
49 +void install_packed_git(struct repository *r, struct packed_git *pack);
50
51 struct packed_git *get_packed_git(struct repository *r);
52 struct list_head *get_packed_git_mru(struct repository *r);
@@ -59,34 +59,34 @@ struct packed_git *get_all_packs(struct repository *r);
59 */
60 unsigned long approximate_object_count(void);
61
62 -extern struct packed_git *find_sha1_pack(const unsigned char *sha1,
62 +struct packed_git *find_sha1_pack(const unsigned char *sha1,
63 struct packed_git *packs);
64
65 -extern void pack_report(void);
65 +void pack_report(void);
66
67 /*
68 * mmap the index file for the specified packfile (if it is not
69 * already mmapped). Return 0 on success.
70 */
71 -extern int open_pack_index(struct packed_git *);
71 +int open_pack_index(struct packed_git *);
72
73 /*
74 * munmap the index file for the specified packfile (if it is
75 * currently mmapped).
76 */
77 -extern void close_pack_index(struct packed_git *);
77 +void close_pack_index(struct packed_git *);
78
79 int close_pack_fd(struct packed_git *p);
80
81 -extern uint32_t get_pack_fanout(struct packed_git *p, uint32_t value);
81 +uint32_t get_pack_fanout(struct packed_git *p, uint32_t value);
82
83 -extern unsigned char *use_pack(struct packed_git *, struct pack_window **, off_t, unsigned long *);
84 -extern void close_pack_windows(struct packed_git *);
85 -extern void close_pack(struct packed_git *);
86 -extern void close_all_packs(struct raw_object_store *o);
87 -extern void unuse_pack(struct pack_window **);
88 -extern void clear_delta_base_cache(void);
89 -extern struct packed_git *add_packed_git(const char *path, size_t path_len, int local);
83 +unsigned char *use_pack(struct packed_git *, struct pack_window **, off_t, unsigned long *);
84 +void close_pack_windows(struct packed_git *);
85 +void close_pack(struct packed_git *);
86 +void close_all_packs(struct raw_object_store *o);
87 +void unuse_pack(struct pack_window **);
88 +void clear_delta_base_cache(void);
89 +struct packed_git *add_packed_git(const char *path, size_t path_len, int local);
90
91 /*
92 * Make sure that a pointer access into an mmap'd index file is within bounds,
@@ -96,7 +96,7 @@ extern struct packed_git *add_packed_git(const char *path, size_t path_len, int
96 * (like the 64-bit extended offset table), as we compare the size to the
97 * fixed-length parts when we open the file.
98 */
99 -extern void check_pack_index_ptr(const struct packed_git *p, const void *ptr);
99 +void check_pack_index_ptr(const struct packed_git *p, const void *ptr);
100
101 /*
102 * Perform binary search on a pack-index for a given oid. Packfile is expected to
@@ -112,59 +112,59 @@ int bsearch_pack(const struct object_id *oid, const struct packed_git *p, uint32
112 * at the SHA-1 within the mmapped index. Return NULL if there is an
113 * error.
114 */
115 -extern const unsigned char *nth_packed_object_sha1(struct packed_git *, uint32_t n);
115 +const unsigned char *nth_packed_object_sha1(struct packed_git *, uint32_t n);
116 /*
117 * Like nth_packed_object_sha1, but write the data into the object specified by
118 * the the first argument. Returns the first argument on success, and NULL on
119 * error.
120 */
121 -extern const struct object_id *nth_packed_object_oid(struct object_id *, struct packed_git *, uint32_t n);
121 +const struct object_id *nth_packed_object_oid(struct object_id *, struct packed_git *, uint32_t n);
122
123 /*
124 * Return the offset of the nth object within the specified packfile.
125 * The index must already be opened.
126 */
127 -extern off_t nth_packed_object_offset(const struct packed_git *, uint32_t n);
127 +off_t nth_packed_object_offset(const struct packed_git *, uint32_t n);
128
129 /*
130 * If the object named sha1 is present in the specified packfile,
131 * return its offset within the packfile; otherwise, return 0.
132 */
133 -extern off_t find_pack_entry_one(const unsigned char *sha1, struct packed_git *);
133 +off_t find_pack_entry_one(const unsigned char *sha1, struct packed_git *);
134
135 -extern int is_pack_valid(struct packed_git *);
136 -extern void *unpack_entry(struct repository *r, struct packed_git *, off_t, enum object_type *, unsigned long *);
137 -extern unsigned long unpack_object_header_buffer(const unsigned char *buf, unsigned long len, enum object_type *type, unsigned long *sizep);
138 -extern unsigned long get_size_from_delta(struct packed_git *, struct pack_window **, off_t);
139 -extern int unpack_object_header(struct packed_git *, struct pack_window **, off_t *, unsigned long *);
135 +int is_pack_valid(struct packed_git *);
136 +void *unpack_entry(struct repository *r, struct packed_git *, off_t, enum object_type *, unsigned long *);
137 +unsigned long unpack_object_header_buffer(const unsigned char *buf, unsigned long len, enum object_type *type, unsigned long *sizep);
138 +unsigned long get_size_from_delta(struct packed_git *, struct pack_window **, off_t);
139 +int unpack_object_header(struct packed_git *, struct pack_window **, off_t *, unsigned long *);
140
141 -extern void release_pack_memory(size_t);
141 +void release_pack_memory(size_t);
142
143 /* global flag to enable extra checks when accessing packed objects */
144 extern int do_check_packed_object_crc;
145
146 -extern int packed_object_info(struct repository *r,
146 +int packed_object_info(struct repository *r,
147 struct packed_git *pack,
148 off_t offset, struct object_info *);
149
150 -extern void mark_bad_packed_object(struct packed_git *p, const unsigned char *sha1);
151 -extern const struct packed_git *has_packed_and_bad(struct repository *r, const unsigned char *sha1);
150 +void mark_bad_packed_object(struct packed_git *p, const unsigned char *sha1);
151 +const struct packed_git *has_packed_and_bad(struct repository *r, const unsigned char *sha1);
152
153 /*
154 * Iff a pack file in the given repository contains the object named by sha1,
155 * return true and store its location to e.
156 */
157 -extern int find_pack_entry(struct repository *r, const struct object_id *oid, struct pack_entry *e);
157 +int find_pack_entry(struct repository *r, const struct object_id *oid, struct pack_entry *e);
158
159 -extern int has_object_pack(const struct object_id *oid);
159 +int has_object_pack(const struct object_id *oid);
160
161 -extern int has_pack_index(const unsigned char *sha1);
161 +int has_pack_index(const unsigned char *sha1);
162
163 /*
164 * Return 1 if an object in a promisor packfile is or refers to the given
165 * object, 0 otherwise.
166 */
167 -extern int is_promisor_object(const struct object_id *oid);
167 +int is_promisor_object(const struct object_id *oid);
168
169 /*
170 * Expose a function for fuzz testing.
@@ -176,7 +176,7 @@ extern int is_promisor_object(const struct object_id *oid);
176 * have a convenient entry-point for fuzz testing. For real uses, you should
177 * probably use open_pack_index() or parse_pack_index() instead.
178 */
179 -extern int load_idx(const char *path, const unsigned int hashsz, void *idx_map,
179 +int load_idx(const char *path, const unsigned int hashsz, void *idx_map,
180 size_t idx_size, struct packed_git *p);
181
182 #endif
path.h
+1 -1
@@ -143,7 +143,7 @@ extern int strbuf_git_path_submodule(struct strbuf *sb, const char *path,
143 const char *fmt, ...)
144 __attribute__((format (printf, 3, 4)));
145
146 -extern void report_linked_checkout_garbage(void);
146 +void report_linked_checkout_garbage(void);
147
148 /*
149 * You can define a static memoized git path like:
pkt-line.h
+3 -3
@@ -172,7 +172,7 @@ struct packet_reader {
172 * Initialize a 'struct packet_reader' object which is an
173 * abstraction around the 'packet_read_with_status()' function.
174 */
175 -extern void packet_reader_init(struct packet_reader *reader, int fd,
175 +void packet_reader_init(struct packet_reader *reader, int fd,
176 char *src_buffer, size_t src_len,
177 int options);
178
@@ -186,7 +186,7 @@ extern void packet_reader_init(struct packet_reader *reader, int fd,
186 * 'line' is set to point at the read line
187 * PACKET_READ_FLUSH: 'pktlen' is set to '0' and 'line' is set to NULL
188 */
189 -extern enum packet_read_status packet_reader_read(struct packet_reader *reader);
189 +enum packet_read_status packet_reader_read(struct packet_reader *reader);
190
191 /*
192 * Peek the next packet line without consuming it and return the status.
@@ -196,7 +196,7 @@ extern enum packet_read_status packet_reader_read(struct packet_reader *reader);
196 * Peeking multiple times without calling 'packet_reader_read()' will return
197 * the same result.
198 */
199 -extern enum packet_read_status packet_reader_peek(struct packet_reader *reader);
199 +enum packet_read_status packet_reader_peek(struct packet_reader *reader);
200
201 #define DEFAULT_PACKET_MAX 1000
202 #define LARGE_PACKET_MAX 65520
ppc/sha1.c
+1 -1
@@ -10,7 +10,7 @@
10 #include <string.h>
11 #include "sha1.h"
12
13 -extern void ppc_sha1_core(uint32_t *hash, const unsigned char *p,
13 +void ppc_sha1_core(uint32_t *hash, const unsigned char *p,
14 unsigned int nblocks);
15
16 int ppc_SHA1_Init(ppc_SHA_CTX *c)
prio-queue.h
+5 -5
@@ -37,24 +37,24 @@ struct prio_queue {
37 /*
38 * Add the "thing" to the queue.
39 */
40 -extern void prio_queue_put(struct prio_queue *, void *thing);
40 +void prio_queue_put(struct prio_queue *, void *thing);
41
42 /*
43 * Extract the "thing" that compares the smallest out of the queue,
44 * or NULL. If compare function is NULL, the queue acts as a LIFO
45 * stack.
46 */
47 -extern void *prio_queue_get(struct prio_queue *);
47 +void *prio_queue_get(struct prio_queue *);
48
49 /*
50 * Gain access to the "thing" that would be returned by
51 * prio_queue_get, but do not remove it from the queue.
52 */
53 -extern void *prio_queue_peek(struct prio_queue *);
53 +void *prio_queue_peek(struct prio_queue *);
54
55 -extern void clear_prio_queue(struct prio_queue *);
55 +void clear_prio_queue(struct prio_queue *);
56
57 /* Reverse the LIFO elements */
58 -extern void prio_queue_reverse(struct prio_queue *);
58 +void prio_queue_reverse(struct prio_queue *);
59
60 #endif /* PRIO_QUEUE_H */
protocol.h
+3 -3
@@ -14,7 +14,7 @@ enum protocol_version {
14 * 'protocol.version' config. If unconfigured, a value of 'protocol_v0' is
15 * returned.
16 */
17 -extern enum protocol_version get_protocol_version_config(void);
17 +enum protocol_version get_protocol_version_config(void);
18
19 /*
20 * Used by a server to determine which protocol version should be used based on
@@ -23,12 +23,12 @@ extern enum protocol_version get_protocol_version_config(void);
23 * request a particular protocol version, a default of 'protocol_v0' will be
24 * used.
25 */
26 -extern enum protocol_version determine_protocol_version_server(void);
26 +enum protocol_version determine_protocol_version_server(void);
27
28 /*
29 * Used by a client to determine which protocol version the server is speaking
30 * based on the server's initial response.
31 */
32 -extern enum protocol_version determine_protocol_version_client(const char *server_response);
32 +enum protocol_version determine_protocol_version_client(const char *server_response);
33
34 #endif /* PROTOCOL_H */
quote.h
+15 -15
@@ -29,8 +29,8 @@ struct strbuf;
29 * sq_quotef() quotes the entire formatted string as a single result.
30 */
31
32 -extern void sq_quote_buf(struct strbuf *, const char *src);
33 -extern void sq_quote_argv(struct strbuf *, const char **argv);
32 +void sq_quote_buf(struct strbuf *, const char *src);
33 +void sq_quote_argv(struct strbuf *, const char **argv);
34 extern void sq_quotef(struct strbuf *, const char *fmt, ...);
35
36 /*
@@ -45,14 +45,14 @@ void sq_quote_argv_pretty(struct strbuf *, const char **argv);
45 * NULL if the input does not look like what sq_quote would have
46 * produced.
47 */
48 -extern char *sq_dequote(char *);
48 +char *sq_dequote(char *);
49
50 /*
51 * Same as the above, but can be used to unwrap many arguments in the
52 * same string separated by space. Like sq_quote, it works in place,
53 * modifying arg and appending pointers into it to argv.
54 */
55 -extern int sq_dequote_to_argv(char *arg, const char ***argv, int *nr, int *alloc);
55 +int sq_dequote_to_argv(char *arg, const char ***argv, int *nr, int *alloc);
56
57 /*
58 * Same as above, but store the unquoted strings in an argv_array. We will
@@ -60,24 +60,24 @@ extern int sq_dequote_to_argv(char *arg, const char ***argv, int *nr, int *alloc
60 * will duplicate and take ownership of the strings.
61 */
62 struct argv_array;
63 -extern int sq_dequote_to_argv_array(char *arg, struct argv_array *);
63 +int sq_dequote_to_argv_array(char *arg, struct argv_array *);
64
65 -extern int unquote_c_style(struct strbuf *, const char *quoted, const char **endp);
66 -extern size_t quote_c_style(const char *name, struct strbuf *, FILE *, int no_dq);
67 -extern void quote_two_c_style(struct strbuf *, const char *, const char *, int);
65 +int unquote_c_style(struct strbuf *, const char *quoted, const char **endp);
66 +size_t quote_c_style(const char *name, struct strbuf *, FILE *, int no_dq);
67 +void quote_two_c_style(struct strbuf *, const char *, const char *, int);
68
69 -extern void write_name_quoted(const char *name, FILE *, int terminator);
70 -extern void write_name_quoted_relative(const char *name, const char *prefix,
69 +void write_name_quoted(const char *name, FILE *, int terminator);
70 +void write_name_quoted_relative(const char *name, const char *prefix,
71 FILE *fp, int terminator);
72
73 /* quote path as relative to the given prefix */
74 -extern char *quote_path_relative(const char *in, const char *prefix,
74 +char *quote_path_relative(const char *in, const char *prefix,
75 struct strbuf *out);
76
77 /* quoting as a string literal for other languages */
78 -extern void perl_quote_buf(struct strbuf *sb, const char *src);
79 -extern void python_quote_buf(struct strbuf *sb, const char *src);
80 -extern void tcl_quote_buf(struct strbuf *sb, const char *src);
81 -extern void basic_regex_quote_buf(struct strbuf *sb, const char *src);
78 +void perl_quote_buf(struct strbuf *sb, const char *src);
79 +void python_quote_buf(struct strbuf *sb, const char *src);
80 +void tcl_quote_buf(struct strbuf *sb, const char *src);
81 +void basic_regex_quote_buf(struct strbuf *sb, const char *src);
82
83 #endif
reachable.h
+2 -2
@@ -4,9 +4,9 @@
4 struct progress;
5 struct rev_info;
6
7 -extern int add_unseen_recent_objects_to_traversal(struct rev_info *revs,
7 +int add_unseen_recent_objects_to_traversal(struct rev_info *revs,
8 timestamp_t timestamp);
9 -extern void mark_reachable_objects(struct rev_info *revs, int mark_reflog,
9 +void mark_reachable_objects(struct rev_info *revs, int mark_reflog,
10 timestamp_t mark_recent, struct progress *);
11
12 #endif
reflog-walk.h
+8 -8
@@ -6,21 +6,21 @@
6 struct commit;
7 struct reflog_walk_info;
8
9 -extern void init_reflog_walk(struct reflog_walk_info **info);
10 -extern int add_reflog_for_walk(struct reflog_walk_info *info,
9 +void init_reflog_walk(struct reflog_walk_info **info);
10 +int add_reflog_for_walk(struct reflog_walk_info *info,
11 struct commit *commit, const char *name);
12 -extern void show_reflog_message(struct reflog_walk_info *info, int,
12 +void show_reflog_message(struct reflog_walk_info *info, int,
13 const struct date_mode *, int force_date);
14 -extern void get_reflog_message(struct strbuf *sb,
14 +void get_reflog_message(struct strbuf *sb,
15 struct reflog_walk_info *reflog_info);
16 -extern const char *get_reflog_ident(struct reflog_walk_info *reflog_info);
17 -extern timestamp_t get_reflog_timestamp(struct reflog_walk_info *reflog_info);
18 -extern void get_reflog_selector(struct strbuf *sb,
16 +const char *get_reflog_ident(struct reflog_walk_info *reflog_info);
17 +timestamp_t get_reflog_timestamp(struct reflog_walk_info *reflog_info);
18 +void get_reflog_selector(struct strbuf *sb,
19 struct reflog_walk_info *reflog_info,
20 const struct date_mode *dmode, int force_date,
21 int shorten);
22
23 -extern int reflog_walk_empty(struct reflog_walk_info *walk);
23 +int reflog_walk_empty(struct reflog_walk_info *walk);
24
25 struct commit *next_reflog_entry(struct reflog_walk_info *reflog_info);
26
refs.h
+1 -1
@@ -111,7 +111,7 @@ int should_autocreate_reflog(const char *refname);
111
112 int is_branch(const char *refname);
113
114 -extern int refs_init_db(struct strbuf *err);
114 +int refs_init_db(struct strbuf *err);
115
116 /*
117 * If refname is a non-symbolic reference that refers to a tag object,
remote.h
+6 -6
@@ -119,13 +119,13 @@ struct ref {
119 #define REF_HEADS (1u << 1)
120 #define REF_TAGS (1u << 2)
121
122 -extern struct ref *find_ref_by_name(const struct ref *list, const char *name);
122 +struct ref *find_ref_by_name(const struct ref *list, const char *name);
123
124 struct ref *alloc_ref(const char *name);
125 struct ref *copy_ref(const struct ref *ref);
126 struct ref *copy_ref_list(const struct ref *ref);
127 void sort_ref_list(struct ref **, int (*cmp)(const void *, const void *));
128 -extern int count_refspec_match(const char *, struct ref *refs, struct ref **matched_ref);
128 +int count_refspec_match(const char *, struct ref *refs, struct ref **matched_ref);
129 int ref_compare_name(const void *, const void *);
130
131 int check_ref_type(const struct ref *ref, int flags);
@@ -139,13 +139,13 @@ struct oid_array;
139 struct packet_reader;
140 struct argv_array;
141 struct string_list;
142 -extern struct ref **get_remote_heads(struct packet_reader *reader,
142 +struct ref **get_remote_heads(struct packet_reader *reader,
143 struct ref **list, unsigned int flags,
144 struct oid_array *extra_have,
145 struct oid_array *shallow_points);
146
147 /* Used for protocol v2 in order to retrieve refs from a remote */
148 -extern struct ref **get_remote_refs(int fd_out, struct packet_reader *reader,
148 +struct ref **get_remote_refs(int fd_out, struct packet_reader *reader,
149 struct ref **list, int for_push,
150 const struct argv_array *ref_prefixes,
151 const struct string_list *server_options);
@@ -287,9 +287,9 @@ struct push_cas_option {
287 int alloc;
288 };
289
290 -extern int parseopt_push_cas_option(const struct option *, const char *arg, int unset);
290 +int parseopt_push_cas_option(const struct option *, const char *arg, int unset);
291
292 -extern int is_empty_cas(const struct push_cas_option *);
292 +int is_empty_cas(const struct push_cas_option *);
293 void apply_push_cas(struct push_cas_option *, struct remote *, struct ref *);
294
295 #endif
replace-object.h
+1 -1
@@ -16,7 +16,7 @@ void prepare_replace_object(struct repository *r);
16 * This internal function is only declared here for the benefit of
17 * lookup_replace_object(). Please do not call it directly.
18 */
19 -extern const struct object_id *do_lookup_replace_object(struct repository *r,
19 +const struct object_id *do_lookup_replace_object(struct repository *r,
20 const struct object_id *oid);
21
22 /*
resolve-undo.h
+7 -7
@@ -8,12 +8,12 @@ struct resolve_undo_info {
8 struct object_id oid[3];
9 };
10
11 -extern void record_resolve_undo(struct index_state *, struct cache_entry *);
12 -extern void resolve_undo_write(struct strbuf *, struct string_list *);
13 -extern struct string_list *resolve_undo_read(const char *, unsigned long);
14 -extern void resolve_undo_clear_index(struct index_state *);
15 -extern int unmerge_index_entry_at(struct index_state *, int);
16 -extern void unmerge_index(struct index_state *, const struct pathspec *);
17 -extern void unmerge_marked_index(struct index_state *);
11 +void record_resolve_undo(struct index_state *, struct cache_entry *);
12 +void resolve_undo_write(struct strbuf *, struct string_list *);
13 +struct string_list *resolve_undo_read(const char *, unsigned long);
14 +void resolve_undo_clear_index(struct index_state *);
15 +int unmerge_index_entry_at(struct index_state *, int);
16 +void unmerge_index(struct index_state *, const struct pathspec *);
17 +void unmerge_marked_index(struct index_state *);
18
19 #endif
run-command.h
+3 -3
@@ -55,7 +55,7 @@ struct child_process {
55 #define CHILD_PROCESS_INIT { NULL, ARGV_ARRAY_INIT, ARGV_ARRAY_INIT }
56 void child_process_init(struct child_process *);
57 void child_process_clear(struct child_process *);
58 -extern int is_executable(const char *name);
58 +int is_executable(const char *name);
59
60 int start_command(struct child_process *);
61 int finish_command(struct child_process *);
@@ -67,10 +67,10 @@ int run_command(struct child_process *);
67 * or disabled. Note that this points to static storage that will be
68 * overwritten by further calls to find_hook and run_hook_*.
69 */
70 -extern const char *find_hook(const char *name);
70 +const char *find_hook(const char *name);
71 LAST_ARG_MUST_BE_NULL
72 extern int run_hook_le(const char *const *env, const char *name, ...);
73 -extern int run_hook_ve(const char *const *env, const char *name, va_list args);
73 +int run_hook_ve(const char *const *env, const char *name, va_list args);
74
75 #define RUN_COMMAND_NO_STDIN 1
76 #define RUN_GIT_CMD 2 /*If this is to be git sub-command */
serve.h
+2 -2
@@ -2,7 +2,7 @@
2 #define SERVE_H
3
4 struct argv_array;
5 -extern int has_capability(const struct argv_array *keys, const char *capability,
5 +int has_capability(const struct argv_array *keys, const char *capability,
6 const char **value);
7
8 struct serve_options {
@@ -10,6 +10,6 @@ struct serve_options {
10 unsigned stateless_rpc;
11 };
12 #define SERVE_OPTIONS_INIT { 0 }
13 -extern void serve(struct serve_options *options);
13 +void serve(struct serve_options *options);
14
15 #endif /* SERVE_H */
sha1-lookup.h
+1 -1
@@ -3,7 +3,7 @@
3
4 typedef const unsigned char *sha1_access_fn(size_t index, void *table);
5
6 -extern int sha1_pos(const unsigned char *sha1,
6 +int sha1_pos(const unsigned char *sha1,
7 void *table,
8 size_t nr,
9 sha1_access_fn fn);
streaming.h
+4 -4
@@ -8,10 +8,10 @@
8 /* opaque */
9 struct git_istream;
10
11 -extern struct git_istream *open_istream(const struct object_id *, enum object_type *, unsigned long *, struct stream_filter *);
12 -extern int close_istream(struct git_istream *);
13 -extern ssize_t read_istream(struct git_istream *, void *, size_t);
11 +struct git_istream *open_istream(const struct object_id *, enum object_type *, unsigned long *, struct stream_filter *);
12 +int close_istream(struct git_istream *);
13 +ssize_t read_istream(struct git_istream *, void *, size_t);
14
15 -extern int stream_blob_to_fd(int fd, const struct object_id *, struct stream_filter *, int can_seek);
15 +int stream_blob_to_fd(int fd, const struct object_id *, struct stream_filter *, int can_seek);
16
17 #endif /* STREAMING_H */
string-list.h
+1 -1
@@ -174,7 +174,7 @@ struct string_list_item *string_list_insert(struct string_list *list, const char
174 * Remove the given string from the sorted list. If the string
175 * doesn't exist, the list is not altered.
176 */
177 -extern void string_list_remove(struct string_list *list, const char *string,
177 +void string_list_remove(struct string_list *list, const char *string,
178 int free_util);
179
180 /**
sub-process.h
+1 -1
@@ -42,7 +42,7 @@ struct subprocess_capability {
42 /* subprocess functions */
43
44 /* Function to test two subprocess hashmap entries for equality. */
45 -extern int cmd2process_cmp(const void *unused_cmp_data,
45 +int cmd2process_cmp(const void *unused_cmp_data,
46 const void *e1,
47 const void *e2,
48 const void *unused_keydata);
submodule-config.h
+10 -10
@@ -30,17 +30,17 @@ struct submodule {
30 struct submodule_cache;
31 struct repository;
32
33 -extern void submodule_cache_free(struct submodule_cache *cache);
33 +void submodule_cache_free(struct submodule_cache *cache);
34
35 -extern int parse_submodule_fetchjobs(const char *var, const char *value);
36 -extern int parse_fetch_recurse_submodules_arg(const char *opt, const char *arg);
35 +int parse_submodule_fetchjobs(const char *var, const char *value);
36 +int parse_fetch_recurse_submodules_arg(const char *opt, const char *arg);
37 struct option;
38 -extern int option_fetch_parse_recurse_submodules(const struct option *opt,
38 +int option_fetch_parse_recurse_submodules(const struct option *opt,
39 const char *arg, int unset);
40 -extern int parse_update_recurse_submodules_arg(const char *opt, const char *arg);
41 -extern int parse_push_recurse_submodules_arg(const char *opt, const char *arg);
42 -extern void repo_read_gitmodules(struct repository *repo);
43 -extern void gitmodules_config_oid(const struct object_id *commit_oid);
40 +int parse_update_recurse_submodules_arg(const char *opt, const char *arg);
41 +int parse_push_recurse_submodules_arg(const char *opt, const char *arg);
42 +void repo_read_gitmodules(struct repository *repo);
43 +void gitmodules_config_oid(const struct object_id *commit_oid);
44 const struct submodule *submodule_from_name(struct repository *r,
45 const struct object_id *commit_or_tree,
46 const char *name);
@@ -66,7 +66,7 @@ int check_submodule_name(const char *name);
66 * New helpers to retrieve arbitrary configuration from the '.gitmodules' file
67 * should NOT be added.
68 */
69 -extern void fetch_config_from_gitmodules(int *max_children, int *recurse_submodules);
70 -extern void update_clone_config_from_gitmodules(int *max_jobs);
69 +void fetch_config_from_gitmodules(int *max_children, int *recurse_submodules);
70 +void update_clone_config_from_gitmodules(int *max_jobs);
71
72 #endif /* SUBMODULE_CONFIG_H */
tag.h
+7 -7
@@ -11,13 +11,13 @@ struct tag {
11 char *tag;
12 timestamp_t date;
13 };
14 -extern struct tag *lookup_tag(struct repository *r, const struct object_id *oid);
15 -extern int parse_tag_buffer(struct repository *r, struct tag *item, const void *data, unsigned long size);
16 -extern int parse_tag(struct tag *item);
17 -extern void release_tag_memory(struct tag *t);
18 -extern struct object *deref_tag(struct repository *r, struct object *, const char *, int);
19 -extern struct object *deref_tag_noverify(struct object *);
20 -extern int gpg_verify_tag(const struct object_id *oid,
14 +struct tag *lookup_tag(struct repository *r, const struct object_id *oid);
15 +int parse_tag_buffer(struct repository *r, struct tag *item, const void *data, unsigned long size);
16 +int parse_tag(struct tag *item);
17 +void release_tag_memory(struct tag *t);
18 +struct object *deref_tag(struct repository *r, struct object *, const char *, int);
19 +struct object *deref_tag_noverify(struct object *);
20 +int gpg_verify_tag(const struct object_id *oid,
21 const char *name_to_report, unsigned flags);
22
23 #endif /* TAG_H */
tempfile.h
+13 -13
@@ -89,7 +89,7 @@ struct tempfile {
89 * a tempfile (whose "fd" member can be used for writing to it), or
90 * NULL on error. It is an error if a file already exists at that path.
91 */
92 -extern struct tempfile *create_tempfile(const char *path);
92 +struct tempfile *create_tempfile(const char *path);
93
94 /*
95 * Register an existing file as a tempfile, meaning that it will be
@@ -97,7 +97,7 @@ extern struct tempfile *create_tempfile(const char *path);
97 * but it can be worked with like any other closed tempfile (for
98 * example, it can be opened using reopen_tempfile()).
99 */
100 -extern struct tempfile *register_tempfile(const char *path);
100 +struct tempfile *register_tempfile(const char *path);
101
102
103 /*
@@ -136,7 +136,7 @@ extern struct tempfile *register_tempfile(const char *path);
136 */
137
138 /* See "mks_tempfile functions" above. */
139 -extern struct tempfile *mks_tempfile_sm(const char *filename_template,
139 +struct tempfile *mks_tempfile_sm(const char *filename_template,
140 int suffixlen, int mode);
141
142 /* See "mks_tempfile functions" above. */
@@ -159,7 +159,7 @@ static inline struct tempfile *mks_tempfile(const char *filename_template)
159 }
160
161 /* See "mks_tempfile functions" above. */
162 -extern struct tempfile *mks_tempfile_tsm(const char *filename_template,
162 +struct tempfile *mks_tempfile_tsm(const char *filename_template,
163 int suffixlen, int mode);
164
165 /* See "mks_tempfile functions" above. */
@@ -182,7 +182,7 @@ static inline struct tempfile *mks_tempfile_t(const char *filename_template)
182 }
183
184 /* See "mks_tempfile functions" above. */
185 -extern struct tempfile *xmks_tempfile_m(const char *filename_template, int mode);
185 +struct tempfile *xmks_tempfile_m(const char *filename_template, int mode);
186
187 /* See "mks_tempfile functions" above. */
188 static inline struct tempfile *xmks_tempfile(const char *filename_template)
@@ -196,7 +196,7 @@ static inline struct tempfile *xmks_tempfile(const char *filename_template)
196 * stream is closed automatically when `close_tempfile_gently()` is called or
197 * when the file is deleted or renamed.
198 */
199 -extern FILE *fdopen_tempfile(struct tempfile *tempfile, const char *mode);
199 +FILE *fdopen_tempfile(struct tempfile *tempfile, const char *mode);
200
201 static inline int is_tempfile_active(struct tempfile *tempfile)
202 {
@@ -207,10 +207,10 @@ static inline int is_tempfile_active(struct tempfile *tempfile)
207 * Return the path of the lockfile. The return value is a pointer to a
208 * field within the lock_file object and should not be freed.
209 */
210 -extern const char *get_tempfile_path(struct tempfile *tempfile);
210 +const char *get_tempfile_path(struct tempfile *tempfile);
211
212 -extern int get_tempfile_fd(struct tempfile *tempfile);
213 -extern FILE *get_tempfile_fp(struct tempfile *tempfile);
212 +int get_tempfile_fd(struct tempfile *tempfile);
213 +FILE *get_tempfile_fp(struct tempfile *tempfile);
214
215 /*
216 * If the temporary file is still open, close it (and the file pointer
@@ -220,7 +220,7 @@ extern FILE *get_tempfile_fp(struct tempfile *tempfile);
220 * should eventually be called regardless of whether `close_tempfile_gently()`
221 * succeeds.
222 */
223 -extern int close_tempfile_gently(struct tempfile *tempfile);
223 +int close_tempfile_gently(struct tempfile *tempfile);
224
225 /*
226 * Re-open a temporary file that has been closed using
@@ -241,7 +241,7 @@ extern int close_tempfile_gently(struct tempfile *tempfile);
241 *
242 * * `rename_tempfile()` to move the file to its permanent location.
243 */
244 -extern int reopen_tempfile(struct tempfile *tempfile);
244 +int reopen_tempfile(struct tempfile *tempfile);
245
246 /*
247 * Close the file descriptor and/or file pointer and remove the
@@ -249,7 +249,7 @@ extern int reopen_tempfile(struct tempfile *tempfile);
249 * `delete_tempfile()` for a `tempfile` object that has already been
250 * deleted or renamed.
251 */
252 -extern void delete_tempfile(struct tempfile **tempfile_p);
252 +void delete_tempfile(struct tempfile **tempfile_p);
253
254 /*
255 * Close the file descriptor and/or file pointer if they are still
@@ -260,6 +260,6 @@ extern void delete_tempfile(struct tempfile **tempfile_p);
260 * `rename(2)`. It is a bug to call `rename_tempfile()` for a
261 * `tempfile` object that is not currently active.
262 */
263 -extern int rename_tempfile(struct tempfile **tempfile_p, const char *path);
263 +int rename_tempfile(struct tempfile **tempfile_p, const char *path);
264
265 #endif /* TEMPFILE_H */
trace.h
+8 -8
@@ -17,12 +17,12 @@ extern struct trace_key trace_default_key;
17 extern struct trace_key trace_perf_key;
18 extern struct trace_key trace_setup_key;
19
20 -extern void trace_repo_setup(const char *prefix);
21 -extern int trace_want(struct trace_key *key);
22 -extern void trace_disable(struct trace_key *key);
23 -extern uint64_t getnanotime(void);
24 -extern void trace_command_performance(const char **argv);
25 -extern void trace_verbatim(struct trace_key *key, const void *buf, unsigned len);
20 +void trace_repo_setup(const char *prefix);
21 +int trace_want(struct trace_key *key);
22 +void trace_disable(struct trace_key *key);
23 +uint64_t getnanotime(void);
24 +void trace_command_performance(const char **argv);
25 +void trace_verbatim(struct trace_key *key, const void *buf, unsigned len);
26 uint64_t trace_performance_enter(void);
27
28 #ifndef HAVE_VARIADIC_MACROS
@@ -36,7 +36,7 @@ extern void trace_printf_key(struct trace_key *key, const char *format, ...);
36 __attribute__((format (printf, 2, 3)))
37 extern void trace_argv_printf(const char **argv, const char *format, ...);
38
39 -extern void trace_strbuf(struct trace_key *key, const struct strbuf *data);
39 +void trace_strbuf(struct trace_key *key, const struct strbuf *data);
40
41 /* Prints elapsed time (in nanoseconds) if GIT_TRACE_PERFORMANCE is enabled. */
42 __attribute__((format (printf, 2, 3)))
@@ -137,7 +137,7 @@ extern void trace_printf_key_fl(const char *file, int line, struct trace_key *ke
137 __attribute__((format (printf, 4, 5)))
138 extern void trace_argv_printf_fl(const char *file, int line, const char **argv,
139 const char *format, ...);
140 -extern void trace_strbuf_fl(const char *file, int line, struct trace_key *key,
140 +void trace_strbuf_fl(const char *file, int line, struct trace_key *key,
141 const struct strbuf *data);
142 __attribute__((format (printf, 4, 5)))
143 extern void trace_performance_fl(const char *file, int line,
transport.h
+2 -2
@@ -134,7 +134,7 @@ struct transport {
134 #define TRANSPORT_PUSH_OPTIONS (1<<14)
135 #define TRANSPORT_RECURSE_SUBMODULES_ONLY (1<<15)
136
137 -extern int transport_summary_width(const struct ref *refs);
137 +int transport_summary_width(const struct ref *refs);
138
139 /* Returns a transport suitable for the url */
140 struct transport *transport_get(struct remote *, const char *);
@@ -263,5 +263,5 @@ void transport_print_push_status(const char *dest, struct ref *refs,
263 int verbose, int porcelain, unsigned int *reject_reasons);
264
265 typedef void alternate_ref_fn(const struct object_id *oid, void *);
266 -extern void for_each_alternate_ref(alternate_ref_fn, void *);
266 +void for_each_alternate_ref(alternate_ref_fn, void *);
267 #endif
tree-walk.h
+2 -2
@@ -67,8 +67,8 @@ struct traverse_info {
67 };
68
69 int get_tree_entry(const struct object_id *, const char *, struct object_id *, unsigned *);
70 -extern char *make_traverse_path(char *path, const struct traverse_info *info, const struct name_entry *n);
71 -extern void setup_traverse_info(struct traverse_info *info, const char *base);
70 +char *make_traverse_path(char *path, const struct traverse_info *info, const struct name_entry *n);
71 +void setup_traverse_info(struct traverse_info *info, const char *base);
72
73 static inline int traverse_path_len(const struct traverse_info *info, const struct name_entry *n)
74 {
upload-pack.h
+2 -2
@@ -13,11 +13,11 @@ void upload_pack(struct upload_pack_options *options);
13 struct repository;
14 struct argv_array;
15 struct packet_reader;
16 -extern int upload_pack_v2(struct repository *r, struct argv_array *keys,
16 +int upload_pack_v2(struct repository *r, struct argv_array *keys,
17 struct packet_reader *request);
18
19 struct strbuf;
20 -extern int upload_pack_advertise(struct repository *r,
20 +int upload_pack_advertise(struct repository *r,
21 struct strbuf *value);
22
23 #endif /* UPLOAD_PACK_H */
url.h
+8 -8
@@ -3,14 +3,14 @@
3
4 struct strbuf;
5
6 -extern int is_url(const char *url);
7 -extern int is_urlschemechar(int first_flag, int ch);
8 -extern char *url_decode(const char *url);
9 -extern char *url_decode_mem(const char *url, int len);
10 -extern char *url_decode_parameter_name(const char **query);
11 -extern char *url_decode_parameter_value(const char **query);
6 +int is_url(const char *url);
7 +int is_urlschemechar(int first_flag, int ch);
8 +char *url_decode(const char *url);
9 +char *url_decode_mem(const char *url, int len);
10 +char *url_decode_parameter_name(const char **query);
11 +char *url_decode_parameter_value(const char **query);
12
13 -extern void end_url_with_slash(struct strbuf *buf, const char *url);
14 -extern void str_end_url_with_slash(const char *url, char **dest);
13 +void end_url_with_slash(struct strbuf *buf, const char *url);
14 +void str_end_url_with_slash(const char *url, char **dest);
15
16 #endif /* URL_H */
urlmatch.h
+2 -2
@@ -33,7 +33,7 @@ struct url_info {
33 * '?...' and '#...' portion; will always be >= 1 */
34 };
35
36 -extern char *url_normalize(const char *, struct url_info *);
36 +char *url_normalize(const char *, struct url_info *);
37
38 struct urlmatch_item {
39 size_t hostmatch_len;
@@ -52,6 +52,6 @@ struct urlmatch_config {
52 int (*cascade_fn)(const char *var, const char *value, void *cb);
53 };
54
55 -extern int urlmatch_config_entry(const char *var, const char *value, void *cb);
55 +int urlmatch_config_entry(const char *var, const char *value, void *cb);
56
57 #endif /* URL_MATCH_H */
utf8.h
+1 -1
@@ -16,7 +16,7 @@ __attribute__((format (printf, 2, 3)))
16 int utf8_fprintf(FILE *, const char *, ...);
17
18 extern const char utf8_bom[];
19 -extern int skip_utf8_bom(char **, size_t);
19 +int skip_utf8_bom(char **, size_t);
20
21 void strbuf_add_wrapped_text(struct strbuf *buf,
22 const char *text, int indent, int indent2, int width);
varint.h
+2 -2
@@ -1,7 +1,7 @@
1 #ifndef VARINT_H
2 #define VARINT_H
3
4 -extern int encode_varint(uintmax_t, unsigned char *);
5 -extern uintmax_t decode_varint(const unsigned char **);
4 +int encode_varint(uintmax_t, unsigned char *);
5 +uintmax_t decode_varint(const unsigned char **);
6
7 #endif /* VARINT_H */
vcs-svn/sliding_window.h
+1 -1
@@ -13,6 +13,6 @@ struct sliding_view {
13
14 #define SLIDING_VIEW_INIT(input, len) { (input), 0, 0, (len), STRBUF_INIT }
15
16 -extern int move_window(struct sliding_view *view, off_t off, size_t width);
16 +int move_window(struct sliding_view *view, off_t off, size_t width);
17
18 #endif
vcs-svn/svndiff.h
+1 -1
@@ -4,7 +4,7 @@
4 struct line_buffer;
5 struct sliding_view;
6
7 -extern int svndiff0_apply(struct line_buffer *delta, off_t delta_len,
7 +int svndiff0_apply(struct line_buffer *delta, off_t delta_len,
8 struct sliding_view *preimage, FILE *postimage);
9
10 #endif
worktree.h
+10 -10
@@ -30,37 +30,37 @@ struct worktree {
30 * The caller is responsible for freeing the memory from the returned
31 * worktree(s).
32 */
33 -extern struct worktree **get_worktrees(unsigned flags);
33 +struct worktree **get_worktrees(unsigned flags);
34
35 /*
36 * Returns 1 if linked worktrees exist, 0 otherwise.
37 */
38 -extern int submodule_uses_worktrees(const char *path);
38 +int submodule_uses_worktrees(const char *path);
39
40 /*
41 * Return git dir of the worktree. Note that the path may be relative.
42 * If wt is NULL, git dir of current worktree is returned.
43 */
44 -extern const char *get_worktree_git_dir(const struct worktree *wt);
44 +const char *get_worktree_git_dir(const struct worktree *wt);
45
46 /*
47 * Search a worktree that can be unambiguously identified by
48 * "arg". "prefix" must not be NULL.
49 */
50 -extern struct worktree *find_worktree(struct worktree **list,
50 +struct worktree *find_worktree(struct worktree **list,
51 const char *prefix,
52 const char *arg);
53
54 /*
55 * Return true if the given worktree is the main one.
56 */
57 -extern int is_main_worktree(const struct worktree *wt);
57 +int is_main_worktree(const struct worktree *wt);
58
59 /*
60 * Return the reason string if the given worktree is locked or NULL
61 * otherwise.
62 */
63 -extern const char *worktree_lock_reason(struct worktree *wt);
63 +const char *worktree_lock_reason(struct worktree *wt);
64
65 #define WT_VALIDATE_WORKTREE_MISSING_OK (1 << 0)
66
@@ -68,27 +68,27 @@ extern const char *worktree_lock_reason(struct worktree *wt);
68 * Return zero if the worktree is in good condition. Error message is
69 * returned if "errmsg" is not NULL.
70 */
71 -extern int validate_worktree(const struct worktree *wt,
71 +int validate_worktree(const struct worktree *wt,
72 struct strbuf *errmsg,
73 unsigned flags);
74
75 /*
76 * Update worktrees/xxx/gitdir with the new path.
77 */
78 -extern void update_worktree_location(struct worktree *wt,
78 +void update_worktree_location(struct worktree *wt,
79 const char *path_);
80
81 /*
82 * Free up the memory for worktree(s)
83 */
84 -extern void free_worktrees(struct worktree **);
84 +void free_worktrees(struct worktree **);
85
86 /*
87 * Check if a per-worktree symref points to a ref in the main worktree
88 * or any linked worktree, and return the worktree that holds the ref,
89 * or NULL otherwise. The result may be destroyed by the next call.
90 */
91 -extern const struct worktree *find_shared_symref(const char *symref,
91 +const struct worktree *find_shared_symref(const char *symref,
92 const char *target);
93
94 /*
xdiff-interface.h
+5 -5
@@ -27,9 +27,9 @@ int read_mmfile(mmfile_t *ptr, const char *filename);
27 void read_mmblob(mmfile_t *ptr, const struct object_id *oid);
28 int buffer_is_binary(const char *ptr, unsigned long size);
29
30 -extern void xdiff_set_find_func(xdemitconf_t *xecfg, const char *line, int cflags);
31 -extern void xdiff_clear_find_func(xdemitconf_t *xecfg);
32 -extern int git_xmerge_config(const char *var, const char *value, void *cb);
30 +void xdiff_set_find_func(xdemitconf_t *xecfg, const char *line, int cflags);
31 +void xdiff_clear_find_func(xdemitconf_t *xecfg);
32 +int git_xmerge_config(const char *var, const char *value, void *cb);
33 extern int git_xmerge_style;
34
35 /*
@@ -46,7 +46,7 @@ void discard_hunk_line(void *priv,
46 * The `flags` given as XDF_WHITESPACE_FLAGS determine how white spaces
47 * are treated for the comparision.
48 */
49 -extern int xdiff_compare_lines(const char *l1, long s1,
49 +int xdiff_compare_lines(const char *l1, long s1,
50 const char *l2, long s2, long flags);
51
52 /*
@@ -54,6 +54,6 @@ extern int xdiff_compare_lines(const char *l1, long s1,
54 * The `flags` given as XDF_WHITESPACE_FLAGS determine how white spaces
55 * are treated for the hash.
56 */
57 -extern unsigned long xdiff_hash_string(const char *s, size_t len, long flags);
57 +unsigned long xdiff_hash_string(const char *s, size_t len, long flags);
58
59 #endif