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

Rename: nav -> stack

This commit is contained in:
Jonas Fonseca 2005-12-15 17:24:20 +01:00 committed by Jonas Fonseca
parent 3c9f192267
commit c2d27a33d8

View File

@ -55,8 +55,8 @@ struct dom_stack {
void *data;
};
#define dom_stack_has_parents(nav) \
((nav)->states && (nav)->depth > 0)
#define dom_stack_has_parents(stack) \
((stack)->states && (stack)->depth > 0)
static inline struct dom_stack_state *
get_dom_stack_state(struct dom_stack *stack, int top_offset)
@ -66,21 +66,21 @@ get_dom_stack_state(struct dom_stack *stack, int top_offset)
return &stack->states[stack->depth - 1 - top_offset];
}
#define get_dom_stack_parent(nav) get_dom_stack_state(nav, 1)
#define get_dom_stack_top(nav) get_dom_stack_state(nav, 0)
#define get_dom_stack_parent(stack) get_dom_stack_state(stack, 1)
#define get_dom_stack_top(stack) get_dom_stack_state(stack, 0)
#define get_dom_stack_state_data(stack, state) \
((void *) &(stack)->state_objects[(state)->depth * (stack)->object_size])
/* The state iterators do not include the bottom state */
#define foreach_dom_state(nav, item, pos) \
for ((pos) = 1; (pos) < (nav)->depth; (pos)++) \
if (((item) = &(nav)->states[(pos)]))
#define foreach_dom_state(stack, item, pos) \
for ((pos) = 1; (pos) < (stack)->depth; (pos)++) \
if (((item) = &(stack)->states[(pos)]))
#define foreachback_dom_state(nav, item, pos) \
for ((pos) = (nav)->depth - 1; (pos) > 0; (pos)--) \
if (((item) = &(nav)->states[(pos)]))
#define foreachback_dom_state(stack, item, pos) \
for ((pos) = (stack)->depth - 1; (pos) > 0; (pos)--) \
if (((item) = &(stack)->states[(pos)]))
/* Dive through the stack states in search for the specified match. */
static inline struct dom_stack_state *