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