Lines Matching defs:match

18  *      string matches are performed only when the previous match ends. So it
22 * is used to find longer strings when a small match has been found.
96 local void check_match OF((deflate_state *s, IPos start, IPos match,
118 ush good_length; /* reduce lazy search above this match length */
119 ush max_lazy; /* do not perform lazy search above this match length */
120 ush nice_length; /* quit search above this match length */
1102 * Initialize the "longest match" routines for a new zlib stream
1134 * Set match_start to the longest match starting at the given string and
1140 * OUT assertion: the match length is not greater than s->lookahead.
1143 /* For 80x86 and 680x0, an optimized version will be provided in match.asm or
1144 * match.S. The code will be functionally equivalent.
1148 IPos cur_match; /* current match */
1152 register Bytef *match; /* matched string */
1153 register int len; /* length of current match */
1154 int best_len = s->prev_length; /* best match length so far */
1155 int nice_match = s->nice_match; /* stop if match long enough */
1182 /* Do not waste too much time if we already have a good match: */
1195 match = s->window + cur_match;
1197 /* Skip to next match if the match length cannot increase
1198 * or if the match length is less than 2. Note that the checks below
1202 * However the length of the match is limited to the lookahead, so
1209 if (*(ushf*)(match+best_len-1) != scan_end ||
1210 *(ushf*)match != scan_start) continue;
1212 /* It is not necessary to compare scan[2] and match[2] since they are
1213 * always equal when the other bytes match, given that the hash keys
1221 Assert(scan[2] == match[2], "scan[2]?");
1222 scan++, match++;
1224 } while (*(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
1225 *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
1226 *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
1227 *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
1233 if (*scan == *match) scan++;
1240 if (match[best_len] != scan_end ||
1241 match[best_len-1] != scan_end1 ||
1242 *match != *scan ||
1243 *++match != scan[1]) continue;
1247 * It is not necessary to compare scan[2] and match[2] since they
1248 * are always equal when the other bytes match, given that
1251 scan += 2, match++;
1252 Assert(*scan == *match, "match[2]?");
1258 } while (*++scan == *++match && *++scan == *++match &&
1259 *++scan == *++match && *++scan == *++match &&
1260 *++scan == *++match && *++scan == *++match &&
1261 *++scan == *++match && *++scan == *++match &&
1297 IPos cur_match; /* current match */
1300 register Bytef *match; /* matched string */
1301 register int len; /* length of current match */
1313 match = s->window + cur_match;
1315 /* Return failure if the match length is less than 2:
1317 if (match[0] != scan[0] || match[1] != scan[1]) return MIN_MATCH-1;
1321 * It is not necessary to compare scan[2] and match[2] since they
1322 * are always equal when the other bytes match, given that
1325 scan += 2, match += 2;
1326 Assert(*scan == *match, "match[2]?");
1332 } while (*++scan == *++match && *++scan == *++match &&
1333 *++scan == *++match && *++scan == *++match &&
1334 *++scan == *++match && *++scan == *++match &&
1335 *++scan == *++match && *++scan == *++match &&
1352 * Check that the match at match_start is indeed a match.
1354 local void check_match(s, start, match, length)
1356 IPos start, match;
1359 /* check that the match is indeed a match */
1360 if (zmemcmp(s->window + match,
1362 fprintf(stderr, " start %u, match %u, length %d\n",
1363 start, match, length);
1365 fprintf(stderr, "%c%c", s->window[match++], s->window[start++]);
1367 z_error("invalid match");
1370 fprintf(stderr,"\\[%d,%d]", start-match, length);
1375 # define check_match(s, start, match, length)
1497 * the longest match routines. Update the high water mark for the next
1498 * time through here. WIN_INIT is set to MAX_MATCH since the longest match
1534 * IN assertion: strstart is set to the end of the current match.
1636 * for the next match, plus MIN_MATCH bytes to insert the
1637 * string following the next match.
1655 /* Find the longest match, discarding those <= prev_length.
1660 * of window index 0 (in particular we have to avoid a match
1674 /* Insert new strings in the hash table only if the match length
1704 /* No match, output a literal byte */
1725 * evaluation for matches: a match is finally adopted only if there is
1726 * no better match at the next window position.
1739 * for the next match, plus MIN_MATCH bytes to insert the
1740 * string following the next match.
1758 /* Find the longest match, discarding those <= prev_length.
1766 * of window index 0 (in particular we have to avoid a match
1780 * but we will ignore the current match anyway.
1785 /* If there was a match at the previous step and the current
1786 * match is not better, output the previous match:
1797 /* Insert in hash table all strings up to the end of the match.
1816 /* If there was no match at the previous position, output a
1817 * single literal. If there was a match but the current match
1818 * is longer, truncate the previous match to a single literal.
1829 /* There is no previous match to compare with, wait for
1864 uInt prev; /* byte at distance one to match */
1900 /* Emit match if have run of MIN_MATCH or longer, else emit literal */
1910 /* No match, output a literal byte */