From 4eb18e0c42c31de268f428c355f7a661f614a80f Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Thu, 23 May 2013 00:02:10 -0500 Subject: [PATCH] Deprecate wimlib_print_wim_information() --- include/wimlib.h | 13 +++---------- src/wim.c | 26 +++++++++++++------------- 2 files changed, 16 insertions(+), 23 deletions(-) diff --git a/include/wimlib.h b/include/wimlib.h index 0ffc302e..1efdcb1b 100644 --- a/include/wimlib.h +++ b/include/wimlib.h @@ -2327,18 +2327,11 @@ extern int wimlib_print_metadata(WIMStruct *wim, int image); /** - * Prints some basic information about a WIM file. All information printed by - * this function is also printed by wimlib_print_header(), but - * wimlib_print_wim_information() prints some of this information more concisely - * and in a more readable form. - * - * @param wim - * Pointer to the ::WIMStruct for a WIM file. - * - * @return This function has no return value. + * Deprecated in favor of wimlib_get_wim_info(), which provides the information + * in a way that can be accessed programatically. */ extern void -wimlib_print_wim_information(const WIMStruct *wim); +wimlib_print_wim_information(const WIMStruct *wim) _wimlib_deprecated; /** * Translates a string specifying the name or number of an image in the WIM into diff --git a/src/wim.c b/src/wim.c index 73fdebf0..475ec19b 100644 --- a/src/wim.c +++ b/src/wim.c @@ -254,28 +254,28 @@ wimlib_resolve_image(WIMStruct *w, const tchar *image_name_or_num) /* Prints some basic information about a WIM file. */ WIMLIBAPI void -wimlib_print_wim_information(const WIMStruct *w) +wimlib_print_wim_information(const WIMStruct *wim) { - const struct wim_header *hdr; + struct wimlib_wim_info info; + + wimlib_get_wim_info((WIMStruct*)wim, &info); - hdr = &w->hdr; tputs(T("WIM Information:")); tputs(T("----------------")); - tprintf(T("Path: %"TS"\n"), w->filename); + tprintf(T("Path: %"TS"\n"), wim->filename); tfputs(T("GUID: 0x"), stdout); - print_byte_field(hdr->guid, WIM_GID_LEN, stdout); + print_byte_field(info.guid, WIM_GID_LEN, stdout); tputchar(T('\n')); - tprintf(T("Image Count: %d\n"), hdr->image_count); + tprintf(T("Image Count: %d\n"), info.image_count); tprintf(T("Compression: %"TS"\n"), - wimlib_get_compression_type_string(w->compression_type)); - tprintf(T("Part Number: %d/%d\n"), hdr->part_number, hdr->total_parts); - tprintf(T("Boot Index: %d\n"), hdr->boot_idx); - tprintf(T("Size: %"PRIu64" bytes\n"), - wim_info_get_total_bytes(w->wim_info)); + wimlib_get_compression_type_string(info.compression_type)); + tprintf(T("Part Number: %d/%d\n"), info.part_number, info.total_parts); + tprintf(T("Boot Index: %d\n"), info.boot_index); + tprintf(T("Size: %"PRIu64" bytes\n"), info.total_bytes); tprintf(T("Integrity Info: %"TS"\n"), - (w->hdr.integrity.offset != 0) ? T("yes") : T("no")); + info.has_integrity_table ? T("yes") : T("no")); tprintf(T("Relative path junction: %"TS"\n"), - (hdr->flags & WIM_HDR_FLAG_RP_FIX) ? T("yes") : T("no")); + info.has_rpfix ? T("yes") : T("no")); tputchar(T('\n')); } -- 2.43.0