Exemplo n.º 1
0
static int
zlib125_inflate(WZStream *wstrm, int flush)
{
   auto zstrm = getZStream(wstrm);
   zstrm->next_in = wstrm->next_in;
   zstrm->avail_in = wstrm->avail_in;
   zstrm->total_in = wstrm->total_in;

   zstrm->next_out = wstrm->next_out;
   zstrm->avail_out = wstrm->avail_out;
   zstrm->total_out = wstrm->total_out;

   zstrm->data_type = wstrm->data_type;
   zstrm->adler = wstrm->adler;

   auto result = inflate(zstrm, flush);

   wstrm->next_in = zstrm->next_in;
   wstrm->avail_in = zstrm->avail_in;
   wstrm->total_in = zstrm->total_in;

   wstrm->next_out = zstrm->next_out;
   wstrm->avail_out = zstrm->avail_out;
   wstrm->total_out = zstrm->total_out;

   wstrm->data_type = zstrm->data_type;
   wstrm->adler = zstrm->adler;

   return result;
}
Exemplo n.º 2
0
static int
zlib125_inflate(WZStream *wstrm, int flush)
{
   //assert(wstrm->zalloc == nullptr);
   //assert(wstrm->zfree == nullptr);
   //assert(wstrm->opaque == nullptr);

   auto zstrm = getZStream(wstrm);
   zstrm->next_in = wstrm->next_in;
   zstrm->avail_in = wstrm->avail_in;
   zstrm->total_in = wstrm->total_in;

   zstrm->next_out = wstrm->next_out;
   zstrm->avail_out = wstrm->avail_out;
   zstrm->total_out = wstrm->total_out;

   zstrm->data_type = wstrm->data_type;
   zstrm->adler = wstrm->adler;
   
   auto result = inflate(zstrm, flush);

   wstrm->next_in = zstrm->next_in;
   wstrm->avail_in = zstrm->avail_in;
   wstrm->total_in = zstrm->total_in;

   wstrm->next_out = zstrm->next_out;
   wstrm->avail_out = zstrm->avail_out;
   wstrm->total_out = zstrm->total_out;

   wstrm->data_type = zstrm->data_type;
   wstrm->adler = zstrm->adler;

   return result;
}
Exemplo n.º 3
0
static int
zlib125_inflateEnd(WZStream *wstrm)
{
   auto zstrm = getZStream(wstrm);
   auto result = inflateEnd(zstrm);
   eraseZStream(wstrm);
   return result;
}
Exemplo n.º 4
0
static int
zlib125_inflateInit2_(WZStream *wstrm, int windowBits, const char *version, int stream_size)
{
   assert(sizeof(WZStream) == stream_size);

   auto zstrm = getZStream(wstrm);
   auto result = inflateInit2_(zstrm, windowBits, version, sizeof(z_stream));

   wstrm->msg = nullptr;

   return result;
}