From e93ca2b1af8a086a933d4fb09ea8fa55abd0a267 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Thu, 30 Mar 2023 00:00:55 -0700 Subject: [PATCH] 'extern' in function declarations is redundant --- include/wimlib/apply.h | 14 ++++----- include/wimlib/avl_tree.h | 16 +++++----- include/wimlib/blob_table.h | 50 +++++++++++++++--------------- include/wimlib/decompress_common.h | 2 +- include/wimlib/dentry.h | 46 +++++++++++++-------------- include/wimlib/divsufsort.h | 2 +- include/wimlib/encoding.h | 18 +++++------ include/wimlib/error.h | 10 +++--- include/wimlib/file_io.h | 12 +++---- include/wimlib/glob.h | 4 +-- include/wimlib/inode.h | 44 +++++++++++++------------- include/wimlib/inode_table.h | 10 +++--- include/wimlib/integrity.h | 6 ++-- include/wimlib/lcpit_matchfinder.h | 12 +++---- include/wimlib/lzms_common.h | 12 +++---- include/wimlib/lzx_common.h | 8 ++--- include/wimlib/metadata.h | 8 ++--- include/wimlib/ntfs_3g.h | 8 ++--- include/wimlib/pathlist.h | 2 +- include/wimlib/paths.h | 6 ++-- include/wimlib/pattern.h | 4 +-- include/wimlib/progress.h | 2 +- include/wimlib/registry.h | 12 +++---- include/wimlib/reparse.h | 10 +++--- include/wimlib/resource.h | 36 ++++++++++----------- include/wimlib/scan.h | 30 +++++++++--------- include/wimlib/security.h | 18 +++++------ include/wimlib/sha1.h | 10 +++--- include/wimlib/solid.h | 2 +- include/wimlib/tagged_items.h | 4 +-- include/wimlib/textfile.h | 2 +- include/wimlib/timestamp.h | 18 +++++------ include/wimlib/unix_data.h | 6 ++-- include/wimlib/util.h | 24 +++++++------- include/wimlib/wim.h | 24 +++++++------- include/wimlib/wimboot.h | 4 +-- include/wimlib/win32.h | 32 +++++++++---------- include/wimlib/win32_common.h | 16 +++++----- include/wimlib/win32_vss.h | 6 ++-- include/wimlib/write.h | 4 +-- include/wimlib/xml.h | 32 +++++++++---------- include/wimlib/xml_windows.h | 2 +- programs/imagex-win32.h | 6 ++-- programs/imagex.c | 2 +- programs/wgetopt.h | 6 ++-- tests/wlfuzz.c | 24 +++++++------- 46 files changed, 313 insertions(+), 313 deletions(-) diff --git a/include/wimlib/apply.h b/include/wimlib/apply.h index b290693e..d801ab0c 100644 --- a/include/wimlib/apply.h +++ b/include/wimlib/apply.h @@ -94,7 +94,7 @@ extract_progress(struct apply_ctx *ctx, enum wimlib_progress_msg msg) return call_progress(ctx->progfunc, msg, &ctx->progress, ctx->progctx); } -extern int +int do_file_extract_progress(struct apply_ctx *ctx, enum wimlib_progress_msg msg); #define COUNT_PER_FILE_PROGRESS 256 @@ -108,10 +108,10 @@ maybe_do_file_progress(struct apply_ctx *ctx, enum wimlib_progress_msg msg) return 0; } -extern int +int start_file_structure_phase(struct apply_ctx *ctx, u64 end_file_count); -extern int +int start_file_metadata_phase(struct apply_ctx *ctx, u64 end_file_count); /* Report that a file was created, prior to blob extraction. */ @@ -128,10 +128,10 @@ report_file_metadata_applied(struct apply_ctx *ctx) return maybe_do_file_progress(ctx, WIMLIB_PROGRESS_MSG_EXTRACT_METADATA); } -extern int +int end_file_structure_phase(struct apply_ctx *ctx); -extern int +int end_file_metadata_phase(struct apply_ctx *ctx); static inline int @@ -140,7 +140,7 @@ report_apply_error(struct apply_ctx *ctx, int error_code, const tchar *path) return report_error(ctx->progfunc, ctx->progctx, error_code, path); } -extern bool +bool detect_sparse_region(const void *data, size_t size, size_t *len_ret); static inline bool @@ -163,7 +163,7 @@ maybe_detect_sparse_region(const void *data, size_t size, size_t *len_ret, dentry != NULL; \ dentry = dentry->d_next_extraction_alias) -extern int +int extract_blob_list(struct apply_ctx *ctx, const struct read_blob_callbacks *cbs); /* diff --git a/include/wimlib/avl_tree.h b/include/wimlib/avl_tree.h index b2ccb85d..5ae11ebb 100644 --- a/include/wimlib/avl_tree.h +++ b/include/wimlib/avl_tree.h @@ -71,7 +71,7 @@ avl_get_parent(const struct avl_tree_node *node) } /* (Internal use only) */ -extern void +void avl_tree_rebalance_after_insert(struct avl_tree_node **root_ptr, struct avl_tree_node *inserted); @@ -253,27 +253,27 @@ avl_tree_insert(struct avl_tree_node **root_ptr, /* Removes an item from the specified AVL tree. * See implementation for details. */ -extern void +void avl_tree_remove(struct avl_tree_node **root_ptr, struct avl_tree_node *node); /* Nonrecursive AVL tree traversal functions */ -extern struct avl_tree_node * +struct avl_tree_node * avl_tree_first_in_order(const struct avl_tree_node *root); -extern struct avl_tree_node * +struct avl_tree_node * avl_tree_last_in_order(const struct avl_tree_node *root); -extern struct avl_tree_node * +struct avl_tree_node * avl_tree_next_in_order(const struct avl_tree_node *node); -extern struct avl_tree_node * +struct avl_tree_node * avl_tree_prev_in_order(const struct avl_tree_node *node); -extern struct avl_tree_node * +struct avl_tree_node * avl_tree_first_in_postorder(const struct avl_tree_node *root); -extern struct avl_tree_node * +struct avl_tree_node * avl_tree_next_in_postorder(const struct avl_tree_node *prev, const struct avl_tree_node *prev_parent); diff --git a/include/wimlib/blob_table.h b/include/wimlib/blob_table.h index 9bb54b54..2c9aab15 100644 --- a/include/wimlib/blob_table.h +++ b/include/wimlib/blob_table.h @@ -265,79 +265,79 @@ struct blob_descriptor { }; }; -extern struct blob_table * +struct blob_table * new_blob_table(size_t capacity); -extern void +void free_blob_table(struct blob_table *table); -extern int +int read_blob_table(WIMStruct *wim); -extern int +int write_blob_table_from_blob_list(struct list_head *blob_list, struct filedes *out_fd, u16 part_number, struct wim_reshdr *out_reshdr, int write_resource_flags); -extern struct blob_descriptor * +struct blob_descriptor * new_blob_descriptor(void); -extern struct blob_descriptor * +struct blob_descriptor * clone_blob_descriptor(const struct blob_descriptor *blob); -extern void +void blob_decrement_refcnt(struct blob_descriptor *blob, struct blob_table *table); -extern void +void blob_subtract_refcnt(struct blob_descriptor *blob, struct blob_table *table, u32 count); #ifdef WITH_FUSE -extern void +void blob_decrement_num_opened_fds(struct blob_descriptor *blob); #endif -extern void +void blob_release_location(struct blob_descriptor *blob); -extern void +void free_blob_descriptor(struct blob_descriptor *blob); -extern void +void blob_table_insert(struct blob_table *table, struct blob_descriptor *blob); -extern void +void blob_table_unlink(struct blob_table *table, struct blob_descriptor *blob); -extern struct blob_descriptor * +struct blob_descriptor * lookup_blob(const struct blob_table *table, const u8 *hash); -extern int +int for_blob_in_table(struct blob_table *table, int (*visitor)(struct blob_descriptor *, void *), void *arg); -extern int +int for_blob_in_table_sorted_by_sequential_order(struct blob_table *table, int (*visitor)(struct blob_descriptor *, void *), void *arg); struct wimlib_resource_entry; -extern void +void blob_to_wimlib_resource_entry(const struct blob_descriptor *blob, struct wimlib_resource_entry *wentry); -extern int +int sort_blob_list(struct list_head *blob_list, size_t list_head_offset, int (*compar)(const void *, const void*)); -extern int +int sort_blob_list_by_sequential_order(struct list_head *blob_list, size_t list_head_offset); -extern int +int cmp_blobs_by_sequential_order(const void *p1, const void *p2); static inline const struct blob_extraction_target * @@ -391,7 +391,7 @@ blob_is_in_file(const struct blob_descriptor *blob) } #ifdef _WIN32 -extern const wchar_t * +const wchar_t * get_windows_file_path(const struct windows_file *file); #endif @@ -405,20 +405,20 @@ blob_file_path(const struct blob_descriptor *blob) return blob->file_on_disk; } -extern struct blob_descriptor * +struct blob_descriptor * new_blob_from_data_buffer(const void *buffer, size_t size, struct blob_table *blob_table); -extern struct blob_descriptor * +struct blob_descriptor * after_blob_hashed(struct blob_descriptor *blob, struct blob_descriptor **back_ptr, struct blob_table *blob_table, struct wim_inode *inode); -extern int +int hash_unhashed_blob(struct blob_descriptor *blob, struct blob_table *blob_table, struct blob_descriptor **blob_ret); -extern struct blob_descriptor ** +struct blob_descriptor ** retrieve_pointer_to_unhashed_blob(struct blob_descriptor *blob); static inline void diff --git a/include/wimlib/decompress_common.h b/include/wimlib/decompress_common.h index 9b557271..c4291267 100644 --- a/include/wimlib/decompress_common.h +++ b/include/wimlib/decompress_common.h @@ -412,7 +412,7 @@ read_huffsym(struct input_bitstream *is, const u16 decode_table[], #define DECODE_TABLE_WORKING_SPACE(name, num_syms, max_codeword_len) \ u16 name[2 * ((max_codeword_len) + 1) + (num_syms)]; -extern int +int make_huffman_decode_table(u16 decode_table[], unsigned num_syms, unsigned table_bits, const u8 lens[], unsigned max_codeword_len, u16 working_space[]); diff --git a/include/wimlib/dentry.h b/include/wimlib/dentry.h index 64ff6c30..4a99b543 100644 --- a/include/wimlib/dentry.h +++ b/include/wimlib/dentry.h @@ -123,10 +123,10 @@ will_extract_dentry(const struct wim_dentry *dentry) return dentry->d_extraction_list_node.next != NULL; } -extern size_t +size_t dentry_out_total_length(const struct wim_dentry *dentry); -extern int +int for_dentry_in_tree(struct wim_dentry *root, int (*visitor)(struct wim_dentry *, void *), void *args); @@ -162,10 +162,10 @@ for_dentry_in_tree(struct wim_dentry *root, #define dentry_any_child(parent) \ inode_any_child((parent)->d_inode) -extern struct wim_dentry * +struct wim_dentry * dentry_get_first_ci_match(struct wim_dentry *dentry); -extern struct wim_dentry * +struct wim_dentry * dentry_get_next_ci_match(struct wim_dentry *dentry, struct wim_dentry *ci_match); @@ -176,75 +176,75 @@ dentry_get_next_ci_match(struct wim_dentry *dentry, (ci_match); \ (ci_match) = dentry_get_next_ci_match((dentry), (ci_match))) -extern void +void calculate_subdir_offsets(struct wim_dentry *root, u64 *subdir_offset_p); -extern int +int dentry_set_name(struct wim_dentry *dentry, const tchar *name); -extern int +int dentry_set_name_utf16le(struct wim_dentry *dentry, const utf16lechar *name, size_t name_nbytes); -extern struct wim_dentry * +struct wim_dentry * get_dentry(WIMStruct *wim, const tchar *path, CASE_SENSITIVITY_TYPE case_type); -extern struct wim_dentry * +struct wim_dentry * get_dentry_child_with_name(const struct wim_dentry *dentry, const tchar *name, CASE_SENSITIVITY_TYPE case_type); -extern struct wim_dentry * +struct wim_dentry * get_dentry_child_with_utf16le_name(const struct wim_dentry *dentry, const utf16lechar *name, size_t name_nbytes, CASE_SENSITIVITY_TYPE case_type); -extern struct wim_dentry * +struct wim_dentry * get_parent_dentry(WIMStruct *wim, const tchar *path, CASE_SENSITIVITY_TYPE case_type); -extern int +int calculate_dentry_full_path(struct wim_dentry *dentry); -extern tchar * +tchar * dentry_full_path(struct wim_dentry *dentry); -extern int +int new_dentry_with_new_inode(const tchar *name, bool set_timestamps, struct wim_dentry **dentry_ret); -extern int +int new_dentry_with_existing_inode(const tchar *name, struct wim_inode *inode, struct wim_dentry **dentry_ret); -extern int +int new_filler_directory(struct wim_dentry **dentry_ret); -extern void +void free_dentry(struct wim_dentry *dentry); -extern void +void free_dentry_tree(struct wim_dentry *root, struct blob_table *blob_table); -extern void +void unlink_dentry(struct wim_dentry *dentry); -extern struct wim_dentry * +struct wim_dentry * dentry_add_child(struct wim_dentry *parent, struct wim_dentry *child); struct update_command_journal; -extern int +int rename_wim_path(WIMStruct *wim, const tchar *from, const tchar *to, CASE_SENSITIVITY_TYPE case_type, struct update_command_journal *j); -extern int +int read_dentry_tree(const u8 *buf, size_t buf_len, u64 root_offset, struct wim_dentry **root_ret); -extern u8 * +u8 * write_dentry_tree(struct wim_dentry *root, u8 *p); static inline bool diff --git a/include/wimlib/divsufsort.h b/include/wimlib/divsufsort.h index 8ec81a9f..c82bda18 100644 --- a/include/wimlib/divsufsort.h +++ b/include/wimlib/divsufsort.h @@ -3,7 +3,7 @@ #include "wimlib/types.h" -extern void +void divsufsort(const u8 *T, u32 *SA, u32 n, u32 *tmp); #define DIVSUFSORT_TMP_LEN (256 + (256 * 256)) diff --git a/include/wimlib/encoding.h b/include/wimlib/encoding.h index 9216ca2c..da83b9d3 100644 --- a/include/wimlib/encoding.h +++ b/include/wimlib/encoding.h @@ -9,11 +9,11 @@ /* String conversion functions */ -extern int +int utf8_to_utf16le(const char *in, size_t in_nbytes, utf16lechar **out_ret, size_t *out_nbytes_ret); -extern int +int utf16le_to_utf8(const utf16lechar *in, size_t in_nbytes, char **out_ret, size_t *out_nbytes_ret); @@ -121,28 +121,28 @@ utf16le_put_tstr(const tchar *s) extern u16 upcase[65536]; -extern void +void init_upcase(void); -extern int +int cmp_utf16le_strings(const utf16lechar *s1, size_t n1, const utf16lechar *s2, size_t n2, bool ignore_case); -extern int +int cmp_utf16le_strings_z(const utf16lechar *s1, const utf16lechar *s2, bool ignore_case); -extern utf16lechar * +utf16lechar * utf16le_dupz(const void *s, size_t size); -extern utf16lechar * +utf16lechar * utf16le_dup(const utf16lechar *s); -extern size_t +size_t utf16le_len_bytes(const utf16lechar *s); -extern size_t +size_t utf16le_len_chars(const utf16lechar *s); #endif /* _WIMLIB_ENCODING_H */ diff --git a/include/wimlib/error.h b/include/wimlib/error.h index 75b48c1b..e332903f 100644 --- a/include/wimlib/error.h +++ b/include/wimlib/error.h @@ -13,19 +13,19 @@ dummy_tprintf(const tchar *format, ...) return 0; } -extern void +void wimlib_error(const tchar *format, ...) _format_attribute(printf, 1, 2) _cold_attribute; -extern void +void wimlib_error_with_errno(const tchar *format, ...) _format_attribute(printf, 1, 2) _cold_attribute; -extern void +void wimlib_warning(const tchar *format, ...) _format_attribute(printf, 1, 2) _cold_attribute; -extern void +void wimlib_warning_with_errno(const tchar *format, ...) _format_attribute(printf, 1, 2) _cold_attribute; # define ERROR(format, ...) wimlib_error(T(format), ## __VA_ARGS__) @@ -35,7 +35,7 @@ wimlib_warning_with_errno(const tchar *format, ...) extern bool wimlib_print_errors; extern FILE *wimlib_error_file; -extern void +void print_byte_field(const u8 *field, size_t len, FILE *out); #endif /* _WIMLIB_ERROR_H */ diff --git a/include/wimlib/file_io.h b/include/wimlib/file_io.h index 7cfe2cd8..8dbdb120 100644 --- a/include/wimlib/file_io.h +++ b/include/wimlib/file_io.h @@ -14,26 +14,26 @@ struct filedes { off_t offset; }; -extern int +int full_read(struct filedes *fd, void *buf, size_t n); -extern int +int full_pread(struct filedes *fd, void *buf, size_t nbyte, off_t offset); -extern int +int full_write(struct filedes *fd, const void *buf, size_t n); -extern int +int full_pwrite(struct filedes *fd, const void *buf, size_t count, off_t offset); #ifndef _WIN32 # define O_BINARY 0 #endif -extern off_t +off_t filedes_seek(struct filedes *fd, off_t offset); -extern bool +bool filedes_is_seekable(struct filedes *fd); static inline void filedes_init(struct filedes *fd, int raw_fd) diff --git a/include/wimlib/glob.h b/include/wimlib/glob.h index 5455be26..d5ab3999 100644 --- a/include/wimlib/glob.h +++ b/include/wimlib/glob.h @@ -14,12 +14,12 @@ typedef struct { } glob_t; /* WARNING: this is a reduced functionality replacement */ -extern int +int win32_wglob(const wchar_t *pattern, int flags, int (*errfunc)(const wchar_t *epath, int eerrno), glob_t *pglob); -extern void globfree(glob_t *pglob); +void globfree(glob_t *pglob); #define GLOB_ERR 0x1 /* Return on read errors. */ #define GLOB_NOSORT 0x2 /* Don't sort the names. */ diff --git a/include/wimlib/inode.h b/include/wimlib/inode.h index 44977750..56b177e8 100644 --- a/include/wimlib/inode.h +++ b/include/wimlib/inode.h @@ -264,7 +264,7 @@ struct wim_inode_extra { #define FILE_ATTRIBUTE_ENCRYPTED 0x00004000 #define FILE_ATTRIBUTE_VIRTUAL 0x00010000 -extern struct wim_inode * +struct wim_inode * new_inode(struct wim_dentry *dentry, bool set_timestamps); /* Iterate through each alias of the specified inode. */ @@ -280,14 +280,14 @@ new_inode(struct wim_dentry *dentry, bool set_timestamps); #define inode_any_full_path(inode) \ dentry_full_path(inode_any_dentry(inode)) -extern void +void d_associate(struct wim_dentry *dentry, struct wim_inode *inode); -extern void +void d_disassociate(struct wim_dentry *dentry); #ifdef WITH_FUSE -extern void +void inode_dec_num_opened_fds(struct wim_inode *inode); #endif @@ -330,11 +330,11 @@ inode_has_security_descriptor(const struct wim_inode *inode) return inode->i_security_id >= 0; } -extern struct wim_inode_stream * +struct wim_inode_stream * inode_get_stream(const struct wim_inode *inode, int stream_type, const utf16lechar *stream_name); -extern struct wim_inode_stream * +struct wim_inode_stream * inode_get_unnamed_stream(const struct wim_inode *inode, int stream_type); static inline struct wim_inode_stream * @@ -343,29 +343,29 @@ inode_get_unnamed_data_stream(const struct wim_inode *inode) return inode_get_unnamed_stream(inode, STREAM_TYPE_DATA); } -extern struct wim_inode_stream * +struct wim_inode_stream * inode_add_stream(struct wim_inode *inode, int stream_type, const utf16lechar *stream_name, struct blob_descriptor *blob); -extern void +void inode_replace_stream_blob(struct wim_inode *inode, struct wim_inode_stream *strm, struct blob_descriptor *new_blob, struct blob_table *blob_table); -extern bool +bool inode_replace_stream_data(struct wim_inode *inode, struct wim_inode_stream *strm, const void *data, size_t size, struct blob_table *blob_table); -extern bool +bool inode_add_stream_with_data(struct wim_inode *inode, int stream_type, const utf16lechar *stream_name, const void *data, size_t size, struct blob_table *blob_table); -extern void +void inode_remove_stream(struct wim_inode *inode, struct wim_inode_stream *strm, struct blob_table *blob_table); @@ -394,40 +394,40 @@ stream_is_named_data_stream(const struct wim_inode_stream *strm) return strm->stream_type == STREAM_TYPE_DATA && stream_is_named(strm); } -extern bool +bool inode_has_named_data_stream(const struct wim_inode *inode); -extern int +int inode_resolve_streams(struct wim_inode *inode, struct blob_table *table, bool force); -extern int +int blob_not_found_error(const struct wim_inode *inode, const u8 *hash); -extern struct blob_descriptor * +struct blob_descriptor * stream_blob(const struct wim_inode_stream *strm, const struct blob_table *table); -extern struct blob_descriptor * +struct blob_descriptor * inode_get_blob_for_unnamed_data_stream(const struct wim_inode *inode, const struct blob_table *blob_table); -extern struct blob_descriptor * +struct blob_descriptor * inode_get_blob_for_unnamed_data_stream_resolved(const struct wim_inode *inode); -extern const u8 * +const u8 * stream_hash(const struct wim_inode_stream *strm); -extern const u8 * +const u8 * inode_get_hash_of_unnamed_data_stream(const struct wim_inode *inode); -extern void +void inode_ref_blobs(struct wim_inode *inode); -extern void +void inode_unref_blobs(struct wim_inode *inode, struct blob_table *blob_table); /* inode_fixup.c */ -extern int +int dentry_tree_fix_inodes(struct wim_dentry *root, struct hlist_head *inode_list); #endif /* _WIMLIB_INODE_H */ diff --git a/include/wimlib/inode_table.h b/include/wimlib/inode_table.h index 4d4fab5e..781a8706 100644 --- a/include/wimlib/inode_table.h +++ b/include/wimlib/inode_table.h @@ -28,22 +28,22 @@ hash_inode(const struct wim_inode_table *table, u64 ino, u64 devno) return (hash_u64(ino) + devno) & (table->capacity - 1); } -extern int +int init_inode_table(struct wim_inode_table *table, size_t capacity); -extern int +int inode_table_new_dentry(struct wim_inode_table *table, const tchar *name, u64 ino, u64 devno, bool noshare, struct wim_dentry **dentry_ret); -extern void +void enlarge_inode_table(struct wim_inode_table *table); -extern void +void inode_table_prepare_inode_list(struct wim_inode_table *table, struct hlist_head *head); -extern void +void destroy_inode_table(struct wim_inode_table *table); #endif /* _WIMLIB_INODE_TABLE_H */ diff --git a/include/wimlib/integrity.h b/include/wimlib/integrity.h index 48f24e31..755cddda 100644 --- a/include/wimlib/integrity.h +++ b/include/wimlib/integrity.h @@ -11,19 +11,19 @@ struct integrity_table; -extern int +int read_integrity_table(WIMStruct *wim, u64 num_checked_bytes, struct integrity_table **table_ret); #define free_integrity_table(table) FREE(table) -extern int +int write_integrity_table(WIMStruct *wim, off_t new_blob_table_end, off_t old_blob_table_end, struct integrity_table *old_table); -extern int +int check_wim_integrity(WIMStruct *wim); #endif /* _WIMLIB_INTEGRITY_H */ diff --git a/include/wimlib/lcpit_matchfinder.h b/include/wimlib/lcpit_matchfinder.h index f9543e0a..1cfa444f 100644 --- a/include/wimlib/lcpit_matchfinder.h +++ b/include/wimlib/lcpit_matchfinder.h @@ -52,24 +52,24 @@ struct lz_match { u32 offset; }; -extern u64 +u64 lcpit_matchfinder_get_needed_memory(size_t max_bufsize); -extern bool +bool lcpit_matchfinder_init(struct lcpit_matchfinder *mf, size_t max_bufsize, u32 min_match_len, u32 nice_match_len); -extern void +void lcpit_matchfinder_load_buffer(struct lcpit_matchfinder *mf, const u8 *T, u32 n); -extern u32 +u32 lcpit_matchfinder_get_matches(struct lcpit_matchfinder *mf, struct lz_match *matches); -extern void +void lcpit_matchfinder_skip_bytes(struct lcpit_matchfinder *mf, u32 count); -extern void +void lcpit_matchfinder_destroy(struct lcpit_matchfinder *mf); #endif /* _LCPIT_MATCHFINDER_H */ diff --git a/include/wimlib/lzms_common.h b/include/wimlib/lzms_common.h index b5071469..b2d59d8a 100644 --- a/include/wimlib/lzms_common.h +++ b/include/wimlib/lzms_common.h @@ -19,7 +19,7 @@ extern const u8 lzms_extra_offset_bits[LZMS_MAX_NUM_OFFSET_SYMS]; extern const u32 lzms_length_slot_base[LZMS_NUM_LENGTH_SYMS + 1]; extern const u8 lzms_extra_length_bits[LZMS_NUM_LENGTH_SYMS]; -extern unsigned +unsigned lzms_get_slot(u32 value, const u32 slot_base_tab[], unsigned num_slots); /* Return the offset slot for the specified offset */ @@ -36,7 +36,7 @@ lzms_get_length_slot(u32 length) return lzms_get_slot(length, lzms_length_slot_base, LZMS_NUM_LENGTH_SYMS); } -extern unsigned +unsigned lzms_get_num_offset_slots(size_t uncompressed_size); @@ -67,7 +67,7 @@ struct lzms_probabilites { [LZMS_NUM_DELTA_REP_PROBS]; }; -extern void +void lzms_init_probabilities(struct lzms_probabilites *probs); /* Given a decoded or encoded bit, update the probability entry. */ @@ -130,14 +130,14 @@ lzms_get_probability(const struct lzms_probability_entry *prob_entry) return prob; } -extern void +void lzms_init_symbol_frequencies(u32 freqs[], unsigned num_syms); -extern void +void lzms_dilute_symbol_frequencies(u32 freqs[], unsigned num_syms); /* Pre/post-processing */ -extern void +void lzms_x86_filter(u8 data[], s32 size, s32 last_target_usages[], bool undo); #endif /* _LZMS_COMMON_H */ diff --git a/include/wimlib/lzx_common.h b/include/wimlib/lzx_common.h index f93221d5..80d53813 100644 --- a/include/wimlib/lzx_common.h +++ b/include/wimlib/lzx_common.h @@ -14,16 +14,16 @@ extern const s32 lzx_offset_slot_base[LZX_MAX_OFFSET_SLOTS + 1]; extern const u8 lzx_extra_offset_bits[LZX_MAX_OFFSET_SLOTS]; -extern unsigned +unsigned lzx_get_window_order(size_t max_bufsize); -extern unsigned +unsigned lzx_get_num_main_syms(unsigned window_order); -extern void +void lzx_preprocess(u8 *data, u32 size); -extern void +void lzx_postprocess(u8 *data, u32 size); #endif /* _LZX_COMMON_H */ diff --git a/include/wimlib/metadata.h b/include/wimlib/metadata.h index 030b0b12..a3d28048 100644 --- a/include/wimlib/metadata.h +++ b/include/wimlib/metadata.h @@ -150,16 +150,16 @@ can_unload_image(const struct wim_image_metadata *imd) #define image_for_each_unhashed_blob_safe(blob, tmp, imd) \ list_for_each_entry_safe(blob, tmp, &(imd)->unhashed_blobs, unhashed_list) -extern void +void put_image_metadata(struct wim_image_metadata *imd); -extern int +int append_image_metadata(WIMStruct *wim, struct wim_image_metadata *imd); -extern struct wim_image_metadata * +struct wim_image_metadata * new_empty_image_metadata(void); -extern struct wim_image_metadata * +struct wim_image_metadata * new_unloaded_image_metadata(struct blob_descriptor *metadata_blob); #endif /* _WIMLIB_METADATA_H */ diff --git a/include/wimlib/ntfs_3g.h b/include/wimlib/ntfs_3g.h index e2ed6d6b..03fc04b6 100644 --- a/include/wimlib/ntfs_3g.h +++ b/include/wimlib/ntfs_3g.h @@ -9,18 +9,18 @@ struct blob_descriptor; struct consume_chunk_callback; struct ntfs_location; -extern int +int read_ntfs_attribute_prefix(const struct blob_descriptor *blob, u64 size, const struct consume_chunk_callback *cb, bool recover_data); -extern struct ntfs_location * +struct ntfs_location * clone_ntfs_location(const struct ntfs_location *loc); -extern void +void free_ntfs_location(struct ntfs_location *loc); -extern int +int cmp_ntfs_locations(const struct ntfs_location *loc1, const struct ntfs_location *loc2); diff --git a/include/wimlib/pathlist.h b/include/wimlib/pathlist.h index 71878bf7..b49dbd28 100644 --- a/include/wimlib/pathlist.h +++ b/include/wimlib/pathlist.h @@ -3,7 +3,7 @@ #include "wimlib/types.h" -extern int +int read_path_list_file(const tchar *listfile, tchar ***paths_ret, size_t *num_paths_ret, void **mem_ret); diff --git a/include/wimlib/paths.h b/include/wimlib/paths.h index 764bdcfb..4faf9703 100644 --- a/include/wimlib/paths.h +++ b/include/wimlib/paths.h @@ -10,13 +10,13 @@ path_basename(const tchar *path); const tchar * path_basename_with_len(const tchar *path, size_t len); -extern const tchar * +const tchar * path_stream_name(const tchar *path); -extern void +void do_canonicalize_path(const tchar *in, tchar *out); -extern tchar * +tchar * canonicalize_wim_path(const tchar *wim_path); /* is_any_path_separator() - characters treated as path separators in WIM path diff --git a/include/wimlib/pattern.h b/include/wimlib/pattern.h index b0e29995..3f3add77 100644 --- a/include/wimlib/pattern.h +++ b/include/wimlib/pattern.h @@ -19,10 +19,10 @@ struct wim_dentry; */ #define MATCH_ANCESTORS 0x02 -extern bool +bool match_path(const tchar *path, const tchar *pattern, int match_flags); -extern int +int expand_path_pattern(struct wim_dentry *root, const tchar *pattern, int (*consume_dentry)(struct wim_dentry *, void *), void *ctx); diff --git a/include/wimlib/progress.h b/include/wimlib/progress.h index 062656c5..538e358f 100644 --- a/include/wimlib/progress.h +++ b/include/wimlib/progress.h @@ -30,7 +30,7 @@ call_progress(wimlib_progress_func_t progfunc, return 0; } -extern int +int report_error(wimlib_progress_func_t progfunc, void *progctx, int error_code, const tchar *path); diff --git a/include/wimlib/registry.h b/include/wimlib/registry.h index 7f306313..27fcd1ab 100644 --- a/include/wimlib/registry.h +++ b/include/wimlib/registry.h @@ -16,25 +16,25 @@ enum hive_status { HIVE_ITERATION_STOPPED, }; -extern enum hive_status +enum hive_status hive_validate(const void *hive_mem, size_t hive_size); -extern enum hive_status +enum hive_status hive_get_string(const struct regf *regf, const tchar *key_name, const tchar *value_name, tchar **value_ret); -extern enum hive_status +enum hive_status hive_get_number(const struct regf *regf, const tchar *key_name, const tchar *value_name, s64 *value_ret); -extern enum hive_status +enum hive_status hive_list_subkeys(const struct regf *regf, const tchar *key_name, tchar ***subkeys_ret); -extern void +void hive_free_subkeys_list(tchar **subkeys); -extern const char * +const char * hive_status_to_string(enum hive_status status); #endif /* _WIMLIB_REGISTRY_H */ diff --git a/include/wimlib/reparse.h b/include/wimlib/reparse.h index 04592cec..fcc63424 100644 --- a/include/wimlib/reparse.h +++ b/include/wimlib/reparse.h @@ -86,25 +86,25 @@ link_is_relative_symlink(const struct link_reparse_point *link) (link->symlink_flags & SYMBOLIC_LINK_RELATIVE); } -extern void +void complete_reparse_point(struct reparse_buffer_disk *rpbuf, const struct wim_inode *inode, u16 blob_size); -extern int +int parse_link_reparse_point(const struct reparse_buffer_disk *rpbuf, u16 rpbuflen, struct link_reparse_point *link); -extern int +int make_link_reparse_point(const struct link_reparse_point *link, struct reparse_buffer_disk *rpbuf, u16 *rpbuflen_ret); #ifndef _WIN32 -extern int +int wim_inode_readlink(const struct wim_inode *inode, char *buf, size_t bufsize, const struct blob_descriptor *blob, const char *altroot, size_t altroot_len); -extern int +int wim_inode_set_symlink(struct wim_inode *inode, const char *target, struct blob_table *blob_table); #endif diff --git a/include/wimlib/resource.h b/include/wimlib/resource.h index 94e43e5f..0985c4f3 100644 --- a/include/wimlib/resource.h +++ b/include/wimlib/resource.h @@ -119,20 +119,20 @@ zero_reshdr(struct wim_reshdr *reshdr) memset(reshdr, 0, sizeof(struct wim_reshdr)); } -extern void +void wim_reshdr_to_desc(const struct wim_reshdr *reshdr, WIMStruct *wim, struct wim_resource_descriptor *rdesc); -extern void +void wim_reshdr_to_desc_and_blob(const struct wim_reshdr *reshdr, WIMStruct *wim, struct wim_resource_descriptor *rdesc, struct blob_descriptor *blob); -extern void +void get_wim_reshdr(const struct wim_reshdr_disk *disk_reshdr, struct wim_reshdr *reshdr); -extern void +void put_wim_reshdr(const struct wim_reshdr *reshdr, struct wim_reshdr_disk *disk_reshdr); @@ -171,25 +171,25 @@ get_chunk_entry_size(u64 res_size, bool is_alt) /* Functions to read blobs */ -extern int +int read_partial_wim_blob_into_buf(const struct blob_descriptor *blob, u64 offset, size_t size, void *buf); -extern int +int read_blob_into_buf(const struct blob_descriptor *blob, void *buf); -extern int +int read_blob_into_alloc_buf(const struct blob_descriptor *blob, void **buf_ret); -extern int +int wim_reshdr_to_data(const struct wim_reshdr *reshdr, WIMStruct *wim, void **buf_ret); -extern int +int wim_reshdr_to_hash(const struct wim_reshdr *reshdr, WIMStruct *wim, u8 hash[SHA1_HASH_SIZE]); -extern int +int skip_wim_resource(const struct wim_resource_descriptor *rdesc); /* @@ -275,37 +275,37 @@ call_end_blob(struct blob_descriptor *blob, int status, #define BLOB_LIST_ALREADY_SORTED 0x4 #define RECOVER_DATA 0x8 -extern int +int read_blob_list(struct list_head *blob_list, size_t list_head_offset, const struct read_blob_callbacks *cbs, int flags); -extern int +int read_blob_with_cbs(struct blob_descriptor *blob, const struct read_blob_callbacks *cbs, bool recover_data); -extern int +int read_blob_with_sha1(struct blob_descriptor *blob, const struct read_blob_callbacks *cbs, bool recover_data); -extern int +int extract_blob_prefix_to_fd(struct blob_descriptor *blob, u64 size, struct filedes *fd); -extern int +int extract_blob_to_fd(struct blob_descriptor *blob, struct filedes *fd, bool recover_data); /* Miscellaneous blob functions. */ -extern int +int sha1_blob(struct blob_descriptor *blob); /* Functions to read/write metadata resources. */ -extern int +int read_metadata_resource(struct wim_image_metadata *imd); -extern int +int write_metadata_resource(WIMStruct *wim, int image, int write_resource_flags); /* Definitions specific to pipable WIM resources. */ diff --git a/include/wimlib/scan.h b/include/wimlib/scan.h index bae72c75..cfd7835e 100644 --- a/include/wimlib/scan.h +++ b/include/wimlib/scan.h @@ -73,25 +73,25 @@ struct scan_params { /* scan.c */ -extern int +int do_scan_progress(struct scan_params *params, int status, const struct wim_inode *inode); -extern int +int mangle_pat(tchar *pat, const tchar *path, unsigned long line_no); -extern int +int read_capture_config(const tchar *config_file, const void *buf, size_t bufsize, struct capture_config *config); -extern void +void destroy_capture_config(struct capture_config *config); -extern bool +bool match_pattern_list(const tchar *path, const struct string_list *list, int match_flags); -extern int +int try_exclude(const struct scan_params *params); typedef int (*scan_tree_t)(struct wim_dentry **, const tchar *, @@ -99,28 +99,28 @@ typedef int (*scan_tree_t)(struct wim_dentry **, const tchar *, #ifdef WITH_NTFS_3G /* ntfs-3g_capture.c */ -extern int +int ntfs_3g_build_dentry_tree(struct wim_dentry **root_ret, const tchar *device, struct scan_params *params); #endif #ifdef _WIN32 /* win32_capture.c */ -extern int +int win32_build_dentry_tree(struct wim_dentry **root_ret, const tchar *root_disk_path, struct scan_params *params); #define platform_default_scan_tree win32_build_dentry_tree #else /* unix_capture.c */ -extern int +int unix_build_dentry_tree(struct wim_dentry **root_ret, const tchar *root_disk_path, struct scan_params *params); #define platform_default_scan_tree unix_build_dentry_tree #endif #ifdef ENABLE_TEST_SUPPORT -extern int +int generate_dentry_tree(struct wim_dentry **root_ret, const tchar *root_disk_path, struct scan_params *params); #endif @@ -134,21 +134,21 @@ report_scan_error(struct scan_params *params, int error_code) params->cur_path); } -extern bool +bool should_ignore_filename(const tchar *name, int name_nchars); -extern void +void attach_scanned_tree(struct wim_dentry *parent, struct wim_dentry *child, struct blob_table *blob_table); -extern int +int pathbuf_init(struct scan_params *params, const tchar *root_path); -extern const tchar * +const tchar * pathbuf_append_name(struct scan_params *params, const tchar *name, size_t name_nchars, size_t *orig_path_nchars_ret); -extern void +void pathbuf_truncate(struct scan_params *params, size_t nchars); #endif /* _WIMLIB_SCAN_H */ diff --git a/include/wimlib/security.h b/include/wimlib/security.h index 5c864ddd..3e817750 100644 --- a/include/wimlib/security.h +++ b/include/wimlib/security.h @@ -35,34 +35,34 @@ struct wim_security_data { u8 **descriptors; }; -extern void +void rollback_new_security_descriptors(struct wim_sd_set *sd_set); -extern void +void destroy_sd_set(struct wim_sd_set *sd_set); -extern s32 +s32 sd_set_add_sd(struct wim_sd_set *sd_set, const char descriptor[], size_t size); -extern int +int init_sd_set(struct wim_sd_set *sd_set, struct wim_security_data *sd); -extern struct wim_security_data * +struct wim_security_data * new_wim_security_data(void); -extern int +int read_wim_security_data(const u8 *buf, size_t buf_len, struct wim_security_data **sd_ret); -extern u8 * +u8 * write_wim_security_data(const struct wim_security_data * restrict sd, u8 * restrict p); -extern void +void print_wim_security_data(const struct wim_security_data *sd); -extern void +void free_wim_security_data(struct wim_security_data *sd); #endif /* _WIMLIB_SECURITY_H */ diff --git a/include/wimlib/sha1.h b/include/wimlib/sha1.h index dc63857c..91f84d91 100644 --- a/include/wimlib/sha1.h +++ b/include/wimlib/sha1.h @@ -42,22 +42,22 @@ struct sha1_ctx { u8 buffer[SHA1_BLOCK_SIZE]; }; -extern void +void sha1_init(struct sha1_ctx *ctx); -extern void +void sha1_update(struct sha1_ctx *ctx, const void *data, size_t len); -extern void +void sha1_final(struct sha1_ctx *ctx, u8 hash[SHA1_HASH_SIZE]); -extern void +void sha1(const void *data, size_t len, u8 hash[SHA1_HASH_SIZE]); extern const u8 zero_hash[SHA1_HASH_SIZE]; #define SHA1_HASH_STRING_LEN (2 * SHA1_HASH_SIZE + 1) -extern void +void sprint_hash(const u8 hash[SHA1_HASH_SIZE], tchar strbuf[SHA1_HASH_STRING_LEN]); static inline void diff --git a/include/wimlib/solid.h b/include/wimlib/solid.h index cf37a880..051e445f 100644 --- a/include/wimlib/solid.h +++ b/include/wimlib/solid.h @@ -3,7 +3,7 @@ struct list_head; -extern int +int sort_blob_list_for_solid_compression(struct list_head *blob_list); #endif /* _WIMLIB_SOLID_H */ diff --git a/include/wimlib/tagged_items.h b/include/wimlib/tagged_items.h index dfbae30b..815fa187 100644 --- a/include/wimlib/tagged_items.h +++ b/include/wimlib/tagged_items.h @@ -20,11 +20,11 @@ struct wim_inode; */ #define TAG_WIMLIB_LINUX_XATTRS 0x337DD874 -extern void * +void * inode_get_tagged_item(const struct wim_inode *inode, u32 tag, u32 min_len, u32 *actual_len_ret); -extern bool +bool inode_set_tagged_item(struct wim_inode *inode, u32 tag, const void *data, u32 len); diff --git a/include/wimlib/textfile.h b/include/wimlib/textfile.h index d79f8b11..df606561 100644 --- a/include/wimlib/textfile.h +++ b/include/wimlib/textfile.h @@ -27,7 +27,7 @@ struct text_file_section { #define LOAD_TEXT_FILE_NO_WARNINGS 0x00000002 #define LOAD_TEXT_FILE_ALLOW_STDIN 0x00000004 -extern int +int load_text_file(const tchar *path, const void *buf, size_t bufsize, void **mem_ret, const struct text_file_section *pos_sections, diff --git a/include/wimlib/timestamp.h b/include/wimlib/timestamp.h index 37666c9a..e30e0621 100644 --- a/include/wimlib/timestamp.h +++ b/include/wimlib/timestamp.h @@ -14,32 +14,32 @@ struct wimlib_timespec; -extern time_t +time_t wim_timestamp_to_time_t(u64 timestamp); -extern void +void wim_timestamp_to_wimlib_timespec(u64 timestamp, struct wimlib_timespec *wts, s32 *high_part_ret); -extern struct timeval +struct timeval wim_timestamp_to_timeval(u64 timestamp); -extern struct timespec +struct timespec wim_timestamp_to_timespec(u64 timestamp); -extern u64 +u64 time_t_to_wim_timestamp(time_t t); -extern u64 +u64 timeval_to_wim_timestamp(const struct timeval *tv); -extern u64 +u64 timespec_to_wim_timestamp(const struct timespec *ts); -extern u64 +u64 now_as_wim_timestamp(void); -extern void +void wim_timestamp_to_str(u64 timestamp, tchar *buf, size_t len); #endif /* _WIMLIB_TIMESTAMP_H */ diff --git a/include/wimlib/unix_data.h b/include/wimlib/unix_data.h index ede0fdce..11aa67b3 100644 --- a/include/wimlib/unix_data.h +++ b/include/wimlib/unix_data.h @@ -12,10 +12,10 @@ struct wimlib_unix_data { struct wim_inode; -extern bool +bool inode_has_unix_data(const struct wim_inode *inode); -extern bool +bool inode_get_unix_data(const struct wim_inode *inode, struct wimlib_unix_data *unix_data); @@ -26,7 +26,7 @@ inode_get_unix_data(const struct wim_inode *inode, #define UNIX_DATA_ALL 0xF -extern bool +bool inode_set_unix_data(struct wim_inode *inode, struct wimlib_unix_data *unix_data, int which); diff --git a/include/wimlib/util.h b/include/wimlib/util.h index 55fc9e4a..6c9ee061 100644 --- a/include/wimlib/util.h +++ b/include/wimlib/util.h @@ -42,33 +42,33 @@ * Memory allocation *******************/ -extern void * +void * wimlib_malloc(size_t size); -extern void +void wimlib_free_memory(void *p); -extern void * +void * wimlib_realloc(void *ptr, size_t size); -extern void * +void * wimlib_calloc(size_t nmemb, size_t size); -extern char * +char * wimlib_strdup(const char *str); #ifdef _WIN32 -extern wchar_t * +wchar_t * wimlib_wcsdup(const wchar_t *str); #endif -extern void * +void * wimlib_aligned_malloc(size_t size, size_t alignment); -extern void +void wimlib_aligned_free(void *ptr); -extern void * +void * memdup(const void *mem, size_t size); #define MALLOC wimlib_malloc @@ -85,7 +85,7 @@ memdup(const void *mem, size_t size); *******************/ #ifndef HAVE_MEMPCPY -extern void * +void * mempcpy(void *dst, const void *src, size_t n); #endif @@ -93,10 +93,10 @@ mempcpy(void *dst, const void *src, size_t n); * Random number generation **************************/ -extern void +void get_random_bytes(void *p, size_t n); -extern void +void get_random_alnum_chars(tchar *p, size_t n); /************************ diff --git a/include/wimlib/wim.h b/include/wimlib/wim.h index 571d59cf..666f4b02 100644 --- a/include/wimlib/wim.h +++ b/include/wimlib/wim.h @@ -188,47 +188,47 @@ static inline bool wim_is_pipable(const WIMStruct *wim) return (wim->hdr.magic == PWM_MAGIC); } -extern void +void wim_decrement_refcnt(WIMStruct *wim); -extern bool +bool wim_has_solid_resources(const WIMStruct *wim); -extern int +int read_wim_header(WIMStruct *wim, struct wim_header *hdr); -extern int +int write_wim_header(const struct wim_header *hdr, struct filedes *out_fd, off_t offset); -extern int +int write_wim_header_flags(u32 hdr_flags, struct filedes *out_fd); -extern int +int select_wim_image(WIMStruct *wim, int image); -extern void +void deselect_current_wim_image(WIMStruct *wim); -extern int +int for_image(WIMStruct *wim, int image, int (*visitor)(WIMStruct *)); -extern int +int wim_checksum_unhashed_blobs(WIMStruct *wim); -extern int +int delete_wim_image(WIMStruct *wim, int image); /* Internal open flags (pass to open_wim_as_WIMStruct(), not wimlib_open_wim()) */ #define WIMLIB_OPEN_FLAG_FROM_PIPE 0x80000000 -extern int +int open_wim_as_WIMStruct(const void *wim_filename_or_fd, int open_flags, WIMStruct **wim_ret, wimlib_progress_func_t progfunc, void *progctx); -extern int +int can_modify_wim(WIMStruct *wim); #endif /* _WIMLIB_WIM_H */ diff --git a/include/wimlib/wimboot.h b/include/wimlib/wimboot.h index 10857d5b..97071290 100644 --- a/include/wimlib/wimboot.h +++ b/include/wimlib/wimboot.h @@ -8,13 +8,13 @@ struct blob_descriptor; -extern int +int wimboot_alloc_data_source_id(const wchar_t *wim_path, const u8 guid[GUID_SIZE], int image, const wchar_t *target, u64 *data_source_id_ret, bool *wof_running_ret); -extern bool +bool wimboot_set_pointer(HANDLE h, const struct blob_descriptor *blob, u64 data_source_id, diff --git a/include/wimlib/win32.h b/include/wimlib/win32.h index 16462096..ed54e6f5 100644 --- a/include/wimlib/win32.h +++ b/include/wimlib/win32.h @@ -13,55 +13,55 @@ struct blob_descriptor; struct consume_chunk_callback; struct windows_file; -extern struct windows_file * +struct windows_file * clone_windows_file(const struct windows_file *file); -extern void +void free_windows_file(struct windows_file *file); -extern int +int cmp_windows_files(const struct windows_file *file1, const struct windows_file *file2); -extern int +int read_windows_file_prefix(const struct blob_descriptor *blob, u64 size, const struct consume_chunk_callback *cb, bool recover_data); -extern int +int win32_global_init(int init_flags); -extern void +void win32_global_cleanup(void); -extern int +int fsync(int fd); -extern tchar * +tchar * realpath(const tchar *path, tchar *resolved_path); -extern int +int win32_rename_replacement(const tchar *oldpath, const tchar *newpath); -extern int +int win32_truncate_replacement(const tchar *path, off_t size); -extern int +int win32_strerror_r_replacement(int errnum, tchar *buf, size_t buflen); -extern FILE * +FILE * win32_open_logfile(const wchar_t *path); -extern ssize_t +ssize_t win32_read(int fd, void *buf, size_t count); -extern ssize_t +ssize_t win32_write(int fd, const void *buf, size_t count); -extern ssize_t +ssize_t win32_pread(int fd, void *buf, size_t count, off_t offset); -extern ssize_t +ssize_t win32_pwrite(int fd, const void *buf, size_t count, off_t offset); #endif /* _WIN32 */ diff --git a/include/wimlib/win32_common.h b/include/wimlib/win32_common.h index a886b56d..320da3eb 100644 --- a/include/wimlib/win32_common.h +++ b/include/wimlib/win32_common.h @@ -136,28 +136,28 @@ extern NTSTATUS (WINAPI *func_RtlCreateSystemVolumeInformationFolder) /* Other utility functions */ -extern int +int win32_path_to_nt_path(const wchar_t *win32_path, UNICODE_STRING *nt_path); -extern int +int win32_get_drive_path(const wchar_t *file_path, wchar_t drive_path[7]); -extern bool +bool win32_try_to_attach_wof(const wchar_t *drive); -extern void +void win32_warning(DWORD err, const wchar_t *format, ...) _cold_attribute; -extern void +void win32_error(DWORD err, const wchar_t *format, ...) _cold_attribute; -extern void +void winnt_warning(NTSTATUS status, const wchar_t *format, ...) _cold_attribute; -extern void +void winnt_error(NTSTATUS status, const wchar_t *format, ...) _cold_attribute; -extern NTSTATUS +NTSTATUS winnt_fsctl(HANDLE h, u32 code, const void *in, u32 in_size, void *out, u32 out_size_avail, u32 *actual_out_size_ret); diff --git a/include/wimlib/win32_vss.h b/include/wimlib/win32_vss.h index 6e9c1977..54244064 100644 --- a/include/wimlib/win32_vss.h +++ b/include/wimlib/win32_vss.h @@ -14,7 +14,7 @@ struct vss_snapshot { size_t refcnt; }; -extern void +void vss_delete_snapshot(struct vss_snapshot *snapshot); /* Acquire a reference to the specified VSS snapshot. */ @@ -35,11 +35,11 @@ vss_put_snapshot(struct vss_snapshot *snapshot) vss_delete_snapshot(snapshot); } -extern int +int vss_create_snapshot(const wchar_t *source, UNICODE_STRING *vss_path_ret, struct vss_snapshot **snapshot_ret); -extern void +void vss_global_cleanup(void); #endif /* _WIMLIB_WIN32_VSS_H */ diff --git a/include/wimlib/write.h b/include/wimlib/write.h index 3f7a7e54..605b10de 100644 --- a/include/wimlib/write.h +++ b/include/wimlib/write.h @@ -31,9 +31,9 @@ WIMLIB_WRITE_FLAG_UNSAFE_COMPACT) #if defined(HAVE_SYS_FILE_H) && defined(HAVE_FLOCK) -extern int +int lock_wim_for_append(WIMStruct *wim); -extern void +void unlock_wim_for_append(WIMStruct *wim); #else static inline int diff --git a/include/wimlib/xml.h b/include/wimlib/xml.h index a8d8f91f..c11138c9 100644 --- a/include/wimlib/xml.h +++ b/include/wimlib/xml.h @@ -7,53 +7,53 @@ struct wim_xml_info; -extern struct wim_xml_info * +struct wim_xml_info * xml_new_info_struct(void); -extern void +void xml_free_info_struct(struct wim_xml_info *info); /*****************************************************************************/ -extern int +int xml_get_image_count(const struct wim_xml_info *info); -extern u64 +u64 xml_get_total_bytes(const struct wim_xml_info *info); -extern u64 +u64 xml_get_image_total_bytes(const struct wim_xml_info *info, int image); -extern u64 +u64 xml_get_image_hard_link_bytes(const struct wim_xml_info *info, int image); -extern bool +bool xml_get_wimboot(const struct wim_xml_info *info, int image); -extern u64 +u64 xml_get_windows_build_number(const struct wim_xml_info *info, int image); -extern int +int xml_set_wimboot(struct wim_xml_info *info, int image); /*****************************************************************************/ -extern int +int xml_update_image_info(WIMStruct *wim, int image); -extern int +int xml_add_image(struct wim_xml_info *info, const tchar *name); -extern int +int xml_export_image(const struct wim_xml_info *src_info, int src_image, struct wim_xml_info *dest_info, const tchar *dest_image_name, const tchar *dest_image_description, bool wimboot); -extern void +void xml_delete_image(struct wim_xml_info *info, int image); -extern void +void xml_print_image_info(struct wim_xml_info *info, int image); /*****************************************************************************/ @@ -63,10 +63,10 @@ struct wim_reshdr; #define WIM_TOTALBYTES_USE_EXISTING ((u64)(-1)) #define WIM_TOTALBYTES_OMIT ((u64)(-2)) -extern int +int read_wim_xml_data(WIMStruct *wim); -extern int +int write_wim_xml_data(WIMStruct *wim, int image, u64 total_bytes, struct wim_reshdr *out_reshdr, int write_resource_flags); diff --git a/include/wimlib/xml_windows.h b/include/wimlib/xml_windows.h index c374bc8a..203e79d0 100644 --- a/include/wimlib/xml_windows.h +++ b/include/wimlib/xml_windows.h @@ -3,7 +3,7 @@ #include "wimlib/types.h" -extern int +int set_windows_specific_info(WIMStruct *wim); #endif /* _WIMLIB_XML_WINDOWS_H */ diff --git a/programs/imagex-win32.h b/programs/imagex-win32.h index 11143f7b..2a694c0e 100644 --- a/programs/imagex-win32.h +++ b/programs/imagex-win32.h @@ -6,13 +6,13 @@ #include #include -extern wchar_t * +wchar_t * win32_mbs_to_wcs(const char *mbs, size_t mbs_nbytes, size_t *num_wchars_ret); -extern void +void win32_print_security_descriptor(const uint8_t *sd, size_t size); -extern void +void set_fd_to_binary_mode(int fd); #include "wgetopt.h" diff --git a/programs/imagex.c b/programs/imagex.c index c0b68020..25cc2477 100644 --- a/programs/imagex.c +++ b/programs/imagex.c @@ -4708,7 +4708,7 @@ usage_all(FILE *fp) } #ifdef _WIN32 -extern int wmain(int argc, wchar_t **argv); +int wmain(int argc, wchar_t **argv); #define main wmain #endif diff --git a/programs/wgetopt.h b/programs/wgetopt.h index 9b2f3a3b..70887062 100644 --- a/programs/wgetopt.h +++ b/programs/wgetopt.h @@ -17,14 +17,14 @@ struct woption { #define required_argument 1 #define optional_argument 2 -extern int +int wgetopt (int argc, wchar_t *const *argv, const wchar_t *optstring); -extern int +int wgetopt_long(int argc, wchar_t * const *argv, const wchar_t *options, const struct woption *long_options, int *opt_index); -extern int +int wgetopt_long_only(int argc, wchar_t *const *argv, const wchar_t *options, const struct woption *long_options, int *opt_index); diff --git a/tests/wlfuzz.c b/tests/wlfuzz.c index e9880a26..a32218f2 100644 --- a/tests/wlfuzz.c +++ b/tests/wlfuzz.c @@ -188,17 +188,17 @@ create_ntfs_volume(const char *name) #ifdef _WIN32 -extern WINAPI NTSTATUS NtQueryDirectoryFile (HANDLE FileHandle, - HANDLE Event, - PIO_APC_ROUTINE ApcRoutine, - PVOID ApcContext, - PIO_STATUS_BLOCK IoStatusBlock, - PVOID FileInformation, - ULONG Length, - FILE_INFORMATION_CLASS FileInformationClass, - BOOLEAN ReturnSingleEntry, - PUNICODE_STRING FileName, - BOOLEAN RestartScan); +WINAPI NTSTATUS NtQueryDirectoryFile(HANDLE FileHandle, + HANDLE Event, + PIO_APC_ROUTINE ApcRoutine, + PVOID ApcContext, + PIO_STATUS_BLOCK IoStatusBlock, + PVOID FileInformation, + ULONG Length, + FILE_INFORMATION_CLASS FileInformationClass, + BOOLEAN ReturnSingleEntry, + PUNICODE_STRING FileName, + BOOLEAN RestartScan); static void delete_directory_tree_recursive(HANDLE cur_dir, UNICODE_STRING *name) @@ -1045,7 +1045,7 @@ static const operation_func operation_table[] = { }; #ifdef _WIN32 -extern int wmain(int argc, wchar_t **argv); +int wmain(int argc, wchar_t **argv); #define main wmain #endif -- 2.43.0