I want my program to be able to use zlib, lzma, lzo and bzip2 compression algorithms.
Is there any compression library for C which simlifies working with multiple algorithms (like libmcrypt supporting multiple encryption modes and algorithms)?
Expecting something like this:
struct compressor c;
universal_compressor_init(&c, "lzma", 7 /* compression level */);
universal_compressor_compress(&c, inputbuf, inputsize, outputbuf, &outputsize);
universal_compressor_save_state(&c, statebuf, &statesize);
Note: It is not about zip/rar/7z/tar/cpio and other archive formats, it's about compression of raw buffers. Think of compressed networking protocol or about random access to compressed block device (like cloop).