StrPushFrontCstr
- Macro
- August 22, 2025
Table of Contents
StrPushFrontCstr
StrPushFrontCstr
Description
Push a array of characters with given length to the front of this string
Parameters
Name | Direction | Description |
---|---|---|
str | in,out | Str to insert array chars into. |
cstr | in | array of characters with given length to be inserted. |
Success
str
Failure
NULL
Usage example (Cross-references)
- In
Insert.h:137
:
/// FAILURE : NULL
///
#define StrPushFrontZstr(str, zstr) StrPushFrontCstr((str), (zstr), strlen((zstr)))
///
- In
MisraDoc.c:208
:
StrPushFront(&output_path, '/');
LOG_INFO("{}", output_path);
StrPushFrontCstr(&output_path, project.build_dir.data, project.build_dir.length);
LOG_INFO("{}", output_path);
StrReplaceZstr(&output_path, ".c", ".md", 1);
- In
Str.Insert.c:172
:
// Test StrPushFrontCstr function
bool test_str_push_front_cstr(void) {
printf("Testing StrPushFrontCstr\n");
Str s = StrInitFromZstr("World");
- In
Str.Insert.c:177
:
// Push a string at the front
StrPushFrontCstr(&s, "Hello ", 6);
// Check that the string was inserted correctly