bug-wget
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-wget] [PATCH 2/8] Add extern declaration for version.c strings


From: Darshit Shah
Subject: [Bug-wget] [PATCH 2/8] Add extern declaration for version.c strings
Date: Sat, 22 Nov 2014 14:52:16 +0530

---
 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 d49e6ca..e912cf9 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,13 @@
 2014-11-22  Darshit Shah  <address@hidden>
 
+       * 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  <address@hidden>
+
        * utils.c (abort_run_with_timeout): The sig parameter is not used. Mark 
it
        as such.
        (abort_run_with_timeout): One implementation of this function did not
diff --git a/src/Makefile.am b/src/Makefile.am
index a5db9fd..cfa853f 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 b96d4a9..bac471d 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 28c832c..56f3312 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 <getopt.h>
 #include <getpass.h>
@@ -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 0000000..487f73f
--- /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 <http://www.gnu.org/licenses/>.
+
+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 32675f8..d61093c 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 <stdio.h>
 #include <stdlib.h>
@@ -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;
-- 
2.1.3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]