deflate.h (21673) | deflate.h (33908) |
---|---|
1/* deflate.h -- internal compression state | 1/* deflate.h -- internal compression state |
2 * Copyright (C) 1995-1996 Jean-loup Gailly | 2 * Copyright (C) 1995-1998 Jean-loup Gailly |
3 * For conditions of distribution and use, see copyright notice in zlib.h 4 */ 5 6/* WARNING: this file should *not* be used by applications. It is 7 part of the implementation of the compression library and is 8 subject to change. Applications should only use zlib.h. 9 */ 10 | 3 * For conditions of distribution and use, see copyright notice in zlib.h 4 */ 5 6/* WARNING: this file should *not* be used by applications. It is 7 part of the implementation of the compression library and is 8 subject to change. Applications should only use zlib.h. 9 */ 10 |
11/* $FreeBSD: head/lib/libz/deflate.h 21673 1997-01-14 07:20:47Z jkh $ */ | 11/* $FreeBSD: head/lib/libz/deflate.h 33908 1998-02-28 06:08:17Z steve $ */ |
12 13#ifndef _DEFLATE_H 14#define _DEFLATE_H 15 16#include "zutil.h" 17 18/* =========================================================================== 19 * Internal compression state. --- 58 unchanged lines hidden (view full) --- 78/* A Pos is an index in the character window. We use short instead of int to 79 * save space in the various tables. IPos is used only for parameter passing. 80 */ 81 82typedef struct internal_state { 83 z_streamp strm; /* pointer back to this zlib stream */ 84 int status; /* as the name implies */ 85 Bytef *pending_buf; /* output still pending */ | 12 13#ifndef _DEFLATE_H 14#define _DEFLATE_H 15 16#include "zutil.h" 17 18/* =========================================================================== 19 * Internal compression state. --- 58 unchanged lines hidden (view full) --- 78/* A Pos is an index in the character window. We use short instead of int to 79 * save space in the various tables. IPos is used only for parameter passing. 80 */ 81 82typedef struct internal_state { 83 z_streamp strm; /* pointer back to this zlib stream */ 84 int status; /* as the name implies */ 85 Bytef *pending_buf; /* output still pending */ |
86 ulg pending_buf_size; /* size of pending_buf */ |
|
86 Bytef *pending_out; /* next pending byte to output to the stream */ 87 int pending; /* nb of bytes in the pending buffer */ 88 int noheader; /* suppress zlib header and adler32 */ 89 Byte data_type; /* UNKNOWN, BINARY or ASCII */ 90 Byte method; /* STORED (for zip only) or DEFLATED */ 91 int last_flush; /* value of flush param for previous deflate call */ 92 93 /* used by deflate.c: */ --- 173 unchanged lines hidden (view full) --- 267 /* in trees.c */ 268void _tr_init OF((deflate_state *s)); 269int _tr_tally OF((deflate_state *s, unsigned dist, unsigned lc)); 270ulg _tr_flush_block OF((deflate_state *s, charf *buf, ulg stored_len, 271 int eof)); 272void _tr_align OF((deflate_state *s)); 273void _tr_stored_block OF((deflate_state *s, charf *buf, ulg stored_len, 274 int eof)); | 87 Bytef *pending_out; /* next pending byte to output to the stream */ 88 int pending; /* nb of bytes in the pending buffer */ 89 int noheader; /* suppress zlib header and adler32 */ 90 Byte data_type; /* UNKNOWN, BINARY or ASCII */ 91 Byte method; /* STORED (for zip only) or DEFLATED */ 92 int last_flush; /* value of flush param for previous deflate call */ 93 94 /* used by deflate.c: */ --- 173 unchanged lines hidden (view full) --- 268 /* in trees.c */ 269void _tr_init OF((deflate_state *s)); 270int _tr_tally OF((deflate_state *s, unsigned dist, unsigned lc)); 271ulg _tr_flush_block OF((deflate_state *s, charf *buf, ulg stored_len, 272 int eof)); 273void _tr_align OF((deflate_state *s)); 274void _tr_stored_block OF((deflate_state *s, charf *buf, ulg stored_len, 275 int eof)); |
276 277#define d_code(dist) \ 278 ((dist) < 256 ? _dist_code[dist] : _dist_code[256+((dist)>>7)]) 279/* Mapping from a distance to a distance code. dist is the distance - 1 and 280 * must not have side effects. _dist_code[256] and _dist_code[257] are never 281 * used. 282 */ 283 284#ifndef DEBUG 285/* Inline versions of _tr_tally for speed: */ 286 287#if defined(GEN_TREES_H) || !defined(STDC) 288 extern uch _length_code[]; 289 extern uch _dist_code[]; 290#else 291 extern const uch _length_code[]; 292 extern const uch _dist_code[]; |
|
275#endif | 293#endif |
294 295# define _tr_tally_lit(s, c, flush) \ 296 { uch cc = (c); \ 297 s->d_buf[s->last_lit] = 0; \ 298 s->l_buf[s->last_lit++] = cc; \ 299 s->dyn_ltree[cc].Freq++; \ 300 flush = (s->last_lit == s->lit_bufsize-1); \ 301 } 302# define _tr_tally_dist(s, distance, length, flush) \ 303 { uch len = (length); \ 304 ush dist = (distance); \ 305 s->d_buf[s->last_lit] = dist; \ 306 s->l_buf[s->last_lit++] = len; \ 307 dist--; \ 308 s->dyn_ltree[_length_code[len]+LITERALS+1].Freq++; \ 309 s->dyn_dtree[d_code(dist)].Freq++; \ 310 flush = (s->last_lit == s->lit_bufsize-1); \ 311 } 312#else 313# define _tr_tally_lit(s, c, flush) flush = _tr_tally(s, 0, c) 314# define _tr_tally_dist(s, distance, length, flush) \ 315 flush = _tr_tally(s, distance, length) 316#endif 317 318#endif |
|