Debian Codegraph @

libs/zziplib/zziplib-src/bins/zzip.c

raw
1 /*
2 * Copyright (c) 2003 Guido Draheim <[email protected]>
3 * Use freely under the restrictions of the ZLIB license.
4 *
5 * This file is used as an example to clarify zzip api usage.
6 * (the write-api is work in progress, beware)
7 */
8
9 #define _ZZIP_WRITE_SOURCE
10
11 #include <zzip/write.h>
12 #include <stdio.h>
13 #include <string.h>
14 #include "zzipmake-zip.h"
15
16 #ifdef ZZIP_HAVE_UNISTD_H
17 #include <unistd.h>
18 #endif
19 #ifdef ZZIP_HAVE_IO_H
20 #include <io.h>
21 #endif
22
23 static const char usage[] =
24 {
25 "zzip <dir> files... \n"
26 " - zzip the files into a zip area."
27 };
28
29 int
30 main (int argc, char ** argv)
31 {
32 int argn;
33 int exitcode = 0;
34 ZZIP_DIR * dir;
35
36 if (argc <= 1 || ! strcmp (argv[1], "--help"))
37 {
38 printf (usage);
39 return 0;
40 }
41 if (! strcmp (argv[1], "--version"))
42 {
43 # if defined _ZZIP_ENABLE_WRITE
44 printf (__FILE__ " version " ZZIP_PACKAGE_NAME " " ZZIP_PACKAGE_VERSION " - W/ -D_ZZIP_ENABLE_WRITE\n");
45 # else
46 printf (__FILE__ " version " ZZIP_PACKAGE_NAME " " ZZIP_PACKAGE_VERSION " - NO -D_ZZIP_ENABLE_WRITE\n");
47 # endif
48 return 0;
49 }
50
51 return rezzip_make(argc, argv);
52 }
53
54 /*
55 * Local variables:
56 * c-file-style: "stroustrup"
57 * End:
58 */