+ * 0:
+ * Just do a normal read, decompressing the data if necessary. @size and
+ * @offset are interpreted relative to the uncompressed contents of the
+ * stream.
+ *
+ * WIMLIB_READ_RESOURCE_FLAG_RAW_FULL:
+ * Only valid when the resource is compressed: Read the raw contents of
+ * the compressed resource. If the resource is non-pipable, this includes
+ * the chunk table as well as the compressed chunks. If the resource is
+ * pipable, this includes the compressed chunks--- including the chunk
+ * headers--- and the chunk table. The stream header is still *not*
+ * included.
+ *
+ * In this mode, @offset is relative to the beginning of the raw contents
+ * of the compressed resource--- that is, the chunk table if the resource
+ * is non-pipable, or the header for the first compressed chunk if the
+ * resource is pipable. @size is the number of raw bytes to read, which
+ * must not overrun the end of the resource. For example, if @offset is 0,
+ * then @size can be at most the raw size of the compressed resource
+ * (@lte->resource_entry.size).
+ *
+ * WIMLIB_READ_RESOURCE_FLAG_RAW_CHUNKS:
+ * Only valid when the resource is compressed and is not being read from a
+ * pipe: Read the raw contents of the compressed chunks of the compressed
+ * resource. For pipable resources, this does *not* include the chunk
+ * headers. If a callback function is being used, it will be called once
+ * for each compressed chunk. The chunk table is excluded. Also, for
+ * pipable resources, the stream and chunk headers are excluded. In this
+ * mode, @size must be exactly the raw size of the compressed resource
+ * (@lte->resource_entry.size) and @offset must be 0.
+ *
+ * WIMLIB_READ_RESOURCE_FLAG_SEEK_ONLY:
+ * Only valid when the resource is being read from a pipe: Skip over the
+ * requested data rather than feed it to the callback function or write it
+ * into the buffer. No decompression is done.
+ * WIMLIB_READ_RESOURCE_FLAG_RAW_* may not be combined with this flag.
+ * @offset must be 0 and @size must be the uncompressed size of the
+ * resource.
+ *
+ * Return values:
+ * WIMLIB_ERR_SUCCESS (0)
+ * WIMLIB_ERR_READ (errno set)
+ * WIMLIB_ERR_UNEXPECTED_END_OF_FILE (errno set to 0)
+ * WIMLIB_ERR_NOMEM (errno set to ENOMEM)
+ * WIMLIB_ERR_DECOMPRESSION (errno set to EINVAL)
+ * WIMLIB_ERR_INVALID_PIPABLE_WIM (errno set to EINVAL)
+ *
+ * or other error code returned by the @cb function.