# Function Calls

The following list contains the function calls that handle linked lists. See Kernel Folio Calls, in the 3DO System Programmer's Reference for more information on these calls.

## Initializing a List

The following calls initialize a list:

- `InitList()` Initializes a list.
- `INITLIST()` Statically initializes a list.

## Adding Nodes to a List

The following calls handle nodes:

- `AddHead()` Adds a node to the head of a list.
- `AddTail()` Adds a node to the tail of a list.
- `InsertNodeAfter()` Inserts a node after another node already in a list.
- `InsertNodeBefore()` Inserts a node before another node already in a list.
- `InsertNodeFromHead()`Inserts a node into a list.
- `InsertNodeFromTail()` Inserts a node into a list.
- `UniversalInsertNode()` Inserts a node into a list.

## Changing the Priority of a List Node

The following call changes the priority of a node:

- `SetNodePri()` Changes the priority of a list node.

## Removing Nodes From a List

The following calls remove nodes from a list:

- `RemHead()` Removes the first node from a list.
- `RemNode()` Removes a specified node from a list.
- `RemTail()` Removes the last node from a list.

## Checking to See If a List Is Empty

The following call checks if a list is empty:

- `IsListEmpty()` Checks whether a list is empty.

## Testing Nodes and Lists

The following calls are used to test nodes and lists:

- `IsNode()` Checks whether a node is an actual node or the tail (end-of-list) anchor.
- `IsNodeB()` Tests whether the node is an actual node or the head (beginning-of-list) anchor.

## Traversing a Linked List

The following calls are used to traverse a list:

- `FirstNode()` Gets the first node in a list.
- `LastNode()` Gets the last node in a list.
- `NextNode()` Gets the next node in a list.
- `PrevNode()` Gets the previous node in a list.
- `ScanList()`Walks through all the nodes in a list.
- `ScanListB()` Walks through all the nodes in a list backwards.

## Finding a Node by Name

The following call finds a node by name.

- `FindNamedNode()` Finds a node by specifying its name.

## Ordinal Node Position Functions

The following functions deal with nodes using their ordinal position in a list.

- `FindNodeFromHead()` Finds a node in a list by counting from the head of the list.
- `FindNodeFromTail()` Finds a node in a list by counting from the tail of the list.
- `GetNodePosFromHead()` Determines the position of a node within a list, counting from the head of the list.
- `GetNodePosFromTail()` Determines the position of a node within a list, counting from the tail of the list.

## Counting the Nodes in a List

- `GetNodeCount()` Counts the number of nodes in a list.
- `DumpNode()` Prints contents of a node to the debugging terminal.