gdl_next, gdl_prev 3 2016-03-06 genlist manual

NAME

gdl_index - count element index on a list

SYNPOSIS

void gdl_index(gdl_list_t *list, itemtype *elem, fieldname *field, size_t *result)

DESCRIPTION

gdl_index counts elements from elem to the beginning of the list in result. If elem is the first element of the list, result is loaded with 0.

This call is implemented as function-like macros evaluating to void.

Arguments:
list A list of which elem is a member. May not be NULL.
elem The element whose index is to be counted; may be NULL.
field Structure field name that is used for linking. The field must be of type gdl_elem_t (not a pointer).
result The result is stored here.

SEE ALSO

gdl_next, gdl_prev 3 2016-03-06 genlist manual