mirror of
https://github.com/netsurf-browser/netsurf
synced 2025-02-04 00:24:20 +03:00
Virtualise content handler finalisation calls. Remove pointless implementations.
svn path=/trunk/netsurf/; revision=12797
This commit is contained in:
parent
3d71da088b
commit
339bed7272
@ -37,12 +37,4 @@ nserror amiga_datatypes_init(void)
|
||||
return NSERROR_OK;
|
||||
}
|
||||
|
||||
void amiga_datatypes_fini(void)
|
||||
{
|
||||
amiga_dt_picture_fini();
|
||||
#ifdef WITH_DTANIM
|
||||
amiga_dt_anim_fini();
|
||||
#endif
|
||||
amiga_dt_sound_fini();
|
||||
}
|
||||
#endif
|
||||
|
@ -25,21 +25,16 @@
|
||||
#ifdef WITH_AMIGA_DATATYPES
|
||||
|
||||
nserror amiga_datatypes_init(void);
|
||||
void amiga_datatypes_fini(void);
|
||||
|
||||
nserror amiga_dt_picture_init(void);
|
||||
void amiga_dt_picture_fini(void);
|
||||
|
||||
nserror amiga_dt_anim_init(void);
|
||||
void amiga_dt_anim_fini(void);
|
||||
|
||||
nserror amiga_dt_sound_init(void);
|
||||
void amiga_dt_sound_fini(void);
|
||||
|
||||
#else
|
||||
|
||||
#define amiga_datatypes_init() NSERROR_OK
|
||||
#define amiga_datatypes_fini() ((void) 0)
|
||||
|
||||
#endif /* WITH_AMIGA_DATATYPES */
|
||||
|
||||
|
@ -133,11 +133,6 @@ nserror amiga_dt_anim_init(void)
|
||||
return NSERROR_OK;
|
||||
}
|
||||
|
||||
void amiga_dt_anim_fini(void)
|
||||
{
|
||||
/* Nothing to do */
|
||||
}
|
||||
|
||||
nserror amiga_dt_anim_create(const content_handler *handler,
|
||||
lwc_string *imime_type, const http_parameter *params,
|
||||
llcache_handle *llcache, const char *fallback_charset,
|
||||
|
@ -120,11 +120,6 @@ nserror amiga_dt_picture_init(void)
|
||||
return NSERROR_OK;
|
||||
}
|
||||
|
||||
void amiga_dt_picture_fini(void)
|
||||
{
|
||||
/* Nothing to do */
|
||||
}
|
||||
|
||||
nserror amiga_dt_picture_create(const content_handler *handler,
|
||||
lwc_string *imime_type, const http_parameter *params,
|
||||
llcache_handle *llcache, const char *fallback_charset,
|
||||
|
@ -117,11 +117,6 @@ nserror amiga_dt_sound_init(void)
|
||||
return NSERROR_OK;
|
||||
}
|
||||
|
||||
void amiga_dt_sound_fini(void)
|
||||
{
|
||||
/* Nothing to do */
|
||||
}
|
||||
|
||||
nserror amiga_dt_sound_create(const content_handler *handler,
|
||||
lwc_string *imime_type, const http_parameter *params,
|
||||
llcache_handle *llcache, const char *fallback_charset,
|
||||
|
@ -785,10 +785,6 @@ int main(int argc, char** argv)
|
||||
|
||||
netsurf_exit();
|
||||
|
||||
amiga_plugin_hack_fini();
|
||||
amiga_datatypes_fini();
|
||||
amiga_icon_fini();
|
||||
|
||||
ami_mime_free();
|
||||
|
||||
return 0;
|
||||
|
@ -94,11 +94,6 @@ nserror amiga_plugin_hack_init(void)
|
||||
return NSERROR_OK;
|
||||
}
|
||||
|
||||
void amiga_plugin_hack_fini(void)
|
||||
{
|
||||
/* Nothing to do */
|
||||
}
|
||||
|
||||
nserror amiga_plugin_hack_create(const content_handler *handler,
|
||||
lwc_string *imime_type, const http_parameter *params,
|
||||
llcache_handle *llcache, const char *fallback_charset,
|
||||
|
@ -25,7 +25,6 @@
|
||||
struct hlcache_handle;
|
||||
|
||||
nserror amiga_plugin_hack_init(void);
|
||||
void amiga_plugin_hack_fini(void);
|
||||
|
||||
void amiga_plugin_hack_execute(struct hlcache_handle *c);
|
||||
#endif
|
||||
|
@ -201,8 +201,6 @@ int main( int argc, char **argv )
|
||||
[app run];
|
||||
|
||||
netsurf_exit();
|
||||
|
||||
apple_image_fini();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -26,12 +26,10 @@
|
||||
#ifdef WITH_APPLE_IMAGE
|
||||
|
||||
nserror apple_image_init(void);
|
||||
void apple_image_fini(void);
|
||||
|
||||
#else
|
||||
|
||||
#define apple_image_init() NSERROR_OK
|
||||
#define apple_image_fini() ((void) 0)
|
||||
|
||||
#endif /* WITH_APPLE_IMAGE */
|
||||
|
||||
|
@ -105,10 +105,6 @@ nserror apple_image_init(void)
|
||||
return NSERROR_OK;
|
||||
}
|
||||
|
||||
void apple_image_fini(void)
|
||||
{
|
||||
}
|
||||
|
||||
nserror apple_image_create(const content_handler *handler,
|
||||
lwc_string *imime_type, const http_parameter *params,
|
||||
llcache_handle *llcache, const char *fallback_charset,
|
||||
|
@ -56,6 +56,9 @@ void content_factory_fini(void)
|
||||
|
||||
content_handlers = content_handlers->next;
|
||||
|
||||
if (victim->handler->fini != NULL)
|
||||
victim->handler->fini();
|
||||
|
||||
lwc_string_unref(victim->mime_type);
|
||||
|
||||
free(victim);
|
||||
|
@ -31,26 +31,17 @@
|
||||
nserror HNAME##_init(void) \
|
||||
{ \
|
||||
uint32_t i; \
|
||||
nserror error; \
|
||||
nserror error = NSERROR_OK; \
|
||||
\
|
||||
for (i = 0; i < NOF_ELEMENTS(HTYPELIST); i++) { \
|
||||
error = content_factory_register_handler( \
|
||||
HTYPELIST[i], \
|
||||
&HHANDLER); \
|
||||
if (error != NSERROR_OK) \
|
||||
goto error; \
|
||||
break; \
|
||||
} \
|
||||
\
|
||||
return NSERROR_OK; \
|
||||
\
|
||||
error: \
|
||||
HNAME##_fini(); \
|
||||
\
|
||||
return error; \
|
||||
} \
|
||||
/* Pointless */ \
|
||||
void HNAME##_fini(void) \
|
||||
{ \
|
||||
}
|
||||
|
||||
struct content;
|
||||
|
@ -40,6 +40,8 @@ struct rect;
|
||||
struct redraw_context;
|
||||
|
||||
struct content_handler {
|
||||
void (*fini)(void);
|
||||
|
||||
nserror (*create)(const content_handler *handler,
|
||||
lwc_string *imime_type, const http_parameter *params,
|
||||
llcache_handle *llcache,
|
||||
|
@ -55,6 +55,7 @@ typedef struct {
|
||||
* imports array */
|
||||
} nscss_import_ctx;
|
||||
|
||||
static void nscss_fini(void);
|
||||
static nserror nscss_create(const content_handler *handler,
|
||||
lwc_string *imime_type, const http_parameter *params,
|
||||
llcache_handle *llcache, const char *fallback_charset,
|
||||
@ -79,6 +80,7 @@ static css_error nscss_register_import(struct content_css_data *c,
|
||||
const hlcache_handle *import);
|
||||
|
||||
static const content_handler css_content_handler = {
|
||||
.fini = nscss_fini,
|
||||
.create = nscss_create,
|
||||
.process_data = nscss_process_data,
|
||||
.data_complete = nscss_convert,
|
||||
@ -95,7 +97,7 @@ static css_stylesheet *blank_import;
|
||||
/**
|
||||
* Initialise the CSS content handler
|
||||
*/
|
||||
nserror css_init(void)
|
||||
nserror nscss_init(void)
|
||||
{
|
||||
lwc_error lerror;
|
||||
nserror error;
|
||||
@ -117,7 +119,7 @@ nserror css_init(void)
|
||||
/**
|
||||
* Clean up after the CSS content handler
|
||||
*/
|
||||
void css_fini(void)
|
||||
void nscss_fini(void)
|
||||
{
|
||||
if (css_charset != NULL) {
|
||||
lwc_string_unref(css_charset);
|
||||
|
@ -61,8 +61,7 @@ struct nscss_import {
|
||||
uint64_t media; /**< Media types that sheet applies to */
|
||||
};
|
||||
|
||||
nserror css_init(void);
|
||||
void css_fini(void);
|
||||
nserror nscss_init(void);
|
||||
|
||||
nserror nscss_create_css_data(struct content_css_data *c,
|
||||
const char *url, const char *charset, bool quirks,
|
||||
|
@ -193,7 +193,7 @@ nserror netsurf_init(int *pargc,
|
||||
return error;
|
||||
|
||||
/* content handler initialisation */
|
||||
error = css_init();
|
||||
error = nscss_init();
|
||||
if (error != NSERROR_OK)
|
||||
return error;
|
||||
|
||||
@ -267,15 +267,10 @@ void netsurf_exit(void)
|
||||
|
||||
mimesniff_fini();
|
||||
|
||||
/* Clean up after content handlers */
|
||||
textplain_fini();
|
||||
image_fini();
|
||||
html_fini();
|
||||
css_fini();
|
||||
|
||||
/* dump any remaining cache entries */
|
||||
image_cache_fini();
|
||||
|
||||
/* Clean up after content handlers */
|
||||
content_factory_fini();
|
||||
|
||||
LOG(("Closing utf8"));
|
||||
|
@ -31,6 +31,5 @@
|
||||
extern bmp_bitmap_callback_vt bmp_bitmap_callbacks; /** Only to be used by ICO code. */
|
||||
|
||||
nserror nsbmp_init(void);
|
||||
void nsbmp_fini(void);
|
||||
|
||||
#endif
|
||||
|
@ -25,6 +25,5 @@
|
||||
#define _NETSURF_IMAGE_GIF_H_
|
||||
|
||||
nserror nsgif_init(void);
|
||||
void nsgif_fini(void);
|
||||
|
||||
#endif
|
||||
|
@ -24,6 +24,5 @@
|
||||
#define _NETSURF_IMAGE_ICO_H_
|
||||
|
||||
nserror nsico_init(void);
|
||||
void nsico_fini(void);
|
||||
|
||||
#endif
|
||||
|
@ -114,51 +114,3 @@ nserror image_init(void)
|
||||
return NSERROR_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* Finalise image content handlers
|
||||
*/
|
||||
void image_fini(void)
|
||||
{
|
||||
#ifdef WITH_BMP
|
||||
nsbmp_fini();
|
||||
#endif
|
||||
|
||||
#ifdef WITH_GIF
|
||||
nsgif_fini();
|
||||
#endif
|
||||
|
||||
#ifdef WITH_BMP
|
||||
nsico_fini();
|
||||
#endif
|
||||
|
||||
#ifdef WITH_JPEG
|
||||
nsjpeg_fini();
|
||||
#endif
|
||||
|
||||
#ifdef WITH_MNG
|
||||
nsmng_fini();
|
||||
nsjpng_fini();
|
||||
#endif
|
||||
|
||||
#ifdef WITH_NSSPRITE
|
||||
nssprite_fini();
|
||||
#endif
|
||||
|
||||
#ifdef WITH_PNG
|
||||
nspng_fini();
|
||||
#endif
|
||||
|
||||
#ifdef WITH_RSVG
|
||||
nsrsvg_fini();
|
||||
#endif
|
||||
|
||||
#ifdef WITH_NS_SVG
|
||||
svg_fini();
|
||||
#endif
|
||||
|
||||
#ifdef WITH_WEBP
|
||||
webp_fini();
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
|
@ -26,6 +26,5 @@
|
||||
#include "utils/errors.h"
|
||||
|
||||
nserror image_init(void);
|
||||
void image_fini(void);
|
||||
|
||||
#endif
|
||||
|
@ -24,6 +24,5 @@
|
||||
#define _NETSURF_IMAGE_JPEG_H_
|
||||
|
||||
nserror nsjpeg_init(void);
|
||||
void nsjpeg_fini(void);
|
||||
|
||||
#endif
|
||||
|
@ -26,7 +26,4 @@
|
||||
nserror nsmng_init(void);
|
||||
nserror nsjpng_init(void);
|
||||
|
||||
void nsmng_fini(void);
|
||||
void nsjpng_fini(void);
|
||||
|
||||
#endif
|
||||
|
@ -24,6 +24,5 @@
|
||||
#define _NETSURF_NS_SPRITE_H_
|
||||
|
||||
nserror nssprite_init(void);
|
||||
void nssprite_fini(void);
|
||||
|
||||
#endif
|
||||
|
@ -21,6 +21,5 @@
|
||||
#define _NETSURF_RISCOS_PNG_H_
|
||||
|
||||
nserror nspng_init(void);
|
||||
void nspng_fini(void);
|
||||
|
||||
#endif
|
||||
|
@ -24,6 +24,5 @@
|
||||
#define _NETSURF_IMAGE_RSVG_H_
|
||||
|
||||
nserror nsrsvg_init(void);
|
||||
void nsrsvg_fini(void);
|
||||
|
||||
#endif
|
||||
|
@ -24,6 +24,5 @@
|
||||
#define _NETSURF_IMAGE_SVG_H_
|
||||
|
||||
nserror svg_init(void);
|
||||
void svg_fini(void);
|
||||
|
||||
#endif
|
||||
|
@ -24,6 +24,5 @@
|
||||
#define _NETSURF_WEBP_H_
|
||||
|
||||
nserror webp_init(void);
|
||||
void webp_fini(void);
|
||||
|
||||
#endif
|
||||
|
@ -59,6 +59,7 @@
|
||||
#define ALWAYS_DUMP_FRAMESET 0
|
||||
#define ALWAYS_DUMP_BOX 0
|
||||
|
||||
static void html_fini(void);
|
||||
static nserror html_create(const content_handler *handler,
|
||||
lwc_string *imime_type, const http_parameter *params,
|
||||
llcache_handle *llcache, const char *fallback_charset,
|
||||
@ -109,6 +110,7 @@ static void html_dump_frameset(struct content_html_frames *frame,
|
||||
#endif
|
||||
|
||||
static const content_handler html_content_handler = {
|
||||
.fini = html_fini,
|
||||
.create = html_create,
|
||||
.process_data = html_process_data,
|
||||
.data_complete = html_convert,
|
||||
|
@ -142,7 +142,6 @@ extern char *quirks_stylesheet_url;
|
||||
extern bool html_redraw_debug;
|
||||
|
||||
nserror html_init(void);
|
||||
void html_fini(void);
|
||||
|
||||
void html_redraw_a_box(struct hlcache_handle *h, struct box *box);
|
||||
|
||||
|
@ -94,6 +94,7 @@ static plot_font_style_t textplain_style = {
|
||||
|
||||
static int textplain_tab_width = 256; /* try for a sensible default */
|
||||
|
||||
static void textplain_fini(void);
|
||||
static nserror textplain_create(const content_handler *handler,
|
||||
lwc_string *imime_type, const http_parameter *params,
|
||||
llcache_handle *llcache, const char *fallback_charset,
|
||||
@ -132,6 +133,7 @@ static int textplain_coord_from_offset(const char *text, size_t offset,
|
||||
static float textplain_line_height(void);
|
||||
|
||||
static const content_handler textplain_content_handler = {
|
||||
.fini = textplain_fini,
|
||||
.create = textplain_create,
|
||||
.process_data = textplain_process_data,
|
||||
.data_complete = textplain_convert,
|
||||
|
@ -33,7 +33,6 @@ struct http_parameter;
|
||||
struct rect;
|
||||
|
||||
nserror textplain_init(void);
|
||||
void textplain_fini(void);
|
||||
|
||||
/* access to lines for text selection and searching */
|
||||
unsigned long textplain_line_count(struct content *c);
|
||||
|
@ -29,12 +29,10 @@
|
||||
#ifdef WITH_ARTWORKS
|
||||
|
||||
nserror artworks_init(void);
|
||||
void artworks_fini(void);
|
||||
|
||||
#else
|
||||
|
||||
#define artworks_init() NSERROR_OK
|
||||
#define artworks_fini() ((void) 0)
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -29,12 +29,10 @@
|
||||
#ifdef WITH_DRAW
|
||||
|
||||
nserror draw_init(void);
|
||||
void draw_fini(void);
|
||||
|
||||
#else
|
||||
|
||||
#define draw_init() NSERROR_OK
|
||||
#define draw_fini() ((void) 0)
|
||||
|
||||
#endif /* WITH_DRAW */
|
||||
|
||||
|
@ -29,12 +29,10 @@
|
||||
#ifdef WITH_SPRITE
|
||||
|
||||
nserror sprite_init(void);
|
||||
void sprite_fini(void);
|
||||
|
||||
#else
|
||||
|
||||
#define sprite_init() NSERROR_OK
|
||||
#define sprite_fini() ((void) 0)
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -800,10 +800,6 @@ int main(int argc, char** argv)
|
||||
|
||||
netsurf_exit();
|
||||
|
||||
sprite_fini();
|
||||
draw_fini();
|
||||
artworks_fini();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user