pike.git / src / modules / Gz / zlibmod.c

version» Context lines:

pike.git/src/modules/Gz/zlibmod.c:66:    *! available when Pike was compiled.    *!    *! Note that although these functions use the same @i{algorithm@} as    *! @tt{gzip@}, they do not use the exact same format, so you cannot directly    *! unzip gzipped files with these routines. Support for this will be    *! added in the future.    */      /*! @class deflate    *! -  *! Gz_deflate is a builtin program written in C. It interfaces the -  *! packing routines in the libz library. +  *! This class interfaces with the compression routines in the libz +  *! library.    *!    *! @note    *! This class is only available if libz was available and found when    *! Pike was compiled.    *!    *! @seealso -  *! @[Gz.inflate()] +  *! @[Gz.inflate()], @[Gz.compress()], @[Gz.uncompress()]    */      /*! @decl void create(int(-9..9)|void level, int|void strategy,@    *! int(8..15)|void window_size)    *! @decl void create(mapping options)    *!    *! This function can also be used to re-initialize a Gz.deflate object    *! so it can be re-used.    *!    *! If a mapping is passed as the only argument, it will accept the
pike.git/src/modules/Gz/zlibmod.c:458:    *! @value FIXED    *! In this mode dynamic huffman codes are disabled, allowing for    *! a simpler decoder for special applications. This mode is not    *! available in all zlib versions.    *! @endint    *!    *! @param window_size    *! Defines the size of the LZ77 window from 256 bytes to 32768    *! bytes, expressed as 2^x.    *! +  *! @seealso +  *! @[deflate], @[inflate], @[uncompress]    */   static void gz_compress(INT32 args)   {    struct pike_string *data;    dynamic_buffer buf;    ONERROR err;       int wbits = 15;    int raw = 0;    int level = 8;
pike.git/src/modules/Gz/zlibmod.c:619:    mt_destroy( & THIS->lock );   }      /*! @endclass    */      /*******************************************************************/      /*! @class inflate    *! -  *! Gz_deflate is a builtin program written in C. It interfaces the -  *! unpacking routines in the libz library. +  *! This class interfaces with the uncompression routines in the libz library.    *!    *! @note    *! This program is only available if libz was available and found when    *! Pike was compiled.    *!    *! @seealso -  *! @[deflate] +  *! @[deflate], @[compress], @[uncompress]    */      /*! @decl void create(int|void window_size)    *! @decl void create(mapping options)    *!    *! If called with a mapping as only argument, @expr{create@} accepts -  *! the entries @expr{window_size@} (described below) and @expr{dictionary@}, -  *! which is a string to be set as dictionary. +  *! the entries @expr{window_size@} (described below) and +  *! @expr{dictionary@}, which is a string to be set as dictionary.    *!    *! The window_size value is passed down to inflateInit2 in zlib.    *!    *! If the argument is negative, no header checks are done, and no    *! verification of the data will be done either. This is needed for    *! uncompressing ZIP-files, as an example. The negative value is then    *! negated, and handled as a positive value.    *!    *! Positive arguments set the maximum dictionary size to an exponent    *! of 2, such that 8 (the minimum) will cause the window size to be
pike.git/src/modules/Gz/zlibmod.c:657:    *! 32Kb. Setting this to anything except 15 is rather pointless in    *! Pike.    *!    *! It can be used to limit the amount of memory that is used to    *! uncompress files, but 32Kb is not all that much in the great    *! scheme of things.    *!    *! To decompress files compressed with level 9 compression, a 32Kb    *! window size is needed. level 1 compression only requires a 256    *! byte window. +  *! +  *! If the @[options] version is used you can specify your own dictionary in addition to the window size. +  *! +  *! @mapping options +  *! @member string dictionary +  *! @member int window_size +  *! @endmapping    */   static void gz_inflate_create(INT32 args)   {    int tmp, *tmp_p = &tmp;    if(THIS->gz.state)    {   /* mt_lock(& THIS->lock); */    inflateEnd(&THIS->gz);   /* mt_unlock(& THIS->lock); */    }
pike.git/src/modules/Gz/zlibmod.c:909:   /*! @class inflate    */      /*! @decl string(8bit) inflate(string(8bit) data)    *!    *! This function performs gzip style decompression. It can inflate    *! a whole file at once or in blocks.    *!    *! @example    *! // whole file +  *! @code    *! write(Gz.inflate()->inflate(stdin->read(0x7fffffff));    *!    *! // streaming (blocks)    *! function inflate=Gz.inflate()->inflate;    *! while(string s=stdin->read(8192))    *! write(inflate(s)); -  +  *! @endcode    *!    *! @seealso -  *! @[Gz.deflate->deflate()] +  *! @[Gz.deflate->deflate()], @[Gz.decompress]    */   static void gz_inflate(INT32 args)   {    struct pike_string *data;    int fail;    struct zipper *this=THIS;    dynamic_buffer buf;    ONERROR err;       if(!THIS->gz.state)