b20b1725603fee68e7e2a1a786bd8e184b02bc32
[strongswan.git] / src / _copyright / _copyright.c
1 /*
2 * copyright reporter
3 * (just avoids having the info in more than one place in the source)
4 * Copyright (C) 2001 Henry Spencer.
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or (at your
9 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * for more details.
15 */
16
17 #include <sys/types.h>
18 #include <stdio.h>
19 #include <stdlib.h>
20 #include <string.h>
21 #include <unistd.h>
22 #include <getopt.h>
23
24 #include <library.h>
25
26 static const char *copyright[] = {
27 "Copyright (C) 1999-2012",
28 " Henry Spencer, D. Hugh Redelmeier, Michael Richardson, Ken Bantoft,",
29 " Stephen J. Bevan, JuanJo Ciarlante, Thomas Egerer, Heiko Hund,",
30 " Mathieu Lafon, Stephane Laroche, Kai Martius, Stephan Scholz,",
31 " Tuomo Soini, Herbert Xu.",
32 "",
33 " Martin Berner, Marco Bertossa, David Buechi, Ueli Galizzi,",
34 " Christoph Gysin, Andreas Hess, Patric Lichtsteiner, Michael Meier,",
35 " Andreas Schleiss, Ariane Seiler, Mario Strasser, Lukas Suter,",
36 " Roger Wegmann, Simon Zwahlen,",
37 " ZHW Zuercher Hochschule Winterthur (Switzerland).",
38 "",
39 " Philip Boetschi, Tobias Brunner, Sansar Choinyambuu, Adrian Doerig,",
40 " Andreas Eigenmann, Giuliano Grassi, Reto Guadagnini, Fabian Hartmann,",
41 " Noah Heusser, Jan Hutter, Thomas Kallenberg, Daniel Roethlisberger,",
42 " Ralf Sager, Joel Stillhart, Daniel Wydler, Andreas Steffen,",
43 " HSR Hochschule fuer Technik Rapperswil (Switzerland).",
44 "",
45 " Martin Willi (revosec AG), Clavister (Sweden).",
46 "",
47 "This program is free software; you can redistribute it and/or modify it",
48 "under the terms of the GNU General Public License as published by the",
49 "Free Software Foundation; either version 2 of the License, or (at your",
50 "option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.",
51 "",
52 "This program is distributed in the hope that it will be useful, but",
53 "WITHOUT ANY WARRANTY; without even the implied warranty of",
54 "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General",
55 "Public License (file COPYING in the distribution) for more details.",
56 NULL,
57 };
58
59 char usage[] = "Usage: ipsec _copyright";
60 struct option opts[] = {
61 {"help", 0, NULL, 'h',},
62 {"version", 0, NULL, 'v',},
63 {0, 0, NULL, 0, },
64 };
65
66 char me[] = "ipsec _copyright"; /* for messages */
67
68 int
69 main(int argc, char *argv[])
70 {
71 int opt;
72 extern int optind;
73 int errflg = 0;
74 const char **notice = copyright;
75 const char **co;
76
77 library_init(NULL);
78 atexit(library_deinit);
79
80 while ((opt = getopt_long(argc, argv, "", opts, NULL)) != EOF)
81 switch (opt) {
82 case 'h': /* help */
83 printf("%s\n", usage);
84 exit(0);
85 break;
86 case 'v': /* version */
87 printf("%s strongSwan "VERSION"\n", me);
88 exit(0);
89 break;
90 case '?':
91 default:
92 errflg = 1;
93 break;
94 }
95 if (errflg || optind != argc) {
96 fprintf(stderr, "%s\n", usage);
97 exit(2);
98 }
99
100 for (co = notice; *co != NULL; co++)
101 printf("%s\n", *co);
102 exit(0);
103 }