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.74 2006/08/02 20:53:55 mast Exp $ + || $Id: zlibmod.c,v 1.75 2006/08/02 21:40:48 mast 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:212:    return ret;   }      static void free_pack(struct zipper *z)   {    deflateEnd(&z->gz);    mt_destroy(&z->lock);    toss_buffer((dynamic_buffer *)z->gz.opaque);   }    - void pack(struct pike_string *data, dynamic_buffer *buf, + void zlibmod_pack(struct pike_string *data, dynamic_buffer *buf,    int level, int strategy, int wbits)   {    struct zipper z;    ONERROR err;    int ret;       if(level < Z_NO_COMPRESSION ||    level > Z_BEST_COMPRESSION)    Pike_error("Compression level out of range for pack. %d %d %d\n",    Z_DEFAULT_COMPRESSION, Z_NO_COMPRESSION, Z_BEST_COMPRESSION);
pike.git/src/modules/Gz/zlibmod.c:292:    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);       if( raw )    wbits = -wbits;    -  pack(data, &buf, level, strategy, wbits); +  zlibmod_pack(data, &buf, level, strategy, wbits);       pop_n_elems(args);    push_string(low_free_buf(&buf));   }      /*! @decl string deflate(string data, int|void flush)    *!    *! This function performs gzip style compression on a string @[data] and    *! returns the packed data. Streaming can be done by calling this    *! function several times and concatenating the returned data.
pike.git/src/modules/Gz/zlibmod.c:787: Inside #if defined(HAVE_ZLIB_H)
   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);       PIKE_MODULE_EXPORT(Gz, crc32); -  PIKE_MODULE_EXPORT(Gz, pack); +  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)   /* Super-special kluge for IRIX 6.3 */   #ifdef HAVE___VTBL__9TYPE_INFO   extern void __vtbl__9type_info(void);