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 | Project-Tick-dca9e1d6f3ee32f26c1831a0a9b3a6a8aa775509.tar.gz Project-Tick-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 52cc6613b3..a6de4d59ed 100644 --- a/as400/bndsrc +++ b/as400/bndsrc @@ -67,6 +67,7 @@ STRPGMEXP PGMLVL(*CURRENT) SIGNATURE('ZLIB') EXPORT SYMBOL("inflate") EXPORT SYMBOL("inflateEnd") EXPORT SYMBOL("inflateSetDictionary") + EXPORT SYMBOL("inflateGetDictionary") EXPORT SYMBOL("inflateSync") EXPORT SYMBOL("inflateReset") EXPORT SYMBOL("inflateInit_") diff --git a/as400/zlib.inc b/as400/zlib.inc index 66d867ae59..9c94be8dc6 100644 --- a/as400/zlib.inc +++ b/as400/zlib.inc @@ -359,6 +359,12 @@ D dictionary 65535 const options(*varsize) Dictionary bytes D dictLength 10U 0 value Dictionary length * + D inflateGetDictionary... + D PR 10I 0 extproc('inflateGetDictionary') Get dictionary + D strm like(z_stream) Expansion stream + D dictionary 65535 options(*varsize) Dictionary bytes + D dictLength 10U 0 Dictionary length + * D inflateSync PR 10I 0 extproc('inflateSync') Sync. expansion D strm like(z_stream) Expansion stream * diff --git a/contrib/vstudio/vc10/zlibvc.def b/contrib/vstudio/vc10/zlibvc.def index feea7cf195..34b1466567 100644 --- a/contrib/vstudio/vc10/zlibvc.def +++ b/contrib/vstudio/vc10/zlibvc.def @@ -137,3 +137,6 @@ EXPORTS ; zlib1 v1.2.7 added: gzopen_w @165 + +; zlib1 v1.2.8 added: + inflateGetDictionary @166 diff --git a/contrib/vstudio/vc9/zlibvc.def b/contrib/vstudio/vc9/zlibvc.def index c1f644d092..3af7061f7f 100644 --- a/contrib/vstudio/vc9/zlibvc.def +++ b/contrib/vstudio/vc9/zlibvc.def @@ -137,3 +137,6 @@ EXPORTS ; zlib1 v1.2.7 added: gzopen_w @165 + +; zlib1 v1.2.8 added: + inflateGetDictionary @166 @@ -1264,6 +1264,29 @@ z_streamp strm; return Z_OK; } +int ZEXPORT inflateGetDictionary(strm, dictionary, dictLength) +z_streamp strm; +Bytef *dictionary; +uInt *dictLength; +{ + struct inflate_state FAR *state; + + /* check state */ + if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + state = (struct inflate_state FAR *)strm->state; + + /* copy dictionary */ + if (state->whave && dictionary != Z_NULL) { + zmemcpy(dictionary, state->window + state->wnext, + state->whave - state->wnext); + zmemcpy(dictionary + state->whave - state->wnext, + state->window, state->wnext); + } + if (dictLength != Z_NULL) + *dictLength = state->whave; + return Z_OK; +} + int ZEXPORT inflateSetDictionary(strm, dictionary, dictLength) z_streamp strm; const Bytef *dictionary; diff --git a/win32/zlib.def b/win32/zlib.def index 04896150e4..f10fa7a67f 100644 --- a/win32/zlib.def +++ b/win32/zlib.def @@ -17,6 +17,7 @@ EXPORTS deflatePrime deflateSetHeader inflateSetDictionary + inflateGetDictionary inflateSync inflateCopy inflateReset @@ -103,6 +103,7 @@ # define inflateReset z_inflateReset # define inflateReset2 z_inflateReset2 # define inflateSetDictionary z_inflateSetDictionary +# define inflateGetDictionary z_inflateGetDictionary # define inflateSync z_inflateSync # define inflateSyncPoint z_inflateSyncPoint # define inflateUndermine z_inflateUndermine diff --git a/zconf.h.cmakein b/zconf.h.cmakein index 1d31b67e2e..5390baa6bb 100644 --- a/zconf.h.cmakein +++ b/zconf.h.cmakein @@ -105,6 +105,7 @@ # define inflateReset z_inflateReset # define inflateReset2 z_inflateReset2 # define inflateSetDictionary z_inflateSetDictionary +# define inflateGetDictionary z_inflateGetDictionary # define inflateSync z_inflateSync # define inflateSyncPoint z_inflateSyncPoint # define inflateUndermine z_inflateUndermine diff --git a/zconf.h.in b/zconf.h.in index c71cade09f..26e7a04882 100644 --- a/zconf.h.in +++ b/zconf.h.in @@ -103,6 +103,7 @@ # define inflateReset z_inflateReset # define inflateReset2 z_inflateReset2 # define inflateSetDictionary z_inflateSetDictionary +# define inflateGetDictionary z_inflateGetDictionary # define inflateSync z_inflateSync # define inflateSyncPoint z_inflateSyncPoint # define inflateUndermine z_inflateUndermine @@ -839,6 +839,21 @@ ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm, inflate(). */ +ZEXTERN int ZEXPORT inflateGetDictionary OF((z_streamp strm, + Bytef *dictionary, + uInt *dictLength)); +/* + Returns the sliding dictionary being maintained by inflate. dictLength is + set to the number of bytes in the dictionary, and that many bytes are copied + to dictionary. dictionary must have enough space, where 32768 bytes is + always enough. If inflateGetDictionary() is called with dictionary equal to + Z_NULL, then only the dictionary length is returned, and nothing is copied. + Similary, if dictLength is Z_NULL, then it is not set. + + inflateSetDictionary returns Z_OK on success, or Z_STREAM_ERROR if the + stream state is inconsistent. +*/ + ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm)); /* Skips invalid compressed data until a possible full flush point (see above @@ -76,3 +76,7 @@ ZLIB_1.2.5.2 { gzgetc_; inflateResetKeep; } ZLIB_1.2.5.1; + +ZLIB_1.2.7.1 { + inflateSetDictionary; +} ZLIB_1.2.7; |
