From f5f95a38c40de63a22112a972d4a18e377257c44 Mon Sep 17 00:00:00 2001 From: Martin Pool Date: Mon, 8 Apr 2002 08:23:50 +0000 Subject: [PATCH] Document the perversely-named matched() function, which is called even if we have not matched! --- match.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/match.c b/match.c index ee8e565f..557226a6 100644 --- a/match.c +++ b/match.c @@ -90,6 +90,18 @@ static void build_hash_table(struct sum_struct *s) static OFF_T last_match; +/** + * Transmit a literal and/or match token. + * + * This delightfully-named function is called either when we find a + * match and need to transmit all the unmatched data leading up to it, + * or when we get bored of accumulating literal data and just need to + * transmit it. As a result of this second case, it is called even if + * we have not matched at all! + * + * @param i If >0, the number of a matched token. If 0, indicates we + * have only literal data. + **/ static void matched(int f,struct sum_struct *s,struct map_struct *buf, OFF_T offset,int i) { @@ -258,7 +270,17 @@ static void hash_search(int f,struct sum_struct *s, } -void match_sums(int f,struct sum_struct *s,struct map_struct *buf,OFF_T len) +/** + * Scan through a origin file, looking for sections that match + * checksums from the generator, and transmit either literal or token + * data. + * + * @param s Checksums received from the generator. If s->count == + * 0, then there are actually no checksums for this file. + * + * @param len Length of the file to send. + **/ +void match_sums(int f, struct sum_struct *s, struct map_struct *buf, OFF_T len) { char file_sum[MD4_SUM_LENGTH]; extern int write_batch; /* dw */ -- 2.34.1