-/*
- * Initializes the header for a WIM file.
- */
-int
-init_wim_header(struct wim_header *hdr, int ctype)
-{
- memset(hdr, 0, sizeof(struct wim_header));
- switch (ctype) {
- case WIMLIB_COMPRESSION_TYPE_NONE:
- hdr->flags = 0;
- break;
- case WIMLIB_COMPRESSION_TYPE_LZX:
- hdr->flags = WIM_HDR_FLAG_COMPRESSION |
- WIM_HDR_FLAG_COMPRESS_LZX;
- break;
- case WIMLIB_COMPRESSION_TYPE_XPRESS:
- hdr->flags = WIM_HDR_FLAG_COMPRESSION |
- WIM_HDR_FLAG_COMPRESS_XPRESS;
- break;
- default:
- ERROR("Invalid compression type specified (%d)", ctype);
- return WIMLIB_ERR_INVALID_COMPRESSION_TYPE;
- }
- hdr->total_parts = 1;
- hdr->part_number = 1;
- randomize_byte_array(hdr->guid, sizeof(hdr->guid));
- hdr->magic = WIM_MAGIC;
- return 0;
-}
-
-struct hdr_flag {