API for content debug dump.

This commit is contained in:
Michael Drake 2012-08-20 16:03:45 +01:00
parent 400ce41623
commit daf10f00a6
3 changed files with 13 additions and 0 deletions

View File

@ -762,6 +762,16 @@ bool content_drop_file_at_point(struct hlcache_handle *h,
} }
void content_debug_dump(struct hlcache_handle *h, FILE *f)
{
struct content *c = hlcache_handle_get_content(h);
assert(c != 0);
if (c->handler->debug_dump != NULL)
c->handler->debug_dump(c, f);
}
void content_add_error(struct content *c, const char *token, void content_add_error(struct content *c, const char *token,
unsigned int line) unsigned int line)
{ {

View File

@ -27,6 +27,7 @@
#define _NETSURF_CONTENT_CONTENT_H_ #define _NETSURF_CONTENT_CONTENT_H_
#include <stdbool.h> #include <stdbool.h>
#include <stdio.h>
#include <libwapcaplet/libwapcaplet.h> #include <libwapcaplet/libwapcaplet.h>
@ -226,6 +227,7 @@ bool content_scroll_at_point(struct hlcache_handle *h,
int x, int y, int scrx, int scry); int x, int y, int scrx, int scry);
bool content_drop_file_at_point(struct hlcache_handle *h, bool content_drop_file_at_point(struct hlcache_handle *h,
int x, int y, char *file); int x, int y, char *file);
void content_debug_dump(struct hlcache_handle *h, FILE *f);
struct content_rfc5988_link *content_find_rfc5988_link(struct hlcache_handle *c, struct content_rfc5988_link *content_find_rfc5988_link(struct hlcache_handle *c,
lwc_string *rel); lwc_string *rel);

View File

@ -71,6 +71,7 @@ struct content_handler {
int scrx, int scry); int scrx, int scry);
bool (*drop_file_at_point)(struct content *c, int x, int y, bool (*drop_file_at_point)(struct content *c, int x, int y,
char *file); char *file);
void (*debug_dump)(struct content *c, FILE *f);
nserror (*clone)(const struct content *old, struct content **newc); nserror (*clone)(const struct content *old, struct content **newc);
bool (*matches_quirks)(const struct content *c, bool quirks); bool (*matches_quirks)(const struct content *c, bool quirks);
content_type (*type)(void); content_type (*type)(void);