gdl_next_nth, gdl_prev_nth 3 | 2016-02-26 | genlist manual |
---|
gdl_next_nth, gdl_prev_nth - return the nth next or nth previous element of a list
void gdl_next_nth(gdl_list_t *list, itemtype *elem, int n, itemtype **result)
void gdl_prev_nth(gdl_list_t *list, itemtype *elem, int n, itemtype **result)
gdl_next_nth returns the nth next element after elem, or NULL if elem is NULL or the result would be beyond the end of the list. gdl_next_nth returns the nth previous element before elem, or NULL if elem is NULL or the result would be beyond the end of the list.Calling these functions with n=1 is the same as calling gdl_next or gdl_prev.
Both calls are implemented as function-like macros.
Arguments:
list A list of which elem is a member. May not be NULL. elem The element whose nth previos or nth next sibling is returned; may be NULL. n An integer offset (the "n" part in the "nth"). result A pointer to an element-pointer; it will be loaded with NULL or with the pointer of the resulting element.
Writes the pointer to the nth next (or nth previous) element, or NULL, into result.
gdl_next_nth, gdl_prev_nth 3 | 2016-02-26 | genlist manual |
---|