Page 1 of 1

using z-lib from PB (example needed)

Posted: Wed Oct 29, 2003 10:44 pm
by pythagoras_156
Hello everyone,

I'm trying to use z-lib decompression functions from my PB app but i've got problems figuring out how to correctly call the functions contained in zlib.dll.
My problem is that i need to pass a zstream object as a parameter to the zlib inflate() function. How could this zstream object (which is defined inside the zlib.dll) be translated into PB ?
If anyone has an example of calling zlib functions from a PB app, it would really be useful :lol:.

Thanks in advance,

Pythagoras

PS : I've looked at the PBZip library and other way of compression/decompression, but they doesn't suit my need as i'm trying to read inside a single packed file which contain g-zip compressed files.

Posted: Thu Oct 30, 2003 12:12 am
by Num3
Check out the PB ZIP library !

It's supports all zip stuff easly... It's in the Annoucements link

Posted: Thu Oct 30, 2003 1:10 am
by pythagoras_156
Thanks for your reply but i've already looked at the PBZip library which is great but doesn't really suit my needs as i'm reading from a big data file which isn't a canonical zip file. This means i can only work with memory buffers that i fill by reading inside the data file. Correct me if i'm wrong but the PBzip functions don't seem to allow me to decompress from a memory buffer but only from a file.
As I want to do it, i need first to retrieve the compressed data for a certain file at a certain offset, store it in a buffer and decompress from that buffer to another one which i can then use.
I can use the PBzip lib with a hack but it requires to first extract the compressed data from the data file, write it into a temporary file and decompress that file with PBzip into a data buffer. I'm afraid this might be too slow so that's why i want to use z-lib which can decompress data from a memory buffer.

Or maybe i got it all wrong and there's an easier way :wink: ?

pythagoras