Commit Graph

11 Commits

Author SHA1 Message Date
41a1e23abf
Remove -ansi and make it compile under TCC 2022-12-25 13:06:02 +01:00
a04af496f0
Use -ansi to build when using GCC/Clang 2022-12-25 12:59:09 +01:00
23c313d9cf
Get rid of libgen.h in favor of our own basename :) 2022-12-25 12:51:35 +01:00
28d1eab1c1 Remove character and block devices from supported entry types
Closes #1.
2022-11-30 11:20:13 +01:00
e43f4d9a07 Add the root directory as an include directory for minitar.h 2022-11-23 21:22:40 +01:00
fd85cf1c6a Full path is now metadata->path and basename metadata->name
Shouldn't have rushed to 1.0.0 so quickly. Oh well, I guess I can allow 1.1.0...
2022-11-23 18:32:10 +01:00
d123c49946 Do not automatically read an entry's contents, leave it up to the user
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 :)
2022-11-21 20:20:37 +01:00
54e1473aee Remove one more line 2022-11-21 19:08:10 +01:00
6c696c67b1 Revert previous commit, but using strtoul(l) everywhere
I'm pretty sure every field in a tar header is unsigned octal...
2022-11-21 19:07:49 +01:00
30c7c0ad57 Determine the signedness of standard types 2022-11-21 19:01:12 +01:00
1633012823 Provide a CMakeLists.txt to use minitar with CMake 2022-11-20 20:14:08 +01:00