ListPtrAt
- Macro
- October 8, 2025
Table of Contents
ListPtrAt
ListPtrAt
Description
Pointer to data in node at given index in given list
Parameters
Name | Direction | Description |
---|---|---|
l | in | List to get data from. |
idx | in | Index to get data at. |
Success
Pointer to data from node in list at given index
Failure
NULL
Usage example (Cross-references)
- In
Access.h:35
:
#ifdef __cplusplus
# define ListAt(l, idx) (ListPtrAt((l), (idx)) ? *ListPtrAt((l), (idx)) : (LIST_DATA_TYPE(l) {0}))
#else
///
- In
Access.h:48
:
/// FAILURE: Emtpy object.
///
# define ListAt(l, idx) (ListPtrAt((l), (idx)) ? *ListPtrAt((l), (idx)) : ((LIST_DATA_TYPE(l)) {0}))
#endif
- In
ListInt.c:185
:
uint16_t idx = extract_u16(data, offset, size);
if (idx < list->length) {
volatile i32 *ptr = ListPtrAt(list, idx);
if (ptr) {
volatile i32 val = *ptr;