]> wimlib.net Git - wimlib/commitdiff
Deprecate wimlib_has_integrity_table()
authorEric Biggers <ebiggers3@gmail.com>
Thu, 23 May 2013 04:53:38 +0000 (23:53 -0500)
committerEric Biggers <ebiggers3@gmail.com>
Thu, 23 May 2013 04:53:38 +0000 (23:53 -0500)
include/wimlib.h
src/wim.c

index 62caa2db3f199e4e350a96aeed30127ca2e9866e..0ffc302e0934a39dc23209ca64d2965e38a94bcc 100644 (file)
@@ -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.
index b15a02de43881c68b597d5dec778bc67541e0510..73fdebf04d010cdb8fca540f3363723af44c6cd9 100644 (file)
--- 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)
 {