prg_list_head_cell_get()
Abstract
Quickly obtains a pointer to the head cell of a specified list.
Syntax
prg_list_head_cell_get (list_ptr)
| Argument | Type | Description |
|---|---|---|
list_ptr |
PrgT_List * |
List of interest. |
Return Type
PrgT_List_Cell *
The head cell of the specified list, or PRGC_NIL if the list is empty.
Header
prg_list_funcs.h
Details
This function is implemented as an inline definition for faster operation. No error checking is done to verify the validity of the list pointer.
WARNING: This function is MT unsafe, as described in “Multi-Threading Safety“ on page 11. Access to shared lists must be externally serialized.
Purpose:
This function provides a way to quickly obtain a pointer to the head cell of a list. It can be used when doing fast iterations over linked lists.
Errors:
- Program Abort: Segmentation violation. (due to an illegal list pointer or malformed list)
Reference:
- use
prg_list_cell_next_get()to obtain a reference to the next cell of a list - use
prg_list_cell_data_get()to obtain the data associated with a specific cell