gdl_insert_before, gdl_insert_after 3 2016-03-06 genlist manual

NAME

gdl_insert_before, gdl_insert_after - enter new item as last or first of the list

SYNPOSIS

void gdl_insert_before(gdl_list_t *list, itemtype *at_elem, itemtype *elem, fieldname *field)

void gdl_insert_after(gdl_list_t *list, itemtype *at_elem, itemtype *elem, fieldname *field)

DESCRIPTION

gdl_insert_before inserts elem before at_elem. gdl_insert_after inserts elem after at_elem. If at_elem is NULL or is the first (last) elem of the list, the effect is the same as calling gdl_insert(3) or gdl_append(3), respectively.

The list must consists of items with the same link-offset; this is assured using field.

Both calls are implemented as function-like macros evaluating to void.

Arguments:
list A list of which elem should be insert in. May not be NULL.
at_elem NULL or a pointer to an item of the list.
elem The element; pointer to a struct with complete type (fields known); may not be NULL.
field Structure field name that is used for linking. The field must be of type gdl_elem_t (not a pointer).

SEE ALSO

gdl_insert_before, gdl_insert_after 3 2016-03-06 genlist manual