ValidateList
- Macro
- October 8, 2025
Table of Contents
ValidateList
ValidateList
Description
Validate whether a given List
object is valid. Not foolproof but will work most of the time. Aborts if provided List
is not valid.
Parameters
Name | Direction | Description |
---|---|---|
l | in | Pointer to List object to validate. |
Success
Continue execution, meaning given List
object is most probably a valid List
.
Failure
abort
with an error message.
Usage example (Cross-references)
- In
List.c:10
:
}
ValidateList(list);
clear_list(list, item_size);
- In
List.c:27
:
}
ValidateList(list);
GenericListNode *new_node = calloc(sizeof(GenericListNode), 1);
- In
List.c:92
:
}
ValidateList(list);
if (count == 0) {
- In
List.c:159
:
}
ValidateList(list);
void *data = malloc(item_size * list->length);
- In
List.c:175
:
}
ValidateList(list);
GenericListNode *n1 = node_at_list(list, item_size, idx1);
- In
List.c:204
:
}
ValidateList(list);
u64 i = list->length / 2;
- In
List.c:222
:
}
ValidateList(list);
while (count--) {
- In
List.c:271
:
}
ValidateList(list1);
ValidateList(list2);
- In
List.c:272
:
ValidateList(list1);
ValidateList(list2);
GenericListNode *node = list2->head;
- In
List.c:287
:
}
ValidateList(list);
remove_range_list(list, NULL, item_size, 0, list->length);
- In
List.c:298
:
}
ValidateList(list);
if (idx >= list->length) {
- In
List.c:317
:
}
ValidateList(list);
if (idx >= list->length) {
- In
List.c:383
:
}
ValidateList(list);
u64 abs_target_idx = nidx + ridx;
- In
Insert.h:45
:
#define ListInsertL(l, lval, idx) \
do { \
ValidateList(l); \
LIST_DATA_TYPE(l) * UNPL(_ptrval) = &(lval); \
LIST_DATA_TYPE(l) UNPL(_tmpval) = *UNPL(_ptrval); \
- In
Insert.h:81
:
#define ListInsertR(l, rval, idx) \
do { \
ValidateList(l); \
LIST_DATA_TYPE(l) UNPL(_rval) = (rval); \
insert_into_list(GENERIC_LIST(l), (char *)&UNPL(_rval), sizeof(LIST_DATA_TYPE(l)), (idx)); \
- In
Insert.h:189
:
#define ListPushArrL(l, arr, count) \
do { \
ValidateList(l); \
LIST_DATA_TYPE(l) * UNPL(_ptrval) = (arr); \
const LIST_DATA_TYPE(l) UNPL(_tmpval) = *UNPL(_ptrval); \
- In
Insert.h:212
:
#define ListMergeL(l, l2) \
do { \
ValidateList(l); \
ValidateList(l2); \
{ \
- In
Insert.h:213
:
do { \
ValidateList(l); \
ValidateList(l2); \
{ \
LIST_DATA_TYPE(l) UNPL(_tmp1) = {0}; \
- In
Insert.h:243
:
#define ListMergeR(l, l2) \
do { \
ValidateList(l); \
ValidateList(l2); \
{ \
- In
Insert.h:244
:
do { \
ValidateList(l); \
ValidateList(l2); \
{ \
LIST_DATA_TYPE(l) UNPL(_tmp1) = {0}; \
- In
Foreach.h:28
:
#define ListForeach(l, var) \
for (TYPE_OF(l) UNPL(pl) = (l); UNPL(pl); UNPL(pl) = NULL) \
if ((ValidateList(UNPL(pl)), 1) && (UNPL(pl)->head)) \
for (GenericListNode * UNPL(node) = (GenericListNode *)ListNodeBegin(UNPL(pl)); UNPL(node); \
UNPL(node) = ListNodeNext(UNPL(node))) \
- In
Foreach.h:55
:
#define ListForeachPtr(l, var) \
for (TYPE_OF(l) UNPL(pl) = (l); UNPL(pl); UNPL(pl) = NULL) \
if ((ValidateList(UNPL(pl)), 1) && (UNPL(pl)->head)) \
for (GenericListNode * UNPL(node) = (GenericListNode *)ListNodeBegin(UNPL(pl)); UNPL(node); \
UNPL(node) = ListNodeNext(UNPL(node))) \
- In
Foreach.h:82
:
#define ListForeachReverse(l, var) \
for (TYPE_OF(l) UNPL(pl) = (l); UNPL(pl); UNPL(pl) = NULL) \
if ((ValidateList(UNPL(pl)), 1) && (UNPL(pl)->tail)) \
for (GenericListNode * UNPL(node) = (GenericListNode *)ListNodeEnd(UNPL(pl)); UNPL(node); \
UNPL(node) = ListNodePrev(UNPL(node))) \
- In
Foreach.h:109
:
#define ListForeachPtrReverse(l, var) \
for (TYPE_OF(l) UNPL(pl) = (l); UNPL(pl); UNPL(pl) = NULL) \
if ((ValidateList(UNPL(pl)), 1) && (UNPL(pl)->tail)) \
for (GenericListNode * UNPL(node) = (GenericListNode *)ListNodeEnd(UNPL(pl)); UNPL(node); \
UNPL(node) = ListNodePrev(UNPL(node))) \
- In
Foreach.h:139
:
#define ListForeachInRange(l, var, start, end) \
for (TYPE_OF(l) UNPL(pl) = (l); UNPL(pl); UNPL(pl) = NULL) \
if ((ValidateList(UNPL(pl)), 1) && UNPL(pl)->head) \
for (GenericListNode * UNPL(node) = (GenericListNode *)ListNodeBegin(UNPL(pl)); UNPL(node); \
UNPL(node) = ListNodeNext(UNPL(node))) \
- In
Foreach.h:166
:
#define ListForeachPtrInRange(l, var, start, end) \
for (TYPE_OF(l) UNPL(pl) = (l); UNPL(pl); UNPL(pl) = NULL) \
if ((ValidateList(UNPL(pl)), 1) && UNPL(pl)->head) \
for (GenericListNode * UNPL(node) = (GenericListNode *)ListNodeBegin(UNPL(pl)); UNPL(node); \
UNPL(node) = ListNodeNext(UNPL(node))) \
- In
Foreach.h:195
:
#define ListForeachReverseInRange(l, var, start, end) \
for (TYPE_OF(l) UNPL(pl) = (l); UNPL(pl); UNPL(pl) = NULL) \
if ((ValidateList(UNPL(pl)), 1) && UNPL(pl)->tail) \
for (GenericListNode * UNPL(node) = (GenericListNode *)ListNodeEnd(UNPL(pl)); UNPL(node); \
UNPL(node) = ListNodePrev(UNPL(node))) \
- In
Foreach.h:225
:
#define ListForeachPtrReverseInRange(l, var, start, end) \
for (TYPE_OF(l) UNPL(pl) = (l); UNPL(pl); UNPL(pl) = NULL) \
if ((ValidateList(UNPL(pl)), 1) && UNPL(pl)->tail) \
for (GenericListNode * UNPL(node) = (GenericListNode *)ListNodeEnd(UNPL(pl)); UNPL(node); \
UNPL(node) = ListNodePrev(UNPL(node))) \
- In
Foreach.h:257
:
#define ListForeachIdx(l, var, idx) \
for (TYPE_OF(l) UNPL(pl) = (l); UNPL(pl); UNPL(pl) = NULL) \
if ((ValidateList(UNPL(pl)), 1) && UNPL(pl)->head) \
for (u64 idx = 0, UNPL(pidx) = 0; idx < UNPL(pl)->length;) \
for (GenericListNode * UNPL(node) = (GenericListNode *)ListNodeBegin(UNPL(pl)), *UNPL(next) = NULL; \
- In
Foreach.h:298
:
#define ListForeachPtrIdx(l, var, idx) \
for (TYPE_OF(l) UNPL(pl) = (l); UNPL(pl); UNPL(pl) = NULL) \
if ((ValidateList(UNPL(pl)), 1) && UNPL(pl)->head) \
for (u64 idx = 0, UNPL(pidx) = 0; idx < UNPL(pl)->length;) \
for (GenericListNode * UNPL(node) = (GenericListNode *)ListNodeBegin(UNPL(pl)), *UNPL(next) = NULL; \
- In
Foreach.h:335
:
#define ListForeachReverseIdx(l, var, idx) \
for (TYPE_OF(l) UNPL(pl) = (l); UNPL(pl); UNPL(pl) = NULL) \
if ((ValidateList(UNPL(pl)), 1) && UNPL(pl)->tail && UNPL(pl)->length > 0) \
for (u64 idx = UNPL(pl)->length - 1, \
UNPL(pidx) = UNPL(pl)->length - 1, \
- In
Foreach.h:385
:
#define ListForeachPtrReverseIdx(l, var, idx) \
for (TYPE_OF(l) UNPL(pl) = (l); UNPL(pl); UNPL(pl) = NULL) \
if ((ValidateList(UNPL(pl)), 1) && UNPL(pl)->tail && UNPL(pl)->length > 0) \
for (u64 idx = UNPL(pl)->length - 1, \
UNPL(pidx) = UNPL(pl)->length - 1, \