diff options
author | Mark Adler <madler@alumni.caltech.edu> | 2024-07-01 19:24:01 -0500 |
---|---|---|
committer | Mark Adler <madler@alumni.caltech.edu> | 2024-07-01 19:34:40 -0500 |
commit | e011d8c164402cbb1baf92533dfb4f933ec08fee (patch) | |
tree | 7a28431c3c5caf885f07deac6718787b36f2231c /zlib.h | |
parent | 534864bccd78812648ad1beaccdeec7c9d47aeef (diff) | |
download | zlib-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.h | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -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 | ||
794 | ZEXTERN 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 | |||
794 | ZEXTERN int ZEXPORT deflatePrime(z_streamp strm, | 806 | ZEXTERN int ZEXPORT deflatePrime(z_streamp strm, |
795 | int bits, | 807 | int bits, |
796 | int value); | 808 | int value); |