blob: 8284108bb4146dd944feb362e6a185a34871dc5b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
#include "fitz.h"
#include "samus.h"
int main(int argc, char **argv)
{
fz_error *error;
fz_buffer *buf;
sa_zip *zip;
int i;
error = sa_openzip(&zip, argv[1]);
if (error)
fz_abort(error);
if (argc == 2)
sa_debugzip(zip);
for (i = 2; i < argc; i++)
{
error = sa_openzipstream(zip, argv[i]);
if (error)
fz_abort(error);
error = fz_readfile(&buf, zip->file);
if (error)
fz_abort(error);
sa_closezipstream(zip);
fwrite(buf->rp, 1, buf->wp - buf->rp, stdout);
fz_dropbuffer(buf);
}
sa_closezip(zip);
return 0;
}
|