ListPushFrontL
Description
Prepend an element at the head of the list. L-value ownership form.
Success
Returns true. A new node holding lval’s payload is linked as the new head; the list length grows by one. When the list has no copy_init handler, lval has been zeroed.
Failure
Returns false on allocation failure. The list and lval are unchanged.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
List.Insert.c:64:
ListInsertR(&list, b, 1);
ListInsert(&list, c, 1);
ListPushFrontL(&list, d);
ListPushFrontR(&list, h);
ListPushBackR(&list, e);- In
Insert.h:117:
/// TAGS: List, PushFront, Insert
///
#define ListPushFront(l, lval) ListPushFrontL((l), (lval))
///
- In
Insert.h:347:
#define ListMustPushFrontL(l, lval) \
do { \
if (!ListPushFrontL((l), (lval))) { \
LOG_FATAL("ListMustPushFrontL failed"); \
} \
Last updated on