X-Git-Url: https://wimlib.net/git/?a=blobdiff_plain;f=src%2Fresource.c;h=4b91be6b010104fc2c26cf65f5a16b77606f357a;hb=1e167170cdc048c6a93db6d994d9da161f8553d9;hp=464ca711ea43a3dbb7dda4d87b3a4d9a8e0b20ec;hpb=f9695b9f40035f1a20968293255761a8301eaba0;p=wimlib diff --git a/src/resource.c b/src/resource.c index 464ca711..4b91be6b 100644 --- a/src/resource.c +++ b/src/resource.c @@ -48,7 +48,7 @@ * Returns zero on success, nonzero on failure. */ static int -read_compressed_resource(filedes_t in_fd, +read_compressed_resource(int in_fd, u64 resource_compressed_size, u64 resource_uncompressed_size, u64 resource_offset, @@ -344,31 +344,6 @@ read_error: goto out; } -/* - * Reads uncompressed data from an open file stream. - */ -int -read_uncompressed_resource(FILE *fp, u64 offset, u64 len, void *contents_ret) -{ - if (fseeko(fp, offset, SEEK_SET) != 0) { - ERROR("Failed to seek to byte %"PRIu64" of input file " - "to read uncompressed resource (len = %"PRIu64")", - offset, len); - return WIMLIB_ERR_READ; - } - if (fread(contents_ret, 1, len, fp) != len) { - if (feof(fp)) { - ERROR("Unexpected EOF in uncompressed file resource"); - } else { - ERROR("Failed to read %"PRIu64" bytes from " - "uncompressed resource at offset %"PRIu64, - len, offset); - } - return WIMLIB_ERR_READ; - } - return 0; -} - /* Reads the contents of a struct resource_entry, as represented in the on-disk * format, from the memory pointed to by @p, and fills in the fields of @entry. * A pointer to the byte after the memory read at @p is returned. */ @@ -422,7 +397,7 @@ read_partial_wim_resource(const struct wim_lookup_table_entry *lte, u64 offset) { WIMStruct *wim; - filedes_t in_fd; + int in_fd; int ret; wimlib_assert(lte->resource_location == RESOURCE_IN_WIM); @@ -588,8 +563,6 @@ typedef int (*read_resource_prefix_handler_t)(const struct wim_lookup_table_entr * size until the resource is exhausted. * * If the resource is located in a WIM file, @flags can be: - * * WIMLIB_RESOURCE_FLAG_THREADSAFE_READ if it must be safe to access the resource - * concurrently by multiple threads. * * WIMLIB_RESOURCE_FLAG_RAW if the raw compressed data is to be supplied * instead of the uncompressed data. * Otherwise, the @flags are ignored.