-/*
- * Extract the first @size bytes of the specified blob.
- *
- * If @size specifies the full uncompressed size of the blob, then the SHA-1
- * message digest of the uncompressed blob is checked while being extracted.
- *
- * The uncompressed data of the blob is passed in chunks of unspecified size to
- * the @extract_chunk function, passing it @extract_chunk_arg.
- */
-int
-extract_blob(struct blob_descriptor *blob, u64 size,
- consume_data_callback_t extract_chunk, void *extract_chunk_arg)
-{
- wimlib_assert(size <= blob->size);
- if (size == blob->size) {
- /* Do SHA-1. */
- struct read_blob_list_callbacks cbs = {
- .consume_chunk = extract_chunk,
- .consume_chunk_ctx = extract_chunk_arg,
- };
- return read_full_blob_with_sha1(blob, &cbs);
- } else {
- /* Don't do SHA-1. */
- return read_blob_prefix(blob, size, extract_chunk,
- extract_chunk_arg);
- }
-}
-
-/* A consume_data_callback_t implementation that writes the chunk of data to a
- * file descriptor. */