VecPushFront
Description
Prepend a single element at the front of the vector, preserving order and taking ownership of val when no deep-copy handler is configured. Default unsuffixed form aliasing to the L (ownership) variant. See VecPushFrontL for the full SUCCESS/FAILURE contract.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
VecCharPtr.c:68:
char *str = generate_cstring(data, offset, data_size, 32);
if (str) {
VecPushFront(vec, str);
cleanup_cstring(str);
}- In
VecStr.c:95:
case VEC_STR_PUSH_FRONT : {
Str str = generate_str_from_input(data, offset, data_size, 32, alloc);
VecPushFront(vec, str);
break;
}- In
VecInt.c:44:
case VEC_INT_PUSH_FRONT : {
i32 value = (i32)extract_u32(data, offset, data_size);
VecPushFront(vec, value);
break;
}- In
Vec.Insert.c:55:
// Test VecPushFront function
bool test_vec_push_front(void) {
WriteFmt("Testing VecPushFront\n");
// Create a vector of integers
- In
Insert.h:1055:
#define VecMustPushFront(v, val) \
do { \
if (!VecPushFront((v), (val))) { \
LOG_FATAL("VecMustPushFront failed"); \
} \
Last updated on