1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

Make init_dom_scanner() take the source string as a dom_string struct

This commit is contained in:
Jonas Fonseca 2005-12-28 15:55:21 +01:00 committed by Jonas Fonseca
parent 62d981c551
commit 2e4e404145
4 changed files with 8 additions and 9 deletions

View File

@ -154,7 +154,7 @@ init_dom_scanner_info(struct dom_scanner_info *scanner_info)
void
init_dom_scanner(struct dom_scanner *scanner, struct dom_scanner_info *scanner_info,
unsigned char *string, unsigned char *end)
struct dom_string *string)
{
if (!scanner_info->initialized) {
init_dom_scanner_info(scanner_info);
@ -163,9 +163,9 @@ init_dom_scanner(struct dom_scanner *scanner, struct dom_scanner_info *scanner_i
memset(scanner, 0, sizeof(*scanner));
scanner->string = string;
scanner->position = string;
scanner->end = end ? end : string + strlen(string);
scanner->string = string->string;
scanner->position = string->string;
scanner->end = string->string + string->length;
scanner->current = scanner->table;
scanner->info = scanner_info;
scanner->info->scan(scanner);

View File

@ -91,7 +91,7 @@ struct dom_scanner_info {
/* Initializes the scanner. */
void init_dom_scanner(struct dom_scanner *scanner, struct dom_scanner_info *scanner_info,
unsigned char *string, unsigned char *end);
struct dom_string *string);
/* The number of tokens in the scanners token table:
* At best it should be big enough to contain properties with space separated

View File

@ -393,8 +393,9 @@ parse_dom_select(struct dom_select *select, struct dom_stack *stack,
{
struct dom_scanner scanner;
struct dom_select_node sel;
struct dom_string source = INIT_DOM_STRING(string, length);
init_dom_scanner(&scanner, &dom_css_scanner_info, string, string + length);
init_dom_scanner(&scanner, &dom_css_scanner_info, &source);
memset(&sel, 0, sizeof(sel));

View File

@ -356,12 +356,10 @@ sgml_parsing_push(struct dom_stack *stack, struct dom_node *node, void *data)
{
struct sgml_parser *parser = get_sgml_parser(stack);
struct sgml_parsing_state *parsing = data;
unsigned char *source = node->string.string;
unsigned char *end = source + node->string.length;
parsing->depth = parser->stack.depth;
get_dom_stack_top(&parser->stack)->immutable = 1;
init_dom_scanner(&parsing->scanner, &sgml_scanner_info, source, end);
init_dom_scanner(&parsing->scanner, &sgml_scanner_info, &node->string);
}
static void