VecPushFrontArrR
Description
Prepend a contiguous range at the front of the vector. R-value form.
Success
Returns true. The vector length grows by count; copies of the source elements occupy [0, count); all previous elements have shifted right by count. The source range is untouched.
Failure
Returns false on allocation failure. The vector is unchanged.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
VecInt.c:286:
values[i] = (i32)extract_u32(data, offset, data_size);
}
VecPushFrontArrR(vec, values, count);
}
break;- In
Vec.Insert.c:167:
// Push an array to the front of empty vector
int values[] = {10, 20, 30, 40, 50};
VecPushFrontArrR(&vec, values, 5);
// Check length
- In
Vec.Insert.c:179:
// Push another array to the front
int more_values[] = {60, 70, 80};
VecPushFrontArrR(&vec, more_values, 3);
// Check length
- In
Insert.h:830:
#define VecMustPushFrontArrR(v, arr, count) \
do { \
if (!VecPushFrontArrR((v), (arr), (count))) { \
LOG_FATAL("VecMustPushFrontArrR failed"); \
} \- In
Insert.h:287:
#define StrPushFrontMany(...) OVERLOAD(StrPushFrontMany, __VA_ARGS__)
#define StrPushFrontMany_2(str, zstr) \
_Generic((zstr), Zstr: VecPushFrontArrR((str), (Zstr)(zstr), ZstrLen((Zstr)(zstr))), char *: VecPushFrontArrR((str), (Zstr)(zstr), ZstrLen((Zstr)(zstr))))
#define StrPushFrontMany_3(str, cstr, cstr_len) \
_Generic((cstr), Zstr: VecPushFrontArrR((str), (Zstr)(cstr), (cstr_len)), char *: VecPushFrontArrR((str), (Zstr)(cstr), (cstr_len)))- In
Insert.h:289:
_Generic((zstr), Zstr: VecPushFrontArrR((str), (Zstr)(zstr), ZstrLen((Zstr)(zstr))), char *: VecPushFrontArrR((str), (Zstr)(zstr), ZstrLen((Zstr)(zstr))))
#define StrPushFrontMany_3(str, cstr, cstr_len) \
_Generic((cstr), Zstr: VecPushFrontArrR((str), (Zstr)(cstr), (cstr_len)), char *: VecPushFrontArrR((str), (Zstr)(cstr), (cstr_len)))
///
- In
Insert.h:723:
/// TAGS: Str, PushFront, Range, RValue
///
#define StrPushFrontArrR(str, arr, count) VecPushFrontArrR((str), (arr), (count))
///
Last updated on