StrPushFrontMany
Description
Prepend MANY characters at the head of str. R-form. Two arities:
StrPushFrontMany(str, zstr) - 2 args; NUL-terminated. StrPushFrontMany(str, cstr, cstr_len) - 3 args; counted view.
Success
Returns true; bytes copied at the head; existing characters shifted right by the prepended length.
Failure
Returns false on allocation failure. str unchanged.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Str.Insert.c:175:
// Test StrPushFrontMany function
bool test_str_push_front_cstr(void) {
WriteFmt("Testing StrPushFrontMany\n");
DefaultAllocator alloc = DefaultAllocatorInit();- In
Str.Insert.c:182:
// Push a string at the front
StrPushFrontMany(&s, "Hello ", 6);
// Check that the string was inserted correctly
- In
Str.Insert.c:194:
// Test StrPushFrontMany function
bool test_str_push_front_zstr(void) {
WriteFmt("Testing StrPushFrontMany\n");
DefaultAllocator alloc = DefaultAllocatorInit();- In
Str.Insert.c:201:
// Push a string at the front
StrPushFrontMany(&s, "Hello ");
// Check that the string was inserted correctly
Last updated on