This API change modifies minitar_read_entry to skip over the file's contents and instead store the current read position in the entry. struct minitar_entry no longer has a ptr field, but has a position field (of type fpos_t) for internal use. minitar_free_entry no longer frees entry->ptr. A new function has been added, minitar_read_contents(). It reads a certain number of bytes from an entry (which is capped to the entry's size) into a user-provided buffer. This function can be called at any time provided it is called with a valid archive stream and entry. This is achieved by calling fgetpos() to store the start of the entry's contents in the entry's position field while reading it. Then minitar_read_contents() will store the current position, rewind to the entry's position, read the chosen number of bytes from the archive, and then rewind back to the current position. Since this is a breaking change, it needs a major version bump. Since there was no version, I bumped it to 1.0.0 :) |
||
---|---|---|
.. | ||
tar.c | ||
tar.h | ||
util.c |