9 int main(int argc, char *argv[])
16 struct wimlib_decompressor *d;
19 fd = open(argv[1], O_RDONLY);
21 ret = fstat(fd, &stbuf);
24 if (stbuf.st_size < 1)
26 ret = read(fd, &ctype, 1);
28 ctype = 1 + ((uint8_t)(ctype - 1) % 3); /* 1-3 */
29 csize = stbuf.st_size - 1;
32 cdata = malloc(csize);
33 udata = malloc(uspace);
35 ret = read(fd, cdata, csize);
38 ret = wimlib_create_decompressor(ctype, uspace, &d);
40 wimlib_decompress(cdata, csize, udata, uspace, d);
44 wimlib_free_decompressor(d);