Inserts a node into a list.
void UniversalInsertNode( List *l, Node *n, bool (*f)(Node *n,Node *m) )
Every node in a list has a priority (a value from 0 to 255 that is stored in the n_Priority field of the node structure). When a new node is inserted with InsertNodeFromHead()
or InsertNodeFromTail()
, the position at which it is added is determined by its priority. The UniversalInsertNode()
procedure allows tasks to arrange list nodes according to values other than priority.
UniversalInsertNode()
uses a comparison function provided by the calling task to determine where to insert a new node. It compares the node to be inserted with nodes already in the list, beginning with the first node. If the comparison function returns TRUE, the new node is inserted immediately before the node to which it was compared. If the comparison function never returns TRUE, the new node becomes the last node in the list. The comparison function, whose arguments are pointers to two nodes, can use any data in the nodes for the comparison.
Folio call implemented in kernel folio V20.
A node can be included only in one list.
AddHead
(), AddTail(), InsertNodeFromHead(), InsertNodeFromTail(), RemHead(), RemNode(), RemTail()