pike.git / src / modules / Gz / zlibmod.c

version» Context lines:

pike.git/src/modules/Gz/zlibmod.c:1:   /*   || 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.70 2006/01/03 11:31:07 marcus Exp $ + || $Id: zlibmod.c,v 1.71 2006/07/26 17:57:46 nilsson Exp $   */      #include "global.h"   #include "zlib_machine.h"   #include "module.h"   #include "program.h"   #include "module_support.h"      #if !defined(HAVE_LIBZ) && !defined(HAVE_LIBGZ)   #undef HAVE_ZLIB_H
pike.git/src/modules/Gz/zlibmod.c:128:    {    Pike_error("Compression level out of range for gz_deflate->create()\n");    }    }       if(args>1)    {    if(sp[1-args].type != T_INT)    Pike_error("Bad argument 2 to gz->create()\n");    strategy=sp[1-args].u.integer; -  if(strategy != Z_DEFAULT_STRATEGY && strategy != Z_FILTERED && +  if(strategy != Z_DEFAULT_STRATEGY && +  strategy != Z_FILTERED && + #ifdef Z_RLE +  strategy != Z_RLE && + #endif + #ifdef Z_FIXED +  strategy != Z_FIXED && + #endif    strategy != Z_HUFFMAN_ONLY)    {    Pike_error("Invalid compression strategy for gz_deflate->create()\n");    }    }       THIS->gz.zalloc=Z_NULL;    THIS->gz.zfree=Z_NULL;    THIS->gz.opaque=(void *)THIS;   
pike.git/src/modules/Gz/zlibmod.c:653: Inside #if defined(HAVE_ZLIB_H)
   ADD_FUNCTION("create",gz_inflate_create,tFunc(tOr(tInt,tVoid),tVoid),0);    /* function(string:string) */    ADD_FUNCTION("inflate",gz_inflate,tFunc(tStr,tStr),0);    /* function(:string) */    ADD_FUNCTION("end_of_stream",gz_end_of_stream,tFunc(tNone,tStr),0);       add_integer_constant("NO_FLUSH",Z_NO_FLUSH,0);    add_integer_constant("PARTIAL_FLUSH",Z_PARTIAL_FLUSH,0);    add_integer_constant("SYNC_FLUSH",Z_SYNC_FLUSH,0);    add_integer_constant("FINISH",Z_FINISH,0); + #ifdef Z_RLE +  add_integer_constant("RLE", Z_RLE,0); + #endif + #ifdef Z_FIXED +  add_integer_constant("FIXED", Z_FIXED,0); + #endif       set_init_callback(init_gz_inflate);    set_exit_callback(exit_gz_inflate);       end_class("inflate",0);       add_integer_constant("NO_FLUSH",Z_NO_FLUSH,0);    add_integer_constant("PARTIAL_FLUSH",Z_PARTIAL_FLUSH,0);    add_integer_constant("SYNC_FLUSH",Z_SYNC_FLUSH,0);    add_integer_constant("FINISH",Z_FINISH,0);    add_integer_constant("DEFAULT_STRATEGY", Z_DEFAULT_STRATEGY,0);    add_integer_constant("FILTERED", Z_FILTERED,0);    add_integer_constant("HUFFMAN_ONLY", Z_HUFFMAN_ONLY,0); -  + #ifdef Z_RLE +  add_integer_constant("RLE", Z_RLE,0); + #endif + #ifdef Z_FIXED +  add_integer_constant("FIXED", Z_FIXED,0); + #endif       /* function(string,void|int:int) */    ADD_FUNCTION("crc32",gz_crc32,tFunc(tStr tOr(tVoid,tInt),tInt),    OPT_TRY_OPTIMIZE);       PIKE_MODULE_EXPORT(Gz, crc32);   #else    if(!TEST_COMPAT(7,6))    HIDE_MODULE();   #endif