return 0;
}
+/* Update just the wim_flags field. */
+int
+write_header_flags(u32 hdr_flags, int out_fd)
+{
+ le32 flags = cpu_to_le32(hdr_flags);
+ if (full_pwrite(out_fd, &flags, sizeof(flags),
+ offsetof(struct wim_header_disk, wim_flags)) != sizeof(flags))
+ {
+ return WIMLIB_ERR_WRITE;
+ } else {
+ return 0;
+ }
+
+}
+
+/* Update just the part_number and total_parts fields. */
+int
+write_header_part_data(u16 part_number, u16 total_parts, int out_fd)
+{
+ le16 part_data[2] = {
+ cpu_to_le16(part_number),
+ cpu_to_le16(total_parts),
+ };
+ if (full_pwrite(out_fd, &part_data, sizeof(part_data),
+ offsetof(struct wim_header_disk, part_number)) != sizeof(part_data))
+ {
+ return WIMLIB_ERR_WRITE;
+ } else {
+ return 0;
+ }
+}
+
/*
* Initializes the header for a WIM file.
*/
{WIM_HDR_FLAG_COMPRESS_XPRESS, "COMPRESS_XPRESS"},
};
-/* Prints information from the header of the WIM file associated with @w. */
+/* Prints information from the header of the WIM file associated with @wim. */
WIMLIBAPI void
-wimlib_print_header(const WIMStruct *w)
+wimlib_print_header(const WIMStruct *wim)
{
- const struct wim_header *hdr = &w->hdr;
+ const struct wim_header *hdr = &wim->hdr;
tprintf(T("Magic Characters = MSWIM\\000\\000\\000\n"));
tprintf(T("Header Size = %u\n"), WIM_HEADER_DISK_SIZE);
tfputs (T("GUID = "), stdout);
print_byte_field(hdr->guid, WIM_GID_LEN, stdout);
tputchar(T('\n'));
- tprintf(T("Part Number = %hu\n"), w->hdr.part_number);
- tprintf(T("Total Parts = %hu\n"), w->hdr.total_parts);
+ tprintf(T("Part Number = %hu\n"), wim->hdr.part_number);
+ tprintf(T("Total Parts = %hu\n"), wim->hdr.total_parts);
tprintf(T("Image Count = %u\n"), hdr->image_count);
tprintf(T("Lookup Table Size = %"PRIu64"\n"),
(u64)hdr->lookup_table_res_entry.size);