_copyright: Replicate copyright text here instead of calling libfreeswan.
[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 Henry Spencer, Richard Guy Briggs,",
28 " D. Hugh Redelmeier, Sandy Harris, Claudia Schmeing,",
29 " Michael Richardson, Angelos D. Keromytis, John Ioannidis,",
30 "",
31 " Ken Bantoft, Stephen J. Bevan, JuanJo Ciarlante, Mathieu Lafon,",
32 " Stephane Laroche, Kai Martius, Stephan Scholz, Tuomo Soini, Herbert Xu,",
33 "",
34 " Martin Berner, Marco Bertossa, David Buechi, Ueli Galizzi,",
35 " Christoph Gysin, Andreas Hess, Patric Lichtsteiner, Michael Meier,",
36 " Andreas Schleiss, Ariane Seiler, Mario Strasser, Lukas Suter,",
37 " Roger Wegmann, Simon Zwahlen,",
38 " ZHW Zuercher Hochschule Winterthur (Switzerland).",
39 "",
40 " Philip Boetschi, Tobias Brunner, Sansar Choinyambuu, Adrian Doerig,",
41 " Andreas Eigenmann, Fabian Hartmann, Noah Heusser, Jan Hutter,",
42 " Thomas Kallenberg, Daniel Roethlisberger, Joel Stillhart, Martin Willi,",
43 " Daniel Wydler, Andreas Steffen,",
44 " HSR Hochschule fuer Technik Rapperswil (Switzerland).",
45 "",
46 "This program is free software; you can redistribute it and/or modify it",
47 "under the terms of the GNU General Public License as published by the",
48 "Free Software Foundation; either version 2 of the License, or (at your",
49 "option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.",
50 "",
51 "This program is distributed in the hope that it will be useful, but",
52 "WITHOUT ANY WARRANTY; without even the implied warranty of",
53 "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General",
54 "Public License (file COPYING in the distribution) for more details.",
55 NULL,
56 };
57
58 char usage[] = "Usage: ipsec _copyright";
59 struct option opts[] = {
60 {"help", 0, NULL, 'h',},
61 {"version", 0, NULL, 'v',},
62 {0, 0, NULL, 0, },
63 };
64
65 char me[] = "ipsec _copyright"; /* for messages */
66
67 int
68 main(int argc, char *argv[])
69 {
70 int opt;
71 extern int optind;
72 int errflg = 0;
73 const char **notice = copyright;
74 const char **co;
75
76 library_init(NULL);
77 atexit(library_deinit);
78
79 while ((opt = getopt_long(argc, argv, "", opts, NULL)) != EOF)
80 switch (opt) {
81 case 'h': /* help */
82 printf("%s\n", usage);
83 exit(0);
84 break;
85 case 'v': /* version */
86 printf("%s strongSwan "VERSION"\n", me);
87 exit(0);
88 break;
89 case '?':
90 default:
91 errflg = 1;
92 break;
93 }
94 if (errflg || optind != argc) {
95 fprintf(stderr, "%s\n", usage);
96 exit(2);
97 }
98
99 for (co = notice; *co != NULL; co++)
100 printf("%s\n", *co);
101 exit(0);
102 }