• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /freebsd-13-stable/sys/contrib/zlib/

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.
99 local void check_match OF((deflate_state *s, IPos start, IPos match,
121 ush good_length; /* reduce lazy search above this match length */
122 ush max_lazy; /* do not perform lazy search above this match length */
123 ush nice_length; /* quit search above this match length */
1195 * Initialize the "longest match" routines for a new zlib stream
1227 * Set match_start to the longest match starting at the given string and
1233 * OUT assertion: the match length is not greater than s->lookahead.
1236 /* For 80x86 and 680x0, an optimized version will be provided in match.asm or
1237 * match.S. The code will be functionally equivalent.
1241 IPos cur_match; /* current match */
1245 register Bytef *match; /* matched string */
1246 register int len; /* length of current match */
1247 int best_len = (int)s->prev_length; /* best match length so far */
1248 int nice_match = s->nice_match; /* stop if match long enough */
1275 /* Do not waste too much time if we already have a good match: */
1288 match = s->window + cur_match;
1290 /* Skip to next match if the match length cannot increase
1291 * or if the match length is less than 2. Note that the checks below
1295 * However the length of the match is limited to the lookahead, so
1302 if (*(ushf*)(match+best_len-1) != scan_end ||
1303 *(ushf*)match != scan_start) continue;
1305 /* It is not necessary to compare scan[2] and match[2] since they are
1306 * always equal when the other bytes match, given that the hash keys
1314 Assert(scan[2] == match[2], "scan[2]?");
1315 scan++, match++;
1317 } while (*(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
1318 *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
1319 *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
1320 *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
1326 if (*scan == *match) scan++;
1333 if (match[best_len] != scan_end ||
1334 match[best_len-1] != scan_end1 ||
1335 *match != *scan ||
1336 *++match != scan[1]) continue;
1340 * It is not necessary to compare scan[2] and match[2] since they
1341 * are always equal when the other bytes match, given that
1344 scan += 2, match++;
1345 Assert(*scan == *match, "match[2]?");
1351 } while (*++scan == *++match && *++scan == *++match &&
1352 *++scan == *++match && *++scan == *++match &&
1353 *++scan == *++match && *++scan == *++match &&
1354 *++scan == *++match && *++scan == *++match &&
1390 IPos cur_match; /* current match */
1393 register Bytef *match; /* matched string */
1394 register int len; /* length of current match */
1406 match = s->window + cur_match;
1408 /* Return failure if the match length is less than 2:
1410 if (match[0] != scan[0] || match[1] != scan[1]) return MIN_MATCH-1;
1414 * It is not necessary to compare scan[2] and match[2] since they
1415 * are always equal when the other bytes match, given that
1418 scan += 2, match += 2;
1419 Assert(*scan == *match, "match[2]?");
1425 } while (*++scan == *++match && *++scan == *++match &&
1426 *++scan == *++match && *++scan == *++match &&
1427 *++scan == *++match && *++scan == *++match &&
1428 *++scan == *++match && *++scan == *++match &&
1449 * Check that the match at match_start is indeed a match.
1451 local void check_match(s, start, match, length)
1453 IPos start, match;
1456 /* check that the match is indeed a match */
1457 if (zmemcmp(s->window + match,
1459 fprintf(stderr, " start %u, match %u, length %d\n",
1460 start, match, length);
1462 fprintf(stderr, "%c%c", s->window[match++], s->window[start++]);
1464 z_error("invalid match");
1467 fprintf(stderr,"\\[%d,%d]", start-match, length);
1472 # define check_match(s, start, match, length)
1569 * the longest match routines. Update the high water mark for the next
1570 * time through here. WIN_INIT is set to MAX_MATCH since the longest match
1606 * IN assertion: strstart is set to the end of the current match.
1839 * for the next match, plus MIN_MATCH bytes to insert the
1840 * string following the next match.
1858 /* Find the longest match, discarding those <= prev_length.
1863 * of window index 0 (in particular we have to avoid a match
1877 /* Insert new strings in the hash table only if the match length
1907 /* No match, output a literal byte */
1928 * evaluation for matches: a match is finally adopted only if there is
1929 * no better match at the next window position.
1942 * for the next match, plus MIN_MATCH bytes to insert the
1943 * string following the next match.
1961 /* Find the longest match, discarding those <= prev_length.
1969 * of window index 0 (in particular we have to avoid a match
1983 * but we will ignore the current match anyway.
1988 /* If there was a match at the previous step and the current
1989 * match is not better, output the previous match:
2000 /* Insert in hash table all strings up to the end of the match.
2019 /* If there was no match at the previous position, output a
2020 * single literal. If there was a match but the current match
2021 * is longer, truncate the previous match to a single literal.
2032 /* There is no previous match to compare with, wait for
2067 uInt prev; /* byte at distance one to match */
2103 /* Emit match if have run of MIN_MATCH or longer, else emit literal */
2113 /* No match, output a literal byte */