diff options
author | Mark Adler <madler@alumni.caltech.edu> | 2012-05-26 10:37:17 -0700 |
---|---|---|
committer | Mark Adler <madler@alumni.caltech.edu> | 2012-05-26 23:25:35 -0700 |
commit | dca9e1d6f3ee32f26c1831a0a9b3a6a8aa775509 (patch) | |
tree | ec9bd5d51d8bec3e1cbe9ef6850b5fcf0898aac4 | |
parent | eb90f6a56892d7f88df99e52300498d6780cacca (diff) | |
download | zlib-dca9e1d6f3ee32f26c1831a0a9b3a6a8aa775509.tar.gz zlib-dca9e1d6f3ee32f26c1831a0a9b3a6a8aa775509.tar.bz2 zlib-dca9e1d6f3ee32f26c1831a0a9b3a6a8aa775509.zip |
Add inflateGetDictionary() function.
-rw-r--r-- | as400/bndsrc | 1 | ||||
-rw-r--r-- | as400/zlib.inc | 6 | ||||
-rw-r--r-- | contrib/vstudio/vc10/zlibvc.def | 3 | ||||
-rw-r--r-- | contrib/vstudio/vc9/zlibvc.def | 3 | ||||
-rw-r--r-- | inflate.c | 23 | ||||
-rw-r--r-- | win32/zlib.def | 1 | ||||
-rw-r--r-- | zconf.h | 1 | ||||
-rw-r--r-- | zconf.h.cmakein | 1 | ||||
-rw-r--r-- | zconf.h.in | 1 | ||||
-rw-r--r-- | zlib.h | 15 | ||||
-rw-r--r-- | zlib.map | 4 |
11 files changed, 59 insertions, 0 deletions
diff --git a/as400/bndsrc b/as400/bndsrc index 52cc661..a6de4d5 100644 --- a/as400/bndsrc +++ b/as400/bndsrc | |||
@@ -67,6 +67,7 @@ STRPGMEXP PGMLVL(*CURRENT) SIGNATURE('ZLIB') | |||
67 | EXPORT SYMBOL("inflate") | 67 | EXPORT SYMBOL("inflate") |
68 | EXPORT SYMBOL("inflateEnd") | 68 | EXPORT SYMBOL("inflateEnd") |
69 | EXPORT SYMBOL("inflateSetDictionary") | 69 | EXPORT SYMBOL("inflateSetDictionary") |
70 | EXPORT SYMBOL("inflateGetDictionary") | ||
70 | EXPORT SYMBOL("inflateSync") | 71 | EXPORT SYMBOL("inflateSync") |
71 | EXPORT SYMBOL("inflateReset") | 72 | EXPORT SYMBOL("inflateReset") |
72 | EXPORT SYMBOL("inflateInit_") | 73 | EXPORT SYMBOL("inflateInit_") |
diff --git a/as400/zlib.inc b/as400/zlib.inc index 66d867a..9c94be8 100644 --- a/as400/zlib.inc +++ b/as400/zlib.inc | |||
@@ -359,6 +359,12 @@ | |||
359 | D dictionary 65535 const options(*varsize) Dictionary bytes | 359 | D dictionary 65535 const options(*varsize) Dictionary bytes |
360 | D dictLength 10U 0 value Dictionary length | 360 | D dictLength 10U 0 value Dictionary length |
361 | * | 361 | * |
362 | D inflateGetDictionary... | ||
363 | D PR 10I 0 extproc('inflateGetDictionary') Get dictionary | ||
364 | D strm like(z_stream) Expansion stream | ||
365 | D dictionary 65535 options(*varsize) Dictionary bytes | ||
366 | D dictLength 10U 0 Dictionary length | ||
367 | * | ||
362 | D inflateSync PR 10I 0 extproc('inflateSync') Sync. expansion | 368 | D inflateSync PR 10I 0 extproc('inflateSync') Sync. expansion |
363 | D strm like(z_stream) Expansion stream | 369 | D strm like(z_stream) Expansion stream |
364 | * | 370 | * |
diff --git a/contrib/vstudio/vc10/zlibvc.def b/contrib/vstudio/vc10/zlibvc.def index feea7cf..34b1466 100644 --- a/contrib/vstudio/vc10/zlibvc.def +++ b/contrib/vstudio/vc10/zlibvc.def | |||
@@ -137,3 +137,6 @@ EXPORTS | |||
137 | 137 | ||
138 | ; zlib1 v1.2.7 added: | 138 | ; zlib1 v1.2.7 added: |
139 | gzopen_w @165 | 139 | gzopen_w @165 |
140 | |||
141 | ; zlib1 v1.2.8 added: | ||
142 | inflateGetDictionary @166 | ||
diff --git a/contrib/vstudio/vc9/zlibvc.def b/contrib/vstudio/vc9/zlibvc.def index c1f644d..3af7061 100644 --- a/contrib/vstudio/vc9/zlibvc.def +++ b/contrib/vstudio/vc9/zlibvc.def | |||
@@ -137,3 +137,6 @@ EXPORTS | |||
137 | 137 | ||
138 | ; zlib1 v1.2.7 added: | 138 | ; zlib1 v1.2.7 added: |
139 | gzopen_w @165 | 139 | gzopen_w @165 |
140 | |||
141 | ; zlib1 v1.2.8 added: | ||
142 | inflateGetDictionary @166 | ||
@@ -1264,6 +1264,29 @@ z_streamp strm; | |||
1264 | return Z_OK; | 1264 | return Z_OK; |
1265 | } | 1265 | } |
1266 | 1266 | ||
1267 | int ZEXPORT inflateGetDictionary(strm, dictionary, dictLength) | ||
1268 | z_streamp strm; | ||
1269 | Bytef *dictionary; | ||
1270 | uInt *dictLength; | ||
1271 | { | ||
1272 | struct inflate_state FAR *state; | ||
1273 | |||
1274 | /* check state */ | ||
1275 | if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; | ||
1276 | state = (struct inflate_state FAR *)strm->state; | ||
1277 | |||
1278 | /* copy dictionary */ | ||
1279 | if (state->whave && dictionary != Z_NULL) { | ||
1280 | zmemcpy(dictionary, state->window + state->wnext, | ||
1281 | state->whave - state->wnext); | ||
1282 | zmemcpy(dictionary + state->whave - state->wnext, | ||
1283 | state->window, state->wnext); | ||
1284 | } | ||
1285 | if (dictLength != Z_NULL) | ||
1286 | *dictLength = state->whave; | ||
1287 | return Z_OK; | ||
1288 | } | ||
1289 | |||
1267 | int ZEXPORT inflateSetDictionary(strm, dictionary, dictLength) | 1290 | int ZEXPORT inflateSetDictionary(strm, dictionary, dictLength) |
1268 | z_streamp strm; | 1291 | z_streamp strm; |
1269 | const Bytef *dictionary; | 1292 | const Bytef *dictionary; |
diff --git a/win32/zlib.def b/win32/zlib.def index 0489615..f10fa7a 100644 --- a/win32/zlib.def +++ b/win32/zlib.def | |||
@@ -17,6 +17,7 @@ EXPORTS | |||
17 | deflatePrime | 17 | deflatePrime |
18 | deflateSetHeader | 18 | deflateSetHeader |
19 | inflateSetDictionary | 19 | inflateSetDictionary |
20 | inflateGetDictionary | ||
20 | inflateSync | 21 | inflateSync |
21 | inflateCopy | 22 | inflateCopy |
22 | inflateReset | 23 | inflateReset |
@@ -103,6 +103,7 @@ | |||
103 | # define inflateReset z_inflateReset | 103 | # define inflateReset z_inflateReset |
104 | # define inflateReset2 z_inflateReset2 | 104 | # define inflateReset2 z_inflateReset2 |
105 | # define inflateSetDictionary z_inflateSetDictionary | 105 | # define inflateSetDictionary z_inflateSetDictionary |
106 | # define inflateGetDictionary z_inflateGetDictionary | ||
106 | # define inflateSync z_inflateSync | 107 | # define inflateSync z_inflateSync |
107 | # define inflateSyncPoint z_inflateSyncPoint | 108 | # define inflateSyncPoint z_inflateSyncPoint |
108 | # define inflateUndermine z_inflateUndermine | 109 | # define inflateUndermine z_inflateUndermine |
diff --git a/zconf.h.cmakein b/zconf.h.cmakein index 1d31b67..5390baa 100644 --- a/zconf.h.cmakein +++ b/zconf.h.cmakein | |||
@@ -105,6 +105,7 @@ | |||
105 | # define inflateReset z_inflateReset | 105 | # define inflateReset z_inflateReset |
106 | # define inflateReset2 z_inflateReset2 | 106 | # define inflateReset2 z_inflateReset2 |
107 | # define inflateSetDictionary z_inflateSetDictionary | 107 | # define inflateSetDictionary z_inflateSetDictionary |
108 | # define inflateGetDictionary z_inflateGetDictionary | ||
108 | # define inflateSync z_inflateSync | 109 | # define inflateSync z_inflateSync |
109 | # define inflateSyncPoint z_inflateSyncPoint | 110 | # define inflateSyncPoint z_inflateSyncPoint |
110 | # define inflateUndermine z_inflateUndermine | 111 | # define inflateUndermine z_inflateUndermine |
@@ -103,6 +103,7 @@ | |||
103 | # define inflateReset z_inflateReset | 103 | # define inflateReset z_inflateReset |
104 | # define inflateReset2 z_inflateReset2 | 104 | # define inflateReset2 z_inflateReset2 |
105 | # define inflateSetDictionary z_inflateSetDictionary | 105 | # define inflateSetDictionary z_inflateSetDictionary |
106 | # define inflateGetDictionary z_inflateGetDictionary | ||
106 | # define inflateSync z_inflateSync | 107 | # define inflateSync z_inflateSync |
107 | # define inflateSyncPoint z_inflateSyncPoint | 108 | # define inflateSyncPoint z_inflateSyncPoint |
108 | # define inflateUndermine z_inflateUndermine | 109 | # define inflateUndermine z_inflateUndermine |
@@ -839,6 +839,21 @@ ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm, | |||
839 | inflate(). | 839 | inflate(). |
840 | */ | 840 | */ |
841 | 841 | ||
842 | ZEXTERN int ZEXPORT inflateGetDictionary OF((z_streamp strm, | ||
843 | Bytef *dictionary, | ||
844 | uInt *dictLength)); | ||
845 | /* | ||
846 | Returns the sliding dictionary being maintained by inflate. dictLength is | ||
847 | set to the number of bytes in the dictionary, and that many bytes are copied | ||
848 | to dictionary. dictionary must have enough space, where 32768 bytes is | ||
849 | always enough. If inflateGetDictionary() is called with dictionary equal to | ||
850 | Z_NULL, then only the dictionary length is returned, and nothing is copied. | ||
851 | Similary, if dictLength is Z_NULL, then it is not set. | ||
852 | |||
853 | inflateSetDictionary returns Z_OK on success, or Z_STREAM_ERROR if the | ||
854 | stream state is inconsistent. | ||
855 | */ | ||
856 | |||
842 | ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm)); | 857 | ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm)); |
843 | /* | 858 | /* |
844 | Skips invalid compressed data until a possible full flush point (see above | 859 | Skips invalid compressed data until a possible full flush point (see above |
@@ -76,3 +76,7 @@ ZLIB_1.2.5.2 { | |||
76 | gzgetc_; | 76 | gzgetc_; |
77 | inflateResetKeep; | 77 | inflateResetKeep; |
78 | } ZLIB_1.2.5.1; | 78 | } ZLIB_1.2.5.1; |
79 | |||
80 | ZLIB_1.2.7.1 { | ||
81 | inflateSetDictionary; | ||
82 | } ZLIB_1.2.7; | ||