Multi-algorithm compression library for C -
i want program able use zlib, lzma, lzo , bzip2 compression algorithms.
is there compression library c simlifies working multiple algorithms (like libmcrypt supporting multiple encryption modes , algorithms)?
expecting 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: not zip/rar/7z/tar/cpio , other archive formats, it's compression of raw buffers. think of compressed networking protocol or random access compressed block device (like cloop).
libarchive fulfills requirements.
from introduction:
the libarchive library features:
- support variety of archive , compression formats.
- robust automatic format detection, including archive/compression combinations such tar.gz. ...
edit: handling raw streams (at least until split libfilter libarchive), consider using boost::iostreams or libbu++ (just found on github)
Comments
Post a Comment