aboutsummaryrefslogtreecommitdiff
path: root/inflate.c
diff options
context:
space:
mode:
authorMark Adler <madler@alumni.caltech.edu>2012-05-26 10:37:17 -0700
committerMark Adler <madler@alumni.caltech.edu>2012-05-26 23:25:35 -0700
commitdca9e1d6f3ee32f26c1831a0a9b3a6a8aa775509 (patch)
treeec9bd5d51d8bec3e1cbe9ef6850b5fcf0898aac4 /inflate.c
parenteb90f6a56892d7f88df99e52300498d6780cacca (diff)
downloadzlib-dca9e1d6f3ee32f26c1831a0a9b3a6a8aa775509.tar.gz
zlib-dca9e1d6f3ee32f26c1831a0a9b3a6a8aa775509.tar.bz2
zlib-dca9e1d6f3ee32f26c1831a0a9b3a6a8aa775509.zip
Add inflateGetDictionary() function.
Diffstat (limited to 'inflate.c')
-rw-r--r--inflate.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/inflate.c b/inflate.c
index 47418a1..d1efdb8 100644
--- a/inflate.c
+++ b/inflate.c
@@ -1264,6 +1264,29 @@ z_streamp strm;
1264 return Z_OK; 1264 return Z_OK;
1265} 1265}
1266 1266
1267int ZEXPORT inflateGetDictionary(strm, dictionary, dictLength)
1268z_streamp strm;
1269Bytef *dictionary;
1270uInt *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
1267int ZEXPORT inflateSetDictionary(strm, dictionary, dictLength) 1290int ZEXPORT inflateSetDictionary(strm, dictionary, dictLength)
1268z_streamp strm; 1291z_streamp strm;
1269const Bytef *dictionary; 1292const Bytef *dictionary;