Lines Matching refs:match

84 /* The minimum and maximum match lengths */
274 uInt match_length; /* length of best match */
275 IPos prev_match; /* previous match */
276 int match_available; /* set if previous match exists */
282 /* Length of the best match at previous step. Matches not greater than this
283 * are discarded. This is used in the lazy match evaluation.
293 /* Attempt to find a better match only when the current match is strictly
298 /* Insert new strings in the hash table only if the match length is not
307 /* Use a faster search when the previous match is longer than this */
309 int nice_match; /* Stop searching when current match exceeds this */
338 /* Size of match buffer for literals/lengths. There are 4 reasons for
403 /* In order to simplify the code, particularly on 16 bit machines, match
436 * string matches are performed only when the previous match ends. So it
440 * is used to find longer strings when a small match has been found.
498 ush good_length; /* reduce lazy search above this match length */
499 ush max_lazy; /* do not perform lazy search above this match length */
500 ush nice_length; /* quit search above this match length */
543 local void check_match OF((deflate_state *s, IPos start, IPos match,
900 * Initialize the "longest match" routines for a new zlib stream
928 * Set match_start to the longest match starting at the given string and
936 /* For 80x86 and 680x0, an optimized version will be provided in match.asm or
937 * match.S. The code will be functionally equivalent.
941 IPos cur_match; /* current match */
945 register Bytef *match; /* matched string */
946 register int len; /* length of current match */
947 int best_len = s->prev_length; /* best match length so far */
974 /* Do not waste too much time if we already have a good match: */
982 match = s->window + cur_match;
984 /* Skip to next match if the match length cannot increase
985 * or if the match length is less than 2:
991 if (*(ushf*)(match+best_len-1) != scan_end ||
992 *(ushf*)match != scan_start) continue;
994 /* It is not necessary to compare scan[2] and match[2] since they are
995 * always equal when the other bytes match, given that the hash keys
1003 Assert(scan[2] == match[2], "scan[2]?");
1004 scan++, match++;
1006 } while (*(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
1007 *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
1008 *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
1009 *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
1015 if (*scan == *match) scan++;
1022 if (match[best_len] != scan_end ||
1023 match[best_len-1] != scan_end1 ||
1024 *match != *scan ||
1025 *++match != scan[1]) continue;
1029 * It is not necessary to compare scan[2] and match[2] since they
1030 * are always equal when the other bytes match, given that
1033 scan += 2, match++;
1034 Assert(*scan == *match, "match[2]?");
1040 } while (*++scan == *++match && *++scan == *++match &&
1041 *++scan == *++match && *++scan == *++match &&
1042 *++scan == *++match && *++scan == *++match &&
1043 *++scan == *++match && *++scan == *++match &&
1073 * Check that the match at match_start is indeed a match.
1075 local void check_match(s, start, match, length)
1077 IPos start, match;
1080 /* check that the match is indeed a match */
1081 if (memcmp((charf *)s->window + match,
1084 " start %u, match %u, length %d\n",
1085 start, match, length);
1086 do { fprintf(stderr, "%c%c", s->window[match++],
1088 z_error("invalid match");
1091 fprintf(stderr,"\\[%d,%d]", start-match, length);
1096 # define check_match(s, start, match, length)
1202 * IN assertion: strstart is set to the end of the current match.
1238 * for the next match, plus MIN_MATCH bytes to insert the
1239 * string following the next match.
1255 /* Find the longest match, discarding those <= prev_length.
1260 * of window index 0 (in particular we have to avoid a match
1278 /* Insert new strings in the hash table only if the match length
1305 /* No match, output a literal byte */
1319 * evaluation for matches: a match is finally adopted only if there is
1320 * no better match at the next window position.
1333 * for the next match, plus MIN_MATCH bytes to insert the
1334 * string following the next match.
1350 /* Find the longest match, discarding those <= prev_length.
1358 * of window index 0 (in particular we have to avoid a match
1372 * but we will ignore the current match anyway.
1377 /* If there was a match at the previous step and the current
1378 * match is not better, output the previous match:
1389 /* Insert in hash table all strings up to the end of the match.
1408 /* If there was no match at the previous position, output a
1409 * single literal. If there was a match but the current match
1410 * is longer, truncate the previous match to a single literal.
1420 /* There is no previous match to compare with, wait for
1540 /* length code for each normalized match length (0 == MIN_MATCH) */
1689 /* Note that the length 255 (match length 258) can be represented
2400 * Save the match info and tally the frequency counts. Return true if
2406 int lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */
2415 /* Here, lc is the match length - MIN_MATCH */
2416 dist--; /* dist = match distance - 1 */
2419 (ush)d_code(dist) < (ush)D_CODES, "ct_tally: bad match");
2457 int lc; /* match length or unmatched char (if dist == 0) */
2469 /* Here, lc is the match length - MIN_MATCH */
2477 dist--; /* dist is now the match distance - 1 */
2487 } /* literal or match pair ? */
3200 258 is special since 258 - 3 (the min match length) is 255.