1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-11-02 08:57:19 -04:00

Make init_dom_select() take dom_string struct

This commit is contained in:
Jonas Fonseca 2005-12-28 15:57:37 +01:00 committed by Jonas Fonseca
parent 2e4e404145
commit 97c702c674
2 changed files with 5 additions and 7 deletions

View File

@ -389,13 +389,12 @@ parse_dom_select_pseudo(struct dom_select *select, struct dom_select_node *sel,
/* Parse a CSS3 selector and add selector nodes to the @select struct. */ /* Parse a CSS3 selector and add selector nodes to the @select struct. */
static enum dom_exception_code static enum dom_exception_code
parse_dom_select(struct dom_select *select, struct dom_stack *stack, parse_dom_select(struct dom_select *select, struct dom_stack *stack,
unsigned char *string, int length) struct dom_string *string)
{ {
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, &source); init_dom_scanner(&scanner, &dom_css_scanner_info, string);
memset(&sel, 0, sizeof(sel)); memset(&sel, 0, sizeof(sel));
@ -524,8 +523,7 @@ parse_dom_select(struct dom_select *select, struct dom_stack *stack,
/* Basically this is just a wrapper for parse_dom_select() to ease error /* Basically this is just a wrapper for parse_dom_select() to ease error
* handling. */ * handling. */
struct dom_select * struct dom_select *
init_dom_select(enum dom_select_syntax syntax, init_dom_select(enum dom_select_syntax syntax, struct dom_string *string)
unsigned char *string, int length)
{ {
struct dom_select *select = mem_calloc(1, sizeof(select)); struct dom_select *select = mem_calloc(1, sizeof(select));
struct dom_stack stack; struct dom_stack stack;
@ -533,7 +531,7 @@ init_dom_select(enum dom_select_syntax syntax,
init_dom_stack(&stack, DOM_STACK_KEEP_NODES); init_dom_stack(&stack, DOM_STACK_KEEP_NODES);
code = parse_dom_select(select, &stack, string, length); code = parse_dom_select(select, &stack, string);
done_dom_stack(&stack); done_dom_stack(&stack);
if (code == DOM_ERR_NONE) if (code == DOM_ERR_NONE)

View File

@ -193,7 +193,7 @@ enum dom_select_syntax {
}; };
struct dom_select *init_dom_select(enum dom_select_syntax syntax, struct dom_select *init_dom_select(enum dom_select_syntax syntax,
unsigned char *string, int length); struct dom_string *string);
void done_dom_select(struct dom_select *select); void done_dom_select(struct dom_select *select);