StrMergeR
Description
Merge a copy of str2 into the end of str with R-value (read-only- source) semantics. The source is never emptied.
Success
Returns true; str grows by str2->length characters; str2 is untouched.
Failure
Returns false on allocation failure. Both strings unchanged.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Proc.c:503:
if (n > 0) {
StrResize(&tmpbuf, (size)n);
StrMergeR(buf, &tmpbuf);
total_read += n;
} else if (n == 0) {- In
Proc.c:550:
StrResize(&tmpbuf, bytes_read);
StrMergeR(buf, &tmpbuf);
total_read += bytes_read;
}- In
Dns.c:118:
break;
StrResize(&chunk, (size)n);
StrMergeR(out, &chunk);
}
}- In
Str.Insert.c:289:
// Test StrMergeR function
bool test_str_merge_r(void) {
WriteFmt("Testing StrMergeR\n");
DefaultAllocator alloc = DefaultAllocatorInit();- In
Str.Insert.c:297:
// Merge s2 into s1 (R-value semantics)
StrMergeR(&s1, &s2);
// Check that the strings were merged correctly
Last updated on