mirror of
https://github.com/rkd77/elinks.git
synced 2025-01-03 14:57:44 -05:00
Make init_dom_scanner() take the source string as a dom_string struct
This commit is contained in:
parent
62d981c551
commit
2e4e404145
@ -154,7 +154,7 @@ init_dom_scanner_info(struct dom_scanner_info *scanner_info)
|
|||||||
|
|
||||||
void
|
void
|
||||||
init_dom_scanner(struct dom_scanner *scanner, struct dom_scanner_info *scanner_info,
|
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) {
|
if (!scanner_info->initialized) {
|
||||||
init_dom_scanner_info(scanner_info);
|
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));
|
memset(scanner, 0, sizeof(*scanner));
|
||||||
|
|
||||||
scanner->string = string;
|
scanner->string = string->string;
|
||||||
scanner->position = string;
|
scanner->position = string->string;
|
||||||
scanner->end = end ? end : string + strlen(string);
|
scanner->end = string->string + string->length;
|
||||||
scanner->current = scanner->table;
|
scanner->current = scanner->table;
|
||||||
scanner->info = scanner_info;
|
scanner->info = scanner_info;
|
||||||
scanner->info->scan(scanner);
|
scanner->info->scan(scanner);
|
||||||
|
@ -91,7 +91,7 @@ struct dom_scanner_info {
|
|||||||
|
|
||||||
/* Initializes the scanner. */
|
/* Initializes the scanner. */
|
||||||
void init_dom_scanner(struct dom_scanner *scanner, 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);
|
||||||
|
|
||||||
/* The number of tokens in the scanners token table:
|
/* The number of tokens in the scanners token table:
|
||||||
* At best it should be big enough to contain properties with space separated
|
* At best it should be big enough to contain properties with space separated
|
||||||
|
@ -393,8 +393,9 @@ parse_dom_select(struct dom_select *select, struct dom_stack *stack,
|
|||||||
{
|
{
|
||||||
struct dom_scanner scanner;
|
struct dom_scanner scanner;
|
||||||
struct dom_select_node sel;
|
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));
|
memset(&sel, 0, sizeof(sel));
|
||||||
|
|
||||||
|
@ -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_parser *parser = get_sgml_parser(stack);
|
||||||
struct sgml_parsing_state *parsing = data;
|
struct sgml_parsing_state *parsing = data;
|
||||||
unsigned char *source = node->string.string;
|
|
||||||
unsigned char *end = source + node->string.length;
|
|
||||||
|
|
||||||
parsing->depth = parser->stack.depth;
|
parsing->depth = parser->stack.depth;
|
||||||
get_dom_stack_top(&parser->stack)->immutable = 1;
|
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
|
static void
|
||||||
|
Loading…
Reference in New Issue
Block a user