mirror of
https://github.com/rkd77/elinks.git
synced 2025-02-02 15:09:23 -05:00
Replace struct cache_entry member with struct uri member
Reduces the number of (unused) dependencies. Also, update the #include list removing old entries.
This commit is contained in:
parent
38b8503161
commit
69b321cb5b
@ -759,7 +759,7 @@ render_dom_document(struct cache_entry *cached, struct document *document,
|
|||||||
|
|
||||||
document->bgcolor = document->options.default_bg;
|
document->bgcolor = document->options.default_bg;
|
||||||
|
|
||||||
parser = init_sgml_parser(SGML_PARSER_STREAM, &renderer, cached,
|
parser = init_sgml_parser(SGML_PARSER_STREAM, &renderer, cached->uri,
|
||||||
dom_source_renderer_push_callbacks,
|
dom_source_renderer_push_callbacks,
|
||||||
dom_source_renderer_pop_callbacks);
|
dom_source_renderer_pop_callbacks);
|
||||||
if (!parser) return;
|
if (!parser) return;
|
||||||
|
@ -9,16 +9,12 @@
|
|||||||
|
|
||||||
#include "elinks.h"
|
#include "elinks.h"
|
||||||
|
|
||||||
#include "cache/cache.h"
|
|
||||||
#include "document/document.h"
|
|
||||||
#include "document/dom/node.h"
|
#include "document/dom/node.h"
|
||||||
#include "document/dom/stack.h"
|
#include "document/dom/stack.h"
|
||||||
#include "document/html/renderer.h" /* TODO: Move get_convert_table() */
|
|
||||||
#include "document/sgml/html/html.h"
|
#include "document/sgml/html/html.h"
|
||||||
#include "document/sgml/parser.h"
|
#include "document/sgml/parser.h"
|
||||||
#include "document/sgml/scanner.h"
|
#include "document/sgml/scanner.h"
|
||||||
#include "document/sgml/sgml.h"
|
#include "document/sgml/sgml.h"
|
||||||
#include "intl/charsets.h"
|
|
||||||
#include "protocol/uri.h"
|
#include "protocol/uri.h"
|
||||||
#include "util/error.h"
|
#include "util/error.h"
|
||||||
#include "util/lists.h"
|
#include "util/lists.h"
|
||||||
@ -307,8 +303,7 @@ parse_sgml_document(struct dom_stack *stack, struct scanner *scanner)
|
|||||||
|
|
||||||
|
|
||||||
struct sgml_parser *
|
struct sgml_parser *
|
||||||
init_sgml_parser(enum sgml_parser_type type, void *renderer,
|
init_sgml_parser(enum sgml_parser_type type, void *renderer, struct uri *uri,
|
||||||
struct cache_entry *cached,
|
|
||||||
dom_stack_callback_T push_callbacks[DOM_NODES],
|
dom_stack_callback_T push_callbacks[DOM_NODES],
|
||||||
dom_stack_callback_T pop_callbacks[DOM_NODES])
|
dom_stack_callback_T pop_callbacks[DOM_NODES])
|
||||||
{
|
{
|
||||||
@ -319,7 +314,7 @@ init_sgml_parser(enum sgml_parser_type type, void *renderer,
|
|||||||
if (!parser) return NULL;
|
if (!parser) return NULL;
|
||||||
|
|
||||||
parser->type = type;
|
parser->type = type;
|
||||||
parser->cache_entry = cached;
|
parser->uri = get_uri_reference(uri);
|
||||||
parser->info = &sgml_html_info;
|
parser->info = &sgml_html_info;
|
||||||
|
|
||||||
init_dom_stack(&parser->stack, parser, renderer,
|
init_dom_stack(&parser->stack, parser, renderer,
|
||||||
@ -332,6 +327,7 @@ void
|
|||||||
done_sgml_parser(struct sgml_parser *parser)
|
done_sgml_parser(struct sgml_parser *parser)
|
||||||
{
|
{
|
||||||
done_dom_stack(&parser->stack);
|
done_dom_stack(&parser->stack);
|
||||||
|
done_uri(parser->uri);
|
||||||
mem_free(parser);
|
mem_free(parser);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -346,7 +342,7 @@ parse_sgml(struct sgml_parser *parser, struct string *buffer)
|
|||||||
|
|
||||||
init_scanner(&parser->scanner, &sgml_scanner_info, source, end);
|
init_scanner(&parser->scanner, &sgml_scanner_info, source, end);
|
||||||
|
|
||||||
parser->root = add_sgml_document(&parser->stack, parser->cache_entry->uri);
|
parser->root = add_sgml_document(&parser->stack, parser->uri);
|
||||||
if (parser->root) {
|
if (parser->root) {
|
||||||
parse_sgml_document(&parser->stack, &parser->scanner);
|
parse_sgml_document(&parser->stack, &parser->scanner);
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,6 @@
|
|||||||
#include "document/sgml/sgml.h"
|
#include "document/sgml/sgml.h"
|
||||||
#include "util/scanner.h"
|
#include "util/scanner.h"
|
||||||
|
|
||||||
struct cache_entry;
|
|
||||||
struct string;
|
struct string;
|
||||||
struct uri;
|
struct uri;
|
||||||
|
|
||||||
@ -28,7 +27,7 @@ struct sgml_parser {
|
|||||||
|
|
||||||
struct sgml_info *info;
|
struct sgml_info *info;
|
||||||
|
|
||||||
struct cache_entry *cache_entry;
|
struct uri *uri;
|
||||||
struct dom_node *root;
|
struct dom_node *root;
|
||||||
|
|
||||||
struct scanner scanner;
|
struct scanner scanner;
|
||||||
@ -43,8 +42,7 @@ struct sgml_parser_state {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct sgml_parser *
|
struct sgml_parser *
|
||||||
init_sgml_parser(enum sgml_parser_type type, void *renderer,
|
init_sgml_parser(enum sgml_parser_type type, void *renderer, struct uri *uri,
|
||||||
struct cache_entry *cached,
|
|
||||||
dom_stack_callback_T push_callbacks[DOM_NODES],
|
dom_stack_callback_T push_callbacks[DOM_NODES],
|
||||||
dom_stack_callback_T pop_callbacks[DOM_NODES]);
|
dom_stack_callback_T pop_callbacks[DOM_NODES]);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user