mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
Make init_dom_scanner() take the state arg and drop a macro
This commit is contained in:
parent
7489c134f7
commit
9264221635
@ -153,8 +153,8 @@ init_dom_scanner_info(struct dom_scanner_info *scanner_info)
|
||||
}
|
||||
|
||||
void
|
||||
init_dom_scanner_state(struct dom_scanner *scanner, struct dom_scanner_info *scanner_info,
|
||||
struct dom_string *string, int state)
|
||||
init_dom_scanner(struct dom_scanner *scanner, struct dom_scanner_info *scanner_info,
|
||||
struct dom_string *string, int state)
|
||||
{
|
||||
if (!scanner_info->initialized) {
|
||||
init_dom_scanner_info(scanner_info);
|
||||
|
@ -91,11 +91,8 @@ struct dom_scanner_info {
|
||||
|
||||
|
||||
/* Initializes the scanner. */
|
||||
void init_dom_scanner_state(struct dom_scanner *scanner, struct dom_scanner_info *scanner_info,
|
||||
struct dom_string *string, int state);
|
||||
|
||||
#define init_dom_scanner(scanner, info, string) \
|
||||
init_dom_scanner_state(scanner, info, string, 0)
|
||||
void init_dom_scanner(struct dom_scanner *scanner, struct dom_scanner_info *scanner_info,
|
||||
struct dom_string *string, int state);
|
||||
|
||||
/* The number of tokens in the scanners token table:
|
||||
* At best it should be big enough to contain properties with space separated
|
||||
|
@ -391,7 +391,7 @@ parse_dom_select(struct dom_select *select, struct dom_stack *stack,
|
||||
struct dom_scanner scanner;
|
||||
struct dom_select_node sel;
|
||||
|
||||
init_dom_scanner(&scanner, &dom_css_scanner_info, string);
|
||||
init_dom_scanner(&scanner, &dom_css_scanner_info, string, 0);
|
||||
|
||||
memset(&sel, 0, sizeof(sel));
|
||||
|
||||
|
@ -295,10 +295,8 @@ parse_sgml_plain(struct dom_stack *stack, struct dom_scanner *scanner)
|
||||
/* Parse the <?xml data="attributes"?>. */
|
||||
struct dom_scanner attr_scanner;
|
||||
|
||||
init_dom_scanner_state(&attr_scanner,
|
||||
&sgml_scanner_info,
|
||||
&token->string,
|
||||
SGML_STATE_ELEMENT);
|
||||
init_dom_scanner(&attr_scanner, &sgml_scanner_info,
|
||||
&token->string, SGML_STATE_ELEMENT);
|
||||
|
||||
if (dom_scanner_has_tokens(&attr_scanner))
|
||||
parse_sgml_attributes(stack, &attr_scanner);
|
||||
@ -362,7 +360,8 @@ sgml_parsing_push(struct dom_stack *stack, struct dom_node *node, void *data)
|
||||
|
||||
parsing->depth = parser->stack.depth;
|
||||
get_dom_stack_top(&parser->stack)->immutable = 1;
|
||||
init_dom_scanner(&parsing->scanner, &sgml_scanner_info, &node->string);
|
||||
init_dom_scanner(&parsing->scanner, &sgml_scanner_info, &node->string,
|
||||
SGML_STATE_TEXT);
|
||||
}
|
||||
|
||||
static void
|
||||
|
Loading…
Reference in New Issue
Block a user