aboutsummaryrefslogtreecommitdiff
path: root/zlib.h
diff options
context:
space:
mode:
authorMark Adler <madler@alumni.caltech.edu>2024-07-01 19:24:01 -0500
committerMark Adler <madler@alumni.caltech.edu>2024-07-01 19:34:40 -0500
commite011d8c164402cbb1baf92533dfb4f933ec08fee (patch)
tree7a28431c3c5caf885f07deac6718787b36f2231c /zlib.h
parent534864bccd78812648ad1beaccdeec7c9d47aeef (diff)
downloadzlib-e011d8c164402cbb1baf92533dfb4f933ec08fee.tar.gz
zlib-e011d8c164402cbb1baf92533dfb4f933ec08fee.tar.bz2
zlib-e011d8c164402cbb1baf92533dfb4f933ec08fee.zip
Add deflateUsed() function to get the used bits in the last byte.
This returns the number of used bits in the last byte of a stream that has just been compressed with deflate.
Diffstat (limited to 'zlib.h')
-rw-r--r--zlib.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/zlib.h b/zlib.h
index 5498b54..ad33815 100644
--- a/zlib.h
+++ b/zlib.h
@@ -791,6 +791,18 @@ ZEXTERN int ZEXPORT deflatePending(z_streamp strm,
791 stream state was inconsistent. 791 stream state was inconsistent.
792 */ 792 */
793 793
794ZEXTERN int ZEXPORT deflateUsed(z_streamp strm,
795 int *bits);
796/*
797 deflateUsed() returns in *bits the most recent number of deflate bits used
798 in the last byte when flushing to a byte boundary. The result is in 1..8, or
799 0 if there has not yet been a flush. This helps determine the location of
800 the last bit of a deflate stream.
801
802 deflateUsed returns Z_OK if success, or Z_STREAM_ERROR if the source
803 stream state was inconsistent.
804 */
805
794ZEXTERN int ZEXPORT deflatePrime(z_streamp strm, 806ZEXTERN int ZEXPORT deflatePrime(z_streamp strm,
795 int bits, 807 int bits,
796 int value); 808 int value);