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 | |
| 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.
| -rw-r--r-- | contrib/vstudio/vc10/zlibvc.def | 11 | ||||
| -rw-r--r-- | contrib/vstudio/vc11/zlibvc.def | 11 | ||||
| -rw-r--r-- | contrib/vstudio/vc12/zlibvc.def | 11 | ||||
| -rw-r--r-- | contrib/vstudio/vc14/zlibvc.def | 11 | ||||
| -rw-r--r-- | contrib/vstudio/vc17/zlibvc.def | 319 | ||||
| -rw-r--r-- | contrib/vstudio/vc9/zlibvc.def | 11 | ||||
| -rw-r--r-- | deflate.c | 8 | ||||
| -rw-r--r-- | deflate.h | 3 | ||||
| -rw-r--r-- | os400/bndsrc | 6 | ||||
| -rw-r--r-- | os400/zlib.inc | 4 | ||||
| -rw-r--r-- | trees.c | 2 | ||||
| -rw-r--r-- | win32/zlib.def | 1 | ||||
| -rw-r--r-- | zconf.h | 1 | ||||
| -rw-r--r-- | zconf.h.cmakein | 1 | ||||
| -rw-r--r-- | zconf.h.in | 1 | ||||
| -rw-r--r-- | zlib.h | 12 | ||||
| -rw-r--r-- | zlib.map | 4 |
17 files changed, 239 insertions, 178 deletions
diff --git a/contrib/vstudio/vc10/zlibvc.def b/contrib/vstudio/vc10/zlibvc.def index f28aa6c..61b2d3f 100644 --- a/contrib/vstudio/vc10/zlibvc.def +++ b/contrib/vstudio/vc10/zlibvc.def | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | LIBRARY | 1 | LIBRARY |
| 2 | ; zlib data compression and ZIP file I/O library | 2 | ; zlib data compression and ZIP file I/O library |
| 3 | 3 | ||
| 4 | VERSION 1.3 | 4 | VERSION 1.3 |
| 5 | 5 | ||
| 6 | EXPORTS | 6 | EXPORTS |
| 7 | adler32 @1 | 7 | adler32 @1 |
| @@ -153,6 +153,9 @@ EXPORTS | |||
| 153 | crc32_z @175 | 153 | crc32_z @175 |
| 154 | 154 | ||
| 155 | ; zlib1 v1.2.12 added: | 155 | ; zlib1 v1.2.12 added: |
| 156 | crc32_combine_gen @176 | 156 | crc32_combine_gen @176 |
| 157 | crc32_combine_gen64 @177 | 157 | crc32_combine_gen64 @177 |
| 158 | crc32_combine_op @178 | 158 | crc32_combine_op @178 |
| 159 | |||
| 160 | ; zlib1 v1.3.2 added: | ||
| 161 | deflateUsed @179 | ||
diff --git a/contrib/vstudio/vc11/zlibvc.def b/contrib/vstudio/vc11/zlibvc.def index f28aa6c..61b2d3f 100644 --- a/contrib/vstudio/vc11/zlibvc.def +++ b/contrib/vstudio/vc11/zlibvc.def | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | LIBRARY | 1 | LIBRARY |
| 2 | ; zlib data compression and ZIP file I/O library | 2 | ; zlib data compression and ZIP file I/O library |
| 3 | 3 | ||
| 4 | VERSION 1.3 | 4 | VERSION 1.3 |
| 5 | 5 | ||
| 6 | EXPORTS | 6 | EXPORTS |
| 7 | adler32 @1 | 7 | adler32 @1 |
| @@ -153,6 +153,9 @@ EXPORTS | |||
| 153 | crc32_z @175 | 153 | crc32_z @175 |
| 154 | 154 | ||
| 155 | ; zlib1 v1.2.12 added: | 155 | ; zlib1 v1.2.12 added: |
| 156 | crc32_combine_gen @176 | 156 | crc32_combine_gen @176 |
| 157 | crc32_combine_gen64 @177 | 157 | crc32_combine_gen64 @177 |
| 158 | crc32_combine_op @178 | 158 | crc32_combine_op @178 |
| 159 | |||
| 160 | ; zlib1 v1.3.2 added: | ||
| 161 | deflateUsed @179 | ||
diff --git a/contrib/vstudio/vc12/zlibvc.def b/contrib/vstudio/vc12/zlibvc.def index f28aa6c..61b2d3f 100644 --- a/contrib/vstudio/vc12/zlibvc.def +++ b/contrib/vstudio/vc12/zlibvc.def | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | LIBRARY | 1 | LIBRARY |
| 2 | ; zlib data compression and ZIP file I/O library | 2 | ; zlib data compression and ZIP file I/O library |
| 3 | 3 | ||
| 4 | VERSION 1.3 | 4 | VERSION 1.3 |
| 5 | 5 | ||
| 6 | EXPORTS | 6 | EXPORTS |
| 7 | adler32 @1 | 7 | adler32 @1 |
| @@ -153,6 +153,9 @@ EXPORTS | |||
| 153 | crc32_z @175 | 153 | crc32_z @175 |
| 154 | 154 | ||
| 155 | ; zlib1 v1.2.12 added: | 155 | ; zlib1 v1.2.12 added: |
| 156 | crc32_combine_gen @176 | 156 | crc32_combine_gen @176 |
| 157 | crc32_combine_gen64 @177 | 157 | crc32_combine_gen64 @177 |
| 158 | crc32_combine_op @178 | 158 | crc32_combine_op @178 |
| 159 | |||
| 160 | ; zlib1 v1.3.2 added: | ||
| 161 | deflateUsed @179 | ||
diff --git a/contrib/vstudio/vc14/zlibvc.def b/contrib/vstudio/vc14/zlibvc.def index f28aa6c..61b2d3f 100644 --- a/contrib/vstudio/vc14/zlibvc.def +++ b/contrib/vstudio/vc14/zlibvc.def | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | LIBRARY | 1 | LIBRARY |
| 2 | ; zlib data compression and ZIP file I/O library | 2 | ; zlib data compression and ZIP file I/O library |
| 3 | 3 | ||
| 4 | VERSION 1.3 | 4 | VERSION 1.3 |
| 5 | 5 | ||
| 6 | EXPORTS | 6 | EXPORTS |
| 7 | adler32 @1 | 7 | adler32 @1 |
| @@ -153,6 +153,9 @@ EXPORTS | |||
| 153 | crc32_z @175 | 153 | crc32_z @175 |
| 154 | 154 | ||
| 155 | ; zlib1 v1.2.12 added: | 155 | ; zlib1 v1.2.12 added: |
| 156 | crc32_combine_gen @176 | 156 | crc32_combine_gen @176 |
| 157 | crc32_combine_gen64 @177 | 157 | crc32_combine_gen64 @177 |
| 158 | crc32_combine_op @178 | 158 | crc32_combine_op @178 |
| 159 | |||
| 160 | ; zlib1 v1.3.2 added: | ||
| 161 | deflateUsed @179 | ||
diff --git a/contrib/vstudio/vc17/zlibvc.def b/contrib/vstudio/vc17/zlibvc.def index c349235..61b2d3f 100644 --- a/contrib/vstudio/vc17/zlibvc.def +++ b/contrib/vstudio/vc17/zlibvc.def | |||
| @@ -1,158 +1,161 @@ | |||
| 1 | LIBRARY | 1 | LIBRARY |
| 2 | ; zlib data compression and ZIP file I/O library | 2 | ; zlib data compression and ZIP file I/O library |
| 3 | 3 | ||
| 4 | VERSION 1.3 | 4 | VERSION 1.3 |
| 5 | 5 | ||
| 6 | EXPORTS | 6 | EXPORTS |
| 7 | adler32 @1 | 7 | adler32 @1 |
| 8 | compress @2 | 8 | compress @2 |
| 9 | crc32 @3 | 9 | crc32 @3 |
| 10 | deflate @4 | 10 | deflate @4 |
| 11 | deflateCopy @5 | 11 | deflateCopy @5 |
| 12 | deflateEnd @6 | 12 | deflateEnd @6 |
| 13 | deflateInit2_ @7 | 13 | deflateInit2_ @7 |
| 14 | deflateInit_ @8 | 14 | deflateInit_ @8 |
| 15 | deflateParams @9 | 15 | deflateParams @9 |
| 16 | deflateReset @10 | 16 | deflateReset @10 |
| 17 | deflateSetDictionary @11 | 17 | deflateSetDictionary @11 |
| 18 | gzclose @12 | 18 | gzclose @12 |
| 19 | gzdopen @13 | 19 | gzdopen @13 |
| 20 | gzerror @14 | 20 | gzerror @14 |
| 21 | gzflush @15 | 21 | gzflush @15 |
| 22 | gzopen @16 | 22 | gzopen @16 |
| 23 | gzread @17 | 23 | gzread @17 |
| 24 | gzwrite @18 | 24 | gzwrite @18 |
| 25 | inflate @19 | 25 | inflate @19 |
| 26 | inflateEnd @20 | 26 | inflateEnd @20 |
| 27 | inflateInit2_ @21 | 27 | inflateInit2_ @21 |
| 28 | inflateInit_ @22 | 28 | inflateInit_ @22 |
| 29 | inflateReset @23 | 29 | inflateReset @23 |
| 30 | inflateSetDictionary @24 | 30 | inflateSetDictionary @24 |
| 31 | inflateSync @25 | 31 | inflateSync @25 |
| 32 | uncompress @26 | 32 | uncompress @26 |
| 33 | zlibVersion @27 | 33 | zlibVersion @27 |
| 34 | gzprintf @28 | 34 | gzprintf @28 |
| 35 | gzputc @29 | 35 | gzputc @29 |
| 36 | gzgetc @30 | 36 | gzgetc @30 |
| 37 | gzseek @31 | 37 | gzseek @31 |
| 38 | gzrewind @32 | 38 | gzrewind @32 |
| 39 | gztell @33 | 39 | gztell @33 |
| 40 | gzeof @34 | 40 | gzeof @34 |
| 41 | gzsetparams @35 | 41 | gzsetparams @35 |
| 42 | zError @36 | 42 | zError @36 |
| 43 | inflateSyncPoint @37 | 43 | inflateSyncPoint @37 |
| 44 | get_crc_table @38 | 44 | get_crc_table @38 |
| 45 | compress2 @39 | 45 | compress2 @39 |
| 46 | gzputs @40 | 46 | gzputs @40 |
| 47 | gzgets @41 | 47 | gzgets @41 |
| 48 | inflateCopy @42 | 48 | inflateCopy @42 |
| 49 | inflateBackInit_ @43 | 49 | inflateBackInit_ @43 |
| 50 | inflateBack @44 | 50 | inflateBack @44 |
| 51 | inflateBackEnd @45 | 51 | inflateBackEnd @45 |
| 52 | compressBound @46 | 52 | compressBound @46 |
| 53 | deflateBound @47 | 53 | deflateBound @47 |
| 54 | gzclearerr @48 | 54 | gzclearerr @48 |
| 55 | gzungetc @49 | 55 | gzungetc @49 |
| 56 | zlibCompileFlags @50 | 56 | zlibCompileFlags @50 |
| 57 | deflatePrime @51 | 57 | deflatePrime @51 |
| 58 | deflatePending @52 | 58 | deflatePending @52 |
| 59 | 59 | ||
| 60 | unzOpen @61 | 60 | unzOpen @61 |
| 61 | unzClose @62 | 61 | unzClose @62 |
| 62 | unzGetGlobalInfo @63 | 62 | unzGetGlobalInfo @63 |
| 63 | unzGetCurrentFileInfo @64 | 63 | unzGetCurrentFileInfo @64 |
| 64 | unzGoToFirstFile @65 | 64 | unzGoToFirstFile @65 |
| 65 | unzGoToNextFile @66 | 65 | unzGoToNextFile @66 |
| 66 | unzOpenCurrentFile @67 | 66 | unzOpenCurrentFile @67 |
| 67 | unzReadCurrentFile @68 | 67 | unzReadCurrentFile @68 |
| 68 | unzOpenCurrentFile3 @69 | 68 | unzOpenCurrentFile3 @69 |
| 69 | unztell @70 | 69 | unztell @70 |
| 70 | unzeof @71 | 70 | unzeof @71 |
| 71 | unzCloseCurrentFile @72 | 71 | unzCloseCurrentFile @72 |
| 72 | unzGetGlobalComment @73 | 72 | unzGetGlobalComment @73 |
| 73 | unzStringFileNameCompare @74 | 73 | unzStringFileNameCompare @74 |
| 74 | unzLocateFile @75 | 74 | unzLocateFile @75 |
| 75 | unzGetLocalExtrafield @76 | 75 | unzGetLocalExtrafield @76 |
| 76 | unzOpen2 @77 | 76 | unzOpen2 @77 |
| 77 | unzOpenCurrentFile2 @78 | 77 | unzOpenCurrentFile2 @78 |
| 78 | unzOpenCurrentFilePassword @79 | 78 | unzOpenCurrentFilePassword @79 |
| 79 | 79 | ||
| 80 | zipOpen @80 | 80 | zipOpen @80 |
| 81 | zipOpenNewFileInZip @81 | 81 | zipOpenNewFileInZip @81 |
| 82 | zipWriteInFileInZip @82 | 82 | zipWriteInFileInZip @82 |
| 83 | zipCloseFileInZip @83 | 83 | zipCloseFileInZip @83 |
| 84 | zipClose @84 | 84 | zipClose @84 |
| 85 | zipOpenNewFileInZip2 @86 | 85 | zipOpenNewFileInZip2 @86 |
| 86 | zipCloseFileInZipRaw @87 | 86 | zipCloseFileInZipRaw @87 |
| 87 | zipOpen2 @88 | 87 | zipOpen2 @88 |
| 88 | zipOpenNewFileInZip3 @89 | 88 | zipOpenNewFileInZip3 @89 |
| 89 | 89 | ||
| 90 | unzGetFilePos @100 | 90 | unzGetFilePos @100 |
| 91 | unzGoToFilePos @101 | 91 | unzGoToFilePos @101 |
| 92 | 92 | ||
| 93 | fill_win32_filefunc @110 | 93 | fill_win32_filefunc @110 |
| 94 | 94 | ||
| 95 | ; zlibwapi v1.2.4 added: | 95 | ; zlibwapi v1.2.4 added: |
| 96 | fill_win32_filefunc64 @111 | 96 | fill_win32_filefunc64 @111 |
| 97 | fill_win32_filefunc64A @112 | 97 | fill_win32_filefunc64A @112 |
| 98 | fill_win32_filefunc64W @113 | 98 | fill_win32_filefunc64W @113 |
| 99 | 99 | ||
| 100 | unzOpen64 @120 | 100 | unzOpen64 @120 |
| 101 | unzOpen2_64 @121 | 101 | unzOpen2_64 @121 |
| 102 | unzGetGlobalInfo64 @122 | 102 | unzGetGlobalInfo64 @122 |
| 103 | unzGetCurrentFileInfo64 @124 | 103 | unzGetCurrentFileInfo64 @124 |
| 104 | unzGetCurrentFileZStreamPos64 @125 | 104 | unzGetCurrentFileZStreamPos64 @125 |
| 105 | unztell64 @126 | 105 | unztell64 @126 |
| 106 | unzGetFilePos64 @127 | 106 | unzGetFilePos64 @127 |
| 107 | unzGoToFilePos64 @128 | 107 | unzGoToFilePos64 @128 |
| 108 | 108 | ||
| 109 | zipOpen64 @130 | 109 | zipOpen64 @130 |
| 110 | zipOpen2_64 @131 | 110 | zipOpen2_64 @131 |
| 111 | zipOpenNewFileInZip64 @132 | 111 | zipOpenNewFileInZip64 @132 |
| 112 | zipOpenNewFileInZip2_64 @133 | 112 | zipOpenNewFileInZip2_64 @133 |
| 113 | zipOpenNewFileInZip3_64 @134 | 113 | zipOpenNewFileInZip3_64 @134 |
| 114 | zipOpenNewFileInZip4_64 @135 | 114 | zipOpenNewFileInZip4_64 @135 |
| 115 | zipCloseFileInZipRaw64 @136 | 115 | zipCloseFileInZipRaw64 @136 |
| 116 | 116 | ||
| 117 | ; zlib1 v1.2.4 added: | 117 | ; zlib1 v1.2.4 added: |
| 118 | adler32_combine @140 | 118 | adler32_combine @140 |
| 119 | crc32_combine @142 | 119 | crc32_combine @142 |
| 120 | deflateSetHeader @144 | 120 | deflateSetHeader @144 |
| 121 | deflateTune @145 | 121 | deflateTune @145 |
| 122 | gzbuffer @146 | 122 | gzbuffer @146 |
| 123 | gzclose_r @147 | 123 | gzclose_r @147 |
| 124 | gzclose_w @148 | 124 | gzclose_w @148 |
| 125 | gzdirect @149 | 125 | gzdirect @149 |
| 126 | gzoffset @150 | 126 | gzoffset @150 |
| 127 | inflateGetHeader @156 | 127 | inflateGetHeader @156 |
| 128 | inflateMark @157 | 128 | inflateMark @157 |
| 129 | inflatePrime @158 | 129 | inflatePrime @158 |
| 130 | inflateReset2 @159 | 130 | inflateReset2 @159 |
| 131 | inflateUndermine @160 | 131 | inflateUndermine @160 |
| 132 | 132 | ||
| 133 | ; zlib1 v1.2.6 added: | 133 | ; zlib1 v1.2.6 added: |
| 134 | gzgetc_ @161 | 134 | gzgetc_ @161 |
| 135 | inflateResetKeep @163 | 135 | inflateResetKeep @163 |
| 136 | deflateResetKeep @164 | 136 | deflateResetKeep @164 |
| 137 | 137 | ||
| 138 | ; zlib1 v1.2.7 added: | 138 | ; zlib1 v1.2.7 added: |
| 139 | gzopen_w @165 | 139 | gzopen_w @165 |
| 140 | 140 | ||
| 141 | ; zlib1 v1.2.8 added: | 141 | ; zlib1 v1.2.8 added: |
| 142 | inflateGetDictionary @166 | 142 | inflateGetDictionary @166 |
| 143 | gzvprintf @167 | 143 | gzvprintf @167 |
| 144 | 144 | ||
| 145 | ; zlib1 v1.2.9 added: | 145 | ; zlib1 v1.2.9 added: |
| 146 | inflateCodesUsed @168 | 146 | inflateCodesUsed @168 |
| 147 | inflateValidate @169 | 147 | inflateValidate @169 |
| 148 | uncompress2 @170 | 148 | uncompress2 @170 |
| 149 | gzfread @171 | 149 | gzfread @171 |
| 150 | gzfwrite @172 | 150 | gzfwrite @172 |
| 151 | deflateGetDictionary @173 | 151 | deflateGetDictionary @173 |
| 152 | adler32_z @174 | 152 | adler32_z @174 |
| 153 | crc32_z @175 | 153 | crc32_z @175 |
| 154 | 154 | ||
| 155 | ; zlib1 v1.2.12 added: | 155 | ; zlib1 v1.2.12 added: |
| 156 | crc32_combine_gen @176 | 156 | crc32_combine_gen @176 |
| 157 | crc32_combine_gen64 @177 | 157 | crc32_combine_gen64 @177 |
| 158 | crc32_combine_op @178 | 158 | crc32_combine_op @178 |
| 159 | |||
| 160 | ; zlib1 v1.3.2 added: | ||
| 161 | deflateUsed @179 | ||
diff --git a/contrib/vstudio/vc9/zlibvc.def b/contrib/vstudio/vc9/zlibvc.def index f28aa6c..61b2d3f 100644 --- a/contrib/vstudio/vc9/zlibvc.def +++ b/contrib/vstudio/vc9/zlibvc.def | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | LIBRARY | 1 | LIBRARY |
| 2 | ; zlib data compression and ZIP file I/O library | 2 | ; zlib data compression and ZIP file I/O library |
| 3 | 3 | ||
| 4 | VERSION 1.3 | 4 | VERSION 1.3 |
| 5 | 5 | ||
| 6 | EXPORTS | 6 | EXPORTS |
| 7 | adler32 @1 | 7 | adler32 @1 |
| @@ -153,6 +153,9 @@ EXPORTS | |||
| 153 | crc32_z @175 | 153 | crc32_z @175 |
| 154 | 154 | ||
| 155 | ; zlib1 v1.2.12 added: | 155 | ; zlib1 v1.2.12 added: |
| 156 | crc32_combine_gen @176 | 156 | crc32_combine_gen @176 |
| 157 | crc32_combine_gen64 @177 | 157 | crc32_combine_gen64 @177 |
| 158 | crc32_combine_op @178 | 158 | crc32_combine_op @178 |
| 159 | |||
| 160 | ; zlib1 v1.3.2 added: | ||
| 161 | deflateUsed @179 | ||
| @@ -720,6 +720,14 @@ int ZEXPORT deflatePending(z_streamp strm, unsigned *pending, int *bits) { | |||
| 720 | } | 720 | } |
| 721 | 721 | ||
| 722 | /* ========================================================================= */ | 722 | /* ========================================================================= */ |
| 723 | int ZEXPORT deflateUsed(z_streamp strm, int *bits) { | ||
| 724 | if (deflateStateCheck(strm)) return Z_STREAM_ERROR; | ||
| 725 | if (bits != Z_NULL) | ||
| 726 | *bits = strm->state->bi_used; | ||
| 727 | return Z_OK; | ||
| 728 | } | ||
| 729 | |||
| 730 | /* ========================================================================= */ | ||
| 723 | int ZEXPORT deflatePrime(z_streamp strm, int bits, int value) { | 731 | int ZEXPORT deflatePrime(z_streamp strm, int bits, int value) { |
| 724 | deflate_state *s; | 732 | deflate_state *s; |
| 725 | int put; | 733 | int put; |
| @@ -271,6 +271,9 @@ typedef struct internal_state { | |||
| 271 | /* Number of valid bits in bi_buf. All bits above the last valid bit | 271 | /* Number of valid bits in bi_buf. All bits above the last valid bit |
| 272 | * are always zero. | 272 | * are always zero. |
| 273 | */ | 273 | */ |
| 274 | int bi_used; | ||
| 275 | /* Last number of used bits when going to a byte boundary. | ||
| 276 | */ | ||
| 274 | 277 | ||
| 275 | ulg high_water; | 278 | ulg high_water; |
| 276 | /* High water mark offset in window for initialized bytes -- bytes above | 279 | /* High water mark offset in window for initialized bytes -- bytes above |
diff --git a/os400/bndsrc b/os400/bndsrc index 9f92bb1..187fb69 100644 --- a/os400/bndsrc +++ b/os400/bndsrc | |||
| @@ -124,4 +124,10 @@ STRPGMEXP PGMLVL(*CURRENT) SIGNATURE('ZLIB') | |||
| 124 | EXPORT SYMBOL("crc32_combine_gen") | 124 | EXPORT SYMBOL("crc32_combine_gen") |
| 125 | EXPORT SYMBOL("crc32_combine_op") | 125 | EXPORT SYMBOL("crc32_combine_op") |
| 126 | 126 | ||
| 127 | /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/ | ||
| 128 | /* Version 1.3.2 additional entry points. */ | ||
| 129 | /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/ | ||
| 130 | |||
| 131 | EXPORT SYMBOL("deflateUsed") | ||
| 132 | |||
| 127 | ENDPGMEXP | 133 | ENDPGMEXP |
diff --git a/os400/zlib.inc b/os400/zlib.inc index 36db89e..e9352fe 100644 --- a/os400/zlib.inc +++ b/os400/zlib.inc | |||
| @@ -371,6 +371,10 @@ | |||
| 371 | D pending 10U 0 Pending bytes | 371 | D pending 10U 0 Pending bytes |
| 372 | D bits 10I 0 Pending bits | 372 | D bits 10I 0 Pending bits |
| 373 | * | 373 | * |
| 374 | D deflateUsed PR 10I 0 extproc('deflateUsed') Get used bits | ||
| 375 | D strm like(z_stream) Compression stream | ||
| 376 | D bits 10I 0 Used bits | ||
| 377 | * | ||
| 374 | D deflatePrime PR 10I 0 extproc('deflatePrime') Change level & strat | 378 | D deflatePrime PR 10I 0 extproc('deflatePrime') Change level & strat |
| 375 | D strm like(z_stream) Compression stream | 379 | D strm like(z_stream) Compression stream |
| 376 | D bits 10I 0 value # of bits to insert | 380 | D bits 10I 0 value # of bits to insert |
| @@ -184,6 +184,7 @@ local void bi_windup(deflate_state *s) { | |||
| 184 | } else if (s->bi_valid > 0) { | 184 | } else if (s->bi_valid > 0) { |
| 185 | put_byte(s, (Byte)s->bi_buf); | 185 | put_byte(s, (Byte)s->bi_buf); |
| 186 | } | 186 | } |
| 187 | s->bi_used = ((s->bi_valid - 1) & 7) + 1; | ||
| 187 | s->bi_buf = 0; | 188 | s->bi_buf = 0; |
| 188 | s->bi_valid = 0; | 189 | s->bi_valid = 0; |
| 189 | #ifdef ZLIB_DEBUG | 190 | #ifdef ZLIB_DEBUG |
| @@ -466,6 +467,7 @@ void ZLIB_INTERNAL _tr_init(deflate_state *s) { | |||
| 466 | 467 | ||
| 467 | s->bi_buf = 0; | 468 | s->bi_buf = 0; |
| 468 | s->bi_valid = 0; | 469 | s->bi_valid = 0; |
| 470 | s->bi_used = 0; | ||
| 469 | #ifdef ZLIB_DEBUG | 471 | #ifdef ZLIB_DEBUG |
| 470 | s->compressed_len = 0L; | 472 | s->compressed_len = 0L; |
| 471 | s->bits_sent = 0L; | 473 | s->bits_sent = 0L; |
diff --git a/win32/zlib.def b/win32/zlib.def index 53c8011..84f6496 100644 --- a/win32/zlib.def +++ b/win32/zlib.def | |||
| @@ -15,6 +15,7 @@ EXPORTS | |||
| 15 | deflateTune | 15 | deflateTune |
| 16 | deflateBound | 16 | deflateBound |
| 17 | deflatePending | 17 | deflatePending |
| 18 | deflateUsed | ||
| 18 | deflatePrime | 19 | deflatePrime |
| 19 | deflateSetHeader | 20 | deflateSetHeader |
| 20 | inflateSetDictionary | 21 | inflateSetDictionary |
| @@ -59,6 +59,7 @@ | |||
| 59 | # define deflateSetDictionary z_deflateSetDictionary | 59 | # define deflateSetDictionary z_deflateSetDictionary |
| 60 | # define deflateSetHeader z_deflateSetHeader | 60 | # define deflateSetHeader z_deflateSetHeader |
| 61 | # define deflateTune z_deflateTune | 61 | # define deflateTune z_deflateTune |
| 62 | # define deflateUsed z_deflateUsed | ||
| 62 | # define deflate_copyright z_deflate_copyright | 63 | # define deflate_copyright z_deflate_copyright |
| 63 | # define get_crc_table z_get_crc_table | 64 | # define get_crc_table z_get_crc_table |
| 64 | # ifndef Z_SOLO | 65 | # ifndef Z_SOLO |
diff --git a/zconf.h.cmakein b/zconf.h.cmakein index 2e794b9..7a35e8f 100644 --- a/zconf.h.cmakein +++ b/zconf.h.cmakein | |||
| @@ -61,6 +61,7 @@ | |||
| 61 | # define deflateSetDictionary z_deflateSetDictionary | 61 | # define deflateSetDictionary z_deflateSetDictionary |
| 62 | # define deflateSetHeader z_deflateSetHeader | 62 | # define deflateSetHeader z_deflateSetHeader |
| 63 | # define deflateTune z_deflateTune | 63 | # define deflateTune z_deflateTune |
| 64 | # define deflateUsed z_deflateUsed | ||
| 64 | # define deflate_copyright z_deflate_copyright | 65 | # define deflate_copyright z_deflate_copyright |
| 65 | # define get_crc_table z_get_crc_table | 66 | # define get_crc_table z_get_crc_table |
| 66 | # ifndef Z_SOLO | 67 | # ifndef Z_SOLO |
| @@ -59,6 +59,7 @@ | |||
| 59 | # define deflateSetDictionary z_deflateSetDictionary | 59 | # define deflateSetDictionary z_deflateSetDictionary |
| 60 | # define deflateSetHeader z_deflateSetHeader | 60 | # define deflateSetHeader z_deflateSetHeader |
| 61 | # define deflateTune z_deflateTune | 61 | # define deflateTune z_deflateTune |
| 62 | # define deflateUsed z_deflateUsed | ||
| 62 | # define deflate_copyright z_deflate_copyright | 63 | # define deflate_copyright z_deflate_copyright |
| 63 | # define get_crc_table z_get_crc_table | 64 | # define get_crc_table z_get_crc_table |
| 64 | # ifndef Z_SOLO | 65 | # ifndef Z_SOLO |
| @@ -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); |
| @@ -98,3 +98,7 @@ ZLIB_1.2.12 { | |||
| 98 | crc32_combine_gen64; | 98 | crc32_combine_gen64; |
| 99 | crc32_combine_op; | 99 | crc32_combine_op; |
| 100 | } ZLIB_1.2.9; | 100 | } ZLIB_1.2.9; |
| 101 | |||
| 102 | ZLIB_1.3.2 { | ||
| 103 | deflateUsed; | ||
| 104 | } ZLIB_1.2.12; \ No newline at end of file | ||
