From f5caf29f0f4e72500c7c63ce891c13c87c17a38d Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Wed, 22 May 2013 23:53:38 -0500 Subject: [PATCH] Deprecate wimlib_has_integrity_table() --- include/wimlib.h | 20 ++++++++------------ src/wim.c | 16 ++++++++++------ 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/include/wimlib.h b/include/wimlib.h index 62caa2db..0ffc302e 100644 --- a/include/wimlib.h +++ b/include/wimlib.h @@ -686,10 +686,14 @@ struct wimlib_wim_info { * table. */ uint64_t total_bytes; - /** 1 if the WIM has an integrity table */ + /** 1 if the WIM has an integrity table. Note: if the ::WIMStruct was + * created via wimlib_create_new_wim() rather than wimlib_open_wim(), + * this will always be 0, even if the ::WIMStruct was written to + * somewhere by calling wimlib_write() with the + * ::WIMLIB_WRITE_FLAG_CHECK_INTEGRITY flag specified. */ uint32_t has_integrity_table : 1; - /** 1 if the WIM was created via wimlib_open_wim() rather than + /** 1 if the ::WIMStruct was created via wimlib_open_wim() rather than * wimlib_create_new_wim(). */ uint32_t opened_from_file : 1; @@ -1815,18 +1819,10 @@ extern void wimlib_global_cleanup(void); /** - * Returns true if the WIM has an integrity table. - * - * @param wim - * Pointer to the ::WIMStruct for a WIM file. - * @return - * @c true if the WIM has an integrity table; @c false otherwise. If @a - * wim is a ::WIMStruct created with wimlib_create_new_wim() rather than - * wimlib_open_wim(), @c false will be returned, even if wimlib_write() has - * been called on @a wim with ::WIMLIB_WRITE_FLAG_CHECK_INTEGRITY set. + * Deprecated in favor of wimlib_get_wim_info(). */ extern bool -wimlib_has_integrity_table(const WIMStruct *wim); +wimlib_has_integrity_table(const WIMStruct *wim) _wimlib_deprecated; /** * Determines if an image name is already used by some image in the WIM. diff --git a/src/wim.c b/src/wim.c index b15a02de..73fdebf0 100644 --- a/src/wim.c +++ b/src/wim.c @@ -279,12 +279,6 @@ wimlib_print_wim_information(const WIMStruct *w) tputchar(T('\n')); } -WIMLIBAPI bool -wimlib_has_integrity_table(const WIMStruct *w) -{ - return w->hdr.integrity.size != 0; -} - WIMLIBAPI void wimlib_print_available_images(const WIMStruct *w, int image) { @@ -412,6 +406,16 @@ wimlib_get_part_number(const WIMStruct *wim, int *total_parts_ret) return info.part_number; } +/* Deprecated */ +WIMLIBAPI bool +wimlib_has_integrity_table(const WIMStruct *wim) +{ + struct wimlib_wim_info info; + + wimlib_get_wim_info((WIMStruct*)wim, &info); + return info.has_integrity_table; +} + WIMLIBAPI int wimlib_set_wim_info(WIMStruct *wim, const struct wimlib_wim_info *info, int which) { -- 2.43.0