Add extern declaration for version.c strings

This commit is contained in:
Darshit Shah 2014-11-22 11:29:35 +05:30
parent b41a3a6568
commit c6b750061a
6 changed files with 45 additions and 5 deletions

View File

@ -1,3 +1,11 @@
2014-11-22 Darshit Shah <darnir@gmail.com>
* 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 <darnir@gmail.com>
* utils.c (abort_run_with_timeout): The sig parameter is not used. Mark it

View File

@ -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) >> $@

View File

@ -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;

View File

@ -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 */

33
src/version.h Normal file
View File

@ -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;

View File

@ -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;