rugged 0.26.3 → 0.26.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rugged/version.rb +1 -1
- data/vendor/libgit2/CMakeLists.txt +1 -1
- data/vendor/libgit2/deps/winhttp/winhttp.h +6 -4
- data/vendor/libgit2/deps/zlib/adler32.c +14 -7
- data/vendor/libgit2/deps/zlib/crc32.c +29 -12
- data/vendor/libgit2/deps/zlib/deflate.c +499 -303
- data/vendor/libgit2/deps/zlib/deflate.h +18 -15
- data/vendor/libgit2/deps/zlib/gzguts.h +218 -0
- data/vendor/libgit2/deps/zlib/infback.c +2 -2
- data/vendor/libgit2/deps/zlib/inffast.c +34 -51
- data/vendor/libgit2/deps/zlib/inflate.c +86 -37
- data/vendor/libgit2/deps/zlib/inflate.h +7 -4
- data/vendor/libgit2/deps/zlib/inftrees.c +12 -14
- data/vendor/libgit2/deps/zlib/trees.c +38 -61
- data/vendor/libgit2/deps/zlib/zconf.h +499 -23
- data/vendor/libgit2/deps/zlib/zlib.h +298 -154
- data/vendor/libgit2/deps/zlib/zutil.c +27 -23
- data/vendor/libgit2/deps/zlib/zutil.h +35 -17
- data/vendor/libgit2/include/git2.h +1 -0
- data/vendor/libgit2/include/git2/sys/mempack.h +5 -4
- data/vendor/libgit2/include/git2/version.h +2 -2
- data/vendor/libgit2/src/checkout.c +34 -11
- data/vendor/libgit2/src/curl_stream.c +21 -0
- data/vendor/libgit2/src/curl_stream.h +1 -0
- data/vendor/libgit2/src/delta.c +30 -28
- data/vendor/libgit2/src/diff.c +0 -7
- data/vendor/libgit2/src/diff_file.c +3 -1
- data/vendor/libgit2/src/diff_generate.c +1 -1
- data/vendor/libgit2/src/diff_tform.c +3 -1
- data/vendor/libgit2/src/global.c +4 -2
- data/vendor/libgit2/src/hash/hash_openssl.h +18 -3
- data/vendor/libgit2/src/ignore.c +60 -36
- data/vendor/libgit2/src/index.c +59 -26
- data/vendor/libgit2/src/indexer.c +15 -2
- data/vendor/libgit2/src/merge.c +18 -8
- data/vendor/libgit2/src/odb_mempack.c +1 -0
- data/vendor/libgit2/src/oidarray.c +12 -0
- data/vendor/libgit2/src/oidarray.h +1 -0
- data/vendor/libgit2/src/openssl_stream.c +17 -4
- data/vendor/libgit2/src/pack.c +10 -7
- data/vendor/libgit2/src/path.c +180 -22
- data/vendor/libgit2/src/path.h +73 -0
- data/vendor/libgit2/src/posix.c +1 -1
- data/vendor/libgit2/src/posix.h +3 -0
- data/vendor/libgit2/src/proxy.c +6 -0
- data/vendor/libgit2/src/proxy.h +1 -0
- data/vendor/libgit2/src/push.c +3 -0
- data/vendor/libgit2/src/refdb_fs.c +2 -2
- data/vendor/libgit2/src/refs.c +7 -1
- data/vendor/libgit2/src/repository.c +9 -3
- data/vendor/libgit2/src/sha1_lookup.c +2 -2
- data/vendor/libgit2/src/signature.c +1 -0
- data/vendor/libgit2/src/socket_stream.c +1 -1
- data/vendor/libgit2/src/stransport_stream.c +3 -1
- data/vendor/libgit2/src/submodule.c +54 -7
- data/vendor/libgit2/src/submodule.h +13 -0
- data/vendor/libgit2/src/transports/smart_pkt.c +8 -2
- data/vendor/libgit2/src/transports/smart_protocol.c +6 -6
- data/vendor/libgit2/src/transports/winhttp.c +22 -0
- data/vendor/libgit2/src/tree.c +1 -1
- metadata +3 -2
@@ -1,5 +1,5 @@
|
|
1
1
|
/* trees.c -- output deflated data using Huffman coding
|
2
|
-
* Copyright (C) 1995-
|
2
|
+
* Copyright (C) 1995-2017 Jean-loup Gailly
|
3
3
|
* detect_data_type() function provided freely by Cosmin Truta, 2006
|
4
4
|
* For conditions of distribution and use, see copyright notice in zlib.h
|
5
5
|
*/
|
@@ -36,7 +36,7 @@
|
|
36
36
|
|
37
37
|
#include "deflate.h"
|
38
38
|
|
39
|
-
#ifdef
|
39
|
+
#ifdef ZLIB_DEBUG
|
40
40
|
# include <ctype.h>
|
41
41
|
#endif
|
42
42
|
|
@@ -122,13 +122,13 @@ struct static_tree_desc_s {
|
|
122
122
|
int max_length; /* max bit length for the codes */
|
123
123
|
};
|
124
124
|
|
125
|
-
local static_tree_desc static_l_desc =
|
125
|
+
local const static_tree_desc static_l_desc =
|
126
126
|
{static_ltree, extra_lbits, LITERALS+1, L_CODES, MAX_BITS};
|
127
127
|
|
128
|
-
local static_tree_desc static_d_desc =
|
128
|
+
local const static_tree_desc static_d_desc =
|
129
129
|
{static_dtree, extra_dbits, 0, D_CODES, MAX_BITS};
|
130
130
|
|
131
|
-
local static_tree_desc static_bl_desc =
|
131
|
+
local const static_tree_desc static_bl_desc =
|
132
132
|
{(const ct_data *)0, extra_blbits, 0, BL_CODES, MAX_BL_BITS};
|
133
133
|
|
134
134
|
/* ===========================================================================
|
@@ -152,18 +152,16 @@ local int detect_data_type OF((deflate_state *s));
|
|
152
152
|
local unsigned bi_reverse OF((unsigned value, int length));
|
153
153
|
local void bi_windup OF((deflate_state *s));
|
154
154
|
local void bi_flush OF((deflate_state *s));
|
155
|
-
local void copy_block OF((deflate_state *s, charf *buf, unsigned len,
|
156
|
-
int header));
|
157
155
|
|
158
156
|
#ifdef GEN_TREES_H
|
159
157
|
local void gen_trees_header OF((void));
|
160
158
|
#endif
|
161
159
|
|
162
|
-
#ifndef
|
160
|
+
#ifndef ZLIB_DEBUG
|
163
161
|
# define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len)
|
164
162
|
/* Send a code of the given tree. c and tree must not have side effects */
|
165
163
|
|
166
|
-
#else /*
|
164
|
+
#else /* !ZLIB_DEBUG */
|
167
165
|
# define send_code(s, c, tree) \
|
168
166
|
{ if (z_verbose>2) fprintf(stderr,"\ncd %3d ",(c)); \
|
169
167
|
send_bits(s, tree[c].Code, tree[c].Len); }
|
@@ -182,7 +180,7 @@ local void gen_trees_header OF((void));
|
|
182
180
|
* Send a value on a given number of bits.
|
183
181
|
* IN assertion: length <= 16 and value fits in length bits.
|
184
182
|
*/
|
185
|
-
#ifdef
|
183
|
+
#ifdef ZLIB_DEBUG
|
186
184
|
local void send_bits OF((deflate_state *s, int value, int length));
|
187
185
|
|
188
186
|
local void send_bits(s, value, length)
|
@@ -208,12 +206,12 @@ local void send_bits(s, value, length)
|
|
208
206
|
s->bi_valid += length;
|
209
207
|
}
|
210
208
|
}
|
211
|
-
#else /* !
|
209
|
+
#else /* !ZLIB_DEBUG */
|
212
210
|
|
213
211
|
#define send_bits(s, value, length) \
|
214
212
|
{ int len = length;\
|
215
213
|
if (s->bi_valid > (int)Buf_size - len) {\
|
216
|
-
int val = value;\
|
214
|
+
int val = (int)value;\
|
217
215
|
s->bi_buf |= (ush)val << s->bi_valid;\
|
218
216
|
put_short(s, s->bi_buf);\
|
219
217
|
s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
|
@@ -223,7 +221,7 @@ local void send_bits(s, value, length)
|
|
223
221
|
s->bi_valid += len;\
|
224
222
|
}\
|
225
223
|
}
|
226
|
-
#endif /*
|
224
|
+
#endif /* ZLIB_DEBUG */
|
227
225
|
|
228
226
|
|
229
227
|
/* the arguments must not have side effects */
|
@@ -317,7 +315,7 @@ local void tr_static_init()
|
|
317
315
|
* Genererate the file trees.h describing the static trees.
|
318
316
|
*/
|
319
317
|
#ifdef GEN_TREES_H
|
320
|
-
# ifndef
|
318
|
+
# ifndef ZLIB_DEBUG
|
321
319
|
# include <stdio.h>
|
322
320
|
# endif
|
323
321
|
|
@@ -394,7 +392,7 @@ void ZLIB_INTERNAL _tr_init(s)
|
|
394
392
|
|
395
393
|
s->bi_buf = 0;
|
396
394
|
s->bi_valid = 0;
|
397
|
-
#ifdef
|
395
|
+
#ifdef ZLIB_DEBUG
|
398
396
|
s->compressed_len = 0L;
|
399
397
|
s->bits_sent = 0L;
|
400
398
|
#endif
|
@@ -522,12 +520,12 @@ local void gen_bitlen(s, desc)
|
|
522
520
|
xbits = 0;
|
523
521
|
if (n >= base) xbits = extra[n-base];
|
524
522
|
f = tree[n].Freq;
|
525
|
-
s->opt_len += (ulg)f * (bits + xbits);
|
526
|
-
if (stree) s->static_len += (ulg)f * (stree[n].Len + xbits);
|
523
|
+
s->opt_len += (ulg)f * (unsigned)(bits + xbits);
|
524
|
+
if (stree) s->static_len += (ulg)f * (unsigned)(stree[n].Len + xbits);
|
527
525
|
}
|
528
526
|
if (overflow == 0) return;
|
529
527
|
|
530
|
-
|
528
|
+
Tracev((stderr,"\nbit length overflow\n"));
|
531
529
|
/* This happens for example on obj2 and pic of the Calgary corpus */
|
532
530
|
|
533
531
|
/* Find the first bit length which could increase: */
|
@@ -554,9 +552,8 @@ local void gen_bitlen(s, desc)
|
|
554
552
|
m = s->heap[--h];
|
555
553
|
if (m > max_code) continue;
|
556
554
|
if ((unsigned) tree[m].Len != (unsigned) bits) {
|
557
|
-
|
558
|
-
s->opt_len += ((
|
559
|
-
*(long)tree[m].Freq;
|
555
|
+
Tracev((stderr,"code %d bits %d->%d\n", m, tree[m].Len, bits));
|
556
|
+
s->opt_len += ((ulg)bits - tree[m].Len) * tree[m].Freq;
|
560
557
|
tree[m].Len = (ush)bits;
|
561
558
|
}
|
562
559
|
n--;
|
@@ -578,7 +575,7 @@ local void gen_codes (tree, max_code, bl_count)
|
|
578
575
|
ushf *bl_count; /* number of codes at each bit length */
|
579
576
|
{
|
580
577
|
ush next_code[MAX_BITS+1]; /* next code value for each bit length */
|
581
|
-
|
578
|
+
unsigned code = 0; /* running code value */
|
582
579
|
int bits; /* bit index */
|
583
580
|
int n; /* code index */
|
584
581
|
|
@@ -586,7 +583,8 @@ local void gen_codes (tree, max_code, bl_count)
|
|
586
583
|
* without bit reversal.
|
587
584
|
*/
|
588
585
|
for (bits = 1; bits <= MAX_BITS; bits++) {
|
589
|
-
|
586
|
+
code = (code + bl_count[bits-1]) << 1;
|
587
|
+
next_code[bits] = (ush)code;
|
590
588
|
}
|
591
589
|
/* Check that the bit counts in bl_count are consistent. The last code
|
592
590
|
* must be all ones.
|
@@ -723,7 +721,7 @@ local void scan_tree (s, tree, max_code)
|
|
723
721
|
if (++count < max_count && curlen == nextlen) {
|
724
722
|
continue;
|
725
723
|
} else if (count < min_count) {
|
726
|
-
s->bl_tree[curlen].Freq +=
|
724
|
+
s->bl_tree[curlen].Freq += count;
|
727
725
|
} else if (curlen != 0) {
|
728
726
|
if (curlen != prevlen) s->bl_tree[curlen].Freq++;
|
729
727
|
s->bl_tree[REP_3_6].Freq++;
|
@@ -821,7 +819,7 @@ local int build_bl_tree(s)
|
|
821
819
|
if (s->bl_tree[bl_order[max_blindex]].Len != 0) break;
|
822
820
|
}
|
823
821
|
/* Update opt_len to include the bit length tree and counts */
|
824
|
-
s->opt_len += 3*(max_blindex+1) + 5+5+4;
|
822
|
+
s->opt_len += 3*((ulg)max_blindex+1) + 5+5+4;
|
825
823
|
Tracev((stderr, "\ndyn trees: dyn %ld, stat %ld",
|
826
824
|
s->opt_len, s->static_len));
|
827
825
|
|
@@ -869,11 +867,17 @@ void ZLIB_INTERNAL _tr_stored_block(s, buf, stored_len, last)
|
|
869
867
|
int last; /* one if this is the last block for a file */
|
870
868
|
{
|
871
869
|
send_bits(s, (STORED_BLOCK<<1)+last, 3); /* send block type */
|
872
|
-
|
870
|
+
bi_windup(s); /* align on byte boundary */
|
871
|
+
put_short(s, (ush)stored_len);
|
872
|
+
put_short(s, (ush)~stored_len);
|
873
|
+
zmemcpy(s->pending_buf + s->pending, (Bytef *)buf, stored_len);
|
874
|
+
s->pending += stored_len;
|
875
|
+
#ifdef ZLIB_DEBUG
|
873
876
|
s->compressed_len = (s->compressed_len + 3 + 7) & (ulg)~7L;
|
874
877
|
s->compressed_len += (stored_len + 4) << 3;
|
878
|
+
s->bits_sent += 2*16;
|
879
|
+
s->bits_sent += stored_len<<3;
|
875
880
|
#endif
|
876
|
-
copy_block(s, buf, (unsigned)stored_len, 1); /* with header */
|
877
881
|
}
|
878
882
|
|
879
883
|
/* ===========================================================================
|
@@ -894,7 +898,7 @@ void ZLIB_INTERNAL _tr_align(s)
|
|
894
898
|
{
|
895
899
|
send_bits(s, STATIC_TREES<<1, 3);
|
896
900
|
send_code(s, END_BLOCK, static_ltree);
|
897
|
-
#ifdef
|
901
|
+
#ifdef ZLIB_DEBUG
|
898
902
|
s->compressed_len += 10L; /* 3 for block type, 7 for EOB */
|
899
903
|
#endif
|
900
904
|
bi_flush(s);
|
@@ -902,7 +906,7 @@ void ZLIB_INTERNAL _tr_align(s)
|
|
902
906
|
|
903
907
|
/* ===========================================================================
|
904
908
|
* Determine the best encoding for the current block: dynamic trees, static
|
905
|
-
* trees or store, and
|
909
|
+
* trees or store, and write out the encoded block.
|
906
910
|
*/
|
907
911
|
void ZLIB_INTERNAL _tr_flush_block(s, buf, stored_len, last)
|
908
912
|
deflate_state *s;
|
@@ -974,7 +978,7 @@ void ZLIB_INTERNAL _tr_flush_block(s, buf, stored_len, last)
|
|
974
978
|
send_bits(s, (STATIC_TREES<<1)+last, 3);
|
975
979
|
compress_block(s, (const ct_data *)static_ltree,
|
976
980
|
(const ct_data *)static_dtree);
|
977
|
-
#ifdef
|
981
|
+
#ifdef ZLIB_DEBUG
|
978
982
|
s->compressed_len += 3 + s->static_len;
|
979
983
|
#endif
|
980
984
|
} else {
|
@@ -983,7 +987,7 @@ void ZLIB_INTERNAL _tr_flush_block(s, buf, stored_len, last)
|
|
983
987
|
max_blindex+1);
|
984
988
|
compress_block(s, (const ct_data *)s->dyn_ltree,
|
985
989
|
(const ct_data *)s->dyn_dtree);
|
986
|
-
#ifdef
|
990
|
+
#ifdef ZLIB_DEBUG
|
987
991
|
s->compressed_len += 3 + s->opt_len;
|
988
992
|
#endif
|
989
993
|
}
|
@@ -995,7 +999,7 @@ void ZLIB_INTERNAL _tr_flush_block(s, buf, stored_len, last)
|
|
995
999
|
|
996
1000
|
if (last) {
|
997
1001
|
bi_windup(s);
|
998
|
-
#ifdef
|
1002
|
+
#ifdef ZLIB_DEBUG
|
999
1003
|
s->compressed_len += 7; /* align on byte boundary */
|
1000
1004
|
#endif
|
1001
1005
|
}
|
@@ -1090,7 +1094,7 @@ local void compress_block(s, ltree, dtree)
|
|
1090
1094
|
send_code(s, code, dtree); /* send the distance code */
|
1091
1095
|
extra = extra_dbits[code];
|
1092
1096
|
if (extra != 0) {
|
1093
|
-
dist -= base_dist[code];
|
1097
|
+
dist -= (unsigned)base_dist[code];
|
1094
1098
|
send_bits(s, dist, extra); /* send the extra distance bits */
|
1095
1099
|
}
|
1096
1100
|
} /* literal or match pair ? */
|
@@ -1193,34 +1197,7 @@ local void bi_windup(s)
|
|
1193
1197
|
}
|
1194
1198
|
s->bi_buf = 0;
|
1195
1199
|
s->bi_valid = 0;
|
1196
|
-
#ifdef
|
1200
|
+
#ifdef ZLIB_DEBUG
|
1197
1201
|
s->bits_sent = (s->bits_sent+7) & ~7;
|
1198
1202
|
#endif
|
1199
1203
|
}
|
1200
|
-
|
1201
|
-
/* ===========================================================================
|
1202
|
-
* Copy a stored block, storing first the length and its
|
1203
|
-
* one's complement if requested.
|
1204
|
-
*/
|
1205
|
-
local void copy_block(s, buf, len, header)
|
1206
|
-
deflate_state *s;
|
1207
|
-
charf *buf; /* the input data */
|
1208
|
-
unsigned len; /* its length */
|
1209
|
-
int header; /* true if block header must be written */
|
1210
|
-
{
|
1211
|
-
bi_windup(s); /* align on byte boundary */
|
1212
|
-
|
1213
|
-
if (header) {
|
1214
|
-
put_short(s, (ush)len);
|
1215
|
-
put_short(s, (ush)~len);
|
1216
|
-
#ifdef DEBUG
|
1217
|
-
s->bits_sent += 2*16;
|
1218
|
-
#endif
|
1219
|
-
}
|
1220
|
-
#ifdef DEBUG
|
1221
|
-
s->bits_sent += (ulg)len<<3;
|
1222
|
-
#endif
|
1223
|
-
while (len--) {
|
1224
|
-
put_byte(s, *buf++);
|
1225
|
-
}
|
1226
|
-
}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/* zconf.h -- configuration of the zlib compression library
|
2
|
-
* Copyright (C) 1995-
|
2
|
+
* Copyright (C) 1995-2016 Jean-loup Gailly, Mark Adler
|
3
3
|
* For conditions of distribution and use, see copyright notice in zlib.h
|
4
4
|
*/
|
5
5
|
|
@@ -8,51 +8,527 @@
|
|
8
8
|
#ifndef ZCONF_H
|
9
9
|
#define ZCONF_H
|
10
10
|
|
11
|
-
|
11
|
+
/*
|
12
|
+
* If you *really* need a unique prefix for all types and library functions,
|
13
|
+
* compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
|
14
|
+
* Even better than compiling with -DZ_PREFIX would be to use configure to set
|
15
|
+
* this permanently in zconf.h using "./configure --zprefix".
|
16
|
+
*/
|
17
|
+
#ifdef Z_PREFIX /* may be set to #if 1 by ./configure */
|
18
|
+
# define Z_PREFIX_SET
|
19
|
+
|
20
|
+
/* all linked symbols and init macros */
|
21
|
+
# define _dist_code z__dist_code
|
22
|
+
# define _length_code z__length_code
|
23
|
+
# define _tr_align z__tr_align
|
24
|
+
# define _tr_flush_bits z__tr_flush_bits
|
25
|
+
# define _tr_flush_block z__tr_flush_block
|
26
|
+
# define _tr_init z__tr_init
|
27
|
+
# define _tr_stored_block z__tr_stored_block
|
28
|
+
# define _tr_tally z__tr_tally
|
29
|
+
# define adler32 z_adler32
|
30
|
+
# define adler32_combine z_adler32_combine
|
31
|
+
# define adler32_combine64 z_adler32_combine64
|
32
|
+
# define adler32_z z_adler32_z
|
33
|
+
# ifndef Z_SOLO
|
34
|
+
# define compress z_compress
|
35
|
+
# define compress2 z_compress2
|
36
|
+
# define compressBound z_compressBound
|
37
|
+
# endif
|
38
|
+
# define crc32 z_crc32
|
39
|
+
# define crc32_combine z_crc32_combine
|
40
|
+
# define crc32_combine64 z_crc32_combine64
|
41
|
+
# define crc32_z z_crc32_z
|
42
|
+
# define deflate z_deflate
|
43
|
+
# define deflateBound z_deflateBound
|
44
|
+
# define deflateCopy z_deflateCopy
|
45
|
+
# define deflateEnd z_deflateEnd
|
46
|
+
# define deflateGetDictionary z_deflateGetDictionary
|
47
|
+
# define deflateInit z_deflateInit
|
48
|
+
# define deflateInit2 z_deflateInit2
|
49
|
+
# define deflateInit2_ z_deflateInit2_
|
50
|
+
# define deflateInit_ z_deflateInit_
|
51
|
+
# define deflateParams z_deflateParams
|
52
|
+
# define deflatePending z_deflatePending
|
53
|
+
# define deflatePrime z_deflatePrime
|
54
|
+
# define deflateReset z_deflateReset
|
55
|
+
# define deflateResetKeep z_deflateResetKeep
|
56
|
+
# define deflateSetDictionary z_deflateSetDictionary
|
57
|
+
# define deflateSetHeader z_deflateSetHeader
|
58
|
+
# define deflateTune z_deflateTune
|
59
|
+
# define deflate_copyright z_deflate_copyright
|
60
|
+
# define get_crc_table z_get_crc_table
|
61
|
+
# ifndef Z_SOLO
|
62
|
+
# define gz_error z_gz_error
|
63
|
+
# define gz_intmax z_gz_intmax
|
64
|
+
# define gz_strwinerror z_gz_strwinerror
|
65
|
+
# define gzbuffer z_gzbuffer
|
66
|
+
# define gzclearerr z_gzclearerr
|
67
|
+
# define gzclose z_gzclose
|
68
|
+
# define gzclose_r z_gzclose_r
|
69
|
+
# define gzclose_w z_gzclose_w
|
70
|
+
# define gzdirect z_gzdirect
|
71
|
+
# define gzdopen z_gzdopen
|
72
|
+
# define gzeof z_gzeof
|
73
|
+
# define gzerror z_gzerror
|
74
|
+
# define gzflush z_gzflush
|
75
|
+
# define gzfread z_gzfread
|
76
|
+
# define gzfwrite z_gzfwrite
|
77
|
+
# define gzgetc z_gzgetc
|
78
|
+
# define gzgetc_ z_gzgetc_
|
79
|
+
# define gzgets z_gzgets
|
80
|
+
# define gzoffset z_gzoffset
|
81
|
+
# define gzoffset64 z_gzoffset64
|
82
|
+
# define gzopen z_gzopen
|
83
|
+
# define gzopen64 z_gzopen64
|
84
|
+
# ifdef _WIN32
|
85
|
+
# define gzopen_w z_gzopen_w
|
86
|
+
# endif
|
87
|
+
# define gzprintf z_gzprintf
|
88
|
+
# define gzputc z_gzputc
|
89
|
+
# define gzputs z_gzputs
|
90
|
+
# define gzread z_gzread
|
91
|
+
# define gzrewind z_gzrewind
|
92
|
+
# define gzseek z_gzseek
|
93
|
+
# define gzseek64 z_gzseek64
|
94
|
+
# define gzsetparams z_gzsetparams
|
95
|
+
# define gztell z_gztell
|
96
|
+
# define gztell64 z_gztell64
|
97
|
+
# define gzungetc z_gzungetc
|
98
|
+
# define gzvprintf z_gzvprintf
|
99
|
+
# define gzwrite z_gzwrite
|
100
|
+
# endif
|
101
|
+
# define inflate z_inflate
|
102
|
+
# define inflateBack z_inflateBack
|
103
|
+
# define inflateBackEnd z_inflateBackEnd
|
104
|
+
# define inflateBackInit z_inflateBackInit
|
105
|
+
# define inflateBackInit_ z_inflateBackInit_
|
106
|
+
# define inflateCodesUsed z_inflateCodesUsed
|
107
|
+
# define inflateCopy z_inflateCopy
|
108
|
+
# define inflateEnd z_inflateEnd
|
109
|
+
# define inflateGetDictionary z_inflateGetDictionary
|
110
|
+
# define inflateGetHeader z_inflateGetHeader
|
111
|
+
# define inflateInit z_inflateInit
|
112
|
+
# define inflateInit2 z_inflateInit2
|
113
|
+
# define inflateInit2_ z_inflateInit2_
|
114
|
+
# define inflateInit_ z_inflateInit_
|
115
|
+
# define inflateMark z_inflateMark
|
116
|
+
# define inflatePrime z_inflatePrime
|
117
|
+
# define inflateReset z_inflateReset
|
118
|
+
# define inflateReset2 z_inflateReset2
|
119
|
+
# define inflateResetKeep z_inflateResetKeep
|
120
|
+
# define inflateSetDictionary z_inflateSetDictionary
|
121
|
+
# define inflateSync z_inflateSync
|
122
|
+
# define inflateSyncPoint z_inflateSyncPoint
|
123
|
+
# define inflateUndermine z_inflateUndermine
|
124
|
+
# define inflateValidate z_inflateValidate
|
125
|
+
# define inflate_copyright z_inflate_copyright
|
126
|
+
# define inflate_fast z_inflate_fast
|
127
|
+
# define inflate_table z_inflate_table
|
128
|
+
# ifndef Z_SOLO
|
129
|
+
# define uncompress z_uncompress
|
130
|
+
# define uncompress2 z_uncompress2
|
131
|
+
# endif
|
132
|
+
# define zError z_zError
|
133
|
+
# ifndef Z_SOLO
|
134
|
+
# define zcalloc z_zcalloc
|
135
|
+
# define zcfree z_zcfree
|
136
|
+
# endif
|
137
|
+
# define zlibCompileFlags z_zlibCompileFlags
|
138
|
+
# define zlibVersion z_zlibVersion
|
139
|
+
|
140
|
+
/* all zlib typedefs in zlib.h and zconf.h */
|
141
|
+
# define Byte z_Byte
|
142
|
+
# define Bytef z_Bytef
|
143
|
+
# define alloc_func z_alloc_func
|
144
|
+
# define charf z_charf
|
145
|
+
# define free_func z_free_func
|
146
|
+
# ifndef Z_SOLO
|
147
|
+
# define gzFile z_gzFile
|
148
|
+
# endif
|
149
|
+
# define gz_header z_gz_header
|
150
|
+
# define gz_headerp z_gz_headerp
|
151
|
+
# define in_func z_in_func
|
152
|
+
# define intf z_intf
|
153
|
+
# define out_func z_out_func
|
154
|
+
# define uInt z_uInt
|
155
|
+
# define uIntf z_uIntf
|
156
|
+
# define uLong z_uLong
|
157
|
+
# define uLongf z_uLongf
|
158
|
+
# define voidp z_voidp
|
159
|
+
# define voidpc z_voidpc
|
160
|
+
# define voidpf z_voidpf
|
161
|
+
|
162
|
+
/* all zlib structs in zlib.h and zconf.h */
|
163
|
+
# define gz_header_s z_gz_header_s
|
164
|
+
# define internal_state z_internal_state
|
165
|
+
|
166
|
+
#endif
|
167
|
+
|
168
|
+
#if defined(__MSDOS__) && !defined(MSDOS)
|
169
|
+
# define MSDOS
|
170
|
+
#endif
|
171
|
+
#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
|
172
|
+
# define OS2
|
173
|
+
#endif
|
174
|
+
#if defined(_WINDOWS) && !defined(WINDOWS)
|
175
|
+
# define WINDOWS
|
176
|
+
#endif
|
177
|
+
#if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
|
178
|
+
# ifndef WIN32
|
179
|
+
# define WIN32
|
180
|
+
# endif
|
181
|
+
#endif
|
182
|
+
#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
|
183
|
+
# if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
|
184
|
+
# ifndef SYS16BIT
|
185
|
+
# define SYS16BIT
|
186
|
+
# endif
|
187
|
+
# endif
|
188
|
+
#endif
|
189
|
+
|
190
|
+
/*
|
191
|
+
* Compile with -DMAXSEG_64K if the alloc function cannot allocate more
|
192
|
+
* than 64k bytes at a time (needed on systems with 16-bit int).
|
193
|
+
*/
|
194
|
+
#ifdef SYS16BIT
|
195
|
+
# define MAXSEG_64K
|
196
|
+
#endif
|
197
|
+
#ifdef MSDOS
|
198
|
+
# define UNALIGNED_OK
|
199
|
+
#endif
|
200
|
+
|
201
|
+
#ifdef __STDC_VERSION__
|
202
|
+
# ifndef STDC
|
203
|
+
# define STDC
|
204
|
+
# endif
|
205
|
+
# if __STDC_VERSION__ >= 199901L
|
206
|
+
# ifndef STDC99
|
207
|
+
# define STDC99
|
208
|
+
# endif
|
209
|
+
# endif
|
210
|
+
#endif
|
211
|
+
#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
|
212
|
+
# define STDC
|
213
|
+
#endif
|
214
|
+
#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
|
215
|
+
# define STDC
|
216
|
+
#endif
|
217
|
+
#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
|
218
|
+
# define STDC
|
219
|
+
#endif
|
220
|
+
#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
|
221
|
+
# define STDC
|
222
|
+
#endif
|
223
|
+
|
224
|
+
#if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */
|
225
|
+
# define STDC
|
226
|
+
#endif
|
12
227
|
|
13
|
-
|
14
|
-
|
15
|
-
#
|
16
|
-
#
|
17
|
-
#
|
228
|
+
#ifndef STDC
|
229
|
+
# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
|
230
|
+
# define const /* note: need a more gentle solution here */
|
231
|
+
# endif
|
232
|
+
#endif
|
233
|
+
|
234
|
+
#if defined(ZLIB_CONST) && !defined(z_const)
|
235
|
+
# define z_const const
|
236
|
+
#else
|
237
|
+
# define z_const
|
238
|
+
#endif
|
239
|
+
|
240
|
+
#ifdef Z_SOLO
|
241
|
+
typedef unsigned long z_size_t;
|
242
|
+
#else
|
243
|
+
# define z_longlong long long
|
244
|
+
# if defined(NO_SIZE_T)
|
245
|
+
typedef unsigned NO_SIZE_T z_size_t;
|
246
|
+
# elif defined(STDC)
|
247
|
+
# include <stddef.h>
|
248
|
+
typedef size_t z_size_t;
|
249
|
+
# else
|
250
|
+
typedef unsigned long z_size_t;
|
251
|
+
# endif
|
252
|
+
# undef z_longlong
|
18
253
|
#endif
|
19
254
|
|
20
255
|
/* Maximum value for memLevel in deflateInit2 */
|
21
|
-
#
|
256
|
+
#ifndef MAX_MEM_LEVEL
|
257
|
+
# ifdef MAXSEG_64K
|
258
|
+
# define MAX_MEM_LEVEL 8
|
259
|
+
# else
|
260
|
+
# define MAX_MEM_LEVEL 9
|
261
|
+
# endif
|
262
|
+
#endif
|
22
263
|
|
23
264
|
/* Maximum value for windowBits in deflateInit2 and inflateInit2.
|
24
265
|
* WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
|
25
266
|
* created by gzip. (Files created by minigzip can still be extracted by
|
26
267
|
* gzip.)
|
27
268
|
*/
|
28
|
-
#
|
269
|
+
#ifndef MAX_WBITS
|
270
|
+
# define MAX_WBITS 15 /* 32K LZ77 window */
|
271
|
+
#endif
|
272
|
+
|
273
|
+
/* The memory requirements for deflate are (in bytes):
|
274
|
+
(1 << (windowBits+2)) + (1 << (memLevel+9))
|
275
|
+
that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
|
276
|
+
plus a few kilobytes for small objects. For example, if you want to reduce
|
277
|
+
the default memory requirements from 256K to 128K, compile with
|
278
|
+
make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
|
279
|
+
Of course this will generally degrade compression (there's no free lunch).
|
280
|
+
|
281
|
+
The memory requirements for inflate are (in bytes) 1 << windowBits
|
282
|
+
that is, 32K for windowBits=15 (default value) plus about 7 kilobytes
|
283
|
+
for small objects.
|
284
|
+
*/
|
285
|
+
|
286
|
+
/* Type declarations */
|
287
|
+
|
288
|
+
#ifndef OF /* function prototypes */
|
289
|
+
# ifdef STDC
|
290
|
+
# define OF(args) args
|
291
|
+
# else
|
292
|
+
# define OF(args) ()
|
293
|
+
# endif
|
294
|
+
#endif
|
295
|
+
|
296
|
+
#ifndef Z_ARG /* function prototypes for stdarg */
|
297
|
+
# if defined(STDC) || defined(Z_HAVE_STDARG_H)
|
298
|
+
# define Z_ARG(args) args
|
299
|
+
# else
|
300
|
+
# define Z_ARG(args) ()
|
301
|
+
# endif
|
302
|
+
#endif
|
303
|
+
|
304
|
+
/* The following definitions for FAR are needed only for MSDOS mixed
|
305
|
+
* model programming (small or medium model with some far allocations).
|
306
|
+
* This was tested only with MSC; for other MSDOS compilers you may have
|
307
|
+
* to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
|
308
|
+
* just define FAR to be empty.
|
309
|
+
*/
|
310
|
+
#ifdef SYS16BIT
|
311
|
+
# if defined(M_I86SM) || defined(M_I86MM)
|
312
|
+
/* MSC small or medium model */
|
313
|
+
# define SMALL_MEDIUM
|
314
|
+
# ifdef _MSC_VER
|
315
|
+
# define FAR _far
|
316
|
+
# else
|
317
|
+
# define FAR far
|
318
|
+
# endif
|
319
|
+
# endif
|
320
|
+
# if (defined(__SMALL__) || defined(__MEDIUM__))
|
321
|
+
/* Turbo C small or medium model */
|
322
|
+
# define SMALL_MEDIUM
|
323
|
+
# ifdef __BORLANDC__
|
324
|
+
# define FAR _far
|
325
|
+
# else
|
326
|
+
# define FAR far
|
327
|
+
# endif
|
328
|
+
# endif
|
329
|
+
#endif
|
330
|
+
|
331
|
+
#if defined(WINDOWS) || defined(WIN32)
|
332
|
+
/* If building or using zlib as a DLL, define ZLIB_DLL.
|
333
|
+
* This is not mandatory, but it offers a little performance increase.
|
334
|
+
*/
|
335
|
+
# ifdef ZLIB_DLL
|
336
|
+
# if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
|
337
|
+
# ifdef ZLIB_INTERNAL
|
338
|
+
# define ZEXTERN extern __declspec(dllexport)
|
339
|
+
# else
|
340
|
+
# define ZEXTERN extern __declspec(dllimport)
|
341
|
+
# endif
|
342
|
+
# endif
|
343
|
+
# endif /* ZLIB_DLL */
|
344
|
+
/* If building or using zlib with the WINAPI/WINAPIV calling convention,
|
345
|
+
* define ZLIB_WINAPI.
|
346
|
+
* Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
|
347
|
+
*/
|
348
|
+
# ifdef ZLIB_WINAPI
|
349
|
+
# ifdef FAR
|
350
|
+
# undef FAR
|
351
|
+
# endif
|
352
|
+
# include <windows.h>
|
353
|
+
/* No need for _export, use ZLIB.DEF instead. */
|
354
|
+
/* For complete Windows compatibility, use WINAPI, not __stdcall. */
|
355
|
+
# define ZEXPORT WINAPI
|
356
|
+
# ifdef WIN32
|
357
|
+
# define ZEXPORTVA WINAPIV
|
358
|
+
# else
|
359
|
+
# define ZEXPORTVA FAR CDECL
|
360
|
+
# endif
|
361
|
+
# endif
|
362
|
+
#endif
|
363
|
+
|
364
|
+
#if defined (__BEOS__)
|
365
|
+
# ifdef ZLIB_DLL
|
366
|
+
# ifdef ZLIB_INTERNAL
|
367
|
+
# define ZEXPORT __declspec(dllexport)
|
368
|
+
# define ZEXPORTVA __declspec(dllexport)
|
369
|
+
# else
|
370
|
+
# define ZEXPORT __declspec(dllimport)
|
371
|
+
# define ZEXPORTVA __declspec(dllimport)
|
372
|
+
# endif
|
373
|
+
# endif
|
374
|
+
#endif
|
375
|
+
|
376
|
+
#ifndef ZEXTERN
|
377
|
+
# define ZEXTERN extern
|
378
|
+
#endif
|
379
|
+
#ifndef ZEXPORT
|
380
|
+
# define ZEXPORT
|
381
|
+
#endif
|
382
|
+
#ifndef ZEXPORTVA
|
383
|
+
# define ZEXPORTVA
|
384
|
+
#endif
|
29
385
|
|
30
|
-
#define ZEXTERN extern
|
31
|
-
#define ZEXPORT
|
32
|
-
#define ZEXPORTVA
|
33
386
|
#ifndef FAR
|
34
|
-
#
|
387
|
+
# define FAR
|
35
388
|
#endif
|
36
|
-
#define OF(args) args
|
37
|
-
#define Z_ARG(args) args
|
38
389
|
|
390
|
+
#if !defined(__MACTYPES__)
|
39
391
|
typedef unsigned char Byte; /* 8 bits */
|
392
|
+
#endif
|
40
393
|
typedef unsigned int uInt; /* 16 bits or more */
|
41
394
|
typedef unsigned long uLong; /* 32 bits or more */
|
42
|
-
typedef unsigned long z_crc_t;
|
43
395
|
|
44
|
-
|
396
|
+
#ifdef SMALL_MEDIUM
|
397
|
+
/* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
|
398
|
+
# define Bytef Byte FAR
|
399
|
+
#else
|
400
|
+
typedef Byte FAR Bytef;
|
401
|
+
#endif
|
45
402
|
typedef char FAR charf;
|
46
403
|
typedef int FAR intf;
|
47
404
|
typedef uInt FAR uIntf;
|
48
405
|
typedef uLong FAR uLongf;
|
49
406
|
|
50
|
-
|
51
|
-
typedef void
|
52
|
-
typedef void
|
407
|
+
#ifdef STDC
|
408
|
+
typedef void const *voidpc;
|
409
|
+
typedef void FAR *voidpf;
|
410
|
+
typedef void *voidp;
|
411
|
+
#else
|
412
|
+
typedef Byte const *voidpc;
|
413
|
+
typedef Byte FAR *voidpf;
|
414
|
+
typedef Byte *voidp;
|
415
|
+
#endif
|
416
|
+
|
417
|
+
#if !defined(Z_U4) && !defined(Z_SOLO) && defined(STDC)
|
418
|
+
# include <limits.h>
|
419
|
+
# if (UINT_MAX == 0xffffffffUL)
|
420
|
+
# define Z_U4 unsigned
|
421
|
+
# elif (ULONG_MAX == 0xffffffffUL)
|
422
|
+
# define Z_U4 unsigned long
|
423
|
+
# elif (USHRT_MAX == 0xffffffffUL)
|
424
|
+
# define Z_U4 unsigned short
|
425
|
+
# endif
|
426
|
+
#endif
|
427
|
+
|
428
|
+
#ifdef Z_U4
|
429
|
+
typedef Z_U4 z_crc_t;
|
430
|
+
#else
|
431
|
+
typedef unsigned long z_crc_t;
|
432
|
+
#endif
|
433
|
+
|
434
|
+
#ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */
|
435
|
+
# define Z_HAVE_UNISTD_H
|
436
|
+
#endif
|
437
|
+
|
438
|
+
#ifdef HAVE_STDARG_H /* may be set to #if 1 by ./configure */
|
439
|
+
# define Z_HAVE_STDARG_H
|
440
|
+
#endif
|
441
|
+
|
442
|
+
#ifdef STDC
|
443
|
+
# ifndef Z_SOLO
|
444
|
+
# include <sys/types.h> /* for off_t */
|
445
|
+
# endif
|
446
|
+
#endif
|
447
|
+
|
448
|
+
#if defined(STDC) || defined(Z_HAVE_STDARG_H)
|
449
|
+
# ifndef Z_SOLO
|
450
|
+
# include <stdarg.h> /* for va_list */
|
451
|
+
# endif
|
452
|
+
#endif
|
453
|
+
|
454
|
+
#ifdef _WIN32
|
455
|
+
# ifndef Z_SOLO
|
456
|
+
# include <stddef.h> /* for wchar_t */
|
457
|
+
# endif
|
458
|
+
#endif
|
459
|
+
|
460
|
+
/* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and
|
461
|
+
* "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even
|
462
|
+
* though the former does not conform to the LFS document), but considering
|
463
|
+
* both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as
|
464
|
+
* equivalently requesting no 64-bit operations
|
465
|
+
*/
|
466
|
+
#if defined(_LARGEFILE64_SOURCE) && -_LARGEFILE64_SOURCE - -1 == 1
|
467
|
+
# undef _LARGEFILE64_SOURCE
|
468
|
+
#endif
|
53
469
|
|
54
|
-
#
|
55
|
-
#define
|
56
|
-
#
|
470
|
+
#if defined(__WATCOMC__) && !defined(Z_HAVE_UNISTD_H)
|
471
|
+
# define Z_HAVE_UNISTD_H
|
472
|
+
#endif
|
473
|
+
#ifndef Z_SOLO
|
474
|
+
# if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE)
|
475
|
+
# include <unistd.h> /* for SEEK_*, off_t, and _LFS64_LARGEFILE */
|
476
|
+
# ifdef VMS
|
477
|
+
# include <unixio.h> /* for off_t */
|
478
|
+
# endif
|
479
|
+
# ifndef z_off_t
|
480
|
+
# define z_off_t off_t
|
481
|
+
# endif
|
482
|
+
# endif
|
483
|
+
#endif
|
484
|
+
|
485
|
+
#if defined(_LFS64_LARGEFILE) && _LFS64_LARGEFILE-0
|
486
|
+
# define Z_LFS64
|
487
|
+
#endif
|
488
|
+
|
489
|
+
#if defined(_LARGEFILE64_SOURCE) && defined(Z_LFS64)
|
490
|
+
# define Z_LARGE64
|
491
|
+
#endif
|
492
|
+
|
493
|
+
#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS-0 == 64 && defined(Z_LFS64)
|
494
|
+
# define Z_WANT64
|
495
|
+
#endif
|
496
|
+
|
497
|
+
#if !defined(SEEK_SET) && !defined(Z_SOLO)
|
498
|
+
# define SEEK_SET 0 /* Seek from beginning of file. */
|
499
|
+
# define SEEK_CUR 1 /* Seek from current position. */
|
500
|
+
# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
|
501
|
+
#endif
|
502
|
+
|
503
|
+
#ifndef z_off_t
|
504
|
+
# define z_off_t long
|
505
|
+
#endif
|
506
|
+
|
507
|
+
#if !defined(_WIN32) && defined(Z_LARGE64)
|
508
|
+
# define z_off64_t off64_t
|
509
|
+
#else
|
510
|
+
# if defined(_WIN32) && !defined(__GNUC__) && !defined(Z_SOLO)
|
511
|
+
# define z_off64_t __int64
|
512
|
+
# else
|
513
|
+
# define z_off64_t z_off_t
|
514
|
+
# endif
|
515
|
+
#endif
|
516
|
+
|
517
|
+
/* MVS linker does not support external names larger than 8 bytes */
|
518
|
+
#if defined(__MVS__)
|
519
|
+
#pragma map(deflateInit_,"DEIN")
|
520
|
+
#pragma map(deflateInit2_,"DEIN2")
|
521
|
+
#pragma map(deflateEnd,"DEEND")
|
522
|
+
#pragma map(deflateBound,"DEBND")
|
523
|
+
#pragma map(inflateInit_,"ININ")
|
524
|
+
#pragma map(inflateInit2_,"ININ2")
|
525
|
+
#pragma map(inflateEnd,"INEND")
|
526
|
+
#pragma map(inflateSync,"INSY")
|
527
|
+
#pragma map(inflateSetDictionary,"INSEDI")
|
528
|
+
#pragma map(compressBound,"CMBND")
|
529
|
+
#pragma map(inflate_table,"INTABL")
|
530
|
+
#pragma map(inflate_fast,"INFA")
|
531
|
+
#pragma map(inflate_copyright,"INCOPY")
|
532
|
+
#endif
|
57
533
|
|
58
534
|
#endif /* ZCONF_H */
|