Go to the source code of this file.
Detailed Description
Function Documentation
Returns element located at position pos.
- Parameters:
-
q | A pointer to the queue data structure. |
pos | Zero-based index of element to return. |
- Returns:
- A pointer to the element at position pos.
-
NULL if position out of bounds.
Removes and returns element from front of queue.
- Parameters:
-
q | A pointer to the queue data structure. |
- Returns:
- A pointer to the oldest element in the queue.
-
NULL if the queue is empty.
Frees all associated memory.
Should always be called last.
- Parameters:
-
q | A pointer to the queue data structure. |
- Returns:
- void
Stores item at the back of the queue.
- Parameters:
-
q | A pointer to the queue data structure. |
item | Value of item to be stored. |
- Returns:
- void
Initializes queue structure.
Should always be called first.
- Parameters:
-
q | A pointer to the queue data structure. |
- Returns:
- void
Helper function to apply operation on each item.
- Parameters:
-
q | A pointer to the queue data structure. |
iter_func | Function pointer to operation to be applied. |
arg | Pass through variable to iter_func. |
- Returns:
- void
Removes and returns element at position pos.
- Parameters:
-
q | A pointer to the queue data structure. |
pos | Position to be removed. |
- Returns:
- A pointer to the element at position pos.
-
NULL if the position is invalid.
Returns number of items in the queue.
- Parameters:
-
q | A pointer to the queue data structure. |
- Returns:
- The number of items in the queue.