Lines Matching refs:match

135 /* The minimum and maximum match lengths */
429 uInt match_length; /* length of best match */
430 IPos prev_match; /* previous match */
431 int match_available; /* set if previous match exists */
438 * Length of the best match at previous step. Matches not
440 * match evaluation.
452 * Attempt to find a better match only when the current match
458 * Insert new strings in the hash table only if the match
468 /* Use a faster search when the previous match is longer than this */
470 int nice_match; /* Stop searching when current match exceeds this */
505 * Size of match buffer for literals/lengths. There are 4
580 * match distances are limited to MAX_DIST instead of WSIZE.
652 * string matches are performed only when the previous match ends. So it
656 * is used to find longer strings when a small match has been found.
729 local void check_match OF((deflate_state *s, IPos start, IPos match,
759 ush good_length; /* reduce lazy search above this match length */
760 ush max_lazy; /* do not perform lazy search above this match length */
761 ush nice_length; /* quit search above this match length */
1409 * Initialize the "longest match" routines for a new zlib stream
1438 * Set match_start to the longest match starting at the given string and
1444 * OUT assertion: the match length is not greater than s->lookahead.
1449 * match.asm or match.S. The code will be functionally equivalent.
1455 IPos cur_match; /* current match */
1460 register Bytef *match; /* matched string */
1461 register int len; /* length of current match */
1462 int best_len = s->prev_length; /* best match length so far */
1463 int nice_match = s->nice_match; /* stop if match long enough */
1494 /* Do not waste too much time if we already have a good match: */
1509 match = s->window + cur_match;
1512 * Skip to next match if the match length cannot
1513 * increase or if the match length is less than 2:
1521 if (*(ushf*)(match+best_len-1) != scan_end ||
1522 *(ushf*)match != scan_start) continue;
1525 * It is not necessary to compare scan[2] and match[2]
1527 * match, given that the hash keys are equal and that
1537 Assert(scan[2] == match[2], "scan[2]?");
1538 scan++, match++;
1540 } while (*(ushf *)(scan += 2) == *(ushf *)(match += 2) &&
1541 *(ushf *)(scan += 2) == *(ushf *)(match += 2) &&
1542 *(ushf *)(scan += 2) == *(ushf *)(match += 2) &&
1543 *(ushf *)(scan += 2) == *(ushf *)(match += 2) &&
1550 if (*scan == *match) scan++;
1557 if (match[best_len] != scan_end ||
1558 match[best_len-1] != scan_end1 ||
1559 *match != *scan ||
1560 *++match != scan[1])
1567 * scan[2] and match[2] since they are always equal
1568 * when the other bytes match, given that the hash
1571 scan += 2, match++;
1572 Assert(*scan == *match, "match[2]?");
1580 } while (*++scan == *++match && *++scan == *++match &&
1581 *++scan == *++match && *++scan == *++match &&
1582 *++scan == *++match && *++scan == *++match &&
1583 *++scan == *++match && *++scan == *++match &&
1620 IPos cur_match; /* current match */
1623 register Bytef *match; /* matched string */
1624 register int len; /* length of current match */
1639 match = s->window + cur_match;
1641 /* Return failure if the match length is less than 2: */
1642 if (match[0] != scan[0] || match[1] != scan[1])
1648 * is not necessary to compare scan[2] and match[2] since they
1649 * are always equal when the other bytes match, given that the
1652 scan += 2, match += 2;
1653 Assert(*scan == *match, "match[2]?");
1660 } while (*++scan == *++match && *++scan == *++match &&
1661 *++scan == *++match && *++scan == *++match &&
1662 *++scan == *++match && *++scan == *++match &&
1663 *++scan == *++match && *++scan == *++match &&
1682 * Check that the match at match_start is indeed a match.
1685 check_match(s, start, match, length)
1687 IPos start, match;
1690 /* check that the match is indeed a match */
1691 if (zmemcmp(s->window + match, s->window + start, length) != EQUAL) {
1692 fprintf(stderr, " start %u, match %u, length %d\n",
1693 start, match, length);
1695 fprintf(stderr, "%c%c", s->window[match++],
1698 z_error("invalid match");
1701 fprintf(stderr, "\\[%d,%d]", start-match, length);
1706 #define check_match(s, start, match, length)
1839 * IN assertion: strstart is set to the end of the current match.
1951 * MAX_MATCH bytes for the next match, plus MIN_MATCH
1953 * match.
1975 * Find the longest match, discarding those <=
1984 * particular we have to avoid a match of the
2004 * if the match length is not too large. This
2043 /* No match, output a literal byte */
2058 * evaluation for matches: a match is finally adopted only if there is
2059 * no better match at the next window position.
2074 * MAX_MATCH bytes for the next match, plus MIN_MATCH
2076 * match.
2099 * Find the longest match, discarding those <=
2111 * particular we have to avoid a match of the
2128 * ignore the current match anyway.
2134 * If there was a match at the previous step and the
2135 * current match is not better, output the previous
2136 * match:
2152 * end of the match. strstart-1 and strstart
2173 * If there was no match at the previous
2175 * was a match but the current match is
2176 * longer, truncate the previous match to a
2190 * There is no previous match to compare with,
2327 /* length code for each normalized match length (0 == MIN_MATCH) */
2489 * Note that the length 255 (match length 258) can be
3300 * Save the match info and tally the frequency counts. Return true if
3307 /* match length-MIN_MATCH or unmatched char (if dist==0) */
3317 /* Here, lc is the match length - MIN_MATCH */
3318 dist--; /* dist = match distance - 1 */
3321 (ush)d_code(dist) < (ush)D_CODES, "_tr_tally: bad match");
3365 int lc; /* match length or unmatched char (if dist == 0) */
3378 /* Here, lc is the match length - MIN_MATCH */
3388 /* dist is now the match distance - 1 */
3401 } /* literal or match pair ? */
4286 * 258 is special since 258 - 3 (the min match length) is 255.