summaryrefslogtreecommitdiffstats
path: root/Tests/FindBZip2/Test/main.c
blob: 8e24c94e60da57bfc1260f4582e6d59901e660b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include <bzlib.h>
#include <stdio.h>
#include <stdlib.h>

int main()
{
  int chunksize = 1024;
  FILE* file = fopen("test.bzip2", "wb");
  char* buf = malloc(sizeof(char) * chunksize);
  int error, rsize;
  unsigned int in, out;
  BZFILE* bzfile = BZ2_bzWriteOpen(&error, file, 64, 1, 10);

  /* Don't actually write anything for the purposes of the test */

  BZ2_bzWriteClose(&error, bzfile, 1, &in, &out);
  free(buf);
  fclose(file);

  remove("test.bzip2");

  return 0;
}