#include <archive.h>
#include <archive_entry.h>
+#define INIT_ARCHIVE(ar) \
+ archive_read_support_compression_all((ar)); \
+ archive_read_support_format_all((ar))
+
using __gnu_cxx::stdio_filebuf;
pkgutil::pkgutil(const string& name)
result.second.version = version;
archive = archive_read_new();
- archive_read_support_compression_all(archive);
- archive_read_support_format_all(archive);
+ INIT_ARCHIVE(archive);
if (archive_read_open_filename(archive,
const_cast<char*>(filename.c_str()),
unsigned int i;
archive = archive_read_new();
- archive_read_support_compression_all(archive);
- archive_read_support_format_all(archive);
+ INIT_ARCHIVE(archive);
if (archive_read_open_filename(archive,
const_cast<char*>(filename.c_str()),
//
// FIXME the code duplication here is butt ugly
archive = archive_read_new();
- archive_read_support_compression_all(archive);
- archive_read_support_format_all(archive);
+ INIT_ARCHIVE(archive);
if (archive_read_open_filename(archive,
const_cast<char*>(filename.c_str()),
// Too bad, there doesn't seem to be a way to reuse our archive
// instance
archive = archive_read_new();
- archive_read_support_compression_all(archive);
- archive_read_support_format_all(archive);
+ INIT_ARCHIVE(archive);
if (archive_read_open_filename(archive,
const_cast<char*>(filename.c_str()),