From c6b750061ac4b1f3ea709137998fc1a455485029 Mon Sep 17 00:00:00 2001 From: Darshit Shah Date: Sat, 22 Nov 2014 11:29:35 +0530 Subject: [PATCH] Add extern declaration for version.c strings --- src/ChangeLog | 8 ++++++++ src/Makefile.am | 1 + src/http.c | 2 +- src/main.c | 4 +--- src/version.h | 33 +++++++++++++++++++++++++++++++++ src/warc.c | 2 +- 6 files changed, 45 insertions(+), 5 deletions(-) create mode 100644 src/version.h diff --git a/src/ChangeLog b/src/ChangeLog index d49e6caf..e912cf9e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2014-11-22 Darshit Shah + + * version.h: New file. Add extern declarations for globally shared strings + * Makefile.am: Have version.c import version.h + * main.c: Import version.h and remove old extern declarations + * http.c: Same + * warc.c: Same + 2014-11-22 Darshit Shah * utils.c (abort_run_with_timeout): The sig parameter is not used. Mark it diff --git a/src/Makefile.am b/src/Makefile.am index a5db9fd6..cfa853f4 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -74,6 +74,7 @@ version.c: $(wget_SOURCES) ../lib/libgnu.a echo '/* version.c */' > $@ echo '/* Autogenerated by Makefile - DO NOT EDIT */' >> $@ echo '' >> $@ + echo '#include "version.h"' >> $@ echo 'const char *version_string = "@VERSION@";' >> $@ echo 'const char *compilation_string = "'$(COMPILE)'";' \ | $(ESCAPEQUOTE) >> $@ diff --git a/src/http.c b/src/http.c index b96d4a9b..bac471dc 100644 --- a/src/http.c +++ b/src/http.c @@ -60,6 +60,7 @@ as that of the covered work. */ #include "spider.h" #include "warc.h" #include "c-strcase.h" +#include "version.h" #ifdef TESTING #include "test.h" @@ -69,7 +70,6 @@ as that of the covered work. */ # include "vms.h" #endif /* def __VMS */ -extern char *version_string; /* Forward decls. */ struct http_stat; diff --git a/src/main.c b/src/main.c index 28c832c9..56f33129 100644 --- a/src/main.c +++ b/src/main.c @@ -54,6 +54,7 @@ as that of the covered work. */ #include "http.h" /* for save_cookies */ #include "ptimer.h" #include "warc.h" +#include "version.h" #include "c-strcase.h" #include #include @@ -79,10 +80,7 @@ struct iri dummy_iri; struct options opt; /* defined in version.c */ -extern char *version_string; -extern char *compilation_string; extern char *system_getrc; -extern char *link_string; /* defined in build_info.c */ extern const char *compiled_features[]; /* Used for --version output in print_version */ diff --git a/src/version.h b/src/version.h new file mode 100644 index 00000000..487f73f9 --- /dev/null +++ b/src/version.h @@ -0,0 +1,33 @@ +/* Extern declarations for printing version information + Copyright (C) 2013 Free Software Foundation, Inc. + +This file is part of GNU Wget. + +GNU Wget 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 3 of the License, or +(at your option) any later version. + +GNU Wget 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 Wget. If not, see . + +Additional permission under GNU GPL version 3 section 7 + +If you modify this program, or any covered work, by linking or +combining it with the OpenSSL project's OpenSSL library (or a +modified version of that library), containing parts covered by the +terms of the OpenSSL or SSLeay licenses, the Free Software Foundation +grants you additional permission to convey the resulting work. +Corresponding Source for a non-source form of such a combination +shall include the source code for the parts of OpenSSL used as well +as that of the covered work. */ + +/* Extern declarations for strings in version.c */ +extern const char *version_string; +extern const char *compilation_string; +extern const char *link_string; diff --git a/src/warc.c b/src/warc.c index 32675f87..d61093c4 100644 --- a/src/warc.c +++ b/src/warc.c @@ -34,6 +34,7 @@ as that of the covered work. */ #include "wget.h" #include "hash.h" #include "utils.h" +#include "version.h" #include #include @@ -66,7 +67,6 @@ as that of the covered work. */ #define O_TEMPORARY 0 #endif -extern char *version_string; /* Set by main in main.c */ extern char *program_argstring;