From d33dd6e6c09d87a59989057ad622a6265ddec2e0 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 11 Sep 2019 13:10:46 +0200 Subject: Move code around --- src/libutil/local.mk | 2 ++ src/libutil/rust-ffi.cc | 2 +- src/libutil/tarfile.cc | 14 ++++++++++++++ src/libutil/tarfile.hh | 7 +++++++ 4 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 src/libutil/tarfile.cc create mode 100644 src/libutil/tarfile.hh (limited to 'src/libutil') diff --git a/src/libutil/local.mk b/src/libutil/local.mk index e41a67d1f..35c1f6c13 100644 --- a/src/libutil/local.mk +++ b/src/libutil/local.mk @@ -7,3 +7,5 @@ libutil_DIR := $(d) libutil_SOURCES := $(wildcard $(d)/*.cc) libutil_LDFLAGS = $(LIBLZMA_LIBS) -lbz2 -pthread $(OPENSSL_LIBS) $(LIBBROTLI_LIBS) $(BOOST_LDFLAGS) -lboost_context + +libutil_LIBS = libnixrust diff --git a/src/libutil/rust-ffi.cc b/src/libutil/rust-ffi.cc index a616d83a6..931d29542 100644 --- a/src/libutil/rust-ffi.cc +++ b/src/libutil/rust-ffi.cc @@ -1,5 +1,5 @@ #include "logging.hh" -#include "rust.hh" +#include "rust-ffi.hh" namespace nix { diff --git a/src/libutil/tarfile.cc b/src/libutil/tarfile.cc new file mode 100644 index 000000000..ae6d512bd --- /dev/null +++ b/src/libutil/tarfile.cc @@ -0,0 +1,14 @@ +#include "rust-ffi.hh" + +extern "C" { + rust::CBox2>> unpack_tarfile(rust::Source source, rust::StringSlice dest_dir); +} + +namespace nix { + +void unpackTarfile(Source & source, Path destDir) +{ + unpack_tarfile(source, destDir).use()->unwrap(); +} + +} diff --git a/src/libutil/tarfile.hh b/src/libutil/tarfile.hh new file mode 100644 index 000000000..c3e95fb0c --- /dev/null +++ b/src/libutil/tarfile.hh @@ -0,0 +1,7 @@ +#include "serialise.hh" + +namespace nix { + +void unpackTarfile(Source & source, Path destDir); + +} -- cgit v1.2.3