pike.git
/
src
/
modules
/
zlibmod
/
zlibmod.c
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/src/modules/zlibmod/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.
1
1996/11/
16
05
:
17
:
15
hubbe Exp $");
+
RCSID("$Id: zlibmod.c,v 1.
2
1996/11/
23
00
:
09
:
58
hubbe Exp $");
#include "zlib_machine.h" #include "types.h" #if !defined(HAVE_LIBZ) && !defined(HAVE_LIBGZ) #undef HAVE_ZLIB_H #endif #ifdef HAVE_ZLIB_H
pike.git/src/modules/zlibmod/zlibmod.c:152:
case Z_PARTIAL_FLUSH: case Z_FINISH: case Z_SYNC_FLUSH: case Z_NO_FLUSH: break; defualt: error("Argument 2 to gz_deflate->deflate() out of range.\n"); } }else{
-
flush=Z_
NO_FLUSH
;
+
flush=Z_
FINISH
;
} this->gz.next_in=(Bytef *)data->str; this->gz.avail_in=data->len; fail=do_deflate(&buf,this,flush); pop_n_elems(args); if(fail != Z_OK && fail != Z_STREAM_END) {
pike.git/src/modules/zlibmod/zlibmod.c:196:
mt_lock(& THIS->lock); deflateEnd(&THIS->gz); mt_unlock(& THIS->lock); } /*******************************************************************/ static void gz_inflate_create(INT32 args) {
-
int
level
;
+
int
tmp
;
if(THIS->gz.state) { mt_lock(this->lock); inflateEnd(&THIS->gz); mt_unlock(this->lock); } THIS->gz.zalloc=Z_NULL; THIS->gz.zfree=Z_NULL; THIS->gz.opaque=THIS; pop_n_elems(args); mt_lock(THIS->lock);
-
level
=inflateInit(& THIS->gz);
+
tmp
=inflateInit(& THIS->gz);
mt_unlock(THIS->lock);
-
switch(
level
)
+
switch(
tmp
)
{ case Z_OK: return; case Z_VERSION_ERROR: error("libz not compatible with zlib.h!!!\n"); break; default: if(THIS->gz.msg)
pike.git/src/modules/zlibmod/zlibmod.c:298:
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); } push_string(low_free_buf(&buf));
-
if(fail =
=
Z_STREAM_END && !sp[-1].u.string->len)
+
if(fail
!
= Z_STREAM_END &&
fail
!
=Z_OK && !
sp[-1].u.string->len)
{ pop_stack(); push_int(0); } } static void init_gz_inflate(struct object *o) { mt_init(THIS->locked); MEMSET(& THIS->gz, 0, sizeof(THIS->gz));