-/* Description of the location, size, and compression status of a WIM resource
- * (stream). This is the in-memory version of `struct resource_entry_disk'. */
-struct resource_entry {
- /* Size, in bytes, of the resource as it appears in the WIM file. If
- * the resource is uncompressed, this will be the same as
- * @original_size. If the resource is compressed, this will be the
- * compressed size of the resource, including all compressed chunks as
- * well as the chunk table.
- *
- * Note: if the WIM is "pipable", this value does not include the stream
- * header. */
- u64 size : 56;
-
- /* Bitwise OR of one or more of the WIM_RESHDR_FLAG_* flags. */
- u64 flags : 8;
-
- /* Offset, in bytes, of the resource from the start of the WIM file. */
- u64 offset;
-
- /* Uncompressed size, in bytes, of the resource (stream). */
- u64 original_size;
+/* Specification of a resource in a WIM file.
+ *
+ * If a `struct wim_lookup_table_entry' lte has
+ * (lte->resource_location == RESOURCE_IN_WIM), then lte->wim_res_spec points to
+ * an instance of this structure.
+ *
+ * Normally, there is a one-to-one correspondence between WIM lookup table
+ * entries ("streams", each of which may be the contents of a file, for example)
+ * and WIM resources. However, WIM resources with the
+ * WIM_RESHDR_FLAG_PACKED_STREAMS flag set may actually contain multiple streams
+ * compressed together. */
+struct wim_resource_spec {
+ /* The WIM containing this resource. @wim->in_fd is expected to be a
+ * file descriptor to the underlying WIM file, opened for reading. */
+ WIMStruct *wim;
+
+ /* The offset, in bytes, from the start of WIM file at which this
+ * resource starts. */
+ u64 offset_in_wim;
+
+ /* The size of this resource in the WIM file. For compressed resources
+ * this is the compressed size. */
+ u64 size_in_wim;
+
+ /* The number of bytes of uncompressed data this resource decompresses
+ * to. */
+ u64 uncompressed_size;
+
+ /* The list of streams this resource contains. */
+ struct list_head stream_list;
+
+ /* Flags for this resource (WIM_RESHDR_FLAG_*) */
+ u32 flags : 8;
+
+ /* This flag will be set if the WIM is pipable. In such cases, the
+ * resource will be in a slightly different format if it is compressed.
+ * This is a wimlib extension. */
+ u32 is_pipable : 1;
+
+ /* Temporary flag. */
+ u32 raw_copy_ok : 1;