diff options
| author | Tyge Løvset <[email protected]> | 2022-05-13 13:42:20 +0200 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2022-05-13 13:42:20 +0200 |
| commit | eda5a6418d0dda97261e340998f8f7e23a8e57b2 (patch) | |
| tree | 7f774c6d672f66db52de3a2178ef6fe2b1cb06d6 /docs | |
| parent | 0f257a1065f551e437199307d21cfc4f9e5415ea (diff) | |
| download | STC-modified-eda5a6418d0dda97261e340998f8f7e23a8e57b2.tar.gz STC-modified-eda5a6418d0dda97261e340998f8f7e23a8e57b2.zip | |
Added cstr_assign_s(), and changed return type to char* for cstr_assign*() and cstr_append*(), i.e. the pointer to the (possible new) string buffer.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/cstr_api.md | 13 | ||||
| -rw-r--r-- | docs/csview_api.md | 4 |
2 files changed, 9 insertions, 8 deletions
diff --git a/docs/cstr_api.md b/docs/cstr_api.md index 54178d29..e5a3ce37 100644 --- a/docs/cstr_api.md +++ b/docs/cstr_api.md @@ -45,14 +45,15 @@ void cstr_shrink_to_fit(cstr* self); char* cstr_expand_uninit(cstr* self, size_t n); // return ptr to uninit data void cstr_clear(cstr* self); -cstr* cstr_assign(cstr* self, const char* str); -cstr* cstr_assign_n(cstr* self, const char* str, size_t n); // assign n first chars of str -cstr* cstr_copy(cstr* self, cstr s); // cstr_take(self, cstr_clone(s)) +char* cstr_assign(cstr* self, const char* str); +char* cstr_assign_s(cstr* self, cstr s); +char* cstr_assign_n(cstr* self, const char* str, size_t n); // assign n first chars of str +void cstr_copy(cstr* self, cstr s); // like cstr_assign_s() int cstr_printf(cstr* self, const char* fmt, ...); // printf() formatting -cstr* cstr_append(cstr* self, const char* str); -cstr* cstr_append_s(cstr* self, cstr s); -cstr* cstr_append_n(cstr* self, const char* str, size_t n); +char* cstr_append(cstr* self, const char* str); +char* cstr_append_s(cstr* self, cstr s); +char* cstr_append_n(cstr* self, const char* str, size_t n); void cstr_insert(cstr* self, size_t pos, const char* str); void cstr_insert_s(cstr* self, size_t pos, cstr s); diff --git a/docs/csview_api.md b/docs/csview_api.md index b4319c85..0a071278 100644 --- a/docs/csview_api.md +++ b/docs/csview_api.md @@ -82,8 +82,8 @@ cstr cstr_from_replace_all_sv(csview sv, csview find, csview replace) csview cstr_substr(const cstr* s, intptr_t pos, size_t n); // negative pos count from end csview cstr_slice(const cstr* s, intptr_t p, intptr_t q); // negative p or q count from end -cstr* cstr_assign_sv(cstr* self, csview sv); -cstr* cstr_append_sv(cstr* self, csview sv); +csview cstr_assign_sv(cstr* self, csview sv); // return csview of assigned cstr +void cstr_append_sv(cstr* self, csview sv); void cstr_insert_sv(cstr* self, size_t pos, csview sv); void cstr_replace_sv(cstr* self, size_t pos, size_t len, csview sv); |
