summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2016-04-18 23:04:16 +0100
committerVincent Sanders <vince@kyllikki.org>2016-04-18 23:04:16 +0100
commit392307bb1fdf4186f26300631fe3710d895cf7ce (patch)
tree5a55cf451925bb4b00addcc69942f0678a0ee33e
parent34f6aa13234a618c3b1add75899af2ca1f6a08e9 (diff)
downloadnetsurf-392307bb1fdf4186f26300631fe3710d895cf7ce.tar.gz
netsurf-392307bb1fdf4186f26300631fe3710d895cf7ce.tar.bz2
reduce content header interdependancy
-rw-r--r--content/content.c3
-rw-r--r--content/content.h20
-rw-r--r--content/content_debug.h38
-rw-r--r--content/content_factory.c2
-rw-r--r--content/content_protected.h14
-rw-r--r--desktop/browser.c1
-rw-r--r--desktop/gui_factory.c1
-rw-r--r--desktop/searchweb.c3
-rw-r--r--gtk/bitmap.c1
-rw-r--r--image/jpeg.c2
-rw-r--r--image/nssprite.c2
-rw-r--r--image/png.c2
-rw-r--r--image/svg.c2
-rw-r--r--javascript/content.c2
14 files changed, 65 insertions, 28 deletions
diff --git a/content/content.c b/content/content.c
index d20695613..b0d86b94c 100644
--- a/content/content.c
+++ b/content/content.c
@@ -32,6 +32,7 @@
#include "image/bitmap.h"
#include "content/content_protected.h"
+#include "content/content_debug.h"
#include "content/hlcache.h"
#define URL_FMT_SPC "%.140s"
@@ -62,7 +63,7 @@ static void content_convert(struct content *c);
*/
nserror content__init(struct content *c, const content_handler *handler,
- lwc_string *imime_type, const http_parameter *params,
+ lwc_string *imime_type, const struct http_parameter *params,
llcache_handle *llcache, const char *fallback_charset,
bool quirks)
{
diff --git a/content/content.h b/content/content.h
index 6c05df9c5..cdd7283cc 100644
--- a/content/content.h
+++ b/content/content.h
@@ -26,19 +26,14 @@
#ifndef _NETSURF_CONTENT_CONTENT_H_
#define _NETSURF_CONTENT_CONTENT_H_
-#include <stdbool.h>
-#include <stdio.h>
-
#include <libwapcaplet/libwapcaplet.h>
-#include "utils/config.h"
#include "utils/errors.h"
-#include "utils/http.h"
#include "content/content_factory.h"
#include "content/content_type.h"
-#include "desktop/search.h"
-#include "desktop/mouse.h"
-#include "desktop/plot_style.h"
+#include "desktop/search.h" /* search flags enum */
+#include "desktop/mouse.h" /* mouse state enums */
+#include "desktop/plot_style.h" /* color typedef */
struct browser_window;
struct browser_window_features;
@@ -318,15 +313,6 @@ void content_search(struct hlcache_handle *h, void *context,
void content_search_clear(struct hlcache_handle *h);
/**
- * Dump debug information to file.
- *
- * \param h content handle to debug.
- * \param f File to write output to.
- * \param op Debug operation type.
- */
-nserror content_debug_dump(struct hlcache_handle *h, FILE *f, enum content_debug op);
-
-/**
* Control debug con a content.
*
* \param h content handle to debug.
diff --git a/content/content_debug.h b/content/content_debug.h
new file mode 100644
index 000000000..b08f730b8
--- /dev/null
+++ b/content/content_debug.h
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2016 Vincent Sanders <vince@netsurf-browser.org>
+ *
+ * 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 <http://www.gnu.org/licenses/>.
+ */
+
+/**
+ * \file
+ * Interface to content handling debug.
+ */
+
+#ifndef _NETSURF_CONTENT_CONTENT_DEBUG_H_
+#define _NETSURF_CONTENT_CONTENT_DEBUG_H_
+
+#include <stdio.h>
+
+/**
+ * Dump debug information to file.
+ *
+ * \param h content handle to debug.
+ * \param f File to write output to.
+ * \param op Debug operation type.
+ */
+nserror content_debug_dump(struct hlcache_handle *h, FILE *f, enum content_debug op);
+
+#endif
diff --git a/content/content_factory.c b/content/content_factory.c
index 8da73337c..224220796 100644
--- a/content/content_factory.c
+++ b/content/content_factory.c
@@ -24,6 +24,8 @@
#include <stdlib.h>
#include <string.h>
+#include "utils/http.h"
+
#include "content/content.h"
#include "content/content_factory.h"
#include "content/content_protected.h"
diff --git a/content/content_protected.h b/content/content_protected.h
index e5ff1cae2..e901e40df 100644
--- a/content/content_protected.h
+++ b/content/content_protected.h
@@ -28,6 +28,8 @@
#include <stdint.h>
#include <time.h>
+#include <stdio.h>
+
#include "utils/config.h"
#include "content/content.h"
#include "content/content_factory.h"
@@ -38,15 +40,17 @@ struct bitmap;
struct content;
struct rect;
struct redraw_context;
+struct http_parameter;
struct content_handler {
void (*fini)(void);
nserror (*create)(const content_handler *handler,
- lwc_string *imime_type, const http_parameter *params,
- llcache_handle *llcache,
- const char *fallback_charset, bool quirks,
- struct content **c);
+ lwc_string *imime_type,
+ const struct http_parameter *params,
+ llcache_handle *llcache,
+ const char *fallback_charset, bool quirks,
+ struct content **c);
bool (*process_data)(struct content *c,
const char *data, unsigned int size);
@@ -157,7 +161,7 @@ extern const char * const content_type_name[];
extern const char * const content_status_name[];
nserror content__init(struct content *c, const content_handler *handler,
- lwc_string *imime_type, const http_parameter *params,
+ lwc_string *imime_type, const struct http_parameter *params,
struct llcache_handle *llcache, const char *fallback_charset,
bool quirks);
nserror content__clone(const struct content *c, struct content *nc);
diff --git a/desktop/browser.c b/desktop/browser.c
index 48f69eaae..14fdb565d 100644
--- a/desktop/browser.c
+++ b/desktop/browser.c
@@ -47,6 +47,7 @@
#include "utils/utf8.h"
#include "utils/nsoption.h"
#include "content/content.h"
+#include "content/content_debug.h"
#include "content/fetch.h"
#include "content/hlcache.h"
#include "content/urldb.h"
diff --git a/desktop/gui_factory.c b/desktop/gui_factory.c
index 3150d756c..0b168f405 100644
--- a/desktop/gui_factory.c
+++ b/desktop/gui_factory.c
@@ -20,6 +20,7 @@
#include <stdint.h>
#include <stdbool.h>
+#include "utils/config.h"
#include "utils/errors.h"
#include "utils/file.h"
#include "image/bitmap.h"
diff --git a/desktop/searchweb.c b/desktop/searchweb.c
index 4033f8ef0..83a19c31e 100644
--- a/desktop/searchweb.c
+++ b/desktop/searchweb.c
@@ -21,6 +21,9 @@
* \brief core web search facilities implementation.
*/
+#include <stdlib.h>
+
+#include "utils/utils.h"
#include "utils/log.h"
#include "utils/url.h"
#include "utils/nsoption.h"
diff --git a/gtk/bitmap.c b/gtk/bitmap.c
index fa86ff178..3c5b1742c 100644
--- a/gtk/bitmap.c
+++ b/gtk/bitmap.c
@@ -26,6 +26,7 @@
#include <assert.h>
#include <stdbool.h>
#include <string.h>
+#include <stdlib.h>
#include <cairo.h>
#include <gtk/gtk.h>
diff --git a/image/jpeg.c b/image/jpeg.c
index 8e6ac8528..a9030be1e 100644
--- a/image/jpeg.c
+++ b/image/jpeg.c
@@ -61,7 +61,7 @@ static unsigned char nsjpeg_eoi[] = { 0xff, JPEG_EOI };
* Content create entry point.
*/
static nserror nsjpeg_create(const content_handler *handler,
- lwc_string *imime_type, const http_parameter *params,
+ lwc_string *imime_type, const struct http_parameter *params,
llcache_handle *llcache, const char *fallback_charset,
bool quirks, struct content **c)
{
diff --git a/image/nssprite.c b/image/nssprite.c
index c0c6ff1b9..e61566391 100644
--- a/image/nssprite.c
+++ b/image/nssprite.c
@@ -60,7 +60,7 @@ typedef struct nssprite_content {
static nserror nssprite_create(const content_handler *handler,
- lwc_string *imime_type, const http_parameter *params,
+ lwc_string *imime_type, const struct http_parameter *params,
llcache_handle *llcache, const char *fallback_charset,
bool quirks, struct content **c)
{
diff --git a/image/png.c b/image/png.c
index 934252b7a..dfeac89e0 100644
--- a/image/png.c
+++ b/image/png.c
@@ -279,7 +279,7 @@ static nserror nspng_create_png_data(nspng_content *png_c)
}
static nserror nspng_create(const content_handler *handler,
- lwc_string *imime_type, const http_parameter *params,
+ lwc_string *imime_type, const struct http_parameter *params,
llcache_handle *llcache, const char *fallback_charset,
bool quirks, struct content **c)
{
diff --git a/image/svg.c b/image/svg.c
index 0bffbe836..63cdb3bf8 100644
--- a/image/svg.c
+++ b/image/svg.c
@@ -70,7 +70,7 @@ no_memory:
*/
static nserror svg_create(const content_handler *handler,
- lwc_string *imime_type, const http_parameter *params,
+ lwc_string *imime_type, const struct http_parameter *params,
llcache_handle *llcache, const char *fallback_charset,
bool quirks, struct content **c)
{
diff --git a/javascript/content.c b/javascript/content.c
index ef1bedc8e..ef5614094 100644
--- a/javascript/content.c
+++ b/javascript/content.c
@@ -38,7 +38,7 @@ typedef struct javascript_content {
} javascript_content;
static nserror javascript_create(const content_handler *handler,
- lwc_string *imime_type, const http_parameter *params,
+ lwc_string *imime_type, const struct http_parameter *params,
llcache_handle *llcache, const char *fallback_charset,
bool quirks, struct content **c)
{