2
* Copyright (c) 2001 Guido Draheim <guidod@gmx.de>
3
* Use freely under the restrictions of the ZLIB License
5
* (this example uses errno which might not be multithreaded everywhere)
8
#include <SDL_rwops_zzip.h>
9
#include <stdlib.h> /* exit */
11
/* mostly a copy from zzcat.c */
13
int main (int argc, char** argv)
15
static const char usage[] =
17
" - prints the file to stdout. the file can be a normal file\n"
18
" or an inflated part of a zip-archive \n"
28
for (argn=1; argn < argc; argn++)
32
rwops = SDL_RWFromZZIP (argv[argn], "rb");
41
/* read chunks of 16 bytes into buf and print them to stdout */
42
while (0 < (n = SDL_RWread(rwops, buf, 16, 1)))
46
write (STDOUT_FILENO, buf, n);
48
fwrite (buf, 1, n, stdout);