macro LFDS710_LIST_ASO_GET_START_AND_THEN_NEXT

From liblfds.org
Jump to navigation Jump to search

Source File

└───liblfds710
    └───inc
        └───liblfds710
                lfds710_list_addonly_singlylinked_ordered.h

Opaque Structures

struct lfds710_list_aso_element;
struct lfds710_list_aso_state;

Macro

#define LFDS710_LIST_ASO_GET_START_AND_THEN_NEXT( list_aso_state, pointer_to_list_aso_element )

Parameters

list_aso_state

A struct lfds710_list_aso_state. Not a pointer to it - the struct itself.

pointer_to_list_aso_element

A pointer to struct lfds710_list_aso_element. This is and only is a pointer - it's not the address of an actual, allocated struct.

Return Value

If pointer_to_list_aso_element is NULL, returns (and sets pointer_to_list_aso_element to be the same value) a struct lfds710_list_aso_element * to the first element in the list.

If pointer_to_list_aso_element is not NULL, returns (and sets pointer_to_list_aso_element to be the same value) a struct lfds710_list_aso_element * to the element after the list element *pointer_to_list_aso_element.

Notes

This is a convenience macro, expected use is in the conditional part of while loops. If the pointer_to_list_aso_element argument is NULL, then the macro returns (and sets the element pointer to be) the first element; if it is non-NULL (and then mustt be a pointer to an element in the list), then the macro returns (and sets the element pointer to be) the next element in the list, eventully returning (and setting the element pointer to be) NULL, which causes the while loop to finish.

Example

Coming soon. No, really! (Written 29th Dec 2015).

See Also