1 // -*- mode: cpp; mode: fold -*-
3 // $Id: rsync-algo.h,v 1.3 1999/12/26 06:59:01 jgg Exp $
4 /* ######################################################################
8 The RSync algorithim is attributed to Andrew Tridgell and is a means
9 for matching blocks between two streams. The algorithrim implemented
10 here differs slightly in its structure and is carefully optimized to be
11 able to operate on very large files effectively.
13 We rely on the RSync rolling weak checksum routine and the MD4 strong
14 checksum routine. This implementation requires a uniform block size
17 ##################################################################### */
19 #ifndef DSYNC_RSYNC_ALGO_H
20 #define DSYNC_RSYNC_ALGO_H
23 #pragma interface "dsync/rsync-algo.h"
26 #include <dsync/fileutl.h>
27 #include <dsync/filelist.h>
28 #include <dsync/bitmap.h>
35 uint32_t **IndexesEnd;
36 uint32_t **Hashes[257];
38 dsFList::RSyncChecksum const &Ck;
40 static int Sort(const void *L,const void *R);
44 virtual bool Hit(unsigned long Block,off_t SrcOff,
45 const unsigned char *Data) {return true;};
49 bool Scan(FileFd &Fd);
51 RSyncMatch(dsFList::RSyncChecksum const &Ck);
52 virtual ~RSyncMatch();
55 bool GenerateRSync(FileFd &Fd,dsFList::RSyncChecksum &Ck,
56 unsigned char MD5[16],
57 unsigned long BlockSize = 8*1024);