From 02bbaa3e8855cc632dfca42a8bf06a59a3cecf2a Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Mon, 13 Oct 2014 15:08:16 +0100 Subject: split version info into its own header and remove unnecessary nesurf.h includes The netsurf.h header should *only* contain the registration, core initialisation and finalisation methods. Version information is best placed in its own header. Also remove any unneeded inclusion of this header limiting it to solely the places the relevant API is required. --- desktop/netsurf.c | 27 +++++++++++++-------------- desktop/netsurf.h | 8 +------- desktop/version.c | 20 ++++++++++++++++++++ desktop/version.h | 43 +++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 77 insertions(+), 21 deletions(-) create mode 100644 desktop/version.h (limited to 'desktop') diff --git a/desktop/netsurf.c b/desktop/netsurf.c index 78ec8ab4c..39cee2e2b 100644 --- a/desktop/netsurf.c +++ b/desktop/netsurf.c @@ -23,11 +23,17 @@ #include #include #include - #include #include "utils/config.h" #include "utils/utsname.h" +#include "utils/nsoption.h" +#include "utils/corestrings.h" +#include "utils/log.h" +#include "utils/url.h" +#include "utils/utf8.h" +#include "utils/utils.h" +#include "utils/messages.h" #include "content/content_factory.h" #include "content/fetchers.h" #include "content/hlcache.h" @@ -36,23 +42,16 @@ #include "css/css.h" #include "image/image.h" #include "image/image_cache.h" +#include "javascript/js.h" +#include "render/html.h" +#include "render/textplain.h" + #include "desktop/netsurf.h" +#include "desktop/version.h" #include "desktop/browser.h" #include "desktop/system_colour.h" -#include "desktop/gui_factory.h" -#include "utils/nsoption.h" #include "desktop/searchweb.h" - -#include "javascript/js.h" - -#include "render/html.h" -#include "render/textplain.h" -#include "utils/corestrings.h" -#include "utils/log.h" -#include "utils/url.h" -#include "utils/utf8.h" -#include "utils/utils.h" -#include "utils/messages.h" +#include "desktop/gui_factory.h" /** speculative pre-conversion small image size * diff --git a/desktop/netsurf.h b/desktop/netsurf.h index ff098f437..45a445747 100644 --- a/desktop/netsurf.h +++ b/desktop/netsurf.h @@ -1,5 +1,5 @@ /* - * Copyright 2003 Phil Mellor + * Copyright 2014 Vincent Sanders * * This file is part of NetSurf, http://www.netsurf-browser.org/ * @@ -19,13 +19,8 @@ #ifndef _NETSURF_DESKTOP_NETSURF_H_ #define _NETSURF_DESKTOP_NETSURF_H_ -#include #include "utils/errors.h" -extern const char * const netsurf_version; -extern const int netsurf_version_major; -extern const int netsurf_version_minor; - struct netsurf_table; /** @@ -49,5 +44,4 @@ nserror netsurf_init(const char *messages, const char *store_path); */ extern void netsurf_exit(void); - #endif diff --git a/desktop/version.c b/desktop/version.c index 44d58715f..03918eabe 100644 --- a/desktop/version.c +++ b/desktop/version.c @@ -1,5 +1,25 @@ +/* + * Copyright 2014 Vincent Sanders + * + * This file is part of NetSurf, http://www.netsurf-browser.org/ + * + * NetSurf 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; version 2 of the License. + * + * NetSurf 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, see . + */ + #include "testament.h" +#include "desktop/version.h" + const char * const netsurf_version = "3.3 (Dev" #if defined(CI_BUILD) " CI #" CI_BUILD diff --git a/desktop/version.h b/desktop/version.h new file mode 100644 index 000000000..7ab8eb425 --- /dev/null +++ b/desktop/version.h @@ -0,0 +1,43 @@ +/* + * Copyright 2014 Vincent Sanders + * + * This file is part of NetSurf, http://www.netsurf-browser.org/ + * + * NetSurf 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; version 2 of the License. + * + * NetSurf 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, see . + */ + +/** + * \file + * + * Version information interface. + */ + +#ifndef _NETSURF_DESKTOP_VERSION_H_ +#define _NETSURF_DESKTOP_VERSION_H_ + +/** + * User friendly version string. + */ +extern const char * const netsurf_version; + +/** + * NetSuf browser major version number. + */ +extern const int netsurf_version_major; + +/** + * NetSuf browser minor version number. + */ +extern const int netsurf_version_minor; + +#endif -- cgit v1.2.3