Lines Matching refs:match

25  *      string matches are performed only when the previous match ends. So it
29 * is used to find longer strings when a small match has been found.
102 local void check_match OF((deflate_state *s, IPos start, IPos match,
129 ush good_length; /* reduce lazy search above this match length */
130 ush max_lazy; /* do not perform lazy search above this match length */
131 ush nice_length; /* quit search above this match length */
990 * Initialize the "longest match" routines for a new zlib stream
1021 * Set match_start to the longest match starting at the given string and
1027 * OUT assertion: the match length is not greater than s->lookahead.
1030 /* For 80x86 and 680x0, an optimized version will be provided in match.asm or
1031 * match.S. The code will be functionally equivalent.
1035 IPos cur_match; /* current match */
1039 register Bytef *match; /* matched string */
1040 register int len; /* length of current match */
1041 int best_len = s->prev_length; /* best match length so far */
1042 int nice_match = s->nice_match; /* stop if match long enough */
1069 /* Do not waste too much time if we already have a good match: */
1082 match = s->window + cur_match;
1084 /* Skip to next match if the match length cannot increase
1085 * or if the match length is less than 2. Note that the checks below
1089 * However the length of the match is limited to the lookahead, so
1096 if (*(ushf*)(match+best_len-1) != scan_end ||
1097 *(ushf*)match != scan_start) continue;
1099 /* It is not necessary to compare scan[2] and match[2] since they are
1100 * always equal when the other bytes match, given that the hash keys
1108 Assert(scan[2] == match[2], "scan[2]?");
1109 scan++, match++;
1111 } while (*(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
1112 *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
1113 *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
1114 *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
1120 if (*scan == *match) scan++;
1127 if (match[best_len] != scan_end ||
1128 match[best_len-1] != scan_end1 ||
1129 *match != *scan ||
1130 *++match != scan[1]) continue;
1134 * It is not necessary to compare scan[2] and match[2] since they
1135 * are always equal when the other bytes match, given that
1138 scan += 2, match++;
1139 Assert(*scan == *match, "match[2]?");
1145 } while (*++scan == *++match && *++scan == *++match &&
1146 *++scan == *++match && *++scan == *++match &&
1147 *++scan == *++match && *++scan == *++match &&
1148 *++scan == *++match && *++scan == *++match &&
1183 IPos cur_match; /* current match */
1186 register Bytef *match; /* matched string */
1187 register int len; /* length of current match */
1199 match = s->window + cur_match;
1201 /* Return failure if the match length is less than 2:
1203 if (match[0] != scan[0] || match[1] != scan[1]) return MIN_MATCH-1;
1207 * It is not necessary to compare scan[2] and match[2] since they
1208 * are always equal when the other bytes match, given that
1211 scan += 2, match += 2;
1212 Assert(*scan == *match, "match[2]?");
1218 } while (*++scan == *++match && *++scan == *++match &&
1219 *++scan == *++match && *++scan == *++match &&
1220 *++scan == *++match && *++scan == *++match &&
1221 *++scan == *++match && *++scan == *++match &&
1236 * Check that the match at match_start is indeed a match.
1238 local void check_match(s, start, match, length)
1240 IPos start, match;
1243 /* check that the match is indeed a match */
1244 if (zmemcmp(s->window + match,
1246 fprintf(stderr, " start %u, match %u, length %d\n",
1247 start, match, length);
1249 fprintf(stderr, "%c%c", s->window[match++], s->window[start++]);
1251 z_error("invalid match");
1254 fprintf(stderr,"\\[%d,%d]", start-match, length);
1259 # define check_match(s, start, match, length)
1368 * IN assertion: strstart is set to the end of the current match.
1464 * for the next match, plus MIN_MATCH bytes to insert the
1465 * string following the next match.
1482 /* Find the longest match, discarding those <= prev_length.
1487 * of window index 0 (in particular we have to avoid a match
1512 /* Insert new strings in the hash table only if the match length
1542 /* No match, output a literal byte */
1557 * evaluation for matches: a match is finally adopted only if there is
1558 * no better match at the next window position.
1571 * for the next match, plus MIN_MATCH bytes to insert the
1572 * string following the next match.
1589 /* Find the longest match, discarding those <= prev_length.
1597 * of window index 0 (in particular we have to avoid a match
1615 * but we will ignore the current match anyway.
1620 /* If there was a match at the previous step and the current
1621 * match is not better, output the previous match:
1632 /* Insert in hash table all strings up to the end of the match.
1651 /* If there was no match at the previous position, output a
1652 * single literal. If there was a match but the current match
1653 * is longer, truncate the previous match to a single literal.
1664 /* There is no previous match to compare with, wait for
1696 uInt prev; /* byte at distance one to match */
1724 /* Emit match if have run of MIN_MATCH or longer, else emit literal */
1731 /* No match, output a literal byte */