summaryrefslogtreecommitdiffhomepage
path: root/docs/cstr_api.md
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2022-12-20 12:17:32 +0100
committerTyge Løvset <[email protected]>2022-12-20 12:17:32 +0100
commit1778629d92849af84239c4b8c1940ed76fd87b8a (patch)
treecbe600a280aee2405836c66413e234de071bb231 /docs/cstr_api.md
parent21817cae767d72e6007150b639f9365e35502173 (diff)
downloadSTC-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/cstr_api.md')
-rw-r--r--docs/cstr_api.md6
1 files changed, 3 insertions, 3 deletions
diff --git a/docs/cstr_api.md b/docs/cstr_api.md
index 1f80e8e4..0f9589d9 100644
--- a/docs/cstr_api.md
+++ b/docs/cstr_api.md
@@ -19,7 +19,7 @@ All cstr definitions and prototypes are available by including a single header f
## Methods
```c
cstr cstr_init(void); // constructor; same as cstr_NULL.
-cstr cstr_new(const char literal_only[]); // cstr from literal; no strlen() call.
+cstr cstr_lit(const char literal_only[]); // cstr from literal; no strlen() call.
cstr cstr_from(const char* str); // constructor using strlen()
cstr cstr_from_n(const char* str, size_t n); // constructor with n first bytes of str
cstr cstr_from_sv(csview sv); // construct cstr from csview
@@ -160,10 +160,10 @@ char* cstrnstrn(const char* str, const char* search, size_t slen, size_t
#include <stc/cstr.h>
int main() {
- cstr s0 = cstr_new("Initialization without using strlen().");
+ cstr s0 = cstr_lit("Initialization without using strlen().");
printf("%s\nLength: %" c_ZU "\n\n", cstr_str(&s0), cstr_size(&s0));
- cstr s1 = cstr_new("one-nine-three-seven-five.");
+ cstr s1 = cstr_lit("one-nine-three-seven-five.");
printf("%s\n", cstr_str(&s1));
cstr_insert(&s1, 3, "-two");