00001 /*= -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- 00002 * 00003 * librsync -- the library for network deltas 00004 * $Id: sumset.h,v 1.1.1.1 2002/01/25 22:15:09 kergoth Exp $ 00005 * 00006 * Copyright (C) 1999, 2000, 2001 by Martin Pool <mbp@samba.org> 00007 * Copyright (C) 1999 by Andrew Tridgell <tridge@samba.org> 00008 * 00009 * This program is free software; you can redistribute it and/or 00010 * modify it under the terms of the GNU Lesser General Public License 00011 * as published by the Free Software Foundation; either version 2.1 of 00012 * the License, or (at your option) any later version. 00013 * 00014 * This program is distributed in the hope that it will be useful, but 00015 * WITHOUT ANY WARRANTY; without even the implied warranty of 00016 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00017 * Lesser General Public License for more details. 00018 * 00019 * You should have received a copy of the GNU Lesser General Public 00020 * License along with this program; if not, write to the Free Software 00021 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00022 */ 00023 00024 00025 /* 00026 * TODO: These structures are not terribly useful. Perhaps we need a 00027 * splay tree or something that will let us smoothly grow as data is 00028 * read in. 00029 */ 00030 00031 00035 typedef struct rs_target { 00036 unsigned short t; 00037 int i; 00038 } rs_target_t; 00039 00040 typedef struct rs_block_sig rs_block_sig_t; 00041 00042 /* 00043 * This structure describes all the sums generated for an instance of 00044 * a file. It incorporates some redundancy to make it easier to 00045 * search. 00046 */ 00047 struct rs_signature { 00048 rs_long_t flength; /* total file length */ 00049 int count; /* how many chunks */ 00050 int remainder; /* flength % block_length */ 00051 int block_len; /* block_length */ 00052 int strong_sum_len; 00053 rs_block_sig_t *block_sigs; /* points to info for each chunk */ 00054 int *tag_table; 00055 rs_target_t *targets; 00056 }; 00057 00058 00059 /* 00060 * All blocks are the same length in the current algorithm except for 00061 * the last block which may be short. 00062 */ 00063 struct rs_block_sig { 00064 int i; /* index of this chunk */ 00065 rs_weak_sum_t weak_sum; /* simple checksum */ 00066 rs_strong_sum_t strong_sum; /* checksum */ 00067 };
1.4.2