main.c 479 B

1234567891011121314151617181920212223
  1. #include <bzlib.h>
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4. int main()
  5. {
  6. int chunksize = 1024;
  7. FILE* file = fopen("test.bzip2", "wb");
  8. char* buf = malloc(sizeof(char) * chunksize);
  9. int error, rsize;
  10. unsigned int in, out;
  11. BZFILE* bzfile = BZ2_bzWriteOpen(&error, file, 64, 1, 10);
  12. /* Don't actually write anything for the purposes of the test */
  13. BZ2_bzWriteClose(&error, bzfile, 1, &in, &out);
  14. free(buf);
  15. fclose(file);
  16. remove("test.bzip2");
  17. return 0;
  18. }