1 /* Cumulus: Efficient Filesystem Backup to the Cloud
2 * Copyright (C) 2006-2008 The Regents of the University of California
3 * Written by Michael Vrable <mvrable@cs.ucsd.edu>
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 /* Compute incremental backups at a sub-file level by chopping files up into
21 * blocks in a content-sensitive manner (using Rabin fingerprints). */
29 /* Block breakpoints can only be computed for a single block of memory, all
30 * loaded at once. compute_breaks will, given a block of memory, compute the
31 * offsets at which successive blocks should end. These will be stored into
32 * the provided memory at breakpoints. The maximum possible number of blocks
33 * (given the block size constaints) can be computed by compute_max_num_breaks
34 * so that the breakpoints array can be properly sized. The actual number of
35 * blocks is returned by the compute_breaks function. */
36 int chunk_compute_max_num_breaks(size_t buflen);
37 int chunk_compute_breaks(const char *buf, size_t len, size_t *breakpoints);
38 std::string chunk_algorithm_name();
40 #endif // _LBS_CHUNK_H