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.12 1997/10/14 01:12:23 grubba Exp $"); + RCSID("$Id: zlibmod.c,v 1.13 1997/10/21 17:44:21 grubba 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:89:   }      static int do_deflate(dynamic_buffer *buf,    struct zipper *this,    int flush)   {    int fail=0;       THREADS_ALLOW();    mt_lock(& this->lock); +  THREADS_DISALLOW();    if(!this->gz.state)    {    fail=Z_STREAM_ERROR;    }else{    do    {    char *loc;    int ret;    loc=low_make_buf_space(BUF,buf); -  +  THREADS_ALLOW();    this->gz.next_out=(Bytef *)loc;    this->gz.avail_out=BUF;    ret=deflate(& this->gz, flush); -  +  THREADS_DISALLOW();    low_make_buf_space(-this->gz.avail_out,buf);    if(ret != Z_OK)    {    fail=ret;    break;    }    } while(!this->gz.avail_out || flush==Z_FINISH || this->gz.avail_in);    }       mt_unlock(& this->lock); -  THREADS_DISALLOW(); +     return fail;   }      static void gz_deflate(INT32 args)   {    struct pike_string *data;    int flush, fail;    struct zipper *this=THIS;    dynamic_buffer buf;