Branch: Tag:

2003-03-30

2003-03-30 19:02:39 by Per Hedbor <ph@opera.com>

It's now possible to specify the extra argument to inflateInit2 by calling Gz.inflate() with an argument. Specifically, if you want to uncompress PKZIP-compressed data, you have to specify -15 as the argument, what negative arguments does is somewhat undocumented in the .h-file at least. Positive arguments set the maximum dictionary size though. Documenting this is probably not nessesary, however.

Rev: src/modules/Gz/zlibmod.c:1.60

2:   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: zlibmod.c,v 1.59 2002/11/25 11:39:37 grubba Exp $ + || $Id: zlibmod.c,v 1.60 2003/03/30 19:02:39 per Exp $   */      #include "global.h" - RCSID("$Id: zlibmod.c,v 1.59 2002/11/25 11:39:37 grubba Exp $"); + RCSID("$Id: zlibmod.c,v 1.60 2003/03/30 19:02:39 per Exp $");      #include "zlib_machine.h"   #include "module.h"
312:    *! @[deflate]    */    - /*! @decl void create() + /*! @decl void create(int|void magic)    */   static void gz_inflate_create(INT32 args)   {
328:    THIS->gz.zalloc=Z_NULL;    THIS->gz.zfree=Z_NULL;    THIS->gz.opaque=(void *)THIS; -  +  if( args && Pike_sp[-1].type == PIKE_T_INT ) +  { +  tmp=inflateInit2(& THIS->gz, Pike_sp[-1].u.integer); +  } +  else +  {    pop_n_elems(args); -  +  tmp=inflateInit( &THIS->gz ); +  }   /* mt_lock(& THIS->lock); */ -  tmp=inflateInit(& THIS->gz); +    /* mt_unlock(& THIS->lock); */    switch(tmp)    {