pike.git
/
src
/
modules
/
Gz
/
zlibmod.c
version
»
Context lines:
10
20
40
80
file
none
3
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.
26
1999/
07
/
15
16
:
58
:
44
hubbe
Exp $");
+
RCSID("$Id: zlibmod.c,v 1.
27
1999/
08
/
20
20
:
04
:
31
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:128:
static void gz_deflate(INT32 args) { struct pike_string *data; int flush, fail; struct zipper *this=THIS; dynamic_buffer buf; if(!THIS->gz.state) error("gz_deflate not initialized or destructed\n");
-
initialize_buf(&buf);
-
+
if(args<1) error("Too few arguments to gz_deflate->deflate()\n"); if(sp[-args].type != T_STRING) error("Bad argument 1 to gz_deflate->deflate()\n"); data=sp[-args].u.string; if(args>1) {
pike.git/src/modules/Gz/zlibmod.c:163:
default: error("Argument 2 to gz_deflate->deflate() out of range.\n"); } }else{ flush=Z_FINISH; } this->gz.next_in=(Bytef *)data->str; this->gz.avail_in=data->len;
+
initialize_buf(&buf);
+
fail=do_deflate(&buf,this,flush); pop_n_elems(args); if(fail != Z_OK && fail != Z_STREAM_END) { free(buf.s.str); if(THIS->gz.msg) error("Error in gz_deflate->deflate(): %s\n",THIS->gz.msg); else error("Error in gz_deflate->deflate(): %d\n",fail);
pike.git/src/modules/Gz/zlibmod.c:280:
static void gz_inflate(INT32 args) { struct pike_string *data; int fail; struct zipper *this=THIS; dynamic_buffer buf; if(!THIS->gz.state) error("gz_inflate not initialized or destructed\n");
-
initialize_buf(&buf);
-
+
if(args<1) error("Too few arguments to gz_inflate->inflate()\n"); if(sp[-args].type != T_STRING) 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=data->len;
-
+
initialize_buf(&buf);
+
fail=do_inflate(&buf,this,Z_PARTIAL_FLUSH); pop_n_elems(args); if(fail != Z_OK && fail != Z_STREAM_END) { free(buf.s.str); if(THIS->gz.msg) error("Error in gz_inflate->inflate(): %s\n",THIS->gz.msg); else error("Error in gz_inflate->inflate(): %d\n",fail);