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.35 2001/01/05 18:34:06 grubba Exp $"); + RCSID("$Id: zlibmod.c,v 1.36 2001/01/23 18:05:08 hubbe 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:186:    *!    *! @seealso    *! @[Gz.inflate->inflate()]    */   static void gz_deflate(INT32 args)   {    struct pike_string *data;    int flush, fail;    struct zipper *this=THIS;    dynamic_buffer buf; +  ONERROR err;       if(!THIS->gz.state)    Pike_error("gz_deflate not initialized or destructed\n");       if(args<1)    Pike_error("Too few arguments to gz_deflate->deflate()\n");       if(sp[-args].type != T_STRING)    Pike_error("Bad argument 1 to gz_deflate->deflate()\n");   
pike.git/src/modules/Gz/zlibmod.c:225:    }    }else{    flush=Z_FINISH;    }       this->gz.next_in=(Bytef *)data->str;    this->gz.avail_in = DO_NOT_WARN(data->len);       initialize_buf(&buf);    +  SET_ONERROR(err,toss_buffer,&buf);    fail=do_deflate(&buf,this,flush); -  +  UNSET_ONERROR(err);    pop_n_elems(args);       if(fail != Z_OK && fail != Z_STREAM_END)    {    free(buf.s.str);    if(THIS->gz.msg)    Pike_error("Error in gz_deflate->deflate(): %s\n",THIS->gz.msg);    else    Pike_error("Error in gz_deflate->deflate(): %d\n",fail);    }
pike.git/src/modules/Gz/zlibmod.c:353:    *!    *! @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;       if(!THIS->gz.state)    Pike_error("gz_inflate not initialized or destructed\n");       if(args<1)    Pike_error("Too few arguments to gz_inflate->inflate()\n");       if(sp[-args].type != T_STRING)    Pike_error("Bad argument 1 to gz_inflate->inflate()\n");       data=sp[-args].u.string;       this->gz.next_in=(Bytef *)data->str;    this->gz.avail_in = DO_NOT_WARN(data->len);       initialize_buf(&buf); -  +  SET_ONERROR(err,toss_buffer,&buf);    fail=do_inflate(&buf,this,Z_PARTIAL_FLUSH);    pop_n_elems(args); -  +  UNSET_ONERROR(err);       if(fail != Z_OK && fail != Z_STREAM_END)    {    free(buf.s.str);    if(THIS->gz.msg)    Pike_error("Error in gz_inflate->inflate(): %s\n",THIS->gz.msg);    else    Pike_error("Error in gz_inflate->inflate(): %d\n",fail);    }    push_string(low_free_buf(&buf));