- Copyright (C) 1999, 2006, 2009-2010 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2006, 2009-2012 Free Software Foundation, Inc.
Copyright (C) 1992-1993 Jean-loup Gailly
This program is free software; you can redistribute it and/or modify
Copyright (C) 1992-1993 Jean-loup Gailly
This program is free software; you can redistribute it and/or modify
/* DECLARE(Pos, head, 1<<HASH_BITS); */
/* Heads of the hash chains or NIL. */
/* DECLARE(Pos, head, 1<<HASH_BITS); */
/* Heads of the hash chains or NIL. */
/* window size, 2*WSIZE except for MMAP or BIG_MEM, where it is the
* input file length plus MIN_LOOKAHEAD.
*/
/* window size, 2*WSIZE except for MMAP or BIG_MEM, where it is the
* input file length plus MIN_LOOKAHEAD.
*/
/* Length of the best match at previous step. Matches not greater than this
* are discarded. This is used in the lazy match evaluation.
*/
/* Length of the best match at previous step. Matches not greater than this
* are discarded. This is used in the lazy match evaluation.
*/
local int eofile; /* flag set at end of input file */
local unsigned lookahead; /* number of valid bytes ahead in window */
local int eofile; /* flag set at end of input file */
local unsigned lookahead; /* number of valid bytes ahead in window */
/* To speed up deflation, hash chains are never searched beyond this length.
* A higher limit improves compression ratio but degrades the speed.
*/
/* To speed up deflation, hash chains are never searched beyond this length.
* A higher limit improves compression ratio but degrades the speed.
*/
/* Use a faster search when the previous match is longer than this */
local ulg rsync_sum; /* rolling sum of rsync window */
/* Use a faster search when the previous match is longer than this */
local ulg rsync_sum; /* rolling sum of rsync window */
/* ===========================================================================
* Prototypes for local functions.
*/
/* ===========================================================================
* Prototypes for local functions.
*/
#endif
/* ===========================================================================
* Update a hash value with the given input byte
#endif
/* ===========================================================================
* Update a hash value with the given input byte
* input characters, so that a running hash key can be computed from the
* previous key instead of complete recalculation each time.
*/
* input characters, so that a running hash key can be computed from the
* previous key instead of complete recalculation each time.
*/
* Insert string s in the dictionary and set match_head to the previous head
* of the hash chain (the most recent string with same hash key). Return
* the previous length of the hash chain.
* Insert string s in the dictionary and set match_head to the previous head
* of the hash chain (the most recent string with same hash key). Return
* the previous length of the hash chain.
* input characters and the first MIN_MATCH bytes of s are valid
* (except for the last MIN_MATCH-1 bytes of the input file).
*/
* input characters and the first MIN_MATCH bytes of s are valid
* (except for the last MIN_MATCH-1 bytes of the input file).
*/
if (lookahead == 0 || lookahead == (unsigned)EOF) {
eofile = 1, lookahead = 0;
if (lookahead == 0 || lookahead == (unsigned)EOF) {
eofile = 1, lookahead = 0;
{
unsigned chain_length = max_chain_length; /* max hash chain length */
register uch *scan = window + strstart; /* current string */
{
unsigned chain_length = max_chain_length; /* max hash chain length */
register uch *scan = window + strstart; /* current string */
* At this point we have always match_length < MIN_MATCH
*/
if (hash_head != NIL && strstart - hash_head <= MAX_DIST
* At this point we have always match_length < MIN_MATCH
*/
if (hash_head != NIL && strstart - hash_head <= MAX_DIST
/* To simplify the code, we prevent matches with the string
* of window index 0 (in particular we have to avoid a match
* of the string with itself at the start of the input file).
/* To simplify the code, we prevent matches with the string
* of window index 0 (in particular we have to avoid a match
* of the string with itself at the start of the input file).
- strstart += match_length;
- match_length = 0;
- ins_h = window[strstart];
- UPDATE_HASH(ins_h, window[strstart+1]);
+ strstart += match_length;
+ match_length = 0;
+ ins_h = window[strstart];
+ UPDATE_HASH(ins_h, window[strstart+1]);