tags:

views:

302

answers:

3

I'm searching for an ultra-light gzip compression/decompression library in C++ (something definitively lighter than zlib) on a libral (BSD, MIT, PD) license. Googling revealed many libraries, but either they are bloated (like GZ compression in Crypto++) or on a more restrictive license.

It's hard to believe for me, that there's no lightweight free gz implementation...

Preferably C++ (I need to have it in the form of a stream) but C would be ok.

A: 

Did you look at CGZip, a C++ wrapper for gzip methods?

kiamlaluno
I don't want to link to zlib.
Kornel Kisielewicz
A: 

zlib utility functions

These are pretty lightweight. Generally all it takes is a single function call, assuming all your data is already in the appropriate buffers, which should be easy enough. If you want something even more lightweight than this (which may not be in the grand scheme of things as you potentially need to manage more dependencies), what klamlaluno posted looks good.

blwy10
as noted before -- I don't want to link to zlib, I want to statically compile *into* my project a barebone lightweight simple gz compression and decompression.
Kornel Kisielewicz
Then why don't you use a static zlib library and link it statically? The linker then will take only the parts of the library that your application uses.
lothar
because I need to distribute the source code of my library also.
Kornel Kisielewicz
zlib's license permits that. I don't see the problem.
greyfade
+5  A: 

Statically linked zlib is probably the lightest you can get, it also has a rather nice and generously permissive license.

If it really isn't light enough, even considering what the linker will strip out, then chopping it down to size yourself might be a viable option.

Autopulated
it's the source distribution size that I'm also concerned about. Ideally I'd like to additionally include two or four additional files with the library.
Kornel Kisielewicz
If the number of source files bother you that much then hacking away at zlib I think you could quite easily combine, for example, all the headers into one or two files, and the implementation files into one or two more.Can I ask why you care about the number of source files so much? It is an unusual requirement.
Autopulated