Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2013-07

what is the FPC equivalent of Delphi's zlib unit?

10 messages · 6 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Michael Van Canneyt
to Dennis Poon

There are 3 options:

paszlib.pas pascal implementation of libz.

zstream.pp stream interface, uses paszlib.

zlib.pp native interface to C libz library.

Michael.

Dennis Poon wrote 7 lines
I need to use CompressBuf and DecompressBuf of zlib in fpc. Thanks, Dennis

Reply by email

Graeme Geldenhuys
to Dennis Poon: I need to use CompressBuf and DecompressBuf of zlib in fpc. Dennis
Dennis Poon wrote
I need to use CompressBuf and DecompressBuf of zlib in fpc.

Exactly what Michael said, plus take a look at the dzlib.pas unit included in the tiOPF project (available on SourceForge) in the "Options' directory. It's a FPC & Delphi compatible zlib unit.

While you are there, it might be worth looking at the tiCompress and tiCompressZLib units too. They give a very easy to use API interface to compresssing buffers, streams, strings and files etc.

Regards,
- Graeme -

Reply by email

Mark Morgan Lloyd
to Michael Van Canneyt: There are 3 options: paszlib.pas pascal implementation of libz. zstream.pp stream…
Michael Van Canneyt wrote 7 lines
There are 3 options: paszlib.pas pascal implementation of libz. zstream.pp stream interface, uses paszlib. zlib.pp native interface to C libz library.

Is any one of those more "natural" than the rest, because e.g. it's already used for GIF handling?

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

Dmitry Boyarintsev
to Mark Morgan Lloyd

GIF or PNG?
PNG is using deflate algorithm.
GIF is using its own.

On Sun, Jul 28, 2013 at 4:53 PM, Mark Morgan Lloyd <

Show quoted text 26 lines
wrote: Michael Van Canneyt wrote: > There are 3 options: > > paszlib.pas pascal implementation of libz. > > zstream.pp stream interface, uses paszlib. > > zlib.pp native interface to C libz library. > Is any one of those more "natural" than the rest, because e.g. it's already used for GIF handling? -- Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues] ______________________________**_________________ fpc-pascal maillist - http://lists.freepascal.org/**mailman/listinfo/fpc-pascal<http://lists.freepascal.org/mailman/listinfo/fpc-pascal>

Reply by email

Dennis Poon
to Michael Van Canneyt: There are 3 options: paszlib.pas pascal implementation of libz. zstream.pp stream…

thanks a lot.

Dennis

Michael Van Canneyt wrote 31 lines
There are 3 options: paszlib.pas pascal implementation of libz. zstream.pp stream interface, uses paszlib. zlib.pp native interface to C libz library. Michael. On Mon, 29 Jul 2013, Dennis Poon wrote: > I need to use CompressBuf and DecompressBuf of zlib in fpc. > > Thanks, > > Dennis > > _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal ----- No virus found in this message. Checked by AVG - www.avg.com Version: 2013.0.3349 / Virus Database: 3209/6527 - Release Date: 07/28/13

Reply by email

Michael Van Canneyt
to Mark Morgan Lloyd: Is any one of those more "natural" than the rest, because e.g. it's already used for GIF…
Mark Morgan Lloyd wrote 11 lines
Michael Van Canneyt wrote: > There are 3 options: > > paszlib.pas pascal implementation of libz. > > zstream.pp stream interface, uses paszlib. > > zlib.pp native interface to C libz library. Is any one of those more "natural" than the rest, because e.g. it's already used for GIF handling?

Not to my knowledge.

Michael.

Reply by email

Reinier Olislagers
to Mark Morgan Lloyd: Is any one of those more "natural" than the rest, because e.g. it's already used for GIF…
Mark Morgan Lloyd wrote 11 lines
Michael Van Canneyt wrote: > There are 3 options: > > paszlib.pas pascal implementation of libz. > > zstream.pp stream interface, uses paszlib. > > zlib.pp native interface to C libz library. Is any one of those more "natural" than the rest, because e.g. it's already used for GIF handling?

paszlib/zstream
http://wiki.lazarus.freepascal.org/paszlib
used for zip support in FPC (TZipper).

Reply by email

Dennis Poon
to Reinier Olislagers

Please help. I am using Delphi 5's zlib procedure
CompressBuf(src,SrcLen, Dest, DestLen);
to compress data to be decompressed by FPC's paszlib unit, but I don't know which one of the many procedure is the right right to use? I tried uncompress(Dest, DestLen, Src, SrcLen) but it is obviously wrong. It is urgent. Thanks a lot in advance.

Dennis

Reinier Olislagers wrote 30 lines
On 28/07/2013 22:53, Mark Morgan Lloyd wrote: > Michael Van Canneyt wrote: > >> There are 3 options: >> >> paszlib.pas pascal implementation of libz. >> >> zstream.pp stream interface, uses paszlib. >> >> zlib.pp native interface to C libz library. >> > Is any one of those more "natural" than the rest, because e.g. it's > already used for GIF handling? > paszlib/zstream http://wiki.lazarus.freepascal.org/paszlib used for zip support in FPC (TZipper). _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal ----- No virus found in this message. Checked by AVG - www.avg.com Version: 2013.0.3349 / Virus Database: 3209/6528 - Release Date: 07/28/13

Reply by email

Michael Van Canneyt
to Dennis Poon
Dennis Poon wrote
Please help. I am using Delphi 5's zlib procedure   CompressBuf(src,SrcLen, Dest, DestLen); to compress data to be decompressed by FPC's paszlib unit, but I don't know which one of the many procedure is the right right to use? I tried uncompress(Dest, DestLen, Src, SrcLen) but it is obviously wrong. It is urgent. Thanks a lot in advance.

There is no direct replacement for this routine.

function compress (dest : Pbyte;
                    var destLen : cardinal;
                    const source : array of Byte;
                    sourceLen : cardinal) : integer;

from the zcompres unit probably comes closest.

Michael.

Reply by email