diff options
Diffstat (limited to 'example.c')
-rw-r--r-- | example.c | 24 |
1 files changed, 15 insertions, 9 deletions
@@ -13,7 +13,7 @@ | |||
13 | #endif | 13 | #endif |
14 | 14 | ||
15 | #ifndef __GO32__ | 15 | #ifndef __GO32__ |
16 | extern void exit __P((int)); | 16 | extern void exit OF((int)); |
17 | #endif | 17 | #endif |
18 | 18 | ||
19 | #define BUFLEN 4096 | 19 | #define BUFLEN 4096 |
@@ -31,13 +31,18 @@ extern void exit __P((int)); | |||
31 | } \ | 31 | } \ |
32 | } | 32 | } |
33 | 33 | ||
34 | char *hello = "hello world"; | 34 | char *hello = "hello, hello!"; |
35 | /* "hello world" would be more standard, but the repeated "hello" | ||
36 | * stresses the compression code better, sorry... | ||
37 | */ | ||
35 | 38 | ||
36 | void test_compress __P((void)); | 39 | void test_compress OF((void)); |
37 | void test_gzio __P((char *out, char *in)); | 40 | void test_gzio OF((char *out, char *in)); |
38 | void test_deflate __P((Byte compr[])); | 41 | void test_deflate OF((Byte compr[])); |
39 | void test_inflate __P((Byte compr[])); | 42 | void test_inflate OF((Byte compr[])); |
40 | void main __P((int argc, char *argv[])); | 43 | void test_flush OF((Byte compr[])); |
44 | void test_sync OF((Byte compr[])); | ||
45 | int main OF((int argc, char *argv[])); | ||
41 | 46 | ||
42 | /* =========================================================================== | 47 | /* =========================================================================== |
43 | * Test compress() and uncompress() | 48 | * Test compress() and uncompress() |
@@ -262,7 +267,7 @@ void test_sync(compr) | |||
262 | * Usage: example [output.gz [input.gz]] | 267 | * Usage: example [output.gz [input.gz]] |
263 | */ | 268 | */ |
264 | 269 | ||
265 | void main(argc, argv) | 270 | int main(argc, argv) |
266 | int argc; | 271 | int argc; |
267 | char *argv[]; | 272 | char *argv[]; |
268 | { | 273 | { |
@@ -272,7 +277,7 @@ void main(argc, argv) | |||
272 | fprintf(stderr, "incompatible zlib version\n"); | 277 | fprintf(stderr, "incompatible zlib version\n"); |
273 | exit(1); | 278 | exit(1); |
274 | 279 | ||
275 | } else if (strcmp(zlib_version, ZLIB_VERSION) != 0) { | 280 | } else if (zstrcmp(zlib_version, ZLIB_VERSION) != 0) { |
276 | fprintf(stderr, "warning: different zlib version\n"); | 281 | fprintf(stderr, "warning: different zlib version\n"); |
277 | } | 282 | } |
278 | test_compress(); | 283 | test_compress(); |
@@ -287,4 +292,5 @@ void main(argc, argv) | |||
287 | test_sync(compr); | 292 | test_sync(compr); |
288 | 293 | ||
289 | exit(0); | 294 | exit(0); |
295 | return 0; /* to avoid warning */ | ||
290 | } | 296 | } |