Thread: zlib source code

  1. #1
    Registered User
    Join Date
    Nov 2008
    Posts
    10

    Zlib open source

    I am trying to understand zlib source code.But I am facing so many problemn.
    1. In the file "deflate.c " also in other file data type "z_streamp" is used but could not under stand this.Please help me to understand .
    2. In deflate.c file I get code
    local void fill_window OF((deflate_state *s));
    I could not understand the use of "OF".
    Tell about this line in details

  2. #2
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    My guess would be that OF() is a macro that allows "classic (K&R)" and "ansi" prototypes.

    As to what z_streamp, I have no idea, but it sounds like an implementation of "file streams".

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  3. #3
    Registered User
    Join Date
    Nov 2008
    Posts
    10

    zlib source code

    I want to understand the zlib code (zlib source code, version 1.2.3, tar.bz2 format (415K, MD5 checksum dee233bf288ee795ac96a98cc2e369b6) ) but it is not easy for me to understand by myself.If there is any guide book or material so that I can understand properly plz infrom me

  4. #4
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    Quote Originally Posted by indrajit_muk View Post
    I want to understand the zlib code...If there is any guide book or material...
    I'm going to guess and say that at this point in time you cannot do what you want to do, at least not without some very thorough guide material. I'm going to guess again and say that no one will have written such a thing, but I could be wrong.

    Is this because you want to learn C? I am sure there is no other real way to understand the zlib code. But you will have to do that first.
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

  5. #5
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    This thread is a duplicate of another zlib code question (well, more or less the same at least).

    zlib is certainly not good learning material, as it is meant to run on just about any OS using just about any processor architecture, and that in itself is pretty messy.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  6. #6
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    The threads have been merged.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How do you call another source code file?
    By nifear4 in forum C Programming
    Replies: 2
    Last Post: 10-28-2008, 12:16 PM
  2. DxEngine source code
    By Sang-drax in forum Game Programming
    Replies: 5
    Last Post: 06-26-2003, 05:50 PM
  3. Lines from Unix's source code have been copied into the heart of Linux????
    By zahid in forum A Brief History of Cprogramming.com
    Replies: 13
    Last Post: 05-19-2003, 03:50 PM
  4. Interface Question
    By smog890 in forum C Programming
    Replies: 11
    Last Post: 06-03-2002, 05:06 PM
  5. Source Code Beautifier
    By Hammer in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 05-05-2002, 09:21 PM