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

Add a data member to struct dom_stack_context (not used yet)

This commit is contained in:
Jonas Fonseca 2005-12-21 01:25:50 +01:00 committed by Jonas Fonseca
parent 12a2f96920
commit 0faa8d7462
4 changed files with 15 additions and 5 deletions

View File

@ -803,7 +803,8 @@ render_dom_document(struct cache_entry *cached, struct document *document,
&renderer, cached->uri);
if (!parser) return;
add_dom_stack_context(&parser->stack, &dom_source_renderer_context_info);
add_dom_stack_context(&parser->stack, &renderer,
&dom_source_renderer_context_info);
root = parse_sgml(parser, buffer);
done_sgml_parser(parser);

View File

@ -831,7 +831,8 @@ select_dom_nodes(struct dom_select *select, struct dom_node *root)
select_data.select = select;;
init_dom_stack(&stack, &select_data, 0, 1);
add_dom_stack_context(&stack, &dom_select_context_info);
add_dom_stack_context(&stack, &select_data,
&dom_select_context_info);
init_dom_stack(&select_data.stack, &select_data, obj_size, 1);

View File

@ -78,13 +78,17 @@ done_dom_stack(struct dom_stack *stack)
}
void
add_dom_stack_context(struct dom_stack *stack,
add_dom_stack_context(struct dom_stack *stack, void *data,
struct dom_stack_context_info *context_info)
{
struct dom_stack_context *context;
if (!realloc_dom_stack_context(&stack->contexts, stack->contexts_size))
return;
stack->contexts[stack->contexts_size++].info = context_info;
context = &stack->contexts[stack->contexts_size++];
context->info = context_info;
context->data = data;
}
enum dom_stack_action {

View File

@ -16,6 +16,10 @@ struct dom_stack_context_info {
};
struct dom_stack_context {
/* Data specific to the parser and renderer. */
void *data;
/* Info about node callbacks and such. */
struct dom_stack_context_info *info;
};
@ -124,7 +128,7 @@ void init_dom_stack(struct dom_stack *stack, void *data,
void done_dom_stack(struct dom_stack *stack);
/* Add a callback collection to the stack. */
void add_dom_stack_context(struct dom_stack *stack,
void add_dom_stack_context(struct dom_stack *stack, void *data,
struct dom_stack_context_info *context_info);
/* Decends down to the given node making it the current parent */