mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
search_dom_stack(): No need to inline this at least not while debugging
This commit is contained in:
parent
779a8a4553
commit
9360f88d65
@ -242,6 +242,26 @@ pop_dom_state(struct dom_stack *stack, struct dom_stack_state *target)
|
||||
}
|
||||
}
|
||||
|
||||
struct dom_stack_state *
|
||||
search_dom_stack(struct dom_stack *stack, enum dom_node_type type,
|
||||
struct dom_string *string)
|
||||
{
|
||||
struct dom_stack_state *state;
|
||||
int pos;
|
||||
|
||||
/* FIXME: Take node subtype and compare if non-zero or something. */
|
||||
foreachback_dom_stack_state (stack, state, pos) {
|
||||
struct dom_node *parent = state->node;
|
||||
|
||||
if (parent->type == type
|
||||
&& parent->string.length == string->length
|
||||
&& !strncasecmp(parent->string.string, string->string, string->length))
|
||||
return state;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void
|
||||
walk_dom_nodes(struct dom_stack *stack, struct dom_node *root)
|
||||
{
|
||||
|
@ -106,27 +106,6 @@ get_dom_stack_state(struct dom_stack *stack, int top_offset)
|
||||
for ((pos) = (stack)->depth - 1; (pos) >= 0; (pos)--) \
|
||||
if (((state) = &(stack)->states[(pos)]))
|
||||
|
||||
/* Dive through the stack states in search for the specified match. */
|
||||
static inline struct dom_stack_state *
|
||||
search_dom_stack(struct dom_stack *stack, enum dom_node_type type,
|
||||
struct dom_string *string)
|
||||
{
|
||||
struct dom_stack_state *state;
|
||||
int pos;
|
||||
|
||||
/* FIXME: Take node subtype and compare if non-zero or something. */
|
||||
foreachback_dom_stack_state (stack, state, pos) {
|
||||
struct dom_node *parent = state->node;
|
||||
|
||||
if (parent->type == type
|
||||
&& parent->string.length == string->length
|
||||
&& !strncasecmp(parent->string.string, string->string, string->length))
|
||||
return state;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
/* Life cycle functions. */
|
||||
|
||||
@ -153,6 +132,11 @@ void pop_dom_nodes(struct dom_stack *stack, enum dom_node_type type,
|
||||
/* Pop all stack states until a specific state is reached. */
|
||||
void pop_dom_state(struct dom_stack *stack, struct dom_stack_state *target);
|
||||
|
||||
/* Dive through the stack states in search for the specified match. */
|
||||
struct dom_stack_state *
|
||||
search_dom_stack(struct dom_stack *stack, enum dom_node_type type,
|
||||
struct dom_string *string);
|
||||
|
||||
/* Visit each node in the tree rooted at @root pre-order */
|
||||
void walk_dom_nodes(struct dom_stack *stack, struct dom_node *root);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user