summaryrefslogtreecommitdiff
path: root/libarchive/archive_read_support_filter_bzip2.c
Commit message (Collapse)AuthorAgeFilesLines
* reader: introduce struct archive_read_filter_vtableEmil Velikov2021-10-231-2/+7
| | | | | | | | | As before - move the dispatch/function pointer so a const data segment. Separating it from the RW data section. Note: the close function is _not_ optional - remove the NULL check. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
* reader: track read_filter "can_skip" with a flagEmil Velikov2021-10-231-1/+0
| | | | | | | | | | | | Analogous to the earlier "can_seek" change. Drop the function pointer in favour of a flag. Over the years, with over a dozen filters, no filters actually implemented it. If at a point in the future that changes, one can reinstate it. Alternatively one could use a ARCHIVE_FILTER_NONE check. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
* reader: transform get_bidder into register_bidderEmil Velikov2021-10-231-8/+2
| | | | | | | | | | | | | | | | | There's a notable duplication across all the read bidder code. Check the archive magic/state, set the bidder private data (to NULL in all but one case), name and vtable. Change the helper to do the actual registration, keeping things simpler in the dozen+ filters. This also allows us to enforce the bidder ::bid and ::init dispatch are non NULL. The final one ::free is optional. NOTE: some of the bidders do _not_ set a name, which I suspect is a pre-existing bug. I've left them as-is, but we might want to fix and enforce that somehow. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
* reader: introduce archive_read_filter_bidder::vtableEmil Velikov2021-10-231-3/+7
| | | | | | Provides a clear separation between RW data and RO executable code. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
* reader: remove archive_read_filter_bidder_vtable::free stubsEmil Velikov2021-10-231-8/+1
| | | | | | | | | | | | There is no point in having stubs around. The caller already checks if the function pointer is NULL before calling it. With this in place only one implementation remains in filter_program. Technically we can rework/remove that as well, although the solution might not be so clean, so let's keep that for another day. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
* reader: remove unused read_filter_bidder::optionsEmil Velikov2021-10-231-1/+0
| | | | | | | | | | None of the filters set ::options and based on git log, none of them ever did despite that the API/infra was added over 10 years ago. Let's just drop it, removing the majority of archive_set_filter_option() which is essentially dead code. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
* Implement functions to manually set the format and filters used.Andres Mejia2012-12-071-0/+1
|
* Switch an external program for bzip2 decompression from "bunzip2"Michihiro NAKAJIMA2012-10-131-2/+2
| | | | to "bzip2 -d".
* Parse a command line instead of usingMichihiro NAKAJIMA2012-10-111-2/+2
| | | | | | | | | | archive_write_add_filter_programl, archive_write_add_filter_programv, archive_read_support_filter_programl, archive_read_support_filter_programv, archive_read_support_filter_programl_signature and archive_read_support_filter_programv_signature. And so remove those functions, which I recently added.
* Replace deprecated macro ARCHIVE_COMPRESSION_* by ARCHIVE_FILTER_*.Michihiro NAKAJIMA2012-10-091-2/+2
|
* Remove __archive_read_program(), use __archive_read_programl() instead.Michihiro NAKAJIMA2012-10-061-2/+2
|
* Remove test for 'self == NULL' in bzip2_reader_init. It isn't needed,Colin Percival2011-11-021-1/+1
| | | | | | | | | | since the caller is responsible for providing a non-NULL pointer; and it's meaningless because we've already dereferenced self a few lines earlier. Submitted by: Carlo Teubner (via Tarsnap bug bounties) SVN-Revision: 3742
* Issue 175: Simplify filter bidding code.Tim Kientzle2011-08-311-1/+1
| | | | SVN-Revision: 3663
* Fix screw-up with r3624. Thanks to Michihiro for pointing it out.Tim Kientzle2011-08-171-1/+1
| | | | SVN-Revision: 3635
* The old "compression" terminology will be retired in libarchive 4.0.Tim Kientzle2011-08-161-6/+5
| | | | | | Make this automatic and document it correctly. SVN-Revision: 3624
* plug crashes in archive_read_support_filter_XXXRoman Neuhauser2011-04-101-0/+3
| | | | | | these functions lacked protection by archive_check_magic. SVN-Revision: 3195
* remove archive_read_get_bidder macro againRoman Neuhauser2011-04-041-1/+2
| | | | | | Tim dislikes the hidden return statement SVN-Revision: 3157
* archive_read.c: s/__archive_errx/archive_set_error/Roman Neuhauser2011-03-301-3/+2
| | | | | | | | | | | | | | | the last two calls were in __archive_read_get_bidder() and __archive_read_register_format(). __archive_read_get_bidder() required a change in interface (not really, but if it calls archive_set_error(), it should return ARCHIVE_*); i added a wrapper macro ala archive_check_magic() to keep it DRY. some but not all archive_read_support_compression_*() functions called archive_clear_error() right after __archive_read_get_bidder. the reason isn't clear to me and no tests break without these calls, so i've removed them. SVN-Revision: 3132
* archive_read_support_compression_*() -> archive_read_support_filter_*()Roman Neuhauser2011-03-281-0/+10
| | | | | | | | | | | | | maintain BC aliases (ARCHIVE_VERSION_NUMBER < 4000000). if fact, the new names are wrappers around the old ones as i want to switch the tests to the new names and have the old names still tested. the wrappers revealed a mismatch between archive_read_support_compression_program_signature declaration in archive.h and its definition (const void* vs void*), i'm going with const void*. SVN-Revision: 3113
* archive_read_support_compression_*.c -> archive_read_support_filter_*.cRoman Neuhauser2011-03-281-0/+358
begins a move to symmetry with archive_write, function aliases will follow shortly. SVN-Revision: 3112