Back

List...() functions




    USAGE

    ListLen = (short) List_Len(TopItem)
    Position = (short) List_Position(TopItem, Item)
    Item = (struct ListItem *) List_Pred(TopItem, NextItem)
    Item = (struct ListItem *) List_Index(TopItem, Position)
    TopItem = (struct ListItem *) List_Insert(TopItem, Item, Position)
    TopItem = (struct ListItem *) List_Remove(TopItem, Item)
    TopItem = (struct ListItem *) List_Cat(FirstList, SecondList)

    FUNCTION

    These are a set of general purpose list handling routines that are useful if you are using singly linked lists where the first field in each item is a pointer to the next item.
    You can use these to manipulate gadget lists and the lists you display with the ListInfo structure.
    Some routines that alter a list return a pointer to the top item in the list. This is because the top item get changed to a new value.
    INPUTS

    TopItem Pointer to the top item in your list.
    Item Pointer to a specific item in thelist. Might be TopItem.
    NextItem Pointer to the item following the one we wish to access.
    FirstList pointer to the first item in a list that will have e second list attached to it.
    SecondList Pointer to the first item in the second list for the concatanation operation.
    Position Count that indicates at what position in the list Item is. A Position of -1 can be used to indicate the end of the list.

    RESULT

    ListLen = the len of the requested list

    Position , Item, TopItem see above