Lines Matching refs: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,
119 ush good_length; /* reduce lazy search above this match length */
120 ush max_lazy; /* do not perform lazy search above this match length */
121 ush nice_length; /* quit search above this match length */
1044 * Initialize the "longest match" routines for a new zlib stream
1126 * Set match_start to the longest match starting at the given string and
1132 * OUT assertion: the match length is not greater than s->lookahead.
1135 /* For 80x86 and 680x0, an optimized version will be provided in match.asm or
1136 * match.S. The code will be functionally equivalent.
1140 IPos cur_match; /* current match */
1145 register Bytef *match; /* matched string */
1146 register int len; /* length of current match */
1147 int best_len = s->prev_length; /* best match length so far */
1148 int nice_match = s->nice_match; /* stop if match long enough */
1175 /* Do not waste too much time if we already have a good match: */
1188 match = s->window + cur_match;
1193 /* Skip to next match if the match length cannot increase
1194 * or if the match length is less than 2. Note that the checks below
1198 * However the length of the match is limited to the lookahead, so
1205 if (*(ushf*)(match+best_len-1) != scan_end ||
1206 *(ushf*)match != scan_start) continue;
1208 /* It is not necessary to compare scan[2] and match[2] since they are
1209 * always equal when the other bytes match, given that the hash keys
1217 Assert(scan[2] == match[2], "scan[2]?");
1218 scan++, match++;
1220 } while (*(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
1221 *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
1222 *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
1223 *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
1229 if (*scan == *match) scan++;
1238 if (match[best_len] != scan_end ||
1239 match[best_len-1] != scan_end1 ||
1240 *match != *scan ||
1241 *++match != scan[1]) continue;
1245 * It is not necessary to compare scan[2] and match[2] since they
1246 * are always equal when the other bytes match, given that
1249 scan += 2, match++;
1250 Assert(*scan == *match, "match[2]?");
1257 } while (*++scan == *++match && *++scan == *++match &&
1258 *++scan == *++match && *++scan == *++match &&
1259 *++scan == *++match && *++scan == *++match &&
1260 *++scan == *++match && *++scan == *++match &&
1265 } while (*++scan == *++match &&
1266 class_at(s, match - s->window) == clas &&
1297 * Here we only wish to match the entire value so trying the partial matches in
1298 * longest_match is both wasteful and often fails to find the correct match.
1301 * match in a special hash table. */
1334 * cookie value), or the match is followed by non-cookie data. */
1354 IPos cur_match; /* current match */
1358 register Bytef *match; /* matched string */
1359 register int len; /* length of current match */
1373 match
1375 /* Return failure if the match length is less than 2:
1377 if (match[0] != scan[0] || match[1] != scan[1]) return MIN_MATCH-1;
1381 * It is not necessary to compare scan[2] and match[2] since they
1382 * are always equal when the other bytes match, given that
1385 scan += 2, match += 2;
1386 Assert(*scan == *match, "match[2]?");
1392 } while (*++scan == *++match && *++scan == *++match &&
1393 *++scan == *++match && *++scan == *++match &&
1394 *++scan == *++match && *++scan == *++match &&
1395 *++scan == *++match && *++scan == *++match &&
1412 * Check that the match at match_start is indeed a match.
1414 local void check_match(s, start, match, length)
1416 IPos start, match;
1419 /* check that the match is indeed a match */
1420 if (zmemcmp(s->window + match,
1422 fprintf(stderr, " start %u, match %u, length %d\n",
1423 start, match, length);
1425 fprintf(stderr, "%c%c", s->window[match++], s->window[start++]);
1427 z_error("invalid match");
1430 fprintf(stderr,"\\[%d,%d]", start-match, length);
1435 # define check_match(s, start, match, length)
1561 * the longest match routines. Update the high water mark for the next
1562 * time through here. WIN_INIT is set to MAX_MATCH since the longest match
1595 * IN assertion: strstart is set to the end of the current match.
1698 * for the next match, plus MIN_MATCH bytes to insert the
1699 * string following the next match.
1717 /* Find the longest match, discarding those <= prev_length.
1722 * of window index 0 (in particular we have to avoid a match
1736 /* Insert new strings in the hash table only if the match length
1766 /* No match, output a literal byte */
1781 * evaluation for matches: a match is finally adopted only if there is
1782 * no better match at the next window position.
1808 * for the next match, plus MIN_MATCH bytes to insert the
1809 * string following the next match.
1827 /* Find the longest match, discarding those <= prev_length.
1839 * of window index 0 (in particular we have to avoid a match
1854 * but we will ignore the current match anyway.
1859 /* If there was a match at the previous step and the current
1860 * match is not better, output the previous match:
1864 /* We will only accept an exact match for Z_CLASS_COOKIE data and
1865 * we won't match Z_CLASS_HUFFMAN_ONLY data at all. */
1869 /* We require that a Z_CLASS_COOKIE match be
1884 /* Insert in hash table all strings up to the end of the match.
1903 /* If there was no match at the previous position, output a
1904 * single literal. If there was a match but the current match
1905 * is longer, truncate the previous match to a single literal.
1916 /* There is no previous match to compare with, wait for
1945 uInt prev; /* byte at distance one to match */
1980 /* Emit match if have run of MIN_MATCH or longer, else emit literal */
1990 /* No match, output a literal byte */