aboutsummaryrefslogtreecommitdiff
path: root/src/libutil/tarfile.hh
diff options
context:
space:
mode:
authorMatthew Kenigsberg <matthewkenigsberg@gmail.com>2021-09-15 11:51:52 -0500
committerMatthew Kenigsberg <matthewkenigsberg@gmail.com>2021-09-15 11:58:06 -0500
commit3b82c1a5fef521ebadea5df12384390c8c24100c (patch)
tree67fd413bcf0b42c5ada7eddc41a04f7bd99df3a8 /src/libutil/tarfile.hh
parente023c985d58094041e74ff59a51757bc75687ca7 (diff)
parentd2c8eed34496b650935e4563ffe3174978bd22fc (diff)
Merge remote-tracking branch 'upstream/master' into auto-uid-allocation
Diffstat (limited to 'src/libutil/tarfile.hh')
-rw-r--r--src/libutil/tarfile.hh22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/libutil/tarfile.hh b/src/libutil/tarfile.hh
index 89a024f1d..f107a7e2e 100644
--- a/src/libutil/tarfile.hh
+++ b/src/libutil/tarfile.hh
@@ -1,7 +1,29 @@
#include "serialise.hh"
+#include <archive.h>
namespace nix {
+struct TarArchive {
+ struct archive * archive;
+ Source * source;
+ std::vector<unsigned char> buffer;
+
+ void check(int err, const std::string & reason = "failed to extract archive (%s)");
+
+ TarArchive(Source & source, bool raw = false);
+
+ TarArchive(const Path & path);
+
+ // disable copy constructor
+ TarArchive(const TarArchive &) = delete;
+
+ void init();
+
+ void close();
+
+ ~TarArchive();
+};
+
void unpackTarfile(Source & source, const Path & destDir);
void unpackTarfile(const Path & tarFile, const Path & destDir);