Lines Matching defs:window

212 /* A Pos is an index in the character window. We use short instead of int to
230 uInt w_size; /* LZ77 window size (32K by default) */
234 Bytef *window;
235 /* Sliding window. Input bytes are read into the second half of the window,
240 * the window size to 64K, which is quite useful on MSDOS.
241 * To do: use the user input buffer as sliding window.
245 /* Actual size of window: 2*wSize, except when the user input buffer
246 * is directly used as sliding window.
252 * An index in this array is thus a window index modulo 32K.
271 * negative when the window is moved backwards.
279 uInt lookahead; /* number of valid bytes ahead in window */
342 * data is still in the window so we can still emit a stored block even
429 * sliding window trailing behind the input currently being processed).
566 (UPDATE_HASH(s, s->ins_h, s->window[(str) + (MIN_MATCH-1)]), \
585 /* To do: ignore strm->next_in if we use it as window */
633 s->window = (Bytef *) ZALLOC(strm, s->w_size, 2*sizeof(Byte));
641 if (s->window == Z_NULL || s->prev == Z_NULL || s->head == Z_NULL ||
861 TRY_FREE(strm, state->window, state->w_size * 2 * sizeof(Byte));
944 register Bytef *scan = s->window + s->strstart; /* current string */
951 * we prevent matches with the string of window index 0.
960 register Bytef *strend = s->window + s->strstart + MAX_MATCH - 1;
964 register Bytef *strend = s->window + s->strstart + MAX_MATCH;
982 match = s->window + cur_match;
1000 * necessary to put more guard bytes at the end of the window, or
1013 /* Here, scan <= window+strstart+257 */
1014 Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan");
1046 Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan");
1081 if (memcmp((charf *)s->window + match,
1082 (charf *)s->window + start, length) != EQUAL) {
1086 do { fprintf(stderr, "%c%c", s->window[match++],
1087 s->window[start++]); } while (--length != 0);
1092 do { putc(s->window[start++], stderr); } while (--length != 0);
1100 * Fill the window when the lookahead becomes insufficient.
1114 unsigned more; /* Amount of free space at the end of the window. */
1129 /* If the window is almost full and there is insufficient lookahead,
1134 /* By the IN assertion, the window is not empty so we can't confuse
1137 zmemcpy((charf *)s->window, (charf *)s->window+wsize,
1181 n = read_buf(s->strm, (charf *)s->window + s->strstart + s->lookahead,
1187 s->ins_h = s->window[s->strstart];
1188 UPDATE_HASH(s, s->ins_h, s->window[s->strstart+1]);
1206 (charf *)&s->window[(unsigned)s->block_start] : \
1248 /* Insert the string window[strstart .. strstart+2] in the
1260 * of window index 0 (in particular we have to avoid a match
1295 s->ins_h = s->window[s->strstart];
1296 UPDATE_HASH(s, s->ins_h, s->window[s->strstart+1]);
1306 Tracevv((stderr,"%c", s->window[s->strstart]));
1307 bflush = ct_tally (s, 0, s->window[s->strstart]);
1320 * no better match at the next window position.
1343 /* Insert the string window[strstart .. strstart+2] in the
1358 * of window index 0 (in particular we have to avoid a match
1412 Tracevv((stderr,"%c", s->window[s->strstart-1]));
1413 if (ct_tally (s, 0, s->window[s->strstart-1])) {
1430 Tracevv((stderr,"%c", s->window[s->strstart-1]));
1431 ct_tally (s, 0, s->window[s->strstart-1]);
2614 uInt w)); /* window size */
2763 uInt wbits; /* log2(window size) (8..15, defaults to 15) */
2824 /* set window size */
2882 z->msg = "invalid window size";
3059 DRY, /* output remaining window bytes */
3086 Bytef *window; /* sliding window */
3087 Bytef *end; /* one byte after sliding window */
3088 Bytef *read; /* window read pointer */
3089 Bytef *write; /* window write pointer */
3112 #define WRAP {if(q==s->end&&s->read!=s->window){q=s->window;m=WAVAIL;}}
3126 /* copy as much as possible from the sliding window to the output area */
3226 s->read = s->write = s->window;
3243 if ((s->window = (Bytef *)ZALLOC(z, 1, w)) == Z_NULL)
3248 s->end = s->window + w;
3267 Bytef *q; /* output window write pointer */
3268 uInt m; /* bytes to end of window or read pointer */
3352 (s->end - s->read) + (q - s->window))));
3488 (s->end - s->read) + (q - s->window))));
3526 ZFREE(z, s->window, s->end - s->window);
3549 Bytef *q; /* output window write pointer */
3550 uInt m; /* bytes to end of window or read pointer */
3577 s->read = q = s->window;
4092 COPY, /* o: copying bytes in window, waiting for space */
4155 Bytef *q; /* output window write pointer */
4156 uInt m; /* bytes to end of window or read pointer */
4260 case COPY: /* o: copying bytes in window, waiting for space */
4262 f = (uInt)(q - s->window) < c->sub.copy.dist ?
4263 s->end - (c->sub.copy.dist - (q - s->window)) :
4267 if ((uInt)(q - s->window) < c->sub.copy.dist)
4268 f = s->end - (c->sub.copy.dist - (q - s->window));
4275 f = s->window;
4317 /* copy as much as possible from the sliding window to the output area */
4330 /* compute number of bytes to copy as far as end of window */
4343 /* copy as far as end of window */
4350 /* see if more to copy at beginning of window */
4354 q = s->window;
4356 s->write = s->window;
4404 /* Called with number of bytes left to write in window at least 258
4421 Bytef *q; /* output window write pointer */
4422 uInt m; /* bytes to end of window or read pointer */
4476 if ((uInt)(q - s->window) >= d) /* offset before dest */
4484 e = d - (q - s->window); /* bytes from offset to end */
4488 c -= e; /* copy to end of window */
4492 r = s->window; /* copy rest from start of window */