• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /barrelfish-2018-10-04/lib/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.
97 local void check_match OF((deflate_state *s, IPos start, IPos match,
124 ush good_length; /* reduce lazy search above this match length */
125 ush max_lazy; /* do not perform lazy search above this match length */
126 ush nice_length; /* quit search above this match length */
984 * Initialize the "longest match" routines for a new zlib stream
1015 * Set match_start to the longest match starting at the given string and
1021 * OUT assertion: the match length is not greater than s->lookahead.
1024 /* For 80x86 and 680x0, an optimized version will be provided in match.asm or
1025 * match.S. The code will be functionally equivalent.
1029 IPos cur_match; /* current match */
1033 register Bytef *match; /* matched string */
1034 register int len; /* length of current match */
1035 int best_len = s->prev_length; /* best match length so far */
1036 int nice_match = s->nice_match; /* stop if match long enough */
1063 /* Do not waste too much time if we already have a good match: */
1076 match = s->window + cur_match;
1078 /* Skip to next match if the match length cannot increase
1079 * or if the match length is less than 2. Note that the checks below
1083 * However the length of the match is limited to the lookahead, so
1090 if (*(ushf*)(match+best_len-1) != scan_end ||
1091 *(ushf*)match != scan_start) continue;
1093 /* It is not necessary to compare scan[2] and match[2] since they are
1094 * always equal when the other bytes match, given that the hash keys
1102 Assert(scan[2] == match[2], "scan[2]?");
1103 scan++, match++;
1105 } while (*(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
1106 *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
1107 *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
1108 *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
1114 if (*scan == *match) scan++;
1121 if (match[best_len] != scan_end ||
1122 match[best_len-1] != scan_end1 ||
1123 *match != *scan ||
1124 *++match != scan[1]) continue;
1128 * It is not necessary to compare scan[2] and match[2] since they
1129 * are always equal when the other bytes match, given that
1132 scan += 2, match++;
1133 Assert(*scan == *match, "match[2]?");
1139 } while (*++scan == *++match && *++scan == *++match &&
1140 *++scan == *++match && *++scan == *++match &&
1141 *++scan == *++match && *++scan == *++match &&
1142 *++scan == *++match && *++scan == *++match &&
1177 IPos cur_match; /* current match */
1180 register Bytef *match; /* matched string */
1181 register int len; /* length of current match */
1193 match = s->window + cur_match;
1195 /* Return failure if the match length is less than 2:
1197 if (match[0] != scan[0] || match[1] != scan[1]) return MIN_MATCH-1;
1201 * It is not necessary to compare scan[2] and match[2] since they
1202 * are always equal when the other bytes match, given that
1205 scan += 2, match += 2;
1206 Assert(*scan == *match, "match[2]?");
1212 } while (*++scan == *++match && *++scan == *++match &&
1213 *++scan == *++match && *++scan == *++match &&
1214 *++scan == *++match && *++scan == *++match &&
1215 *++scan == *++match && *++scan == *++match &&
1230 * Check that the match at match_start is indeed a match.
1232 local void check_match(s, start, match, length)
1234 IPos start, match;
1237 /* check that the match is indeed a match */
1238 if (zmemcmp(s->window + match,
1240 fprintf(stderr, " start %u, match %u, length %d\n",
1241 start, match, length);
1243 fprintf(stderr, "%c%c", s->window[match++], s->window[start++]);
1245 z_error("invalid match");
1248 fprintf(stderr,"\\[%d,%d]", start-match, length);
1253 # define check_match(s, start, match, length)
1362 * IN assertion: strstart is set to the end of the current match.
1458 * for the next match, plus MIN_MATCH bytes to insert the
1459 * string following the next match.
1476 /* Find the longest match, discarding those <= prev_length.
1481 * of window index 0 (in particular we have to avoid a match
1506 /* Insert new strings in the hash table only if the match length
1536 /* No match, output a literal byte */
1551 * evaluation for matches: a match is finally adopted only if there is
1552 * no better match at the next window position.
1565 * for the next match, plus MIN_MATCH bytes to insert the
1566 * string following the next match.
1583 /* Find the longest match, discarding those <= prev_length.
1591 * of window index 0 (in particular we have to avoid a match
1609 * but we will ignore the current match anyway.
1614 /* If there was a match at the previous step and the current
1615 * match is not better, output the previous match:
1626 /* Insert in hash table all strings up to the end of the match.
1645 /* If there was no match at the previous position, output a
1646 * single literal. If there was a match but the current match
1647 * is longer, truncate the previous match to a single literal.
1658 /* There is no previous match to compare with, wait for
1690 uInt prev; /* byte at distance one to match */
1718 /* Emit match if have run of MIN_MATCH or longer, else emit literal */
1725 /* No match, output a literal byte */