1 diff -urN mod_gzip-1.3.26.1a.org/mod_gzip.c mod_gzip-1.3.26.1a/mod_gzip.c
2 --- mod_gzip-1.3.26.1a.org/mod_gzip.c Fri Apr 25 11:52:24 2003
3 +++ mod_gzip-1.3.26.1a/mod_gzip.c Fri Apr 25 15:33:54 2003
5 mod_gzip_printf( "%s: Call gzp_main(r,gzp)...",cn);
8 - rc = gzp_main( r, gzp );
9 + rc = mod_gzip_gzp_main( r, gzp );
11 output_size = (long) gzp->bytes_out;
14 mod_gzip_strcpy(gzc.input_filename, r->filename);
15 mod_gzip_strcpy(gzc.output_filename,dest);
17 - rc = gzp_main(r,&gzc);
18 + rc = mod_gzip_gzp_main(r,&gzc);
20 #ifdef MOD_GZIP_USES_APACHE_LOGS
21 if(gzc.bytes_out > 0) {
22 diff -urN mod_gzip-1.3.26.1a.org/mod_gzip.h mod_gzip-1.3.26.1a/mod_gzip.h
23 --- mod_gzip-1.3.26.1a.org/mod_gzip.h Fri Apr 25 11:52:24 2003
24 +++ mod_gzip-1.3.26.1a/mod_gzip.h Fri Apr 25 15:32:16 2003
29 -int gzp_main(request_rec *, GZP_CONTROL *);
30 +int mod_gzip_gzp_main(request_rec *, GZP_CONTROL *);
31 char *mod_gzip_generate_vary_header(mod_gzip_conf *,struct pool *);
32 int mod_gzip_compress_file(request_rec *,char *);
34 diff -urN mod_gzip-1.3.26.1a.org/mod_gzip_compress.c mod_gzip-1.3.26.1a/mod_gzip_compress.c
35 --- mod_gzip-1.3.26.1a.org/mod_gzip_compress.c Fri Apr 25 11:52:24 2003
36 +++ mod_gzip-1.3.26.1a/mod_gzip_compress.c Fri Apr 25 15:31:52 2003
41 -config configuration_table[10] = {
42 +static config configuration_table[10] = {
50 -uch bl_order[BL_CODES]
51 +static uch bl_order[BL_CODES]
52 = {16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15};
54 -int extra_lbits[LENGTH_CODES]
55 +static int extra_lbits[LENGTH_CODES]
56 = {0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0};
58 -int extra_dbits[D_CODES]
59 +static int extra_dbits[D_CODES]
60 = {0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13};
62 -int extra_blbits[BL_CODES]
63 +static int extra_blbits[BL_CODES]
64 = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7};
67 +static ulg crc_32_tab[] = {
68 0x00000000L, 0x77073096L, 0xee0e612cL, 0x990951baL, 0x076dc419L,
69 0x706af48fL, 0xe963a535L, 0x9e6495a3L, 0x0edb8832L, 0x79dcb8a4L,
70 0xe0d5e91eL, 0x97d2d988L, 0x09b64c2bL, 0x7eb17cbdL, 0xe7b82d07L,
75 -int gz1_size = sizeof( GZ1 );
76 +static int gz1_size = sizeof( GZ1 );
78 /* Declare some local function protypes... */
80 @@ -952,118 +952,118 @@
81 /* if the code is being compiled directly into the parent */
82 /* instead of being built as a standalone DLL or DSO library. */
84 -PGZ1 gz1_init ( void );
85 -int gz1_cleanup ( PGZ1 gz1 );
86 -ulg gz1_deflate ( PGZ1 gz1 );
87 -ulg gz1_deflate_fast( PGZ1 gz1 );
88 +static PGZ1 gz1_init ( void );
89 +static int gz1_cleanup ( PGZ1 gz1 );
90 +static ulg gz1_deflate ( PGZ1 gz1 );
91 +static ulg gz1_deflate_fast( PGZ1 gz1 );
93 /* The rest of the routines should not need the 'gz1_' prefix. */
94 /* No conflicts reported at this time. */
96 -int inflate ( PGZ1 gz1 );
97 -int inflate_dynamic( PGZ1 gz1 );
98 -int inflate_stored ( PGZ1 gz1 );
99 -int inflate_fixed ( PGZ1 gz1 );
100 -void fill_window ( PGZ1 gz1 );
101 -void flush_outbuf ( PGZ1 gz1 );
102 -void flush_window ( PGZ1 gz1 );
103 -void bi_windup ( PGZ1 gz1 );
104 -void set_file_type ( PGZ1 gz1 );
105 -void init_block ( PGZ1 gz1 );
106 -int build_bl_tree ( PGZ1 gz1 );
107 -void read_error ( PGZ1 gz1 );
108 -void write_error ( PGZ1 gz1 );
109 -int get_header ( PGZ1 gz1, int in );
110 -int inflate_block ( PGZ1 gz1, int *e );
111 -int fill_inbuf ( PGZ1 gz1, int eof_ok );
112 -char *gz1_basename ( PGZ1 gz1, char *fname );
113 -int longest_match ( PGZ1 gz1, unsigned cur_match );
114 -void bi_init ( PGZ1 gz1, gz1_file_t zipfile );
115 -int file_read ( PGZ1 gz1, char *buf, unsigned size );
116 -void write_buf ( PGZ1 gz1, int fd, voidp buf, unsigned cnt );
117 +static int inflate ( PGZ1 gz1 );
118 +static int inflate_dynamic( PGZ1 gz1 );
119 +static int inflate_stored ( PGZ1 gz1 );
120 +static int inflate_fixed ( PGZ1 gz1 );
121 +static void fill_window ( PGZ1 gz1 );
122 +static void flush_outbuf ( PGZ1 gz1 );
123 +static void flush_window ( PGZ1 gz1 );
124 +static void bi_windup ( PGZ1 gz1 );
125 +static void set_file_type ( PGZ1 gz1 );
126 +static void init_block ( PGZ1 gz1 );
127 +static int build_bl_tree ( PGZ1 gz1 );
128 +static void read_error ( PGZ1 gz1 );
129 +static void write_error ( PGZ1 gz1 );
130 +static int get_header ( PGZ1 gz1, int in );
131 +static int inflate_block ( PGZ1 gz1, int *e );
132 +static int fill_inbuf ( PGZ1 gz1, int eof_ok );
133 +static char *gz1_basename ( PGZ1 gz1, char *fname );
134 +static int longest_match ( PGZ1 gz1, unsigned cur_match );
135 +static void bi_init ( PGZ1 gz1, gz1_file_t zipfile );
136 +static int file_read ( PGZ1 gz1, char *buf, unsigned size );
137 +static void write_buf ( PGZ1 gz1, int fd, voidp buf, unsigned cnt );
139 -void error( char *msg );
140 +static void error( char *msg );
150 +static ulg flush_block(
158 +static void copy_block(
166 +static int ct_tally(
173 +static void send_bits(
180 +static void send_tree(
186 -void send_all_trees(
187 +static void send_all_trees(
194 -void mod_gzip_ct_init(
195 +static void mod_gzip_ct_init(
202 +static void lm_init(
209 +static void build_tree(
214 -void compress_block(
215 +static void compress_block(
222 +static void gen_bitlen(
228 +static void pqdownheap(
235 +static int huft_build(
239 @@ -1074,13 +1074,13 @@
251 +static int inflate_codes(
255 @@ -1088,30 +1088,30 @@
260 +static void gen_codes(
267 +static void scan_tree(
273 -unsigned bi_reverse(
274 +static unsigned bi_reverse(
281 +static int huft_free(
287 +static PGZ1 gz1_init()
291 @@ -1232,7 +1232,7 @@
295 -int gz1_cleanup( PGZ1 gz1 )
296 +static int gz1_cleanup( PGZ1 gz1 )
300 @@ -1254,20 +1254,20 @@
304 -int (*read_buf)(PGZ1 gz1, char *buf, unsigned size);
305 +static int (*read_buf)(PGZ1 gz1, char *buf, unsigned size);
307 -void error( char *msg )
308 +static void error( char *msg )
313 -int (*work)( PGZ1 gz1, int infile, int outfile ) = 0;
314 +static int (*work)( PGZ1 gz1, int infile, int outfile ) = 0;
320 -int get_header( PGZ1 gz1, int in )
321 +static int get_header( PGZ1 gz1, int in )
325 @@ -1365,7 +1365,7 @@
329 -int fill_inbuf( PGZ1 gz1, int eof_ok )
330 +static int fill_inbuf( PGZ1 gz1, int eof_ok )
334 @@ -1429,7 +1429,7 @@
335 return gz1->inbuf[0];
343 @@ -1459,12 +1459,12 @@
344 return( c ^ 0xffffffffL );
347 -void read_error( PGZ1 gz1 )
348 +static void read_error( PGZ1 gz1 )
353 -void mod_gzip_strlwr( char *s )
354 +static void mod_gzip_strlwr( char *s )
358 @@ -1481,7 +1481,7 @@
362 -char *gz1_basename( PGZ1 gz1, char *fname )
363 +static char *gz1_basename( PGZ1 gz1, char *fname )
366 if ((p = strrchr(fname, PATH_SEP)) != NULL) fname = p+1;
367 @@ -1498,7 +1498,7 @@
371 -void write_buf( PGZ1 gz1, int fd, voidp buf, unsigned cnt )
372 +static void write_buf( PGZ1 gz1, int fd, voidp buf, unsigned cnt )
376 @@ -1528,7 +1528,7 @@
380 -void write_error( PGZ1 gz1 )
381 +static void write_error( PGZ1 gz1 )
385 @@ -1538,7 +1538,7 @@
387 static ush ptr_offset = 0;
390 +static void * fcalloc(
394 @@ -1562,7 +1562,7 @@
398 -void fcfree( void *ptr )
399 +static void fcfree( void *ptr )
401 *((ush*)&ptr+1) -= (ptr_offset + 15) >> 4;
402 *(ush*)&ptr = ptr_offset;
403 @@ -1573,7 +1573,7 @@
412 @@ -1637,7 +1637,7 @@
416 -ulg gz1_deflate( PGZ1 gz1 )
417 +static ulg gz1_deflate( PGZ1 gz1 )
421 @@ -1724,7 +1724,7 @@
425 -void flush_outbuf( PGZ1 gz1 )
426 +static void flush_outbuf( PGZ1 gz1 )
428 if ( gz1->outcnt == 0 )
430 @@ -1737,7 +1737,7 @@
435 +static void lm_init(
439 @@ -1805,7 +1805,7 @@
443 -void fill_window( PGZ1 gz1 )
444 +static void fill_window( PGZ1 gz1 )
446 register unsigned n, m;
448 @@ -1856,7 +1856,7 @@
452 -ulg gz1_deflate_fast( PGZ1 gz1 )
453 +static ulg gz1_deflate_fast( PGZ1 gz1 )
457 @@ -1927,7 +1927,7 @@
458 return FLUSH_BLOCK(1);
461 -void mod_gzip_ct_init(
462 +static void mod_gzip_ct_init(
466 @@ -2013,7 +2013,7 @@
471 +static ulg flush_block(
475 @@ -2117,7 +2117,7 @@
479 -unsigned bi_reverse(
480 +static unsigned bi_reverse(
484 @@ -2134,7 +2134,7 @@
488 -void set_file_type( PGZ1 gz1 )
489 +static void set_file_type( PGZ1 gz1 )
492 unsigned ascii_freq = 0;
493 @@ -2147,7 +2147,7 @@
494 *gz1->file_type = bin_freq > (ascii_freq >> 2) ? BINARY : ASCII;
497 -void init_block( PGZ1 gz1 )
498 +static void init_block( PGZ1 gz1 )
502 @@ -2166,7 +2166,7 @@
506 -void bi_init( PGZ1 gz1, gz1_file_t zipfile )
507 +static void bi_init( PGZ1 gz1, gz1_file_t zipfile )
509 gz1->zfile = zipfile;
511 @@ -2178,7 +2178,7 @@
516 +static int ct_tally(
520 @@ -2231,7 +2231,7 @@
521 return( gz1->last_lit == LIT_BUFSIZE-1 || gz1->last_dist == DIST_BUFSIZE );
524 -void compress_block(
525 +static void compress_block(
529 @@ -2279,7 +2279,7 @@
533 -int longest_match( PGZ1 gz1, unsigned cur_match )
534 +static int longest_match( PGZ1 gz1, unsigned cur_match )
536 unsigned chain_length = gz1->max_chain_length;
537 register uch *scan = gz1->window + gz1->strstart;
538 @@ -2363,7 +2363,7 @@
543 +static void send_bits(
547 @@ -2385,7 +2385,7 @@
552 +static void build_tree(
556 @@ -2443,7 +2443,7 @@
557 gen_codes(gz1,(ct_data *)tree, max_code);
560 -int build_bl_tree( PGZ1 gz1 )
561 +static int build_bl_tree( PGZ1 gz1 )
565 @@ -2462,7 +2462,7 @@
570 +static void gen_codes(
574 @@ -2489,7 +2489,7 @@
579 +static void gen_bitlen(
583 @@ -2552,7 +2552,7 @@
588 +static void copy_block(
592 @@ -2581,7 +2581,7 @@
596 -int file_read( PGZ1 gz1, char *buf, unsigned size )
597 +static int file_read( PGZ1 gz1, char *buf, unsigned size )
600 unsigned bytes_to_copy = 0;
601 @@ -2626,7 +2626,7 @@
605 -void bi_windup( PGZ1 gz1 )
606 +static void bi_windup( PGZ1 gz1 )
608 if ( gz1->bi_valid > 8 )
610 @@ -2641,7 +2641,7 @@
614 -void send_all_trees(
615 +static void send_all_trees(
619 @@ -2663,7 +2663,7 @@
620 send_tree(gz1,(ct_data *)gz1->dyn_dtree, dcodes-1);
624 +static void send_tree(
628 @@ -2728,7 +2728,7 @@
633 +static void scan_tree(
637 @@ -2794,7 +2794,7 @@
642 +static void pqdownheap(
646 @@ -2822,15 +2822,15 @@
647 #define GZS_DEFLATE1 3
648 #define GZS_DEFLATE2 4
650 -int gzs_fsp ( PGZ1 gz1 );
651 -int gzs_zip1 ( PGZ1 gz1 );
652 -int gzs_zip2 ( PGZ1 gz1 );
653 -int gzs_deflate1( PGZ1 gz1 );
654 -int gzs_deflate2( PGZ1 gz1 );
655 +static int gzs_fsp ( PGZ1 gz1 );
656 +static int gzs_zip1 ( PGZ1 gz1 );
657 +static int gzs_zip2 ( PGZ1 gz1 );
658 +static int gzs_deflate1( PGZ1 gz1 );
659 +static int gzs_deflate2( PGZ1 gz1 );
661 -int gzp_main( request_rec *r, GZP_CONTROL *gzp )
662 +int mod_gzip_gzp_main( request_rec *r, GZP_CONTROL *gzp )
664 - char cn[]="gzp_main()";
665 + char cn[]="mod_gzip_gzp_main()";
669 @@ -2996,7 +2996,7 @@
670 return final_exit_code;
673 -int gzs_fsp( PGZ1 gz1 )
674 +static int gzs_fsp( PGZ1 gz1 )
678 @@ -3036,7 +3036,7 @@
682 -int gzs_zip1( PGZ1 gz1 )
683 +static int gzs_zip1( PGZ1 gz1 )
687 @@ -3070,7 +3070,7 @@
691 -int gzs_zip2( PGZ1 gz1 )
692 +static int gzs_zip2( PGZ1 gz1 )
696 @@ -3103,7 +3103,7 @@
700 -int gzs_deflate1( PGZ1 gz1 )
701 +static int gzs_deflate1( PGZ1 gz1 )
703 if ( !gz1->deflate1_initialized )
705 @@ -3219,7 +3219,7 @@
709 -int gzs_deflate2( PGZ1 gz1 )
710 +static int gzs_deflate2( PGZ1 gz1 )
712 #if !defined(NO_SIZE_CHECK) && !defined(RECORD_IO)
713 if (gz1->ifile_size != -1L && gz1->isize != (ulg)gz1->ifile_size)