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.
91 local void check_match OF((deflate_state *s, IPos start, IPos match,
118 ush good_length; /* reduce lazy search above this match length */
119 ush max_lazy; /* do not perform lazy search above this match length */
120 ush nice_length; /* quit search above this match length */
684 * Initialize the "longest match" routines for a new zlib stream
712 * Set match_start to the longest match starting at the given string and
718 * OUT assertion: the match length is not greater than s->lookahead.
721 /* For 80x86 and 680x0, an optimized version will be provided in match.asm or
722 * match.S. The code will be functionally equivalent.
727 IPos cur_match; /* current match */
731 register Bytef *match; /* matched string */
732 register int len; /* length of current match */
733 int best_len = s->prev_length; /* best match length so far */
734 int nice_match = s->nice_match; /* stop if match long enough */
761 /* Do not waste too much time if we already have a good match: */
774 match = s->window + cur_match;
776 /* Skip to next match if the match length cannot increase
777 * or if the match length is less than 2:
783 if (*(ushf*)(match+best_len-1) != scan_end ||
784 *(ushf*)match != scan_start) continue;
786 /* It is not necessary to compare scan[2] and match[2] since they are
787 * always equal when the other bytes match, given that the hash keys
795 Assert(scan[2] == match[2], "scan[2]?");
796 scan++, match++;
798 } while (*(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
799 *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
800 *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
801 *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
807 if (*scan == *match) scan++;
814 if (match[best_len] != scan_end ||
815 match[best_len-1] != scan_end1 ||
816 *match != *scan ||
817 *++match != scan[1]) continue;
821 * It is not necessary to compare scan[2] and match[2] since they
822 * are always equal when the other bytes match, given that
825 scan += 2, match++;
826 Assert(*scan == *match, "match[2]?");
832 } while (*++scan == *++match && *++scan == *++match &&
833 *++scan == *++match && *++scan == *++match &&
834 *++scan == *++match && *++scan == *++match &&
835 *++scan == *++match && *++scan == *++match &&
869 IPos cur_match; /* current match */
872 register Bytef *match; /* matched string */
873 register int len; /* length of current match */
885 match = s->window + cur_match;
887 /* Return failure if the match length is less than 2:
889 if (match[0] != scan[0] || match[1] != scan[1]) return MIN_MATCH-1;
893 * It is not necessary to compare scan[2] and match[2] since they
894 * are always equal when the other bytes match, given that
897 scan += 2, match += 2;
898 Assert(*scan == *match, "match[2]?");
904 } while (*++scan == *++match && *++scan == *++match &&
905 *++scan == *++match && *++scan == *++match &&
906 *++scan == *++match && *++scan == *++match &&
907 *++scan == *++match && *++scan == *++match &&
924 * Check that the match at match_start is indeed a match.
926 local void check_match(s, start, match, length)
928 IPos start, match;
931 /* check that the match is indeed a match */
932 if (zmemcmp(s->window + match,
934 fprintf(stderr, " start %u, match %u, length %d\n",
935 start, match, length);
937 fprintf(stderr, "%c%c", s->window[match++], s->window[start++]);
939 z_error("invalid match");
942 fprintf(stderr,"\\[%d,%d]", start-match, length);
947 # define check_match(s, start, match, length)
1052 * IN assertion: strstart is set to the end of the current match.
1148 * for the next match, plus MIN_MATCH bytes to insert the
1149 * string following the next match.
1166 /* Find the longest match, discarding those <= prev_length.
1171 * of window index 0 (in particular we have to avoid a match
1187 /* Insert new strings in the hash table only if the match length
1217 /* No match, output a literal byte */
1231 * evaluation for matches: a match is finally adopted only if there is
1232 * no better match at the next window position.
1245 * for the next match, plus MIN_MATCH bytes to insert the
1246 * string following the next match.
1263 /* Find the longest match, discarding those <= prev_length.
1271 * of window index 0 (in particular we have to avoid a match
1284 * but we will ignore the current match anyway.
1289 /* If there was a match at the previous step and the current
1290 * match is not better, output the previous match:
1301 /* Insert in hash table all strings up to the end of the match.
1320 /* If there was no match at the previous position, output a
1321 * single literal. If there was a match but the current match
1322 * is longer, truncate the previous match to a single literal.
1333 /* There is no previous match to compare with, wait for