• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.5.8/xnu-1228.15.4/libkern/

Lines Matching defs:match

144 /* The minimum and maximum match lengths */
435 uInt match_length; /* length of best match */
436 IPos prev_match; /* previous match */
437 int match_available; /* set if previous match exists */
443 /* Length of the best match at previous step. Matches not greater than this
444 * are discarded. This is used in the lazy match evaluation.
454 /* Attempt to find a better match only when the current match is strictly
459 /* Insert new strings in the hash table only if the match length is not
468 /* Use a faster search when the previous match is longer than this */
470 int nice_match; /* Stop searching when current match exceeds this */
499 /* Size of match buffer for literals/lengths. There are 4 reasons for
559 /* In order to simplify the code, particularly on 16 bit machines, match
634 * string matches are performed only when the previous match ends. So it
638 * is used to find longer strings when a small match has been found.
706 static void check_match OF((deflate_state *s, IPos start, IPos match,
733 ush good_length; /* reduce lazy search above this match length */
734 ush max_lazy; /* do not perform lazy search above this match length */
735 ush nice_length; /* quit search above this match length */
1287 * Initialize the "longest match" routines for a new zlib stream
1315 * Set match_start to the longest match starting at the given string and
1321 * OUT assertion: the match length is not greater than s->lookahead.
1324 /* For 80x86 and 680x0, an optimized version will be provided in match.asm or
1325 * match.S. The code will be functionally equivalent.
1333 Bytef *match; /* matched string */
1334 int len; /* length of current match */
1335 int best_len = s->prev_length; /* best match length so far */
1336 int nice_match = s->nice_match; /* stop if match long enough */
1363 /* Do not waste too much time if we already have a good match: */
1376 match = s->window + cur_match;
1378 /* Skip to next match if the match length cannot increase
1379 * or if the match length is less than 2:
1385 if (*(ushf*)(match+best_len-1) != scan_end ||
1386 *(ushf*)match != scan_start) continue;
1388 /* It is not necessary to compare scan[2] and match[2] since they are
1389 * always equal when the other bytes match, given that the hash keys
1397 Assert(scan[2] == match[2], "scan[2]?");
1398 scan++, match++;
1400 } while (*(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
1401 *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
1402 *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
1403 *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
1409 if (*scan == *match) scan++;
1416 if (match[best_len] != scan_end ||
1417 match[best_len-1] != scan_end1 ||
1418 *match != *scan ||
1419 *++match != scan[1]) continue;
1423 * It is not necessary to compare scan[2] and match[2] since they
1424 * are always equal when the other bytes match, given that
1427 scan += 2, match++;
1428 Assert(*scan == *match, "match[2]?");
1434 } while (*++scan == *++match && *++scan == *++match &&
1435 *++scan == *++match && *++scan == *++match &&
1436 *++scan == *++match && *++scan == *++match &&
1437 *++scan == *++match && *++scan == *++match &&
1473 Bytef *match; /* matched string */
1474 int len; /* length of current match */
1486 match = s->window + cur_match;
1488 /* Return failure if the match length is less than 2:
1490 if (match[0] != scan[0] || match[1] != scan[1]) return MIN_MATCH-1;
1494 * It is not necessary to compare scan[2] and match[2] since they
1495 * are always equal when the other bytes match, given that
1498 scan += 2, match += 2;
1499 Assert(*scan == *match, "match[2]?");
1505 } while (*++scan == *++match && *++scan == *++match &&
1506 *++scan == *++match && *++scan == *++match &&
1507 *++scan == *++match && *++scan == *++match &&
1508 *++scan == *++match && *++scan == *++match &&
1525 * Check that the match at match_start is indeed a match.
1528 check_match(deflate_state *s, IPos start, IPos match, int length)
1530 /* check that the match is indeed a match */
1531 if (zmemcmp(s->window + match,
1533 fprintf(stderr, " start %u, match %u, length %d\n",
1534 start, match, length);
1536 fprintf(stderr, "%c%c", s->window[match++], s->window[start++]);
1538 z_error("invalid match");
1541 fprintf(stderr,"\\[%d,%d]", start-match, length);
1546 # define check_match(s, start, match, length)
1651 * IN assertion: strstart is set to the end of the current match.
1745 * for the next match, plus MIN_MATCH bytes to insert the
1746 * string following the next match.
1763 /* Find the longest match, discarding those <= prev_length.
1768 * of window index 0 (in particular we have to avoid a match
1784 /* Insert new strings in the hash table only if the match length
1814 /* No match, output a literal byte */
1828 * evaluation for matches: a match is finally adopted only if there is
1829 * no better match at the next window position.
1841 * for the next match, plus MIN_MATCH bytes to insert the
1842 * string following the next match.
1859 /* Find the longest match, discarding those <= prev_length.
1867 * of window index 0 (in particular we have to avoid a match
1880 * but we will ignore the current match anyway.
1885 /* If there was a match at the previous step and the current
1886 * match is not better, output the previous match:
1897 /* Insert in hash table all strings up to the end of the match.
1916 /* If there was no match at the previous position, output a
1917 * single literal. If there was a match but the current match
1918 * is longer, truncate the previous match to a single literal.
1929 /* There is no previous match to compare with, wait for
2055 /* length code for each normalized match length (0 == MIN_MATCH) */
2371 /* Note that the length 255 (match length 258) can be represented
3124 * Save the match info and tally the frequency counts. Return true if
3128 * unsigned lc; match length-MIN_MATCH or unmatched char (if dist==0)
3140 /* Here, lc is the match length - MIN_MATCH */
3141 dist--; /* dist = match distance - 1 */
3144 (ush)d_code(dist) < (ush)D_CODES, "_tr_tally: bad match");
3185 int lc; /* match length or unmatched char (if dist == 0) */
3197 /* Here, lc is the match length - MIN_MATCH */
3205 dist--; /* dist is now the match distance - 1 */
3215 } /* literal or match pair ? */
4002 258 is special since 258 - 3 (the min match length) is 255.