From 774a362e87feab25f1be16fbca08269ddc7121a4 Mon Sep 17 00:00:00 2001 From: Rene Mayrhofer Date: Thu, 12 Apr 2007 20:41:31 +0000 Subject: Major new upstream release, just ran svn-upgrade for now (and wrote some debian/changelong entries). --- src/_copyright/_copyright.c | 69 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 src/_copyright/_copyright.c (limited to 'src/_copyright/_copyright.c') diff --git a/src/_copyright/_copyright.c b/src/_copyright/_copyright.c new file mode 100644 index 000000000..0fb360f40 --- /dev/null +++ b/src/_copyright/_copyright.c @@ -0,0 +1,69 @@ +/* + * copyright reporter + * (just avoids having the info in more than one place in the source) + * Copyright (C) 2001 Henry Spencer. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. See . + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * RCSID $Id: _copyright.c,v 1.1 2004/03/15 20:35:27 as Exp $ + */ + +#include +#include +#include +#include +#include +#include +#include + +char usage[] = "Usage: ipsec _copyright"; +struct option opts[] = { + {"help", 0, NULL, 'h',}, + {"version", 0, NULL, 'v',}, + {0, 0, NULL, 0, }, +}; + +char me[] = "ipsec _copyright"; /* for messages */ + +int +main(int argc, char *argv[]) +{ + int opt; + extern int optind; + int errflg = 0; + const char *version = ipsec_version_code(); + const char **notice = ipsec_copyright_notice(); + const char **co; + + while ((opt = getopt_long(argc, argv, "", opts, NULL)) != EOF) + switch (opt) { + case 'h': /* help */ + printf("%s\n", usage); + exit(0); + break; + case 'v': /* version */ + printf("%s %s\n", me, version); + exit(0); + break; + case '?': + default: + errflg = 1; + break; + } + if (errflg || optind != argc) { + fprintf(stderr, "%s\n", usage); + exit(2); + } + + for (co = notice; *co != NULL; co++) + printf("%s\n", *co); + exit(0); +} -- cgit v1.2.3