local uInt longest_match OF((deflate_state *s, IPos cur_match));
#endif
-#ifdef DEBUG
+#ifdef DEBUG_ZLIB
local void check_match OF((deflate_state *s, IPos start, IPos match,
int length));
#endif
#endif /* FASTEST */
-#ifdef DEBUG
+#ifdef DEBUG_ZLIB
/* ===========================================================================
* Check that the match at match_start is indeed a match.
*/
}
#else
# define check_match(s, start, match, length)
-#endif /* DEBUG */
+#endif /* DEBUG_ZLIB */
/* ===========================================================================
* Fill the window when the lookahead becomes insufficient.
#include "deflate.h"
-#ifdef DEBUG
+#ifdef DEBUG_ZLIB
# include <ctype.h>
#endif
local void gen_trees_header OF((void));
#endif
-#ifndef DEBUG
+#ifndef DEBUG_ZLIB
# define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len)
/* Send a code of the given tree. c and tree must not have side effects */
-#else /* DEBUG */
+#else /* DEBUG_ZLIB */
# define send_code(s, c, tree) \
{ if (z_verbose>2) fprintf(stderr,"\ncd %3d ",(c)); \
send_bits(s, tree[c].Code, tree[c].Len); }
* Send a value on a given number of bits.
* IN assertion: length <= 16 and value fits in length bits.
*/
-#ifdef DEBUG
+#ifdef DEBUG_ZLIB
local void send_bits OF((deflate_state *s, int value, int length));
local void send_bits(s, value, length)
s->bi_valid += length;
}
}
-#else /* !DEBUG */
+#else /* !DEBUG_ZLIB */
#define send_bits(s, value, length) \
{ int len = length;\
s->bi_valid += len;\
}\
}
-#endif /* DEBUG */
+#endif /* DEBUG_ZLIB */
/* the arguments must not have side effects */
* Genererate the file trees.h describing the static trees.
*/
#ifdef GEN_TREES_H
-# ifndef DEBUG
+# ifndef DEBUG_ZLIB
# include <stdio.h>
# endif
s->bi_buf = 0;
s->bi_valid = 0;
s->last_eob_len = 8; /* enough lookahead for inflate */
-#ifdef DEBUG
+#ifdef DEBUG_ZLIB
s->compressed_len = 0L;
s->bits_sent = 0L;
#endif
int last; /* one if this is the last block for a file */
{
send_bits(s, (STORED_BLOCK<<1)+last, 3); /* send block type */
-#ifdef DEBUG
+#ifdef DEBUG_ZLIB
s->compressed_len = (s->compressed_len + 3 + 7) & (ulg)~7L;
s->compressed_len += (stored_len + 4) << 3;
#endif
{
send_bits(s, STATIC_TREES<<1, 3);
send_code(s, END_BLOCK, static_ltree);
-#ifdef DEBUG
+#ifdef DEBUG_ZLIB
s->compressed_len += 10L; /* 3 for block type, 7 for EOB */
#endif
bi_flush(s);
if (1 + s->last_eob_len + 10 - s->bi_valid < 9) {
send_bits(s, STATIC_TREES<<1, 3);
send_code(s, END_BLOCK, static_ltree);
-#ifdef DEBUG
+#ifdef DEBUG_ZLIB
s->compressed_len += 10L;
#endif
bi_flush(s);
#endif
send_bits(s, (STATIC_TREES<<1)+last, 3);
compress_block(s, (ct_data *)static_ltree, (ct_data *)static_dtree);
-#ifdef DEBUG
+#ifdef DEBUG_ZLIB
s->compressed_len += 3 + s->static_len;
#endif
} else {
send_all_trees(s, s->l_desc.max_code+1, s->d_desc.max_code+1,
max_blindex+1);
compress_block(s, (ct_data *)s->dyn_ltree, (ct_data *)s->dyn_dtree);
-#ifdef DEBUG
+#ifdef DEBUG_ZLIB
s->compressed_len += 3 + s->opt_len;
#endif
}
if (last) {
bi_windup(s);
-#ifdef DEBUG
+#ifdef DEBUG_ZLIB
s->compressed_len += 7; /* align on byte boundary */
#endif
}
}
s->bi_buf = 0;
s->bi_valid = 0;
-#ifdef DEBUG
+#ifdef DEBUG_ZLIB
s->bits_sent = (s->bits_sent+7) & ~7;
#endif
}
if (header) {
put_short(s, (ush)len);
put_short(s, (ush)~len);
-#ifdef DEBUG
+#ifdef DEBUG_ZLIB
s->bits_sent += 2*16;
#endif
}
-#ifdef DEBUG
+#ifdef DEBUG_ZLIB
s->bits_sent += (ulg)len<<3;
#endif
while (len--) {