diff options
Diffstat (limited to 'FAQ')
| -rw-r--r-- | FAQ | 88 |
1 files changed, 55 insertions, 33 deletions
| @@ -21,18 +21,18 @@ The lastest zlib FAQ is at http://www.gzip.org/zlib/zlib_faq.html | |||
| 21 | 3. Where can I get a Visual Basic interface to zlib? | 21 | 3. Where can I get a Visual Basic interface to zlib? |
| 22 | 22 | ||
| 23 | See | 23 | See |
| 24 | * http://www.winimage.com/zLibDll/ | ||
| 25 | * http://www.dogma.net/markn/articles/zlibtool/zlibtool.htm | 24 | * http://www.dogma.net/markn/articles/zlibtool/zlibtool.htm |
| 26 | * contrib/visual-basic.txt in the zlib distribution | 25 | * contrib/visual-basic.txt in the zlib distribution |
| 26 | * win32/DLL_FAQ.txt in the zlib distribution | ||
| 27 | 27 | ||
| 28 | 4. compress() returns Z_BUF_ERROR | 28 | 4. compress() returns Z_BUF_ERROR. |
| 29 | 29 | ||
| 30 | Make sure that before the call of compress, the length of the compressed | 30 | Make sure that before the call of compress, the length of the compressed |
| 31 | buffer is equal to the total size of the compressed buffer and not | 31 | buffer is equal to the total size of the compressed buffer and not |
| 32 | zero. For Visual Basic, check that this parameter is passed by reference | 32 | zero. For Visual Basic, check that this parameter is passed by reference |
| 33 | ("as any"), not by value ("as long"). | 33 | ("as any"), not by value ("as long"). |
| 34 | 34 | ||
| 35 | 5. deflate() or inflate() returns Z_BUF_ERROR | 35 | 5. deflate() or inflate() returns Z_BUF_ERROR. |
| 36 | 36 | ||
| 37 | Before making the call, make sure that avail_in and avail_out are not | 37 | Before making the call, make sure that avail_in and avail_out are not |
| 38 | zero. When setting the parameter flush equal to Z_FINISH, also make sure | 38 | zero. When setting the parameter flush equal to Z_FINISH, also make sure |
| @@ -47,8 +47,8 @@ The lastest zlib FAQ is at http://www.gzip.org/zlib/zlib_faq.html | |||
| 47 | 47 | ||
| 48 | It's in zlib.h for the moment, and Francis S. Lin has converted it to a | 48 | It's in zlib.h for the moment, and Francis S. Lin has converted it to a |
| 49 | web page zlib.html. Volunteers to transform this to Unix-style man pages, | 49 | web page zlib.html. Volunteers to transform this to Unix-style man pages, |
| 50 | please contact Jean-loup Gailly (jloup@gzip.org). Examples of zlib usage | 50 | please contact us (zlib@gzip.org). Examples of zlib usage are in the files |
| 51 | are in the files example.c and minigzip.c. | 51 | example.c and minigzip.c. |
| 52 | 52 | ||
| 53 | 7. Why don't you use GNU autoconf or libtool or ...? | 53 | 7. Why don't you use GNU autoconf or libtool or ...? |
| 54 | 54 | ||
| @@ -77,7 +77,8 @@ The lastest zlib FAQ is at http://www.gzip.org/zlib/zlib_faq.html | |||
| 77 | 77 | ||
| 78 | 11. Can zlib handle .zip archives? | 78 | 11. Can zlib handle .zip archives? |
| 79 | 79 | ||
| 80 | See the directory contrib/minizip in the zlib distribution. | 80 | Not by itself, no. See the directory contrib/minizip in the zlib |
| 81 | distribution. | ||
| 81 | 82 | ||
| 82 | 12. Can zlib handle .Z files? | 83 | 12. Can zlib handle .Z files? |
| 83 | 84 | ||
| @@ -92,6 +93,8 @@ The lastest zlib FAQ is at http://www.gzip.org/zlib/zlib_faq.html | |||
| 92 | 93 | ||
| 93 | 14. How do I install a shared zlib library on Unix? | 94 | 14. How do I install a shared zlib library on Unix? |
| 94 | 95 | ||
| 96 | After the above, then: | ||
| 97 | |||
| 95 | make install | 98 | make install |
| 96 | 99 | ||
| 97 | However, many flavors of Unix come with a shared zlib already installed. | 100 | However, many flavors of Unix come with a shared zlib already installed. |
| @@ -99,12 +102,31 @@ The lastest zlib FAQ is at http://www.gzip.org/zlib/zlib_faq.html | |||
| 99 | trying to install it, you may want to check if it's already there! If you | 102 | trying to install it, you may want to check if it's already there! If you |
| 100 | can #include <zlib.h>, it's there. The -lz option will probably link to it. | 103 | can #include <zlib.h>, it's there. The -lz option will probably link to it. |
| 101 | 104 | ||
| 102 | 15. I have a question about OttoPDF | 105 | 15. I have a question about OttoPDF. |
| 103 | 106 | ||
| 104 | We are not the authors of OttoPDF. The real author is on the OttoPDF web | 107 | We are not the authors of OttoPDF. The real author is on the OttoPDF web |
| 105 | site Joel Hainley jhainley@myndkryme.com. | 108 | site: Joel Hainley, jhainley@myndkryme.com. |
| 109 | |||
| 110 | 16. Can zlib decode Flate data in an Adobe PDF file? | ||
| 111 | |||
| 112 | Yes. See http://www.fastio.com/ (ClibPDF), or http://www.pdflib.com/ . | ||
| 113 | To modify PDF forms, see http://sourceforge.net/projects/acroformtool/ . | ||
| 114 | |||
| 115 | 17. Why am I getting this "register_frame_info not found" error on Solaris? | ||
| 116 | |||
| 117 | After installing zlib 1.1.4 on Solaris 2.6, running applications using zlib | ||
| 118 | generates an error such as: | ||
| 119 | |||
| 120 | ld.so.1: rpm: fatal: relocation error: file /usr/local/lib/libz.so: | ||
| 121 | symbol __register_frame_info: referenced symbol not found | ||
| 122 | |||
| 123 | The symbol __register_frame_info is not part of zlib, it is generated by | ||
| 124 | the C compiler (cc or gcc). You must recompile applications using zlib | ||
| 125 | which have this problem. This problem is specific to Solaris. See | ||
| 126 | http://www.sunfreeware.com for Solaris versions of zlib and applications | ||
| 127 | using zlib. | ||
| 106 | 128 | ||
| 107 | 16. Why does gzip give an error on a file I make with compress/deflate? | 129 | 18. Why does gzip give an error on a file I make with compress/deflate? |
| 108 | 130 | ||
| 109 | The compress and deflate functions produce data in the zlib format, which | 131 | The compress and deflate functions produce data in the zlib format, which |
| 110 | is different and incompatible with the gzip format. The gz* functions in | 132 | is different and incompatible with the gzip format. The gz* functions in |
| @@ -112,7 +134,7 @@ The lastest zlib FAQ is at http://www.gzip.org/zlib/zlib_faq.html | |||
| 112 | formats use the same compressed data format internally, but have different | 134 | formats use the same compressed data format internally, but have different |
| 113 | headers and trailers around the compressed data. | 135 | headers and trailers around the compressed data. |
| 114 | 136 | ||
| 115 | 17. Ok, so why are there two different formats? | 137 | 19. Ok, so why are there two different formats? |
| 116 | 138 | ||
| 117 | The gzip format was designed to retain the directory information about | 139 | The gzip format was designed to retain the directory information about |
| 118 | a single file, such as the name and last modification date. The zlib | 140 | a single file, such as the name and last modification date. The zlib |
| @@ -120,7 +142,7 @@ The lastest zlib FAQ is at http://www.gzip.org/zlib/zlib_faq.html | |||
| 120 | channel applications, and has a much more compact header and trailer and | 142 | channel applications, and has a much more compact header and trailer and |
| 121 | uses a faster integrity check than gzip. | 143 | uses a faster integrity check than gzip. |
| 122 | 144 | ||
| 123 | 18. Well that's nice, but how do I make a gzip file in memory? | 145 | 20. Well that's nice, but how do I make a gzip file in memory? |
| 124 | 146 | ||
| 125 | You can request that deflate write the gzip format instead of the zlib | 147 | You can request that deflate write the gzip format instead of the zlib |
| 126 | format using deflateInit2(). You can also request that inflate decode | 148 | format using deflateInit2(). You can also request that inflate decode |
| @@ -133,7 +155,7 @@ The lastest zlib FAQ is at http://www.gzip.org/zlib/zlib_faq.html | |||
| 133 | function and roll your own gzip encoding and decoding. Read the gzip | 155 | function and roll your own gzip encoding and decoding. Read the gzip |
| 134 | RFC 1952 for details of the header and trailer format. | 156 | RFC 1952 for details of the header and trailer format. |
| 135 | 157 | ||
| 136 | 19. Is zlib thread-safe? | 158 | 21. Is zlib thread-safe? |
| 137 | 159 | ||
| 138 | Yes. However any library routines that zlib uses and any application- | 160 | Yes. However any library routines that zlib uses and any application- |
| 139 | provided memory allocation routines must also be thread-safe. zlib's gz* | 161 | provided memory allocation routines must also be thread-safe. zlib's gz* |
| @@ -144,15 +166,15 @@ The lastest zlib FAQ is at http://www.gzip.org/zlib/zlib_faq.html | |||
| 144 | Of course, you should only operate on any given zlib or gzip stream from a | 166 | Of course, you should only operate on any given zlib or gzip stream from a |
| 145 | single thread at a time. | 167 | single thread at a time. |
| 146 | 168 | ||
| 147 | 20. Can I use zlib in my commercial application? | 169 | 22. Can I use zlib in my commercial application? |
| 148 | 170 | ||
| 149 | Yes. Please read the license in zlib.h. | 171 | Yes. Please read the license in zlib.h. |
| 150 | 172 | ||
| 151 | 21. Is zlib under the GNU license? | 173 | 23. Is zlib under the GNU license? |
| 152 | 174 | ||
| 153 | No. Please read the license in zlib.h. | 175 | No. Please read the license in zlib.h. |
| 154 | 176 | ||
| 155 | 22. The license says that altered source versions must be "plainly marked". So | 177 | 24. The license says that altered source versions must be "plainly marked". So |
| 156 | what exactly do I need to do to meet that requirement? | 178 | what exactly do I need to do to meet that requirement? |
| 157 | 179 | ||
| 158 | You need to change the ZLIB_VERSION and ZLIB_VERNUM #defines in zlib.h. In | 180 | You need to change the ZLIB_VERSION and ZLIB_VERNUM #defines in zlib.h. In |
| @@ -175,24 +197,24 @@ The lastest zlib FAQ is at http://www.gzip.org/zlib/zlib_faq.html | |||
| 175 | ZLIB_VERSION and ZLIB_VERNUM and note the origin and nature of the changes | 197 | ZLIB_VERSION and ZLIB_VERNUM and note the origin and nature of the changes |
| 176 | in zlib.h as you would for a full source distribution. | 198 | in zlib.h as you would for a full source distribution. |
| 177 | 199 | ||
| 178 | 23. Will zlib work on a big-endian or little-endian architecture, and can I | 200 | 25. Will zlib work on a big-endian or little-endian architecture, and can I |
| 179 | exchange compressed data between them? | 201 | exchange compressed data between them? |
| 180 | 202 | ||
| 181 | Yes and yes. | 203 | Yes and yes. |
| 182 | 204 | ||
| 183 | 24. Will zlib work on a 64-bit machine? | 205 | 26. Will zlib work on a 64-bit machine? |
| 184 | 206 | ||
| 185 | It should. It has been tested on 64-bit machines, and has no dependence | 207 | It should. It has been tested on 64-bit machines, and has no dependence |
| 186 | on any data types being limited to 32-bits in length. If you have any | 208 | on any data types being limited to 32-bits in length. If you have any |
| 187 | difficulties, please provide a complete problem report to zlib@gzip.org | 209 | difficulties, please provide a complete problem report to zlib@gzip.org |
| 188 | 210 | ||
| 189 | 25. Will zlib decompress data from the PKWare Data Compression Library? | 211 | 27. Will zlib decompress data from the PKWare Data Compression Library? |
| 190 | 212 | ||
| 191 | No. The PKWare DCL uses a completely different compressed data format | 213 | No. The PKWare DCL uses a completely different compressed data format |
| 192 | than does PKZIP and zlib. However, you can look in zlib's contrib/blast | 214 | than does PKZIP and zlib. However, you can look in zlib's contrib/blast |
| 193 | directory for a possible solution to your problem. | 215 | directory for a possible solution to your problem. |
| 194 | 216 | ||
| 195 | 26. Can I access data randomly in a compressed stream? | 217 | 28. Can I access data randomly in a compressed stream? |
| 196 | 218 | ||
| 197 | No, not without some preparation. If when compressing you periodically | 219 | No, not without some preparation. If when compressing you periodically |
| 198 | use Z_FULL_FLUSH, carefully write all the pending data at those points, | 220 | use Z_FULL_FLUSH, carefully write all the pending data at those points, |
| @@ -200,27 +222,27 @@ The lastest zlib FAQ is at http://www.gzip.org/zlib/zlib_faq.html | |||
| 200 | at those points. You have to be careful to not use Z_FULL_FLUSH too | 222 | at those points. You have to be careful to not use Z_FULL_FLUSH too |
| 201 | often, since it can significantly degrade compression. | 223 | often, since it can significantly degrade compression. |
| 202 | 224 | ||
| 203 | 27. Does zlib work on MVS, OS/390, CICS, etc.? | 225 | 29. Does zlib work on MVS, OS/390, CICS, etc.? |
| 204 | 226 | ||
| 205 | We don't know for sure. We have heard occasional reports of success on | 227 | We don't know for sure. We have heard occasional reports of success on |
| 206 | these systems. If you do use it on one of these, please provide us with | 228 | these systems. If you do use it on one of these, please provide us with |
| 207 | a report, instructions, and patches that we can reference when we get | 229 | a report, instructions, and patches that we can reference when we get |
| 208 | these questions. Thanks. | 230 | these questions. Thanks. |
| 209 | 231 | ||
| 210 | 28. Is there some simpler, easier to read version of inflate I can look at | 232 | 30. Is there some simpler, easier to read version of inflate I can look at |
| 211 | to understand the deflate format? | 233 | to understand the deflate format? |
| 212 | 234 | ||
| 213 | First off, you should read RFC 1951. Second, yes. Look in zlib's | 235 | First off, you should read RFC 1951. Second, yes. Look in zlib's |
| 214 | contrib/puff directory. | 236 | contrib/puff directory. |
| 215 | 237 | ||
| 216 | 29. Does zlib infringe on any patents? | 238 | 31. Does zlib infringe on any patents? |
| 217 | 239 | ||
| 218 | As far as we know, no. In fact, that was originally the whole point behind | 240 | As far as we know, no. In fact, that was originally the whole point behind |
| 219 | zlib. Look here for some more information: | 241 | zlib. Look here for some more information: |
| 220 | 242 | ||
| 221 | http://www.gzip.org/#faq11 | 243 | http://www.gzip.org/#faq11 |
| 222 | 244 | ||
| 223 | 30. Can zlib work with greater than 4 GB of data? | 245 | 32. Can zlib work with greater than 4 GB of data? |
| 224 | 246 | ||
| 225 | Yes. inflate() and deflate() will process any amount of data correctly. | 247 | Yes. inflate() and deflate() will process any amount of data correctly. |
| 226 | Each call of inflate() or deflate() is limited to input and output chunks | 248 | Each call of inflate() or deflate() is limited to input and output chunks |
| @@ -238,7 +260,7 @@ The lastest zlib FAQ is at http://www.gzip.org/zlib/zlib_faq.html | |||
| 238 | only if the compiler's "long" type is 32 bits. If the compiler's "long" | 260 | only if the compiler's "long" type is 32 bits. If the compiler's "long" |
| 239 | type is 64 bits, then the limit is 16 exabytes. | 261 | type is 64 bits, then the limit is 16 exabytes. |
| 240 | 262 | ||
| 241 | 31. Does zlib have any security vulnerabilities? | 263 | 33. Does zlib have any security vulnerabilities? |
| 242 | 264 | ||
| 243 | The only one that we are aware of is potentially in gzprintf(). If zlib | 265 | The only one that we are aware of is potentially in gzprintf(). If zlib |
| 244 | is compiled to use sprintf() or vsprintf(), then there is no protection | 266 | is compiled to use sprintf() or vsprintf(), then there is no protection |
| @@ -258,35 +280,35 @@ The lastest zlib FAQ is at http://www.gzip.org/zlib/zlib_faq.html | |||
| 258 | Note that you should be using the most recent version of zlib. Versions | 280 | Note that you should be using the most recent version of zlib. Versions |
| 259 | 1.1.3 and before were subject to a double-free vulnerability. | 281 | 1.1.3 and before were subject to a double-free vulnerability. |
| 260 | 282 | ||
| 261 | 32. Is there a Java version of zlib? | 283 | 34. Is there a Java version of zlib? |
| 262 | 284 | ||
| 263 | Probably what you want is to use zlib in Java. zlib is already included | 285 | Probably what you want is to use zlib in Java. zlib is already included |
| 264 | as part of the Java SDK in the java.util.zip package. If you really want | 286 | as part of the Java SDK in the java.util.zip package. If you really want |
| 265 | a version of zlib written in the Java language, look on the zlib home | 287 | a version of zlib written in the Java language, look on the zlib home |
| 266 | page for links: http://www.zlib.org/ | 288 | page for links: http://www.zlib.org/ |
| 267 | 289 | ||
| 268 | 33. I get this or that compiler or source-code scanner warning when I crank it | 290 | 35. I get this or that compiler or source-code scanner warning when I crank it |
| 269 | up to maximally-pendantic. Can't you guys write proper code? | 291 | up to maximally-pedantic. Can't you guys write proper code? |
| 270 | 292 | ||
| 271 | Many years ago, we gave up attempting to avoid warnings on every compiler | 293 | Many years ago, we gave up attempting to avoid warnings on every compiler |
| 272 | in the universe. It just got to be a waste of time, and some compilers | 294 | in the universe. It just got to be a waste of time, and some compilers |
| 273 | were downright silly. So now, we simply make sure that the code always | 295 | were downright silly. So now, we simply make sure that the code always |
| 274 | works. | 296 | works. |
| 275 | 297 | ||
| 276 | 34. Will zlib read the (insert any ancient or arcane format here) compressed | 298 | 36. Will zlib read the (insert any ancient or arcane format here) compressed |
| 277 | data format? | 299 | data format? |
| 278 | 300 | ||
| 279 | Probably not. Look in the comp.compression FAQ for pointers to various | 301 | Probably not. Look in the comp.compression FAQ for pointers to various |
| 280 | formats and associated software. | 302 | formats and associated software. |
| 281 | 303 | ||
| 282 | 35. How can I encrypt/decrypt zip files with zlib? | 304 | 37. How can I encrypt/decrypt zip files with zlib? |
| 283 | 305 | ||
| 284 | zlib doesn't support encryption. The original PKZIP encryption is very weak | 306 | zlib doesn't support encryption. The original PKZIP encryption is very weak |
| 285 | and can be broken with freely available programs. To get strong encryption, | 307 | and can be broken with freely available programs. To get strong encryption, |
| 286 | use gpg ( http://www.gnupg.org/ ) which already includes zlib compression. | 308 | use GnuPG, http://www.gnupg.org/ , which already includes zlib compression. |
| 287 | For PKZIP compatible "encryption", look at http://www.info-zip.org/ | 309 | For PKZIP compatible "encryption", look at http://www.info-zip.org/ |
| 288 | 310 | ||
| 289 | 36. What's the difference between the "gzip" and "deflate" HTTP 1.1 encodings? | 311 | 38. What's the difference between the "gzip" and "deflate" HTTP 1.1 encodings? |
| 290 | 312 | ||
| 291 | "gzip" is the gzip format, and "deflate" is the zlib format. They should | 313 | "gzip" is the gzip format, and "deflate" is the zlib format. They should |
| 292 | probably have called the second one "zlib" instead to avoid confusion | 314 | probably have called the second one "zlib" instead to avoid confusion |
| @@ -302,14 +324,14 @@ The lastest zlib FAQ is at http://www.gzip.org/zlib/zlib_faq.html | |||
| 302 | 324 | ||
| 303 | Bottom line: use the gzip format for HTTP 1.1 encoding. | 325 | Bottom line: use the gzip format for HTTP 1.1 encoding. |
| 304 | 326 | ||
| 305 | 37. Does zlib support the new "Deflate64" format introduced by PKWare? | 327 | 39. Does zlib support the new "Deflate64" format introduced by PKWare? |
| 306 | 328 | ||
| 307 | No. PKWare has apparently decided to keep that format proprietary, since | 329 | No. PKWare has apparently decided to keep that format proprietary, since |
| 308 | they have not documented it as they have previous compression formats. | 330 | they have not documented it as they have previous compression formats. |
| 309 | In any case, the compression improvements are so modest compared to other | 331 | In any case, the compression improvements are so modest compared to other |
| 310 | more modern approaches, that it's not worth the effort to implement. | 332 | more modern approaches, that it's not worth the effort to implement. |
| 311 | 333 | ||
| 312 | 38. Can you please sign these lengthy legal documents and fax them back to us | 334 | 40. Can you please sign these lengthy legal documents and fax them back to us |
| 313 | so that we can use your software in our product? | 335 | so that we can use your software in our product? |
| 314 | 336 | ||
| 315 | No. Go away. Shoo. | 337 | No. Go away. Shoo. |
