diff options
| author | Tyge Løvset <[email protected]> | 2022-12-20 12:17:32 +0100 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2022-12-20 12:17:32 +0100 |
| commit | 1778629d92849af84239c4b8c1940ed76fd87b8a (patch) | |
| tree | cbe600a280aee2405836c66413e234de071bb231 /docs/ccommon_api.md | |
| parent | 21817cae767d72e6007150b639f9365e35502173 (diff) | |
| download | STC-modified-1778629d92849af84239c4b8c1940ed76fd87b8a.tar.gz STC-modified-1778629d92849af84239c4b8c1940ed76fd87b8a.zip | |
Renamed (reverted) cstr_new(lit) => cstr_lit(lit). Old name is deprecated (supported for now).
Diffstat (limited to 'docs/ccommon_api.md')
| -rw-r--r-- | docs/ccommon_api.md | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/docs/ccommon_api.md b/docs/ccommon_api.md index 8f887626..2c6db85f 100644 --- a/docs/ccommon_api.md +++ b/docs/ccommon_api.md @@ -32,7 +32,7 @@ c_with (FILE* fp = fopen(fname, "rb"), fclose(fp)) } } -c_with (cstr str = cstr_new("Hello"), cstr_drop(&str)) +c_with (cstr str = cstr_lit("Hello"), cstr_drop(&str)) { cstr_append(&str, " world"); printf("%s\n", cstr_str(&str)); @@ -50,7 +50,7 @@ c_auto (cstr, s1, s2) printf("%s %s\n", cstr_str(&s1), cstr_str(&s2)); } -c_autodrop (cstr, str, cstr_new("Hello")) +c_autodrop (cstr, str, cstr_lit("Hello")) { cstr_append(&str, " world"); printf("%s\n", cstr_str(&str)); @@ -64,7 +64,7 @@ c_scope (pthread_mutex_lock(&mut), pthread_mutex_unlock(&mut)) } // `c_defer` executes the expressions when leaving scope. -cstr s1 = cstr_new("Hello"), s2 = cstr_new("world"); +cstr s1 = cstr_lit("Hello"), s2 = cstr_lit("world"); c_defer (cstr_drop(&s1), cstr_drop(&s2)) { printf("%s %s\n", cstr_str(&s1), cstr_str(&s2)); @@ -330,7 +330,7 @@ c_free(pnt); int* array = c_alloc_n (int, 100); c_free(array); -cstr a = cstr_new("Hello"), b = cstr_new("World"); +cstr a = cstr_lit("Hello"), b = cstr_lit("World"); c_drop(cstr, &a, &b); ``` |
