diff options
Diffstat (limited to 'inflate.c')
-rw-r--r-- | inflate.c | 23 |
1 files changed, 23 insertions, 0 deletions
@@ -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; |