⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 faq.txt

📁 zlib 压缩算法 测试过
💻 TXT
📖 第 1 页 / 共 2 页
字号:

                Frequently Asked Questions about zlib


If your question is not there, please check the zlib home page
http://www.zlib.org which may have more recent information.
The lastest zlib FAQ is at http://www.gzip.org/zlib/zlib_faq.html


 1. Is zlib Y2K-compliant?

    Yes. zlib doesn't handle dates.

 2. Where can I get a Windows DLL version?

    The zlib sources can be compiled without change to produce a DLL.
    See the file win32/DLL_FAQ.txt in the zlib distribution.
    Pointers to the precompiled DLL are found in the zlib web site at
    http://www.zlib.org.

 3. Where can I get a Visual Basic interface to zlib?

    See
        * http://www.dogma.net/markn/articles/zlibtool/zlibtool.htm
        * contrib/visual-basic.txt in the zlib distribution
        * win32/DLL_FAQ.txt in the zlib distribution

 4. compress() returns Z_BUF_ERROR.

    Make sure that before the call of compress, the length of the compressed
    buffer is equal to the total size of the compressed buffer and not
    zero. For Visual Basic, check that this parameter is passed by reference
    ("as any"), not by value ("as long").

 5. deflate() or inflate() returns Z_BUF_ERROR.

    Before making the call, make sure that avail_in and avail_out are not
    zero. When setting the parameter flush equal to Z_FINISH, also make sure
    that avail_out is big enough to allow processing all pending input.
    Note that a Z_BUF_ERROR is not fatal--another call to deflate() or
    inflate() can be made with more input or output space. A Z_BUF_ERROR
    may in fact be unavoidable depending on how the functions are used, since
    it is not possible to tell whether or not there is more output pending
    when strm.avail_out returns with zero.

 6. Where's the zlib documentation (man pages, etc.)?

    It's in zlib.h for the moment, and Francis S. Lin has converted it to a
    web page zlib.html. Volunteers to transform this to Unix-style man pages,
    please contact us (zlib@gzip.org). Examples of zlib usage are in the files
    example.c and minigzip.c.

 7. Why don't you use GNU autoconf or libtool or ...?

    Because we would like to keep zlib as a very small and simple
    package. zlib is rather portable and doesn't need much configuration.

 8. I found a bug in zlib.

    Most of the time, such problems are due to an incorrect usage of
    zlib. Please try to reproduce the problem with a small program and send
    the corresponding source to us at zlib@gzip.org . Do not send
    multi-megabyte data files without prior agreement.

 9. Why do I get "undefined reference to gzputc"?

    If "make test" produces something like

       example.o(.text+0x154): undefined reference to `gzputc'

    check that you don't have old files libz.* in /usr/lib, /usr/local/lib or
    /usr/X11R6/lib. Remove any old versions, then do "make install".

10. I need a Delphi interface to zlib.

    See the contrib/delphi directory in the zlib distribution.

11. Can zlib handle .zip archives?

    Not by itself, no.  See the directory contrib/minizip in the zlib
    distribution.

12. Can zlib handle .Z files?

    No, sorry. You have to spawn an uncompress or gunzip subprocess, or adapt
    the code of uncompress on your own.

13. How can I make a Unix shared library?

    make clean
    ./configure -s
    make

14. How do I install a shared zlib library on Unix?

    After the above, then:

    make install

    However, many flavors of Unix come with a shared zlib already installed.
    Before going to the trouble of compiling a shared version of zlib and
    trying to install it, you may want to check if it's already there! If you
    can #include <zlib.h>, it's there. The -lz option will probably link to it.

15. I have a question about OttoPDF.

    We are not the authors of OttoPDF. The real author is on the OttoPDF web
    site: Joel Hainley, jhainley@myndkryme.com.

16. Can zlib decode Flate data in an Adobe PDF file?

    Yes. See http://www.fastio.com/ (ClibPDF), or http://www.pdflib.com/ .
    To modify PDF forms, see http://sourceforge.net/projects/acroformtool/ .

17. Why am I getting this "register_frame_info not found" error on Solaris?

    After installing zlib 1.1.4 on Solaris 2.6, running applications using zlib
    generates an error such as:

        ld.so.1: rpm: fatal: relocation error: file /usr/local/lib/libz.so:
        symbol __register_frame_info: referenced symbol not found

    The symbol __register_frame_info is not part of zlib, it is generated by
    the C compiler (cc or gcc). You must recompile applications using zlib
    which have this problem. This problem is specific to Solaris. See
    http://www.sunfreeware.com for Solaris versions of zlib and applications
    using zlib.

18. Why does gzip give an error on a file I make with compress/deflate?

    The compress and deflate functions produce data in the zlib format, which
    is different and incompatible with the gzip format. The gz* functions in
    zlib on the other hand use the gzip format. Both the zlib and gzip
    formats use the same compressed data format internally, but have different
    headers and trailers around the compressed data.

19. Ok, so why are there two different formats?

    The gzip format was designed to retain the directory information about
    a single file, such as the name and last modification date. The zlib
    format on the other hand was designed for in-memory and communication
    channel applications, and has a much more compact header and trailer and
    uses a faster integrity check than gzip.

20. Well that's nice, but how do I make a gzip file in memory?

    You can request that deflate write the gzip format instead of the zlib
    format using deflateInit2(). You can also request that inflate decode
    the gzip format using inflateInit2(). Read zlib.h for more details.

21. Is zlib thread-safe?

    Yes. However any library routines that zlib uses and any application-
    provided memory allocation routines must also be thread-safe. zlib's gz*
    functions use stdio library routines, and most of zlib's functions use the
    library memory allocation routines by default. zlib's Init functions allow
    for the application to provide custom memory allocation routines.

    Of course, you should only operate on any given zlib or gzip stream from a
    single thread at a time.

22. Can I use zlib in my commercial application?

    Yes. Please read the license in zlib.h.

23. Is zlib under the GNU license?

    No. Please read the license in zlib.h.

24. The license says that altered source versions must be "plainly marked". So

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -