Return TypeFunction nameArguments
hzEcodeGunzip(hzChain&,const hzChain&,)

Declared in file: hzCodec.h
Defined in file : hzCodec.cpp

Function Logic:

0:START 1:tmp buf 0 n 2:!zi.eof(); 3:tmp 4:infstream infstream infstream hzChain::Size infstream infstream infstream infstream 5:inflateInit2(&infstream,31)!=Z_OK 6:Return E_NOINIT 7:items items n 8:n 9:hzChain::AddByte 10:tmp buf 11:Return E_OK

Function body:

hzEcode Gunzip (hzChain& orig, const hzChain& gzipped)
{
   _hzfunc(__func__) ;
   z_stream    infstream ;
   chIter      zi ;
   char*       tmp ;
   char*       buf ;
   uint32_t    n ;
   tmp = new char[gzipped.Size()+1];
   buf = new char[20480];
   for (n = 0,zi = gzipped ; !zi.eof() ; n++, zi++)
       tmp[n] = *zi ;
   infstream.zalloc = Z_NULL;
   infstream.zfree = Z_NULL;
   infstream.opaque = Z_NULL;
   //  setup "b" as the input and "c" as the compressed output
   infstream.avail_in = (uInt) gzipped.Size() ;
   infstream.next_in = (Bytef*)tmp ;               //  input char array
   infstream.avail_out = 20480;
   infstream.next_out = (Bytef*)buf ;              //  output char array
   //  the actual DE-compression work.
   if (inflateInit2(&infstream, 31)!=Z_OK)
       return E_NOINIT ;
   inflate(&infstream, Z_NO_FLUSH);
   inflateEnd(&infstream);
   for (n = 0; n < infstream.total_out ; n++)
       orig.AddByte(buf[n]) ;
   delete tmp ;
   delete buf ;
   return E_OK ;
}