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

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -