From 392307bb1fdf4186f26300631fe3710d895cf7ce Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Mon, 18 Apr 2016 23:04:16 +0100 Subject: reduce content header interdependancy --- content/content.c | 3 ++- content/content.h | 20 +++----------------- content/content_debug.h | 38 ++++++++++++++++++++++++++++++++++++++ content/content_factory.c | 2 ++ content/content_protected.h | 14 +++++++++----- 5 files changed, 54 insertions(+), 23 deletions(-) create mode 100644 content/content_debug.h (limited to 'content') 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 -#include - #include -#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; @@ -317,15 +312,6 @@ void content_search(struct hlcache_handle *h, void *context, search_flags_t flags, const char *string); 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. * 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 + * + * 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 + * Interface to content handling debug. + */ + +#ifndef _NETSURF_CONTENT_CONTENT_DEBUG_H_ +#define _NETSURF_CONTENT_CONTENT_DEBUG_H_ + +#include + +/** + * 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 #include +#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 #include +#include + #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); -- cgit v1.2.3