-/* Extract the first @size bytes of the specified stream.
- *
- * If @size specifies the full uncompressed size of the stream, then the SHA1
- * message digest of the uncompressed stream is checked while being extracted.
- *
- * The uncompressed data of the resource is passed in chunks of unspecified size
- * to the @extract_chunk function, passing it @extract_chunk_arg. */
-int
-extract_stream(struct wim_lookup_table_entry *lte, u64 size,
- consume_data_callback_t extract_chunk, void *extract_chunk_arg)
-{
- wimlib_assert(size <= lte->size);
- if (size == lte->size) {
- /* Do SHA1. */
- struct read_stream_list_callbacks cbs = {
- .consume_chunk = extract_chunk,
- .consume_chunk_ctx = extract_chunk_arg,
- };
- return read_full_stream_with_sha1(lte, &cbs);
- } else {
- /* Don't do SHA1. */
- return read_stream_prefix(lte, size, extract_chunk,
- extract_chunk_arg);
- }
-}
-
-/* A consume_data_callback_t implementation that writes the chunk of data to a
- * file descriptor. */
-int
-extract_chunk_to_fd(const void *chunk, size_t size, void *_fd_p)