2 * Copyright (c) 2000,2001,2002 Guido Draheim <guidod@gmx.de>
3 * Use freely under the restrictions of the ZLIB License
14 static const char usage
[] =
17 " - prints the file to stdout, so you may want to redirect the output; \n"
18 " the file can be a normal file or an inflated part of a zip-archive, \n"
19 " to get 'README' from dist.zip you may write \n"
20 " zzcat dist/README \n"
24 main (int argc
, char ** argv
)
28 if (argc
<= 1 || ! strcmp (argv
[1], "--help"))
33 if (! strcmp (argv
[1], "--version"))
35 printf (__FILE__
" version "ZZIP_PACKAGE
" "ZZIP_VERSION
"\n");
39 for (argn
=1; argn
< argc
; argn
++)
41 ZZIP_FILE
* fp
= zzip_open (argv
[argn
], O_RDONLY
|O_BINARY
);
51 /* read chunks of 16 bytes into buf and print them to stdout */
52 while (0 < (n
= zzip_read(fp
, buf
, 16)))
56 write (STDOUT_FILENO
, buf
, n
);
58 fwrite (buf
, 1, n
, stdout
);
72 * c-file-style: "stroustrup"