• The added line is THIS COLOR.
  • The deleted line is THIS COLOR.
- http://www.zlib.net/
--  http://www.zlib.net/zlib_tech.html
TITLE:zlib (A Massively Spiffy Yet Delicately Unobtrusive Compression Library)

- http://oku.edu.mie-u.ac.jp/~okumura/compression/zlib.html
- http://www.zlib.net/ 
--  http://www.zlib.net/zlib_tech.html Technical Details

- http://oku.edu.mie-u.ac.jp/~okumura/compression/zlib.html zlib 入門
- http://dencha.ojaru.jp/programs/pg_filer_04_extra_03.html zlib1.2.2 FAQ 訳 


* compress / uncompress [#x10ab7d2]
** compress [#compress]

 compsize = ~; // 圧縮後のサイズより大きな値
 compbuff = malloc(compsize);
 int result = compress(compbuff, &compsize, origbuff, origsize);
 if (result != Z_OK) {
     if (result == Z_MEM_ERROR) {
         fprintf(stderr, "compress: Z_MEM_ERROR: can't malloc\n");
     } else if (result == Z_BUF_ERROR) {
         fprintf(stderr, "compress: Z_BUF_ERROR: not enough buff size\n");
     }
     return 1; // FAILURE
 }

** uncompress [#uncompress]

 origsize = ~;  // 伸張後のサイズより大きな値
 origbuff = malloc(origsize);
 int result = uncompress(origbuff, &origsize, compbuff, compsize);
 if (result != Z_OK) {
     if (result == Z_MEM_ERROR) {
         fprintf(stderr, "uncompress: Z_MEM_ERROR: can't malloc\n");
     } else if (result == Z_BUF_ERROR) {
         fprintf(stderr, "uncompress: Z_BUF_ERROR: not enough buff size\n");
     }
     return 1; // FAILURE
 }

* inflate / defrate [#q681d972]

(予定)


Reload   Diff   Front page List of pages Search Recent changes Backup Referer   Help   RSS of recent changes