summaryrefslogtreecommitdiff
path: root/libarchive/archive_read_support_filter_program.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-27/+13
| | | | | | | | | | | | | | | | | 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/+8
| | | | | | Provides a clear separation between RW data and RO executable code. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
* reader: remove the return type of archive_read_filter_bidder_vtable::freeEmil Velikov2021-10-231-3/+2
| | | | | | | | | From over a dozen filters, only one instance has the vfunc... Always returning ARCHIVE_OK. Let's just remove the return type. 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>
* Call OpenProcess() from within __archive_create_child()Emil Velikov2020-04-251-17/+1
| | | | | | | | | | Move the Windows specific to the Windows version of the helper, making the existing code shorter and simpler. This means that the child "handle" type will vary across the two platforms - something that we've already been doing with waitpid. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
* Change __archive_create_child() signatureEmil Velikov2020-04-251-3/+4
| | | | | | | | | | Change the function to return an int - ARCHIVE_OK or ARCHIVE_FAILED, taking the child as an output argument. This will allow us to simplify the existing code and have move platform specifics in the platform files - posix and windows Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
* Plug memory leak in __archive_read_program()Martin Matuska2017-01-311-0/+2
|
* Implement functions to manually set the format and filters used.Andres Mejia2012-12-071-0/+1
|
* Parse a command line instead of usingMichihiro NAKAJIMA2012-10-111-249/+3
| | | | | | | | | | 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-1/+1
|
* Fix potential memory leaks found with Clang.Michihiro NAKAJIMA2012-10-081-2/+4
|
* Remove __archive_read_program(), use __archive_read_programl() instead.Michihiro NAKAJIMA2012-10-061-18/+0
|
* Avoid infinity wait in ReadFile during running an external program asMichihiro NAKAJIMA2012-10-051-2/+49
| | | | decoding filter on Windows.
* Make a filter program be called with its arguments.Michihiro NAKAJIMA2012-10-051-28/+320
|
* Remove unnecessary build condition for a use ofMichihiro NAKAJIMA2012-10-031-39/+1
| | | | | __archive_create_child(). It has worked well on both POSIX system and non-POSIX system since libarchive 2.7.0.
* The old "compression" terminology will be retired in libarchive 4.0.Tim Kientzle2011-08-161-12/+11
| | | | | | Make this automatic and document it correctly. SVN-Revision: 3624
* 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/+1
| | | | | | | | | | | | | | | 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-1/+20
| | | | | | | | | | | | | 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/+459
begins a move to symmetry with archive_write, function aliases will follow shortly. SVN-Revision: 3112