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.75 2006/08/02 21:40:48 mast Exp $ + || $Id: zlibmod.c,v 1.76 2007/05/01 20:08:52 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:274:    mt_init(&z.lock);       SET_ONERROR(err,free_pack,&z);    ret = do_deflate(buf, &z, Z_FINISH);    UNSET_ONERROR(err);       deflateEnd(&z.gz);    mt_destroy(&z.lock);   }    - /* @decl string pack(string data, void|int(0..1) raw, void|int level,@ -  * void|int strategy) + /*! @decl string compress(string data, void|int(0..1) raw, @ +  *! void|int(0..9) level, void|int strategy) +  *!    */ - static void gz_pack(INT32 args) + static void gz_compress(INT32 args)   {    struct pike_string *data;    dynamic_buffer buf;       int wbits = 15;    int raw = 0;    int level = 8;    int strategy = Z_DEFAULT_STRATEGY;    -  get_all_args("pack", args, "%n.%d%d%d", &data, &raw, &level, &strategy); +  get_all_args("compress", args, "%n.%d%d%d", &data, &raw, &level, &strategy);       if( raw )    wbits = -wbits;       zlibmod_pack(data, &buf, level, strategy, wbits);       pop_n_elems(args);    push_string(low_free_buf(&buf));   }   
pike.git/src/modules/Gz/zlibmod.c:784: Inside #if defined(HAVE_ZLIB_H)
   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),0);       /* function(string,void|int(0..1),void|int,void|int:string) */ -  ADD_FUNCTION("pack",gz_pack,tFunc(tStr tOr(tVoid,tInt01) tOr(tVoid,tInt) tOr(tVoid,tInt),tStr),0); +  ADD_FUNCTION("compress",gz_compress,tFunc(tStr tOr(tVoid,tInt01) tOr(tVoid,tInt09) tOr(tVoid,tInt),tStr),0);       PIKE_MODULE_EXPORT(Gz, crc32);    PIKE_MODULE_EXPORT(Gz, zlibmod_pack);   #else    if(!TEST_COMPAT(7,6))    HIDE_MODULE();   #endif   }      #if defined(HAVE___VTBL__9TYPE_INFO) || defined(HAVE___T_9__NOTHROW)