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

DOM: Add get_dom_node_next()

This commit is contained in:
Jonas Fonseca 2006-01-30 06:03:36 +01:00 committed by Jonas Fonseca
parent ea675cbb6e
commit bc50084475
2 changed files with 21 additions and 0 deletions

View File

@ -268,6 +268,24 @@ get_dom_node_prev(struct dom_node *node)
return NULL;
}
struct dom_node *
get_dom_node_next(struct dom_node *node)
{
struct dom_node_list **list;
int index;
assert(node->parent);
list = get_dom_node_list(node->parent, node);
if (!list) return NULL;
index = get_dom_node_list_pos(*list, node);
if (index + 1 < (*list)->size)
return (*list)->entries[index + 1];
return NULL;
}
struct dom_node *
get_dom_node_child(struct dom_node *parent, enum dom_node_type type,
int16_t subtype)

View File

@ -242,6 +242,9 @@ int get_dom_node_map_index(struct dom_node_list *list, struct dom_node *node);
/* Returns the previous sibling to the node. */
struct dom_node *get_dom_node_prev(struct dom_node *node);
/* Returns the next sibling to the node. */
struct dom_node *get_dom_node_next(struct dom_node *node);
/* Returns first text node of the element or NULL. */
struct dom_node *
get_dom_node_child(struct dom_node *node, enum dom_node_type child_type,