_copyright.c 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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. #include <sys/types.h>
  17. #include <stdio.h>
  18. #include <stdlib.h>
  19. #include <string.h>
  20. #include <unistd.h>
  21. #include <getopt.h>
  22. #include <library.h>
  23. static const char *copyright[] = {
  24. "Copyright (C) 1999-2013",
  25. " Henry Spencer, D. Hugh Redelmeier, Michael Richardson, Ken Bantoft,",
  26. " Stephen J. Bevan, JuanJo Ciarlante, Thomas Egerer, Heiko Hund,",
  27. " Mathieu Lafon, Stephane Laroche, Kai Martius, Stephan Scholz,",
  28. " Tuomo Soini, Herbert Xu.",
  29. "",
  30. " Martin Berner, Marco Bertossa, David Buechi, Ueli Galizzi,",
  31. " Christoph Gysin, Andreas Hess, Patric Lichtsteiner, Michael Meier,",
  32. " Andreas Schleiss, Ariane Seiler, Mario Strasser, Lukas Suter,",
  33. " Roger Wegmann, Simon Zwahlen,",
  34. " ZHW Zuercher Hochschule Winterthur (Switzerland).",
  35. "",
  36. " Philip Boetschi, Tobias Brunner, Christoph Buehler, Reto Buerki,",
  37. " Sansar Choinyambuu, Adrian Doerig, Andreas Eigenmann, Giuliano Grassi,",
  38. " Reto Guadagnini, Fabian Hartmann, Noah Heusser, Jan Hutter,",
  39. " Thomas Kallenberg, Patrick Loetscher, Daniel Roethlisberger,",
  40. " Adrian-Ken Rueegsegger, Ralf Sager, Joel Stillhart, Daniel Wydler,",
  41. " Andreas Steffen,",
  42. " HSR Hochschule fuer Technik Rapperswil (Switzerland).",
  43. "",
  44. " Martin Willi (revosec AG), Clavister (Sweden).",
  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. char usage[] = "Usage: ipsec _copyright";
  58. struct option opts[] = {
  59. {"help", 0, NULL, 'h',},
  60. {"version", 0, NULL, 'v',},
  61. {0, 0, NULL, 0, },
  62. };
  63. char me[] = "ipsec _copyright"; /* for messages */
  64. int
  65. main(int argc, char *argv[])
  66. {
  67. int opt;
  68. extern int optind;
  69. int errflg = 0;
  70. const char **notice = copyright;
  71. const char **co;
  72. library_init(NULL, "_copyright");
  73. atexit(library_deinit);
  74. while ((opt = getopt_long(argc, argv, "", opts, NULL)) != EOF)
  75. switch (opt) {
  76. case 'h': /* help */
  77. printf("%s\n", usage);
  78. exit(0);
  79. case 'v': /* version */
  80. printf("%s strongSwan "VERSION"\n", me);
  81. exit(0);
  82. case '?':
  83. default:
  84. errflg = 1;
  85. break;
  86. }
  87. if (errflg || optind != argc) {
  88. fprintf(stderr, "%s\n", usage);
  89. exit(2);
  90. }
  91. for (co = notice; *co != NULL; co++)
  92. printf("%s\n", *co);
  93. exit(0);
  94. }