Commit Graph

22 Commits

Author SHA1 Message Date
01d3c27d41
chore: bump patch version 2023-02-06 22:42:31 +01:00
873f056cc3
chore: bump minor version 2023-02-04 19:42:12 +01:00
45fbd789d6
docs: Add APi documentation for MTAR_CHRDEV and MTAR_BLKDEV
Missed that in the previous commits.
2023-01-29 22:14:05 +01:00
e96f7127bf
chore: bump minor version 2023-01-29 22:10:04 +01:00
e9ca265068
fix: Deprecate MINITAR_IGNORE_UNSUPPORTED_TYPES 2023-01-29 22:08:13 +01:00
ce0db53a90
chore: bump minor version 2023-01-26 22:14:22 +01:00
240a4f2f1a
chore: Add examples to CMake as opt-in targets 2023-01-19 22:30:23 +01:00
dead1e3ee2
feat: Move all internal structures to a minitar_entry_internal struct 2023-01-12 19:20:32 +01:00
087b099917
Documentation update 2022-12-31 12:57:24 +01:00
d018d128a0
Optionally ignore unsupported types instead of panicking 2022-12-30 11:13:21 +01:00
7d4e774cf7
Rewrite the entire API just to eliminate heap allocations
Just bumping minor because nobody uses this and I don't want to jump up to 2.0.0
2022-12-25 14:33:47 +01:00
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