From edea7e37d08e3045f4e7932ed74e09b5b8dc5c5c Mon Sep 17 00:00:00 2001 From: Mukund Sivaraman Date: Mon, 18 Jan 2010 19:05:31 +0530 Subject: Show authors and documenters when license is requested --- src/Makefile.am | 14 +++++++++++++ src/authors.c | 41 ++++++++++++++++++++++++++++++++++++ src/authors.h | 30 +++++++++++++++++++++++++++ src/authors.xsl | 64 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main.c | 26 ++++++++++++++++++++++- 5 files changed, 174 insertions(+), 1 deletion(-) create mode 100644 src/authors.c create mode 100644 src/authors.h create mode 100644 src/authors.xsl (limited to 'src') diff --git a/src/Makefile.am b/src/Makefile.am index 0b6d45d..8358ef1 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -24,6 +24,7 @@ AM_CPPFLAGS = \ tinyproxy_SOURCES = \ acl.c acl.h \ anonymous.c anonymous.h \ + authors.c authors.h \ buffer.c buffer.h \ child.c child.h \ common.h \ @@ -51,3 +52,16 @@ EXTRA_tinyproxy_SOURCES = filter.c filter.h \ transparent-proxy.c transparent-proxy.h tinyproxy_DEPENDENCIES = @ADDITIONAL_OBJECTS@ tinyproxy_LDADD = @ADDITIONAL_OBJECTS@ + +EXTRA_DIST = \ + authors.xsl + +authors.c: $(top_srcdir)/authors.xml $(srcdir)/authors.xsl +if HAVE_XSLTPROC + $(AM_V_GEN) $(XSLTPROC) $(srcdir)/authors.xsl $< > $(@) || rm -f $(@) +else + @echo "*** xsltproc is required to regenerate $(@) ***"; exit 1; +endif + +BUILT_SOURCES = \ + authors.c diff --git a/src/authors.c b/src/authors.c new file mode 100644 index 0000000..988a160 --- /dev/null +++ b/src/authors.c @@ -0,0 +1,41 @@ + +/* NOTE: This file is auto-generated from authors.xml, do not edit it. */ + +#include "authors.h" + +static const char * const authors[] = +{ + "Andrew Stribblehill", + "David Shanks", + "Jeremy Hinegardner", + "Kim Holviala", + "Mathew Mrosko", + "Matthew Dempsky", + "Michael Adam", + "Mukund Sivaraman", + "Robert James Kaes", + "Steven Young", + NULL +}; + +static const char * const documenters[] = +{ + "Marc Silver", + "Michael Adam", + "Mukund Sivaraman", + "Robert James Kaes", + "Steven Young", + NULL +}; + +const char * const * +authors_get_authors (void) +{ + return authors; +} + +const char * const * +authors_get_documenters (void) +{ + return documenters; +} diff --git a/src/authors.h b/src/authors.h new file mode 100644 index 0000000..10e5110 --- /dev/null +++ b/src/authors.h @@ -0,0 +1,30 @@ +/* tinyproxy - A fast light-weight HTTP proxy + * Copyright (C) 2010 Mukund Sivaraman + * + * 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. + * + * 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. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#ifndef __AUTHORS_H__ +#define __AUTHORS_H__ + +#include "common.h" + +const char * const * +authors_get_authors (void); + +const char * const * +authors_get_documenters (void); + +#endif /* __AUTHORS_H__ */ diff --git a/src/authors.xsl b/src/authors.xsl new file mode 100644 index 0000000..338bf15 --- /dev/null +++ b/src/authors.xsl @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + +/* NOTE: This file is auto-generated from authors.xml, do not edit it. */ + +#include "authors.h" + +static const char * const authors[] = +{ + + + + + NULL +}; + + + +static const char * const documenters[] = +{ + + + + + NULL +}; + +const char * const * +authors_get_authors (void) +{ + return authors; +} + +const char * const * +authors_get_documenters (void) +{ + return documenters; +} + + + + "", + + + diff --git a/src/main.c b/src/main.c index e141439..2dc5e50 100644 --- a/src/main.c +++ b/src/main.c @@ -32,6 +32,7 @@ #include "main.h" #include "anonymous.h" +#include "authors.h" #include "buffer.h" #include "conf.h" #include "daemon.h" @@ -92,9 +93,13 @@ display_version (void) static void display_license (void) { + const char * const *authors; + const char * const *documenters; + display_version (); printf ("\ +\n\ Copyright 1998 Steven Young (sdyoung@well.com)\n\ Copyright 1998-2002 Robert James Kaes (rjkaes@users.sourceforge.net)\n\ Copyright 1999 George Talusan (gstalusan@uwaterloo.ca)\n\ @@ -114,7 +119,26 @@ display_license (void) \n\ You should have received a copy of the GNU General Public License\n\ along with this program; if not, write to the Free Software\n\ - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.\n"); + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.\n\ +\n"); + + authors = authors_get_authors (); + + printf ("\nAUTHORS:\n"); + while (*authors) { + printf (" %s\n", *authors); + authors++; + } + + documenters = authors_get_documenters (); + + printf ("\nDOCUMENTERS:\n"); + while (*documenters) { + printf (" %s\n", *documenters); + documenters++; + } + + printf ("\n"); } /* -- cgit v1.2.3