Skip to content
ListPushFrontR

ListPushFrontR

Description

Prepend an element at the head of the list. R-value form.

Success

Returns true. A new node holding a copy of rval is linked as the new head; the list length grows by one.

Failure

Returns false on allocation failure. The list is unchanged.

Usage example (Cross-references)

Usage examples (Cross-references)
            case LIST_INT_PUSH_FRONT : {
                i32 value = (i32)extract_u32(data, offset, data_size);
                ListPushFrontR(list, value);
                break;
            }
        ListInsert(&list, c, 1);
        ListPushFrontL(&list, d);
        ListPushFrontR(&list, h);
        ListPushBackR(&list, e);
        ListPushFront(&list, f);
    #define ListMustPushFrontR(l, rval)                                                                                    \
        do {                                                                                                               \
            if (!ListPushFrontR((l), (rval))) {                                                                            \
                LOG_FATAL("ListMustPushFrontR failed");                                                                    \
            }                                                                                                              \
Last updated on