aboutsummaryrefslogtreecommitdiff
path: root/common/zlib.h
diff options
context:
space:
mode:
authorJohannes Schickel2012-07-18 06:39:57 -0700
committerJohannes Schickel2012-07-18 06:39:57 -0700
commit966ce6b413c0b29ef66673c6315fb3641ce113f9 (patch)
tree5743c9ee941b88de6c2504da9bc07cd873f7393e /common/zlib.h
parentb6000da8753c1a28c2f2f3d0bbd2f1e704674d85 (diff)
parentb398dcabaffbbc53d24d296fed3f64b0b8ecd519 (diff)
downloadscummvm-rg350-966ce6b413c0b29ef66673c6315fb3641ce113f9.tar.gz
scummvm-rg350-966ce6b413c0b29ef66673c6315fb3641ce113f9.tar.bz2
scummvm-rg350-966ce6b413c0b29ef66673c6315fb3641ce113f9.zip
Merge pull request #259 from somaen/zlib_knownSize
COMMON: Add an argument to wrapCompressedReadStream, for streams with unknown size()
Diffstat (limited to 'common/zlib.h')
-rw-r--r--common/zlib.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/common/zlib.h b/common/zlib.h
index 61322c286a..8372499922 100644
--- a/common/zlib.h
+++ b/common/zlib.h
@@ -86,10 +86,18 @@ bool inflateZlibHeaderless(byte *dst, uint dstLen, const byte *src, uint srcLen,
* format. In the former case, the original stream is returned unmodified
* (and in particular, not wrapped).
*
+ * Certain GZip-formats don't supply an easily readable length, if you
+ * still need the length carried along with the stream, and you know
+ * the decompressed length at wrap-time, then it can be supplied as knownSize
+ * here. knownSize will be ignored if the GZip-stream DOES include a length.
+ *
* It is safe to call this with a NULL parameter (in this case, NULL is
* returned).
+ *
+ * @param toBeWrapped the stream to be wrapped (if it is in gzip-format)
+ * @param knownSize a supplied length of the compressed data (if not available directly)
*/
-SeekableReadStream *wrapCompressedReadStream(SeekableReadStream *toBeWrapped);
+SeekableReadStream *wrapCompressedReadStream(SeekableReadStream *toBeWrapped, uint32 knownSize = 0);
/**
* Take an arbitrary WriteStream and wrap it in a custom stream which provides