From 40b3f64b55f98e03b3173541b8d94cd924099223 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 30 Nov 2006 19:19:59 +0000 Subject: * Skeleton of the privileged worker program. * Some refactoring: put the NAR archive integer/string serialisation code in a separate file so it can be reused by the worker protocol implementation. --- src/libutil/archive.hh | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) (limited to 'src/libutil/archive.hh') diff --git a/src/libutil/archive.hh b/src/libutil/archive.hh index f85d589c6b2c..c70ef3f1c898 100644 --- a/src/libutil/archive.hh +++ b/src/libutil/archive.hh @@ -2,6 +2,7 @@ #define __ARCHIVE_H #include "types.hh" +#include "serialise.hh" namespace nix { @@ -44,27 +45,9 @@ namespace nix { `+' denotes string concatenation. */ -struct DumpSink -{ - virtual ~DumpSink() { } - virtual void operator () (const unsigned char * data, unsigned int len) = 0; -}; +void dumpPath(const Path & path, Sink & sink); -void dumpPath(const Path & path, DumpSink & sink); - - -struct RestoreSource -{ - virtual ~RestoreSource() { } - - /* The callee should store exactly *len bytes in the buffer - pointed to by data. It should block if that much data is not - yet available, or throw an error if it is not going to be - available. */ - virtual void operator () (unsigned char * data, unsigned int len) = 0; -}; - -void restorePath(const Path & path, RestoreSource & source); +void restorePath(const Path & path, Source & source); } -- cgit 1.4.1