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

version» Context lines:

pike.git/src/modules/Gz/zlibmod.c:1:   /*\   ||| This file a part of Pike, and is copyright by Fredrik Hubinette   ||| Pike is distributed as GPL (General Public License)   ||| See the files COPYING and DISCLAIMER for more information.   \*/   /**/   #include "global.h" - RCSID("$Id: zlibmod.c,v 1.41 2001/07/05 01:47:20 hubbe Exp $"); + RCSID("$Id: zlibmod.c,v 1.42 2001/11/18 02:00:22 nilsson Exp $");      #include "zlib_machine.h"      #if !defined(HAVE_LIBZ) && !defined(HAVE_LIBGZ)   #undef HAVE_ZLIB_H   #endif      #ifdef HAVE_ZLIB_H      #include "interpret.h"
pike.git/src/modules/Gz/zlibmod.c:63:    *! 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. +  *! +  *! @note +  *! This program is only available if libz was available and found when +  *! Pike was compiled. +  *!    *! @seealso    *! @[Gz.inflate()]    */      /*! @decl void create(int(0..9)|void X)    *!    *! If given, @[X] should be a number from 0 to 9 indicating the    *! packing / CPU ratio. Zero means no packing, 2-3 is considered 'fast',    *! 6 is default and higher is considered 'slow' but gives better packing.    *!
pike.git/src/modules/Gz/zlibmod.c:283:   /* mt_unlock(& THIS->lock); */    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. +  *! +  *! @note +  *! This program is only available if libz was available and found when +  *! Pike was compiled. +  *! +  *! @seealso +  *! @[deflate]    */      /*! @decl void create()    */   static void gz_inflate_create(INT32 args)   {    int tmp;    if(THIS->gz.state)    {   /* mt_lock(& THIS->lock); */
pike.git/src/modules/Gz/zlibmod.c:388:    }    mt_unlock(& this->lock);    return fail;   }      /*! @decl string inflate(string data)    *!    *! This function performs gzip style decompression. It can inflate    *! a whole file at once or in blocks.    *! +  *! @example +  *! // whole file +  *! write(Gz_inflate()->inflate(stdin->read(0x7fffffff)); +  *! +  *! // streaming (blocks) +  *! function inflate=Gz_inflate()->inflate; +  *! while(string s=stdin->read(8192)) +  *! write(inflate(s)); +  *!    *! @seealso    *! @[Gz.deflate->deflate()]    */   static void gz_inflate(INT32 args)   {    struct pike_string *data;    int fail;    struct zipper *this=THIS;    dynamic_buffer buf;    ONERROR err;