Git fork

*.[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>

authored by

Denton Liu and committed by
Junio C Hamano
55454427 ffac537e

+885 -885
+1 -1
advice.h
··· 31 31 __attribute__((format (printf, 1, 2))) 32 32 void advise(const char *advice, ...); 33 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 35 void NORETURN die_conclude_merge(void); 36 36 void detach_advice(const char *new_name); 37 37
+7 -7
archive.h
··· 23 23 24 24 /* main api */ 25 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 27 struct repository *repo, 28 28 const char *name_hint, int remote); 29 29 ··· 39 39 unsigned flags; 40 40 void *data; 41 41 }; 42 - extern void register_archiver(struct archiver *); 42 + void register_archiver(struct archiver *); 43 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 47 48 48 typedef int (*write_archive_entry_fn_t)(struct archiver_args *args, 49 49 const struct object_id *oid, 50 50 const char *path, size_t pathlen, 51 51 unsigned int mode); 52 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 55 const char *path, const struct object_id *oid, 56 56 unsigned int mode, enum object_type *type, 57 57 unsigned long *sizep);
+6 -6
bisect.h
··· 11 11 * Otherwise, it will be either all non-SAMETREE commits or the single 12 12 * best commit, as chosen by `find_all`. 13 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 15 int find_all); 16 16 17 - extern struct commit_list *filter_skipped(struct commit_list *list, 17 + struct commit_list *filter_skipped(struct commit_list *list, 18 18 struct commit_list **tried, 19 19 int show_all, 20 20 int *count, ··· 31 31 const char *header_prefix; 32 32 }; 33 33 34 - extern int bisect_next_all(struct repository *r, 34 + int bisect_next_all(struct repository *r, 35 35 const char *prefix, 36 36 int no_checkout); 37 37 38 - extern int estimate_bisect_steps(int all); 38 + int estimate_bisect_steps(int all); 39 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 41 42 - extern int bisect_clean_state(void); 42 + int bisect_clean_state(void); 43 43 44 44 #endif
+1 -1
blame.h
··· 177 177 long start, long end, 178 178 struct blame_origin *o); 179 179 180 - extern struct blame_origin *get_blame_suspects(struct commit *commit); 180 + struct blame_origin *get_blame_suspects(struct commit *commit); 181 181 182 182 #endif /* BLAME_H */
+6 -6
branch.h
··· 50 50 * Return 1 if the named branch already exists; return 0 otherwise. 51 51 * Fill ref with the full refname for the branch. 52 52 */ 53 - extern int validate_branchname(const char *name, struct strbuf *ref); 53 + int validate_branchname(const char *name, struct strbuf *ref); 54 54 55 55 /* 56 56 * Check if a branch 'name' can be created as a new branch; die otherwise. ··· 58 58 * Return 1 if the named branch already exists; return 0 otherwise. 59 59 * Fill ref with the full refname for the branch. 60 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 62 63 63 /* 64 64 * Remove information about the state of working on the current ··· 72 72 * Returns 0 on success. 73 73 */ 74 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 76 77 77 /* 78 78 * Read branch description 79 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 81 82 82 /* 83 83 * Check if a branch is checked out in the main worktree or any linked 84 84 * worktree and die (with a message describing its checkout location) if 85 85 * it is. 86 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 88 89 89 /* 90 90 * Update all per-worktree HEADs pointing at the old ref to point the new ref. 91 91 * This will be used when renaming a branch. Returns 0 if successful, non-zero 92 92 * otherwise. 93 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 95 const char *logmsg); 96 96 97 97 #endif
+126 -126
builtin.h
··· 102 102 #define PRUNE_PACKED_DRY_RUN 01 103 103 #define PRUNE_PACKED_VERBOSE 02 104 104 105 - extern void prune_packed_objects(int); 105 + void prune_packed_objects(int); 106 106 107 107 struct fmt_merge_msg_opts { 108 108 unsigned add_title:1, ··· 110 110 int shortlog_len; 111 111 }; 112 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 114 struct fmt_merge_msg_opts *); 115 115 116 116 /** ··· 123 123 * You should most likely use a default of 0 or 1. "Punt" (-1) could be useful 124 124 * to be able to fall back to some historical compatibility name. 125 125 */ 126 - extern void setup_auto_pager(const char *cmd, int def); 126 + void setup_auto_pager(const char *cmd, int def); 127 127 128 - extern int is_builtin(const char *s); 128 + int is_builtin(const char *s); 129 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 252 253 253 #endif
+3 -3
bulk-checkin.h
··· 6 6 7 7 #include "cache.h" 8 8 9 - extern int index_bulk_checkin(struct object_id *oid, 9 + int index_bulk_checkin(struct object_id *oid, 10 10 int fd, size_t size, enum object_type type, 11 11 const char *path, unsigned flags); 12 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 15 16 16 #endif
+170 -170
cache.h
··· 350 350 }; 351 351 352 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 357 358 358 359 359 /* Cache entry creation and cleanup */ ··· 543 543 */ 544 544 extern const char * const local_repo_env[]; 545 545 546 - extern void setup_git_env(const char *git_dir); 546 + void setup_git_env(const char *git_dir); 547 547 548 548 /* 549 549 * Returns true iff we have a configured git repository (either via ··· 552 552 int have_git_dir(void); 553 553 554 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 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 571 572 572 /* 573 573 * Return true if the given path is a git directory; note that this _just_ 574 574 * looks at the directory itself. If you want to know whether "foo/.git" 575 575 * is a repository, you must feed that path, not just "foo". 576 576 */ 577 - extern int is_git_directory(const char *path); 577 + int is_git_directory(const char *path); 578 578 579 579 /* 580 580 * Return 1 if the given path is the root of a git repository or ··· 586 586 * as we usually consider sub-repos precious, and would prefer to err on the 587 587 * side of not disrupting or deleting them. 588 588 */ 589 - extern int is_nonbare_repository_dir(struct strbuf *path); 589 + int is_nonbare_repository_dir(struct strbuf *path); 590 590 591 591 #define READ_GITFILE_ERR_STAT_FAILED 1 592 592 #define READ_GITFILE_ERR_NOT_A_FILE 2 ··· 596 596 #define READ_GITFILE_ERR_NO_PATH 6 597 597 #define READ_GITFILE_ERR_NOT_A_REPO 7 598 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 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 603 #define resolve_gitdir(path) resolve_gitdir_gently((path), NULL) 604 604 605 - extern void set_git_work_tree(const char *tree); 605 + void set_git_work_tree(const char *tree); 606 606 607 607 #define ALTERNATE_DB_ENVIRONMENT "GIT_ALTERNATE_OBJECT_DIRECTORIES" 608 608 609 - extern void setup_work_tree(void); 609 + void setup_work_tree(void); 610 610 /* 611 611 * Find the commondir and gitdir of the repository that contains the current 612 612 * working directory, without changing the working directory or other global ··· 615 615 * both have the same result appended to the buffer. The return value is 616 616 * either 0 upon success and non-zero if no repository was found. 617 617 */ 618 - extern int discover_git_directory(struct strbuf *commondir, 618 + int discover_git_directory(struct strbuf *commondir, 619 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 624 625 625 /* 626 626 * Concatenate "prefix" (if len is non-zero) and "path", with no ··· 632 632 * The return value is always a newly allocated string (even if the 633 633 * prefix was empty). 634 634 */ 635 - extern char *prefix_filename(const char *prefix, const char *path); 635 + char *prefix_filename(const char *prefix, const char *path); 636 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 639 const char *name, 640 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 643 644 644 #define INIT_DB_QUIET 0x0001 645 645 #define INIT_DB_EXIST_OK 0x0002 646 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 648 const char *template_dir, unsigned int flags); 649 649 650 - extern void sanitize_stdfds(void); 651 - extern int daemonize(void); 650 + void sanitize_stdfds(void); 651 + int daemonize(void); 652 652 653 653 #define alloc_nr(x) (((x)+16)*3/2) 654 654 ··· 672 672 673 673 /* Initialize and use the cache information */ 674 674 struct lock_file; 675 - extern void preload_index(struct index_state *index, 675 + void preload_index(struct index_state *index, 676 676 const struct pathspec *pathspec, 677 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 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 681 const char *gitdir); 682 - extern int is_index_unborn(struct index_state *); 682 + int is_index_unborn(struct index_state *); 683 683 684 684 /* For use with `write_locked_index()`. */ 685 685 #define COMMIT_LOCK (1 << 0) ··· 704 704 * If `SKIP_IF_UNCHANGED` is given and the index is unchanged, nothing 705 705 * is written (and the lock is rolled back if `COMMIT_LOCK` is given). 706 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 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 712 713 713 /** 714 714 * Returns 1 if istate differs from tree, 0 otherwise. If tree is NULL, ··· 717 717 * provided, the space-separated list of files that differ will be appended 718 718 * to it. 719 719 */ 720 - extern int repo_index_has_changes(struct repository *repo, 720 + int repo_index_has_changes(struct repository *repo, 721 721 struct tree *tree, 722 722 struct strbuf *sb); 723 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 729 730 730 /* 731 731 * Searches for an entry defined by name and namelen in the given index. ··· 744 744 * index_name_pos(&index, "f", 1) -> -3 745 745 * index_name_pos(&index, "g", 1) -> -5 746 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 748 749 749 #define ADD_CACHE_OK_TO_ADD 1 /* Ok to add */ 750 750 #define ADD_CACHE_OK_TO_REPLACE 2 /* Ok to replace file/directory */ ··· 753 753 #define ADD_CACHE_NEW_ONLY 16 /* Do not replace existing ones */ 754 754 #define ADD_CACHE_KEEP_CACHE_TREE 32 /* Do not invalidate cache-tree */ 755 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 758 759 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 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 764 #define ADD_CACHE_VERBOSE 1 765 765 #define ADD_CACHE_PRETEND 2 766 766 #define ADD_CACHE_IGNORE_ERRORS 4 ··· 775 775 * the latter will do necessary lstat(2) internally before 776 776 * calling the former. 777 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 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 786 787 787 /* do stat comparison even if CE_VALID is true */ 788 788 #define CE_MATCH_IGNORE_VALID 01 ··· 796 796 #define CE_MATCH_REFRESH 0x10 797 797 /* don't refresh_fsmonitor state or do stat comparison even if CE_FSMONITOR_VALID is true */ 798 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 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 803 804 804 #define HASH_WRITE_OBJECT 1 805 805 #define HASH_FORMAT_CHECK 2 806 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 809 810 810 /* 811 811 * Record to sd the data from st that we use to check whether a file 812 812 * might have changed. 813 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 815 816 816 /* 817 817 * Return 0 if st is consistent with a file not having been changed ··· 819 819 * combination of MTIME_CHANGED, CTIME_CHANGED, OWNER_CHANGED, 820 820 * INODE_CHANGED, and DATA_CHANGED. 821 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 824 const struct stat_data *sd, struct stat *st); 825 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 827 828 828 #define REFRESH_REALLY 0x0001 /* ignore_valid */ 829 829 #define REFRESH_UNMERGED 0x0002 /* allow unmerged */ ··· 832 832 #define REFRESH_IGNORE_SUBMODULES 0x0010 /* ignore submodules */ 833 833 #define REFRESH_IN_PORCELAIN 0x0020 /* user friendly output, not "needs update" */ 834 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 837 838 - extern void set_alternate_index_output(const char *); 838 + void set_alternate_index_output(const char *); 839 839 840 840 extern int verify_index_checksum; 841 841 extern int verify_ce_order; ··· 1020 1020 * set_git_dir() before calling this, and use it only for "are we in a valid 1021 1021 * repo?". 1022 1022 */ 1023 - extern void check_repository_format(void); 1023 + void check_repository_format(void); 1024 1024 1025 1025 #define MTIME_CHANGED 0x0001 1026 1026 #define CTIME_CHANGED 0x0002 ··· 1045 1045 * Note that while this version avoids the static buffer, it is not fully 1046 1046 * reentrant, as it calls into other non-reentrant git code. 1047 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 1050 1051 1051 extern const unsigned char null_sha1[GIT_MAX_RAWSZ]; 1052 1052 extern const struct object_id null_oid; ··· 1242 1242 int raceproof_create_file(const char *path, create_file_fn fn, void *cb); 1243 1243 1244 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 1246 const char *enter_repo(const char *path, int strict); 1247 1247 static inline int is_absolute_path(const char *path) 1248 1248 { ··· 1286 1286 * "$XDG_CONFIG_HOME/git/$filename" if $XDG_CONFIG_HOME is non-empty, otherwise 1287 1287 * "$HOME/.config/git/$filename". Return NULL upon error. 1288 1288 */ 1289 - extern char *xdg_config_home(const char *filename); 1289 + char *xdg_config_home(const char *filename); 1290 1290 1291 1291 /** 1292 1292 * Return a newly allocated string with the evaluation of 1293 1293 * "$XDG_CACHE_HOME/git/$filename" if $XDG_CACHE_HOME is non-empty, otherwise 1294 1294 * "$HOME/.cache/git/$filename". Return NULL upon error. 1295 1295 */ 1296 - extern char *xdg_cache_home(const char *filename); 1296 + char *xdg_cache_home(const char *filename); 1297 1297 1298 - extern int git_open_cloexec(const char *name, int flags); 1298 + int git_open_cloexec(const char *name, int flags); 1299 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 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 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 1306 1307 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 1309 1310 1310 extern const signed char hexval_table[256]; 1311 1311 static inline unsigned int hexval(unsigned char c) ··· 1378 1378 */ 1379 1379 }; 1380 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 1389 unsigned flags, struct object_id *oid, 1390 1390 struct object_context *oc); 1391 1391 1392 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 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 1396 1397 1397 /* 1398 1398 * Try to read a SHA1 in hexadecimal format from the 40 characters ··· 1401 1401 * input, so it is safe to pass this function an arbitrary 1402 1402 * null-terminated string. 1403 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 1406 1407 1407 /* 1408 1408 * Read `len` pairs of hexadecimal digits from `hex` and write the 1409 1409 * values to `binary` as `len` bytes. Return 0 on success, or -1 if 1410 1410 * the input does not consist of hex digits). 1411 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 1413 1414 1414 /* 1415 1415 * Convert a binary hash to its hex equivalent. The `_r` variant is reentrant, ··· 1437 1437 * other invalid character. end is only updated on success; otherwise, it is 1438 1438 * unmodified. 1439 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 1441 1442 1442 /* 1443 1443 * This reads short-hand syntax that not only evaluates to a commit ··· 1468 1468 #define INTERPRET_BRANCH_LOCAL (1<<0) 1469 1469 #define INTERPRET_BRANCH_REMOTE (1<<1) 1470 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 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 1474 1475 - extern int validate_headref(const char *ref); 1475 + int validate_headref(const char *ref); 1476 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 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 1483 const char *required_type, 1484 1484 unsigned long *size, 1485 1485 struct object_id *oid_ret); 1486 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 1488 struct object *o, enum object_type); 1489 1489 1490 1490 enum date_mode_type { ··· 1539 1539 WANT_COMMITTER_IDENT 1540 1540 }; 1541 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 1545 enum want_ident whose_ident, 1546 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 1556 1557 1557 struct ident_split { 1558 1558 const char *name_begin; ··· 1568 1568 * Signals an success with 0, but time part of the result may be NULL 1569 1569 * if the input lacks timestamp and zone 1570 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 1572 1573 1573 /* 1574 1574 * Like show_date, but pull the timestamp and tz parameters from ··· 1585 1585 * Because there are two fields, we must choose one as the primary key; we 1586 1586 * currently arbitrarily pick the email. 1587 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 1589 1590 1590 struct checkout { 1591 1591 struct index_state *istate; ··· 1601 1601 #define CHECKOUT_INIT { NULL, "" } 1602 1602 1603 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 1607 /* 1608 1608 * Unlink the last component and schedule the leading directories for 1609 1609 * removal, such that empty directories get removed. 1610 1610 */ 1611 - extern void unlink_entry(const struct cache_entry *ce); 1611 + void unlink_entry(const struct cache_entry *ce); 1612 1612 1613 1613 struct cache_def { 1614 1614 struct strbuf path; ··· 1622 1622 strbuf_release(&cache->path); 1623 1623 } 1624 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 1631 1632 1632 struct pack_window { 1633 1633 struct pack_window *next; ··· 1649 1649 * usual "XXXXXX" trailer, and the resulting filename is written into the 1650 1650 * "template" buffer. Returns the open descriptor. 1651 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 1653 1654 1654 /* 1655 1655 * Create a pack .keep file named "name" (which should generally be the output 1656 1656 * of odb_pack_name). Returns a file descriptor opened for writing, or -1 on 1657 1657 * error. 1658 1658 */ 1659 - extern int odb_pack_keep(const char *name); 1659 + int odb_pack_keep(const char *name); 1660 1660 1661 1661 /* 1662 1662 * Set this to 0 to prevent oid_object_info_extended() from fetching missing ··· 1667 1667 extern int fetch_if_missing; 1668 1668 1669 1669 /* Dumb servers support */ 1670 - extern int update_server_info(int); 1670 + int update_server_info(int); 1671 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 1674 1675 1675 /* 1676 1676 * This is a hack for test programs like test-dump-untracked-cache to ··· 1679 1679 */ 1680 1680 extern int ignore_untracked_cache_config; 1681 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 1684 1685 1685 extern const char *git_commit_encoding; 1686 1686 extern const char *git_log_output_encoding; ··· 1688 1688 extern const char *git_mailmap_blob; 1689 1689 1690 1690 /* IO helper functions */ 1691 - extern void maybe_flush_or_die(FILE *, const char *); 1691 + void maybe_flush_or_die(FILE *, const char *); 1692 1692 __attribute__((format (printf, 2, 3))) 1693 1693 extern void fprintf_or_die(FILE *, const char *fmt, ...); 1694 1694 1695 1695 #define COPY_READ_ERROR (-2) 1696 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 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 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 1707 1708 1708 static inline ssize_t write_str_in_full(int fd, const char *str) 1709 1709 { ··· 1714 1714 * Open (and truncate) the file at path, write the contents of buf to it, 1715 1715 * and close it. Dies if any errors are encountered. 1716 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 1718 1719 1719 /** 1720 1720 * Like write_file_buf(), but format the contents into a buffer first. ··· 1727 1727 extern void write_file(const char *path, const char *fmt, ...); 1728 1728 1729 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 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 1737 1738 1738 extern const char *editor_program; 1739 1739 extern const char *askpass_program; ··· 1777 1777 /* All WS_* -- when extended, adapt diff.c emit_symbol */ 1778 1778 #define WS_RULE_MASK 07777 1779 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 1787 #define ws_tab_width(rule) ((rule) & WS_TAB_WIDTH_MASK) 1788 1788 1789 1789 /* ls-files */ ··· 1853 1853 * Should we print an ellipsis after an abbreviated SHA-1 value 1854 1854 * when doing diff-raw output or indicating a detached HEAD? 1855 1855 */ 1856 - extern int print_sha1_ellipsis(void); 1856 + int print_sha1_ellipsis(void); 1857 1857 1858 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 1860 1861 1861 #endif /* CACHE_H */
+1 -1
checkout.h
··· 8 8 * tracking branch. Return the name of the remote if such a branch 9 9 * exists, NULL otherwise. 10 10 */ 11 - extern const char *unique_tracking_name(const char *name, 11 + const char *unique_tracking_name(const char *name, 12 12 struct object_id *oid, 13 13 int *dwim_remotes_matched); 14 14
+6 -6
column.h
··· 27 27 }; 28 28 29 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 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 34 static inline int column_active(unsigned int colopts) 35 35 { 36 36 return (colopts & COL_ENABLE_MASK) == COL_ENABLED; 37 37 } 38 38 39 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 41 const struct column_options *opts); 42 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 45 46 46 #endif
+35 -35
commit.h
··· 177 177 178 178 struct rev_info; /* in revision.h, it circularly uses enum cmit_fmt */ 179 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 182 char **commit_encoding, 183 183 const char *output_encoding); 184 184 const char *repo_logmsg_reencode(struct repository *r, ··· 189 189 #define logmsg_reencode(c, enc, out) repo_logmsg_reencode(the_repository, c, enc, out) 190 190 #endif 191 191 192 - extern const char *skip_blank_lines(const char *msg); 192 + const char *skip_blank_lines(const char *msg); 193 193 194 194 /** Removes the first commit from a list sorted by date, and adds all 195 195 * of its parents. ··· 240 240 241 241 struct oid_array; 242 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 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 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 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 255 const char **alternate_shallow_file, 256 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 259 260 260 struct shallow_info { 261 261 struct oid_array *shallow; ··· 272 272 int nr_commits; 273 273 }; 274 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 279 uint32_t **used, 280 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 282 #define PRUNE_SHOW_ONLY 1 283 283 #define PRUNE_QUICK 2 284 - extern void prune_shallow(unsigned options); 284 + void prune_shallow(unsigned options); 285 285 extern struct trace_key trace_shallow; 286 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 289 const struct pathspec *pathspec); 290 290 291 291 struct commit_extra_header { ··· 295 295 size_t len; 296 296 }; 297 297 298 - extern void append_merge_tag_headers(struct commit_list *parents, 298 + void append_merge_tag_headers(struct commit_list *parents, 299 299 struct commit_extra_header ***tail); 300 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 302 const struct object_id *tree, 303 303 struct commit_list *parents, struct object_id *ret, 304 304 const char *author, const char *sign_commit); 305 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 307 const struct object_id *tree, 308 308 struct commit_list *parents, 309 309 struct object_id *ret, const char *author, 310 310 const char *sign_commit, 311 311 struct commit_extra_header *); 312 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 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 316 317 317 /* 318 318 * Search the commit object contents given by "msg" for the header "key". ··· 322 322 * Note that some headers (like mergetag) may be multi-line. It is the caller's 323 323 * responsibility to parse further in this case! 324 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 326 size_t *out_len); 327 327 328 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 330 331 331 typedef int (*each_mergetag_fn)(struct commit *commit, struct commit_extra_header *extra, 332 332 void *cb_data); 333 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 335 336 336 struct merge_remote_desc { 337 337 struct object *obj; /* the named object, could be a tag */ 338 338 char name[FLEX_ARRAY]; 339 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 342 const char *name, struct object *obj); 343 343 344 344 /* ··· 348 348 */ 349 349 struct commit *get_merge_parent(const char *name); 350 350 351 - extern int parse_signed_commit(const struct commit *commit, 351 + int parse_signed_commit(const struct commit *commit, 352 352 struct strbuf *message, struct strbuf *signature); 353 - extern int remove_signature(struct strbuf *buf); 353 + int remove_signature(struct strbuf *buf); 354 354 355 355 /* 356 356 * Check the signature of the given commit. The result of the check is stored ··· 359 359 * at all. This may allocate memory for sig->gpg_output, sig->gpg_status, 360 360 * sig->signer and sig->key. 361 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 363 364 364 /* record author-date for each commit object */ 365 365 struct author_date_slab;
+91 -91
config.h
··· 68 68 }; 69 69 70 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 74 void *, 75 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 77 const enum config_origin_type, 78 78 const char *name, 79 79 const char *buf, size_t len, 80 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 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 88 struct git_config_source *config_source, 89 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 122 #if defined(__GNUC__) 123 123 #define config_error_nonbool(s) (config_error_nonbool(s), const_error()) 124 124 #endif 125 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 127 128 128 enum config_scope { 129 129 CONFIG_SCOPE_UNKNOWN = 0, ··· 133 133 CONFIG_SCOPE_CMDLINE, 134 134 }; 135 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 139 140 140 struct config_include_data { 141 141 int depth; ··· 144 144 const struct config_options *opts; 145 145 }; 146 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 148 149 149 /* 150 150 * Match and parse a config key of the form: ··· 159 159 * If the subsection pointer-to-pointer passed in is NULL, returns 0 only if 160 160 * there is no subsection at all. 161 161 */ 162 - extern int parse_config_key(const char *var, 162 + int parse_config_key(const char *var, 163 163 const char *section, 164 164 const char **subsection, int *subsection_len, 165 165 const char **key); ··· 192 192 struct configset_list list; 193 193 }; 194 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 199 200 200 /* 201 201 * These functions return 1 if not found, and 0 if found, leaving the found 202 202 * value in the 'dest' pointer. 203 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 213 214 214 /* Functions for reading a repository's config */ 215 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 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 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 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 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 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 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 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 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 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 236 const char *key, const char **dest); 237 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 254 255 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 257 258 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 260 261 261 struct key_value_info { 262 262 const char *filename; ··· 266 266 }; 267 267 268 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 270 271 271 #define LOOKUP_CONFIG(mapping, var) \ 272 272 lookup_config(mapping, ARRAY_SIZE(mapping), var)
+10 -10
connect.h
··· 7 7 #define CONNECT_DIAG_URL (1u << 1) 8 8 #define CONNECT_IPV4 (1u << 2) 9 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 17 18 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 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 23 int die_on_error); 24 24 25 25 #endif
+10 -10
csum-file.h
··· 25 25 git_hash_ctx ctx; 26 26 }; 27 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 30 31 31 /* finalize_hashfile flags */ 32 32 #define CSUM_CLOSE 1 33 33 #define CSUM_FSYNC 2 34 34 #define CSUM_HASH_IN_STREAM 4 35 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 44 45 45 static inline void hashwrite_u8(struct hashfile *f, uint8_t data) 46 46 {
+2 -2
decorate.h
··· 50 50 * NULL), returning the previously associated pointer. If there is no previous 51 51 * association, this function returns NULL. 52 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 54 55 55 /* 56 56 * Return the pointer associated to the given object. If there is no 57 57 * association, this function returns NULL. 58 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 60 61 61 #endif
+5 -5
delta.h
··· 13 13 * before free_delta_index() is called. The returned pointer must be freed 14 14 * using free_delta_index(). 15 15 */ 16 - extern struct delta_index * 16 + struct delta_index * 17 17 create_delta_index(const void *buf, unsigned long bufsize); 18 18 19 19 /* ··· 21 21 * 22 22 * Given pointer must be what create_delta_index() returned, or NULL. 23 23 */ 24 - extern void free_delta_index(struct delta_index *index); 24 + void free_delta_index(struct delta_index *index); 25 25 26 26 /* 27 27 * sizeof_delta_index: returns memory usage of delta index 28 28 * 29 29 * Given pointer must be what create_delta_index() returned, or NULL. 30 30 */ 31 - extern unsigned long sizeof_delta_index(struct delta_index *index); 31 + unsigned long sizeof_delta_index(struct delta_index *index); 32 32 33 33 /* 34 34 * create_delta: create a delta from given index for the given buffer ··· 40 40 * returned and *delta_size is updated with its size. The returned buffer 41 41 * must be freed by the caller. 42 42 */ 43 - extern void * 43 + void * 44 44 create_delta(const struct delta_index *index, 45 45 const void *buf, unsigned long bufsize, 46 46 unsigned long *delta_size, unsigned long max_delta_size); ··· 75 75 * *trg_bufsize is updated with its size. On failure a NULL pointer is 76 76 * returned. The returned buffer must be freed by the caller. 77 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 79 const void *delta_buf, unsigned long delta_size, 80 80 unsigned long *dst_size); 81 81
+35 -35
dir.h
··· 202 202 }; 203 203 204 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 206 207 207 /* 208 208 * The ordering of these constants is significant, with ··· 213 213 #define MATCHED_RECURSIVELY 1 214 214 #define MATCHED_FNMATCH 2 215 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 220 const struct pathspec *pathspec, 221 221 const char *name, int namelen, 222 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 225 226 - extern int fill_directory(struct dir_struct *dir, 226 + int fill_directory(struct dir_struct *dir, 227 227 struct index_state *istate, 228 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 230 const char *path, int len, 231 231 const struct pathspec *pathspec); 232 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 234 const char *basename, int *dtype, 235 235 struct exclude_list *el, 236 236 struct index_state *istate); ··· 242 242 * these implement the matching logic for dir.c:excluded_from_list and 243 243 * attr.c:path_matches() 244 244 */ 245 - extern int match_basename(const char *, int, 245 + int match_basename(const char *, int, 246 246 const char *, int, int, unsigned); 247 - extern int match_pathname(const char *, int, 247 + int match_pathname(const char *, int, 248 248 const char *, int, 249 249 const char *, int, int, unsigned); 250 250 251 - extern struct exclude *last_exclude_matching(struct dir_struct *dir, 251 + struct exclude *last_exclude_matching(struct dir_struct *dir, 252 252 struct index_state *istate, 253 253 const char *name, int *dtype); 254 254 255 - extern int is_excluded(struct dir_struct *dir, 255 + int is_excluded(struct dir_struct *dir, 256 256 struct index_state *istate, 257 257 const char *name, int *dtype); 258 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 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 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 265 const char *base, int baselen, 266 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 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 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 276 277 277 static inline int is_dot_or_dotdot(const char *name) 278 278 { ··· 281 281 (name[1] == '.' && name[2] == '\0'))); 282 282 } 283 283 284 - extern int is_empty_dir(const char *dir); 284 + int is_empty_dir(const char *dir); 285 285 286 - extern void setup_standard_excludes(struct dir_struct *dir); 286 + void setup_standard_excludes(struct dir_struct *dir); 287 287 288 288 289 289 /* Constants for remove_dir_recursively: */ ··· 311 311 * This function uses path as temporary scratch space, but restores it 312 312 * before returning. 313 313 */ 314 - extern int remove_dir_recursively(struct strbuf *path, int flag); 314 + int remove_dir_recursively(struct strbuf *path, int flag); 315 315 316 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 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 321 322 322 /* 323 323 * The prefix part of pattern must not contains wildcards. 324 324 */ 325 325 struct pathspec_item; 326 - extern int git_fnmatch(const struct pathspec_item *item, 326 + int git_fnmatch(const struct pathspec_item *item, 327 327 const char *pattern, const char *string, 328 328 int prefix); 329 329 330 - extern int submodule_path_match(const struct index_state *istate, 330 + int submodule_path_match(const struct index_state *istate, 331 331 const struct pathspec *ps, 332 332 const char *submodule_name, 333 333 char *seen); ··· 372 372 * When `recurse_into_nested` is set, recurse into any nested submodules, 373 373 * connecting them as well. 374 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 376 const char *git_dir, 377 377 int recurse_into_nested); 378 - extern void relocate_gitdir(const char *path, 378 + void relocate_gitdir(const char *path, 379 379 const char *old_git_dir, 380 380 const char *new_git_dir); 381 381 #endif
+7 -7
exec-cmd.h
··· 3 3 4 4 struct argv_array; 5 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 12 LAST_ARG_MUST_BE_NULL 13 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 15 16 16 #endif /* GIT_EXEC_CMD_H */
+1 -1
fmt-merge-msg.h
··· 2 2 #define FMT_MERGE_MSG_H 3 3 4 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 6 7 7 #endif /* FMT_MERGE_MSG_H */
+7 -7
fsmonitor.h
··· 10 10 * Read the fsmonitor index extension and (if configured) restore the 11 11 * CE_FSMONITOR_VALID state. 12 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 14 15 15 /* 16 16 * Fill the fsmonitor_dirty ewah bits with their state from the index, 17 17 * before it is split during writing. 18 18 */ 19 - extern void fill_fsmonitor_bitmap(struct index_state *istate); 19 + void fill_fsmonitor_bitmap(struct index_state *istate); 20 20 21 21 /* 22 22 * Write the CE_FSMONITOR_VALID state into the fsmonitor index 23 23 * extension. Reads from the fsmonitor_dirty ewah in the index. 24 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 26 27 27 /* 28 28 * Add/remove the fsmonitor index extension 29 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 32 33 33 /* 34 34 * Add/remove the fsmonitor index extension as necessary based on the current 35 35 * core.fsmonitor setting. 36 36 */ 37 - extern void tweak_fsmonitor(struct index_state *istate); 37 + void tweak_fsmonitor(struct index_state *istate); 38 38 39 39 /* 40 40 * Run the configured fsmonitor integration script and clear the ··· 42 42 * any corresponding untracked cache directory structures. Optimized to only 43 43 * run the first time it is called. 44 44 */ 45 - extern void refresh_fsmonitor(struct index_state *istate); 45 + void refresh_fsmonitor(struct index_state *istate); 46 46 47 47 /* 48 48 * Set the given cache entries CE_FSMONITOR_VALID bit. This should be
+4 -4
gettext.h
··· 28 28 29 29 #define FORMAT_PRESERVING(n) __attribute__((format_arg(n))) 30 30 31 - extern int use_gettext_poison(void); 31 + int use_gettext_poison(void); 32 32 33 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 36 #else 37 37 static inline void git_setup_gettext(void) 38 38 { ··· 87 87 #endif 88 88 89 89 const char *get_preferred_languages(void); 90 - extern int is_utf8_locale(void); 90 + int is_utf8_locale(void); 91 91 92 92 #endif
+54 -54
git-compat-util.h
··· 249 249 250 250 #ifdef MKDIR_WO_TRAILING_SLASH 251 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 253 #endif 254 254 255 255 #ifdef NO_STRUCT_ITIMERVAL ··· 267 267 #include <libgen.h> 268 268 #else 269 269 #define basename gitbasename 270 - extern char *gitbasename(char *); 270 + char *gitbasename(char *); 271 271 #define dirname gitdirname 272 - extern char *gitdirname(char *); 272 + char *gitdirname(char *); 273 273 #endif 274 274 275 275 #ifndef NO_ICONV ··· 446 446 struct strbuf; 447 447 448 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 451 extern NORETURN void usagef(const char *err, ...) __attribute__((format (printf, 1, 2))); 452 452 extern NORETURN void die(const char *err, ...) __attribute__((format (printf, 1, 2))); 453 453 extern NORETURN void die_errno(const char *err, ...) __attribute__((format (printf, 1, 2))); ··· 482 482 #define error_errno(...) (error_errno(__VA_ARGS__), const_error()) 483 483 #endif 484 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 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 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 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 494 495 495 /* 496 496 * If the string "str" begins with the string found in "prefix", return 1. ··· 613 613 614 614 #define mmap git_mmap 615 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 618 619 619 #else /* NO_MMAP || USE_WIN32_MMAP */ 620 620 ··· 668 668 #undef stat 669 669 #endif 670 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 672 #ifdef fstat 673 673 #undef fstat 674 674 #endif 675 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 677 #ifdef lstat 678 678 #undef lstat 679 679 #endif 680 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 682 #endif 683 683 684 684 #define DEFAULT_PACKED_GIT_LIMIT \ ··· 686 686 687 687 #ifdef NO_PREAD 688 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 690 #endif 691 691 /* 692 692 * Forward decl that will remind us if its twin in cache.h changes. 693 693 * This function is used in compat/pread.c. But we can't include 694 694 * cache.h there. 695 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 697 698 698 #ifdef NO_SETENV 699 699 #define setenv gitsetenv 700 - extern int gitsetenv(const char *, const char *, int); 700 + int gitsetenv(const char *, const char *, int); 701 701 #endif 702 702 703 703 #ifdef NO_MKDTEMP 704 704 #define mkdtemp gitmkdtemp 705 - extern char *gitmkdtemp(char *); 705 + char *gitmkdtemp(char *); 706 706 #endif 707 707 708 708 #ifdef NO_UNSETENV 709 709 #define unsetenv gitunsetenv 710 - extern void gitunsetenv(const char *); 710 + void gitunsetenv(const char *); 711 711 #endif 712 712 713 713 #ifdef NO_STRCASESTR 714 714 #define strcasestr gitstrcasestr 715 - extern char *gitstrcasestr(const char *haystack, const char *needle); 715 + char *gitstrcasestr(const char *haystack, const char *needle); 716 716 #endif 717 717 718 718 #ifdef NO_STRLCPY 719 719 #define strlcpy gitstrlcpy 720 - extern size_t gitstrlcpy(char *, const char *, size_t); 720 + size_t gitstrlcpy(char *, const char *, size_t); 721 721 #endif 722 722 723 723 #ifdef NO_STRTOUMAX 724 724 #define strtoumax gitstrtoumax 725 - extern uintmax_t gitstrtoumax(const char *, char **, int); 725 + uintmax_t gitstrtoumax(const char *, char **, int); 726 726 #define strtoimax gitstrtoimax 727 - extern intmax_t gitstrtoimax(const char *, char **, int); 727 + intmax_t gitstrtoimax(const char *, char **, int); 728 728 #endif 729 729 730 730 #ifdef NO_HSTRERROR 731 731 #define hstrerror githstrerror 732 - extern const char *githstrerror(int herror); 732 + const char *githstrerror(int herror); 733 733 #endif 734 734 735 735 #ifdef NO_MEMMEM ··· 761 761 # endif 762 762 # define fopen(a,b) git_fopen(a,b) 763 763 # endif 764 - extern FILE *git_fopen(const char*, const char*); 764 + FILE *git_fopen(const char*, const char*); 765 765 #endif 766 766 767 767 #ifdef SNPRINTF_RETURNS_BOGUS ··· 775 775 #undef vsnprintf 776 776 #endif 777 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 779 const char *format, va_list ap); 780 780 #endif 781 781 ··· 805 805 806 806 #ifdef NO_PTHREADS 807 807 #define atexit git_atexit 808 - extern int git_atexit(void (*handler)(void)); 808 + int git_atexit(void (*handler)(void)); 809 809 #endif 810 810 811 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 813 814 814 static inline size_t st_add(size_t a, size_t b) 815 815 { ··· 845 845 # define xalloca(size) (xmalloc(size)) 846 846 # define xalloca_free(p) (free(p)) 847 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 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 870 871 871 /* 872 872 * FREE_AND_NULL(ptr) is like free(ptr) followed by ptr = NULL. Note ··· 972 972 #define HOST_NAME_MAX 256 973 973 #endif 974 974 975 - extern int xgethostname(char *buf, size_t len); 975 + int xgethostname(char *buf, size_t len); 976 976 977 977 /* in ctype.c, for kwset users */ 978 978 extern const unsigned char tolower_trans_tbl[256]; ··· 1257 1257 return (errno_ == ENOENT || errno_ == ENOTDIR); 1258 1258 } 1259 1259 1260 - extern int cmd_main(int, const char **); 1260 + int cmd_main(int, const char **); 1261 1261 1262 1262 /* 1263 1263 * Intercept all calls to exit() and route them to trace2 to ··· 1280 1280 * an annotation, and does nothing in non-leak-checking builds. 1281 1281 */ 1282 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 1284 #define UNLEAK(var) unleak_memory(&(var), sizeof(var)) 1285 1285 #else 1286 1286 #define UNLEAK(var) do {} while (0)
+11 -11
grep.h
··· 186 186 void *output_priv; 187 187 }; 188 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 192 void grep_commit_pattern_type(enum grep_pattern_type, struct grep_opt *opt); 193 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 200 201 201 struct grep_source { 202 202 char *name; ··· 226 226 227 227 int grep_source(struct grep_opt *opt, struct grep_source *gs); 228 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 231 232 232 /* 233 233 * Mutex used around access to the attributes machinery if
+15 -15
hashmap.h
··· 104 104 * `memihash_cont` is a variant of `memihash` that allows a computation to be 105 105 * continued with another chunk of data. 106 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 112 113 113 /* 114 114 * Converts a cryptographic hash (e.g. SHA-1) into an int-sized hash code ··· 216 216 * parameter may be used to preallocate a sufficiently large table and thus 217 217 * prevent expensive resizing. If 0, the table is dynamically resized. 218 218 */ 219 - extern void hashmap_init(struct hashmap *map, 219 + void hashmap_init(struct hashmap *map, 220 220 hashmap_cmp_fn equals_function, 221 221 const void *equals_function_data, 222 222 size_t initial_size); ··· 227 227 * If `free_entries` is true, each hashmap_entry in the map is freed as well 228 228 * using stdlibs free(). 229 229 */ 230 - extern void hashmap_free(struct hashmap *map, int free_entries); 230 + void hashmap_free(struct hashmap *map, int free_entries); 231 231 232 232 /* hashmap_entry functions */ 233 233 ··· 284 284 * If an entry with matching hash code is found, `key` and `keydata` are passed 285 285 * to `hashmap_cmp_fn` to decide whether the entry matches the key. 286 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 288 const void *keydata); 289 289 290 290 /* ··· 316 316 * `entry` is the hashmap_entry to start the search from, obtained via a previous 317 317 * call to `hashmap_get` or `hashmap_get_next`. 318 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 320 321 321 /* 322 322 * Adds a hashmap entry. This allows to add duplicate entries (i.e. ··· 325 325 * `map` is the hashmap structure. 326 326 * `entry` is the entry to add. 327 327 */ 328 - extern void hashmap_add(struct hashmap *map, void *entry); 328 + void hashmap_add(struct hashmap *map, void *entry); 329 329 330 330 /* 331 331 * Adds or replaces a hashmap entry. If the hashmap contains duplicate ··· 335 335 * `entry` is the entry to add or replace. 336 336 * Returns the replaced entry, or NULL if not found (i.e. the entry was added). 337 337 */ 338 - extern void *hashmap_put(struct hashmap *map, void *entry); 338 + void *hashmap_put(struct hashmap *map, void *entry); 339 339 340 340 /* 341 341 * Removes a hashmap entry matching the specified key. If the hashmap contains ··· 344 344 * 345 345 * Argument explanation is the same as in `hashmap_get`. 346 346 */ 347 - extern void *hashmap_remove(struct hashmap *map, const void *key, 347 + void *hashmap_remove(struct hashmap *map, const void *key, 348 348 const void *keydata); 349 349 350 350 /* ··· 365 365 }; 366 366 367 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 369 370 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 372 373 373 /* Initializes the iterator and returns the first entry, if any. */ 374 374 static inline void *hashmap_iter_first(struct hashmap *map, ··· 429 429 * 430 430 * Uses a hashmap to store the pool of interned strings. 431 431 */ 432 - extern const void *memintern(const void *data, size_t len); 432 + const void *memintern(const void *data, size_t len); 433 433 static inline const char *strintern(const char *string) 434 434 { 435 435 return memintern(string, strlen(string));
+15 -15
help.h
··· 19 19 putchar(c); 20 20 } 21 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 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 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 34 struct cmdnames *main_cmds, 35 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 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 41 42 42 /* 43 43 * call this to die(), when it is suspected that the user mistyped a 44 44 * ref to the command, to give suggested "correct" refs. 45 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 47 48 48 static inline void list_config_item(struct string_list *list, 49 49 const char *prefix,
+26 -26
http.h
··· 75 75 }; 76 76 77 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 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 83 #endif 84 84 85 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 90 91 91 /* 92 92 * This will run one slot to completion in a blocking manner, similar to how ··· 98 98 struct slot_results *results); 99 99 100 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 104 #endif 105 105 106 - extern void http_init(struct remote *remote, const char *url, 106 + void http_init(struct remote *remote, const char *url, 107 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 110 111 111 extern long int git_curl_ipresolve; 112 112 extern int active_requests; ··· 146 146 size_t errorlen); 147 147 148 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 150 const char *hex, 151 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 153 int only_two_digit_prefix); 154 154 155 155 /* Options for http_get_*() */ ··· 204 204 */ 205 205 int http_get_strbuf(const char *url, struct strbuf *result, struct http_get_options *options); 206 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 208 209 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 211 struct packed_git **packs_head); 212 212 213 213 struct http_pack_request { ··· 219 219 struct active_request_slot *slot; 220 220 }; 221 221 222 - extern struct http_pack_request *new_http_pack_request( 222 + struct http_pack_request *new_http_pack_request( 223 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 226 227 227 /* Helpers for fetching object */ 228 228 struct http_object_request { ··· 241 241 struct active_request_slot *slot; 242 242 }; 243 243 244 - extern struct http_object_request *new_http_object_request( 244 + struct http_object_request *new_http_object_request( 245 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 250 251 251 /* setup routine for curl_easy_setopt CURLOPT_DEBUGFUNCTION */ 252 252 void setup_curl_trace(CURL *handle);
+5 -5
kwset.h
··· 37 37 if enough memory cannot be obtained. The argument if non-NULL 38 38 specifies a table of character translations to be applied to all 39 39 pattern and search text. */ 40 - extern kwset_t kwsalloc(unsigned char const *); 40 + kwset_t kwsalloc(unsigned char const *); 41 41 42 42 /* Incrementally extend the keyword set to include the given string. 43 43 Return NULL for success, or an error message. Remember an index 44 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 46 47 47 /* When the keyword set has been completely built, prepare it for 48 48 use. Return NULL for success, or an error message. */ 49 - extern const char *kwsprep(kwset_t); 49 + const char *kwsprep(kwset_t); 50 50 51 51 /* Search through the given buffer for a member of the keyword set. 52 52 Return a pointer to the leftmost longest match found, or NULL if ··· 54 54 the matching substring in the integer it points to. Similarly, 55 55 if foundindex is non-NULL, store the index of the particular 56 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 58 59 59 /* Deallocate the given keyword set and all its associated storage. */ 60 - extern void kwsfree(kwset_t); 60 + void kwsfree(kwset_t); 61 61
+8 -8
line-log.h
··· 25 25 struct range_set target; 26 26 }; 27 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 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 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 34 /* 35 35 * In-place pass of sorting and merging the ranges in the range set, 36 36 * to sort and make the ranges disjoint. 37 37 */ 38 - extern void sort_and_merge_range_set(struct range_set *); 38 + void sort_and_merge_range_set(struct range_set *); 39 39 40 40 /* Linked list of interesting files and their associated ranges. The 41 41 * list must be kept sorted by path. ··· 54 54 struct diff_ranges diff; 55 55 }; 56 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 58 59 - extern int line_log_filter(struct rev_info *rev); 59 + int line_log_filter(struct rev_info *rev); 60 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 62 63 63 #endif /* LINE_LOG_H */
+5 -5
lockfile.h
··· 159 159 * timeout_ms is -1, retry indefinitely. The flags argument and error 160 160 * handling are described above. 161 161 */ 162 - extern int hold_lock_file_for_update_timeout( 162 + int hold_lock_file_for_update_timeout( 163 163 struct lock_file *lk, const char *path, 164 164 int flags, long timeout_ms); 165 165 ··· 188 188 * of `hold_lock_file_for_update()` to lock `path`. `err` should be the 189 189 * `errno` set by the failing call. 190 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 192 struct strbuf *buf); 193 193 194 194 /* ··· 197 197 * `errno` set by the failing 198 198 * call. 199 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 201 202 202 /* 203 203 * Associate a stdio stream with the lockfile (which must still be ··· 234 234 * Return the path of the file that is locked by the specified 235 235 * lock_file object. The caller must free the memory. 236 236 */ 237 - extern char *get_locked_file_path(struct lock_file *lk); 237 + char *get_locked_file_path(struct lock_file *lk); 238 238 239 239 /* 240 240 * If the lockfile is still open, close it (and the file pointer if it ··· 282 282 * call `commit_lock_file()` for a `lock_file` object that is not 283 283 * currently locked. 284 284 */ 285 - extern int commit_lock_file(struct lock_file *lk); 285 + int commit_lock_file(struct lock_file *lk); 286 286 287 287 /* 288 288 * Like `commit_lock_file()`, but rename the lockfile to the provided
+1 -1
ls-refs.h
··· 4 4 struct repository; 5 5 struct argv_array; 6 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 8 struct packet_reader *request); 9 9 10 10 #endif /* LS_REFS_H */
+3 -3
mailinfo.h
··· 39 39 int input_error; 40 40 }; 41 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 45 46 46 #endif /* MAILINFO_H */
+1 -1
merge-blobs.h
··· 4 4 struct blob; 5 5 struct index_state; 6 6 7 - extern void *merge_blobs(struct index_state *, const char *, 7 + void *merge_blobs(struct index_state *, const char *, 8 8 struct blob *, struct blob *, 9 9 struct blob *, unsigned long *); 10 10
+8 -8
object-store.h
··· 162 162 void *map_loose_object(struct repository *r, const struct object_id *oid, 163 163 unsigned long *size); 164 164 165 - extern void *read_object_file_extended(struct repository *r, 165 + void *read_object_file_extended(struct repository *r, 166 166 const struct object_id *oid, 167 167 enum object_type *type, 168 168 unsigned long *size, int lookup_replace); ··· 180 180 /* Read and unpack an object file into memory, write memory to an object file */ 181 181 int oid_object_info(struct repository *r, const struct object_id *, unsigned long *); 182 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 184 const char *type, struct object_id *oid); 185 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 187 const char *type, struct object_id *oid); 188 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 190 const char *type, struct object_id *oid, 191 191 unsigned flags); 192 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 194 struct object_id *oid); 195 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 197 198 198 /* 199 199 * Open the loose object at path, check its hash, and return the contents, ··· 227 227 * with the specified name. This function does not respect replace 228 228 * references. 229 229 */ 230 - extern int has_loose_object_nonlocal(const struct object_id *); 230 + int has_loose_object_nonlocal(const struct object_id *); 231 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 233 234 234 struct object_info { 235 235 /* Request */
+6 -6
object.h
··· 90 90 struct object_id oid; 91 91 }; 92 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 95 #define type_from_string(str) type_from_string_gently(str, -1, 0) 96 96 97 97 /* 98 98 * Return the current number of buckets in the object hashmap. 99 99 */ 100 - extern unsigned int get_max_object_index(void); 100 + unsigned int get_max_object_index(void); 101 101 102 102 /* 103 103 * Return the object from the specified bucket in the object hashmap. 104 104 */ 105 - extern struct object *get_indexed_object(unsigned int); 105 + struct object *get_indexed_object(unsigned int); 106 106 107 107 /* 108 108 * This can be used to see if we have heard of the object before, but ··· 118 118 */ 119 119 struct object *lookup_object(struct repository *r, const unsigned char *sha1); 120 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 122 123 123 void *object_as_type(struct repository *r, struct object *obj, enum object_type type, int quiet); 124 124 ··· 189 189 /* 190 190 * Clear the specified object flags from all in-core commit objects. 191 191 */ 192 - extern void clear_commit_marks_all(unsigned int flags); 192 + void clear_commit_marks_all(unsigned int flags); 193 193 194 194 #endif /* OBJECT_H */
+5 -5
oidmap.h
··· 33 33 * parameter may be used to preallocate a sufficiently large table and thus 34 34 * prevent expensive resizing. If 0, the table is dynamically resized. 35 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 37 38 38 /* 39 39 * Frees an oidmap structure and allocated memory. ··· 41 41 * If `free_entries` is true, each oidmap_entry in the map is freed as well 42 42 * using stdlibs free(). 43 43 */ 44 - extern void oidmap_free(struct oidmap *map, int free_entries); 44 + void oidmap_free(struct oidmap *map, int free_entries); 45 45 46 46 /* 47 47 * Returns the oidmap entry for the specified oid, or NULL if not found. 48 48 */ 49 - extern void *oidmap_get(const struct oidmap *map, 49 + void *oidmap_get(const struct oidmap *map, 50 50 const struct object_id *key); 51 51 52 52 /* ··· 57 57 * 58 58 * Returns the replaced entry, or NULL if not found (i.e. the entry was added). 59 59 */ 60 - extern void *oidmap_put(struct oidmap *map, void *entry); 60 + void *oidmap_put(struct oidmap *map, void *entry); 61 61 62 62 /* 63 63 * Removes an oidmap entry matching the specified oid. 64 64 * 65 65 * Returns the removed entry, or NULL if not found. 66 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 68 69 69 70 70 struct oidmap_iter {
+12 -12
pack.h
··· 55 55 uint32_t *anomaly; 56 56 }; 57 57 58 - extern void reset_pack_idx_option(struct pack_idx_option *); 58 + void reset_pack_idx_option(struct pack_idx_option *); 59 59 60 60 /* 61 61 * Packed object index header ··· 79 79 /* Note, the data argument could be NULL if object type is blob */ 80 80 typedef int (*verify_fn)(const struct object_id *, enum object_type, unsigned long, void*, int*); 81 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 89 90 90 /* 91 91 * The "hdr" output buffer should be at least this big, which will handle sizes 92 92 * up to 2^67. 93 93 */ 94 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 96 enum object_type, uintmax_t); 97 97 98 98 #define PH_ERROR_EOF (-1) 99 99 #define PH_ERROR_PACK_SIGNATURE (-2) 100 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 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 105 106 106 #endif
+37 -37
packfile.h
··· 15 15 * 16 16 * Example: odb_pack_name(out, sha1, "idx") => ".git/objects/pack/pack-1234..idx" 17 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 19 20 20 /* 21 21 * Return the name of the (local) packfile with the specified sha1 in 22 22 * its name. The return value is a pointer to memory that is 23 23 * overwritten each time this function is called. 24 24 */ 25 - extern char *sha1_pack_name(const unsigned char *sha1); 25 + char *sha1_pack_name(const unsigned char *sha1); 26 26 27 27 /* 28 28 * Return the name of the (local) pack index file with the specified 29 29 * sha1 in its name. The return value is a pointer to memory that is 30 30 * overwritten each time this function is called. 31 31 */ 32 - extern char *sha1_pack_index_name(const unsigned char *sha1); 32 + char *sha1_pack_index_name(const unsigned char *sha1); 33 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 35 36 36 typedef void each_file_in_pack_dir_fn(const char *full_path, size_t full_path_len, 37 37 const char *file_pach, void *data); ··· 45 45 #define PACKDIR_FILE_GARBAGE 4 46 46 extern void (*report_garbage)(unsigned seen_bits, const char *path); 47 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 50 51 51 struct packed_git *get_packed_git(struct repository *r); 52 52 struct list_head *get_packed_git_mru(struct repository *r); ··· 59 59 */ 60 60 unsigned long approximate_object_count(void); 61 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 63 struct packed_git *packs); 64 64 65 - extern void pack_report(void); 65 + void pack_report(void); 66 66 67 67 /* 68 68 * mmap the index file for the specified packfile (if it is not 69 69 * already mmapped). Return 0 on success. 70 70 */ 71 - extern int open_pack_index(struct packed_git *); 71 + int open_pack_index(struct packed_git *); 72 72 73 73 /* 74 74 * munmap the index file for the specified packfile (if it is 75 75 * currently mmapped). 76 76 */ 77 - extern void close_pack_index(struct packed_git *); 77 + void close_pack_index(struct packed_git *); 78 78 79 79 int close_pack_fd(struct packed_git *p); 80 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 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 90 91 91 /* 92 92 * Make sure that a pointer access into an mmap'd index file is within bounds, ··· 96 96 * (like the 64-bit extended offset table), as we compare the size to the 97 97 * fixed-length parts when we open the file. 98 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 100 101 101 /* 102 102 * Perform binary search on a pack-index for a given oid. Packfile is expected to ··· 112 112 * at the SHA-1 within the mmapped index. Return NULL if there is an 113 113 * error. 114 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 116 /* 117 117 * Like nth_packed_object_sha1, but write the data into the object specified by 118 118 * the the first argument. Returns the first argument on success, and NULL on 119 119 * error. 120 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 122 123 123 /* 124 124 * Return the offset of the nth object within the specified packfile. 125 125 * The index must already be opened. 126 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 128 129 129 /* 130 130 * If the object named sha1 is present in the specified packfile, 131 131 * return its offset within the packfile; otherwise, return 0. 132 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 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 140 141 - extern void release_pack_memory(size_t); 141 + void release_pack_memory(size_t); 142 142 143 143 /* global flag to enable extra checks when accessing packed objects */ 144 144 extern int do_check_packed_object_crc; 145 145 146 - extern int packed_object_info(struct repository *r, 146 + int packed_object_info(struct repository *r, 147 147 struct packed_git *pack, 148 148 off_t offset, struct object_info *); 149 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 152 153 153 /* 154 154 * Iff a pack file in the given repository contains the object named by sha1, 155 155 * return true and store its location to e. 156 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 158 159 - extern int has_object_pack(const struct object_id *oid); 159 + int has_object_pack(const struct object_id *oid); 160 160 161 - extern int has_pack_index(const unsigned char *sha1); 161 + int has_pack_index(const unsigned char *sha1); 162 162 163 163 /* 164 164 * Return 1 if an object in a promisor packfile is or refers to the given 165 165 * object, 0 otherwise. 166 166 */ 167 - extern int is_promisor_object(const struct object_id *oid); 167 + int is_promisor_object(const struct object_id *oid); 168 168 169 169 /* 170 170 * Expose a function for fuzz testing. ··· 176 176 * have a convenient entry-point for fuzz testing. For real uses, you should 177 177 * probably use open_pack_index() or parse_pack_index() instead. 178 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 180 size_t idx_size, struct packed_git *p); 181 181 182 182 #endif
+1 -1
path.h
··· 143 143 const char *fmt, ...) 144 144 __attribute__((format (printf, 3, 4))); 145 145 146 - extern void report_linked_checkout_garbage(void); 146 + void report_linked_checkout_garbage(void); 147 147 148 148 /* 149 149 * You can define a static memoized git path like:
+3 -3
pkt-line.h
··· 172 172 * Initialize a 'struct packet_reader' object which is an 173 173 * abstraction around the 'packet_read_with_status()' function. 174 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 176 char *src_buffer, size_t src_len, 177 177 int options); 178 178 ··· 186 186 * 'line' is set to point at the read line 187 187 * PACKET_READ_FLUSH: 'pktlen' is set to '0' and 'line' is set to NULL 188 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 190 191 191 /* 192 192 * Peek the next packet line without consuming it and return the status. ··· 196 196 * Peeking multiple times without calling 'packet_reader_read()' will return 197 197 * the same result. 198 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 200 201 201 #define DEFAULT_PACKET_MAX 1000 202 202 #define LARGE_PACKET_MAX 65520
+1 -1
ppc/sha1.c
··· 10 10 #include <string.h> 11 11 #include "sha1.h" 12 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 14 unsigned int nblocks); 15 15 16 16 int ppc_SHA1_Init(ppc_SHA_CTX *c)
+5 -5
prio-queue.h
··· 37 37 /* 38 38 * Add the "thing" to the queue. 39 39 */ 40 - extern void prio_queue_put(struct prio_queue *, void *thing); 40 + void prio_queue_put(struct prio_queue *, void *thing); 41 41 42 42 /* 43 43 * Extract the "thing" that compares the smallest out of the queue, 44 44 * or NULL. If compare function is NULL, the queue acts as a LIFO 45 45 * stack. 46 46 */ 47 - extern void *prio_queue_get(struct prio_queue *); 47 + void *prio_queue_get(struct prio_queue *); 48 48 49 49 /* 50 50 * Gain access to the "thing" that would be returned by 51 51 * prio_queue_get, but do not remove it from the queue. 52 52 */ 53 - extern void *prio_queue_peek(struct prio_queue *); 53 + void *prio_queue_peek(struct prio_queue *); 54 54 55 - extern void clear_prio_queue(struct prio_queue *); 55 + void clear_prio_queue(struct prio_queue *); 56 56 57 57 /* Reverse the LIFO elements */ 58 - extern void prio_queue_reverse(struct prio_queue *); 58 + void prio_queue_reverse(struct prio_queue *); 59 59 60 60 #endif /* PRIO_QUEUE_H */
+3 -3
protocol.h
··· 14 14 * 'protocol.version' config. If unconfigured, a value of 'protocol_v0' is 15 15 * returned. 16 16 */ 17 - extern enum protocol_version get_protocol_version_config(void); 17 + enum protocol_version get_protocol_version_config(void); 18 18 19 19 /* 20 20 * Used by a server to determine which protocol version should be used based on ··· 23 23 * request a particular protocol version, a default of 'protocol_v0' will be 24 24 * used. 25 25 */ 26 - extern enum protocol_version determine_protocol_version_server(void); 26 + enum protocol_version determine_protocol_version_server(void); 27 27 28 28 /* 29 29 * Used by a client to determine which protocol version the server is speaking 30 30 * based on the server's initial response. 31 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 33 34 34 #endif /* PROTOCOL_H */
+15 -15
quote.h
··· 29 29 * sq_quotef() quotes the entire formatted string as a single result. 30 30 */ 31 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 34 extern void sq_quotef(struct strbuf *, const char *fmt, ...); 35 35 36 36 /* ··· 45 45 * NULL if the input does not look like what sq_quote would have 46 46 * produced. 47 47 */ 48 - extern char *sq_dequote(char *); 48 + char *sq_dequote(char *); 49 49 50 50 /* 51 51 * Same as the above, but can be used to unwrap many arguments in the 52 52 * same string separated by space. Like sq_quote, it works in place, 53 53 * modifying arg and appending pointers into it to argv. 54 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 56 57 57 /* 58 58 * Same as above, but store the unquoted strings in an argv_array. We will ··· 60 60 * will duplicate and take ownership of the strings. 61 61 */ 62 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 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 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 71 FILE *fp, int terminator); 72 72 73 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 75 struct strbuf *out); 76 76 77 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 82 83 83 #endif
+2 -2
reachable.h
··· 4 4 struct progress; 5 5 struct rev_info; 6 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 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 10 timestamp_t mark_recent, struct progress *); 11 11 12 12 #endif
+8 -8
reflog-walk.h
··· 6 6 struct commit; 7 7 struct reflog_walk_info; 8 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 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 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 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 19 struct reflog_walk_info *reflog_info, 20 20 const struct date_mode *dmode, int force_date, 21 21 int shorten); 22 22 23 - extern int reflog_walk_empty(struct reflog_walk_info *walk); 23 + int reflog_walk_empty(struct reflog_walk_info *walk); 24 24 25 25 struct commit *next_reflog_entry(struct reflog_walk_info *reflog_info); 26 26
+1 -1
refs.h
··· 111 111 112 112 int is_branch(const char *refname); 113 113 114 - extern int refs_init_db(struct strbuf *err); 114 + int refs_init_db(struct strbuf *err); 115 115 116 116 /* 117 117 * If refname is a non-symbolic reference that refers to a tag object,
+6 -6
remote.h
··· 119 119 #define REF_HEADS (1u << 1) 120 120 #define REF_TAGS (1u << 2) 121 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 123 124 124 struct ref *alloc_ref(const char *name); 125 125 struct ref *copy_ref(const struct ref *ref); 126 126 struct ref *copy_ref_list(const struct ref *ref); 127 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 129 int ref_compare_name(const void *, const void *); 130 130 131 131 int check_ref_type(const struct ref *ref, int flags); ··· 139 139 struct packet_reader; 140 140 struct argv_array; 141 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 143 struct ref **list, unsigned int flags, 144 144 struct oid_array *extra_have, 145 145 struct oid_array *shallow_points); 146 146 147 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 149 struct ref **list, int for_push, 150 150 const struct argv_array *ref_prefixes, 151 151 const struct string_list *server_options); ··· 287 287 int alloc; 288 288 }; 289 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 291 292 - extern int is_empty_cas(const struct push_cas_option *); 292 + int is_empty_cas(const struct push_cas_option *); 293 293 void apply_push_cas(struct push_cas_option *, struct remote *, struct ref *); 294 294 295 295 #endif
+1 -1
replace-object.h
··· 16 16 * This internal function is only declared here for the benefit of 17 17 * lookup_replace_object(). Please do not call it directly. 18 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 20 const struct object_id *oid); 21 21 22 22 /*
+7 -7
resolve-undo.h
··· 8 8 struct object_id oid[3]; 9 9 }; 10 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 18 19 19 #endif
+3 -3
run-command.h
··· 55 55 #define CHILD_PROCESS_INIT { NULL, ARGV_ARRAY_INIT, ARGV_ARRAY_INIT } 56 56 void child_process_init(struct child_process *); 57 57 void child_process_clear(struct child_process *); 58 - extern int is_executable(const char *name); 58 + int is_executable(const char *name); 59 59 60 60 int start_command(struct child_process *); 61 61 int finish_command(struct child_process *); ··· 67 67 * or disabled. Note that this points to static storage that will be 68 68 * overwritten by further calls to find_hook and run_hook_*. 69 69 */ 70 - extern const char *find_hook(const char *name); 70 + const char *find_hook(const char *name); 71 71 LAST_ARG_MUST_BE_NULL 72 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 74 75 75 #define RUN_COMMAND_NO_STDIN 1 76 76 #define RUN_GIT_CMD 2 /*If this is to be git sub-command */
+2 -2
serve.h
··· 2 2 #define SERVE_H 3 3 4 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 6 const char **value); 7 7 8 8 struct serve_options { ··· 10 10 unsigned stateless_rpc; 11 11 }; 12 12 #define SERVE_OPTIONS_INIT { 0 } 13 - extern void serve(struct serve_options *options); 13 + void serve(struct serve_options *options); 14 14 15 15 #endif /* SERVE_H */
+1 -1
sha1-lookup.h
··· 3 3 4 4 typedef const unsigned char *sha1_access_fn(size_t index, void *table); 5 5 6 - extern int sha1_pos(const unsigned char *sha1, 6 + int sha1_pos(const unsigned char *sha1, 7 7 void *table, 8 8 size_t nr, 9 9 sha1_access_fn fn);
+4 -4
streaming.h
··· 8 8 /* opaque */ 9 9 struct git_istream; 10 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 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 16 17 17 #endif /* STREAMING_H */
+1 -1
string-list.h
··· 174 174 * Remove the given string from the sorted list. If the string 175 175 * doesn't exist, the list is not altered. 176 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 178 int free_util); 179 179 180 180 /**
+1 -1
sub-process.h
··· 42 42 /* subprocess functions */ 43 43 44 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 46 const void *e1, 47 47 const void *e2, 48 48 const void *unused_keydata);
+10 -10
submodule-config.h
··· 30 30 struct submodule_cache; 31 31 struct repository; 32 32 33 - extern void submodule_cache_free(struct submodule_cache *cache); 33 + void submodule_cache_free(struct submodule_cache *cache); 34 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 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 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 44 const struct submodule *submodule_from_name(struct repository *r, 45 45 const struct object_id *commit_or_tree, 46 46 const char *name); ··· 66 66 * New helpers to retrieve arbitrary configuration from the '.gitmodules' file 67 67 * should NOT be added. 68 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 71 72 72 #endif /* SUBMODULE_CONFIG_H */
+7 -7
tag.h
··· 11 11 char *tag; 12 12 timestamp_t date; 13 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 21 const char *name_to_report, unsigned flags); 22 22 23 23 #endif /* TAG_H */
+13 -13
tempfile.h
··· 89 89 * a tempfile (whose "fd" member can be used for writing to it), or 90 90 * NULL on error. It is an error if a file already exists at that path. 91 91 */ 92 - extern struct tempfile *create_tempfile(const char *path); 92 + struct tempfile *create_tempfile(const char *path); 93 93 94 94 /* 95 95 * Register an existing file as a tempfile, meaning that it will be ··· 97 97 * but it can be worked with like any other closed tempfile (for 98 98 * example, it can be opened using reopen_tempfile()). 99 99 */ 100 - extern struct tempfile *register_tempfile(const char *path); 100 + struct tempfile *register_tempfile(const char *path); 101 101 102 102 103 103 /* ··· 136 136 */ 137 137 138 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 140 int suffixlen, int mode); 141 141 142 142 /* See "mks_tempfile functions" above. */ ··· 159 159 } 160 160 161 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 163 int suffixlen, int mode); 164 164 165 165 /* See "mks_tempfile functions" above. */ ··· 182 182 } 183 183 184 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 186 187 187 /* See "mks_tempfile functions" above. */ 188 188 static inline struct tempfile *xmks_tempfile(const char *filename_template) ··· 196 196 * stream is closed automatically when `close_tempfile_gently()` is called or 197 197 * when the file is deleted or renamed. 198 198 */ 199 - extern FILE *fdopen_tempfile(struct tempfile *tempfile, const char *mode); 199 + FILE *fdopen_tempfile(struct tempfile *tempfile, const char *mode); 200 200 201 201 static inline int is_tempfile_active(struct tempfile *tempfile) 202 202 { ··· 207 207 * Return the path of the lockfile. The return value is a pointer to a 208 208 * field within the lock_file object and should not be freed. 209 209 */ 210 - extern const char *get_tempfile_path(struct tempfile *tempfile); 210 + const char *get_tempfile_path(struct tempfile *tempfile); 211 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 214 215 215 /* 216 216 * If the temporary file is still open, close it (and the file pointer ··· 220 220 * should eventually be called regardless of whether `close_tempfile_gently()` 221 221 * succeeds. 222 222 */ 223 - extern int close_tempfile_gently(struct tempfile *tempfile); 223 + int close_tempfile_gently(struct tempfile *tempfile); 224 224 225 225 /* 226 226 * Re-open a temporary file that has been closed using ··· 241 241 * 242 242 * * `rename_tempfile()` to move the file to its permanent location. 243 243 */ 244 - extern int reopen_tempfile(struct tempfile *tempfile); 244 + int reopen_tempfile(struct tempfile *tempfile); 245 245 246 246 /* 247 247 * Close the file descriptor and/or file pointer and remove the ··· 249 249 * `delete_tempfile()` for a `tempfile` object that has already been 250 250 * deleted or renamed. 251 251 */ 252 - extern void delete_tempfile(struct tempfile **tempfile_p); 252 + void delete_tempfile(struct tempfile **tempfile_p); 253 253 254 254 /* 255 255 * Close the file descriptor and/or file pointer if they are still ··· 260 260 * `rename(2)`. It is a bug to call `rename_tempfile()` for a 261 261 * `tempfile` object that is not currently active. 262 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 264 265 265 #endif /* TEMPFILE_H */
+8 -8
trace.h
··· 17 17 extern struct trace_key trace_perf_key; 18 18 extern struct trace_key trace_setup_key; 19 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 26 uint64_t trace_performance_enter(void); 27 27 28 28 #ifndef HAVE_VARIADIC_MACROS ··· 36 36 __attribute__((format (printf, 2, 3))) 37 37 extern void trace_argv_printf(const char **argv, const char *format, ...); 38 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 40 41 41 /* Prints elapsed time (in nanoseconds) if GIT_TRACE_PERFORMANCE is enabled. */ 42 42 __attribute__((format (printf, 2, 3))) ··· 137 137 __attribute__((format (printf, 4, 5))) 138 138 extern void trace_argv_printf_fl(const char *file, int line, const char **argv, 139 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 141 const struct strbuf *data); 142 142 __attribute__((format (printf, 4, 5))) 143 143 extern void trace_performance_fl(const char *file, int line,
+2 -2
transport.h
··· 134 134 #define TRANSPORT_PUSH_OPTIONS (1<<14) 135 135 #define TRANSPORT_RECURSE_SUBMODULES_ONLY (1<<15) 136 136 137 - extern int transport_summary_width(const struct ref *refs); 137 + int transport_summary_width(const struct ref *refs); 138 138 139 139 /* Returns a transport suitable for the url */ 140 140 struct transport *transport_get(struct remote *, const char *); ··· 263 263 int verbose, int porcelain, unsigned int *reject_reasons); 264 264 265 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 267 #endif
+2 -2
tree-walk.h
··· 67 67 }; 68 68 69 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 72 73 73 static inline int traverse_path_len(const struct traverse_info *info, const struct name_entry *n) 74 74 {
+2 -2
upload-pack.h
··· 13 13 struct repository; 14 14 struct argv_array; 15 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 17 struct packet_reader *request); 18 18 19 19 struct strbuf; 20 - extern int upload_pack_advertise(struct repository *r, 20 + int upload_pack_advertise(struct repository *r, 21 21 struct strbuf *value); 22 22 23 23 #endif /* UPLOAD_PACK_H */
+8 -8
url.h
··· 3 3 4 4 struct strbuf; 5 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 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 15 16 16 #endif /* URL_H */
+2 -2
urlmatch.h
··· 33 33 * '?...' and '#...' portion; will always be >= 1 */ 34 34 }; 35 35 36 - extern char *url_normalize(const char *, struct url_info *); 36 + char *url_normalize(const char *, struct url_info *); 37 37 38 38 struct urlmatch_item { 39 39 size_t hostmatch_len; ··· 52 52 int (*cascade_fn)(const char *var, const char *value, void *cb); 53 53 }; 54 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 56 57 57 #endif /* URL_MATCH_H */
+1 -1
utf8.h
··· 16 16 int utf8_fprintf(FILE *, const char *, ...); 17 17 18 18 extern const char utf8_bom[]; 19 - extern int skip_utf8_bom(char **, size_t); 19 + int skip_utf8_bom(char **, size_t); 20 20 21 21 void strbuf_add_wrapped_text(struct strbuf *buf, 22 22 const char *text, int indent, int indent2, int width);
+2 -2
varint.h
··· 1 1 #ifndef VARINT_H 2 2 #define VARINT_H 3 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 6 7 7 #endif /* VARINT_H */
+1 -1
vcs-svn/sliding_window.h
··· 13 13 14 14 #define SLIDING_VIEW_INIT(input, len) { (input), 0, 0, (len), STRBUF_INIT } 15 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 17 18 18 #endif
+1 -1
vcs-svn/svndiff.h
··· 4 4 struct line_buffer; 5 5 struct sliding_view; 6 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 8 struct sliding_view *preimage, FILE *postimage); 9 9 10 10 #endif
+10 -10
worktree.h
··· 30 30 * The caller is responsible for freeing the memory from the returned 31 31 * worktree(s). 32 32 */ 33 - extern struct worktree **get_worktrees(unsigned flags); 33 + struct worktree **get_worktrees(unsigned flags); 34 34 35 35 /* 36 36 * Returns 1 if linked worktrees exist, 0 otherwise. 37 37 */ 38 - extern int submodule_uses_worktrees(const char *path); 38 + int submodule_uses_worktrees(const char *path); 39 39 40 40 /* 41 41 * Return git dir of the worktree. Note that the path may be relative. 42 42 * If wt is NULL, git dir of current worktree is returned. 43 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 45 46 46 /* 47 47 * Search a worktree that can be unambiguously identified by 48 48 * "arg". "prefix" must not be NULL. 49 49 */ 50 - extern struct worktree *find_worktree(struct worktree **list, 50 + struct worktree *find_worktree(struct worktree **list, 51 51 const char *prefix, 52 52 const char *arg); 53 53 54 54 /* 55 55 * Return true if the given worktree is the main one. 56 56 */ 57 - extern int is_main_worktree(const struct worktree *wt); 57 + int is_main_worktree(const struct worktree *wt); 58 58 59 59 /* 60 60 * Return the reason string if the given worktree is locked or NULL 61 61 * otherwise. 62 62 */ 63 - extern const char *worktree_lock_reason(struct worktree *wt); 63 + const char *worktree_lock_reason(struct worktree *wt); 64 64 65 65 #define WT_VALIDATE_WORKTREE_MISSING_OK (1 << 0) 66 66 ··· 68 68 * Return zero if the worktree is in good condition. Error message is 69 69 * returned if "errmsg" is not NULL. 70 70 */ 71 - extern int validate_worktree(const struct worktree *wt, 71 + int validate_worktree(const struct worktree *wt, 72 72 struct strbuf *errmsg, 73 73 unsigned flags); 74 74 75 75 /* 76 76 * Update worktrees/xxx/gitdir with the new path. 77 77 */ 78 - extern void update_worktree_location(struct worktree *wt, 78 + void update_worktree_location(struct worktree *wt, 79 79 const char *path_); 80 80 81 81 /* 82 82 * Free up the memory for worktree(s) 83 83 */ 84 - extern void free_worktrees(struct worktree **); 84 + void free_worktrees(struct worktree **); 85 85 86 86 /* 87 87 * Check if a per-worktree symref points to a ref in the main worktree 88 88 * or any linked worktree, and return the worktree that holds the ref, 89 89 * or NULL otherwise. The result may be destroyed by the next call. 90 90 */ 91 - extern const struct worktree *find_shared_symref(const char *symref, 91 + const struct worktree *find_shared_symref(const char *symref, 92 92 const char *target); 93 93 94 94 /*
+5 -5
xdiff-interface.h
··· 27 27 void read_mmblob(mmfile_t *ptr, const struct object_id *oid); 28 28 int buffer_is_binary(const char *ptr, unsigned long size); 29 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 33 extern int git_xmerge_style; 34 34 35 35 /* ··· 46 46 * The `flags` given as XDF_WHITESPACE_FLAGS determine how white spaces 47 47 * are treated for the comparision. 48 48 */ 49 - extern int xdiff_compare_lines(const char *l1, long s1, 49 + int xdiff_compare_lines(const char *l1, long s1, 50 50 const char *l2, long s2, long flags); 51 51 52 52 /* ··· 54 54 * The `flags` given as XDF_WHITESPACE_FLAGS determine how white spaces 55 55 * are treated for the hash. 56 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 58 59 59 #endif