mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
Make it possible to initialise a scanner in a specific state
This commit is contained in:
parent
889a0f16f8
commit
c24c67ce59
@ -153,8 +153,8 @@ init_dom_scanner_info(struct dom_scanner_info *scanner_info)
|
||||
}
|
||||
|
||||
void
|
||||
init_dom_scanner(struct dom_scanner *scanner, struct dom_scanner_info *scanner_info,
|
||||
struct dom_string *string)
|
||||
init_dom_scanner_state(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);
|
||||
@ -168,5 +168,6 @@ init_dom_scanner(struct dom_scanner *scanner, struct dom_scanner_info *scanner_i
|
||||
scanner->end = string->string + string->length;
|
||||
scanner->current = scanner->table;
|
||||
scanner->info = scanner_info;
|
||||
scanner->state = state;
|
||||
scanner->info->scan(scanner);
|
||||
}
|
||||
|
@ -91,8 +91,11 @@ struct dom_scanner_info {
|
||||
|
||||
|
||||
/* Initializes the scanner. */
|
||||
void init_dom_scanner(struct dom_scanner *scanner, struct dom_scanner_info *scanner_info,
|
||||
struct dom_string *string);
|
||||
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)
|
||||
|
||||
/* The number of tokens in the scanners token table:
|
||||
* At best it should be big enough to contain properties with space separated
|
||||
|
Loading…
Reference in New Issue
Block a user