summaryrefslogtreecommitdiffhomepage
path: root/docs/cstr_api.md
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2022-05-13 13:42:20 +0200
committerTyge Løvset <[email protected]>2022-05-13 13:42:20 +0200
commiteda5a6418d0dda97261e340998f8f7e23a8e57b2 (patch)
tree7f774c6d672f66db52de3a2178ef6fe2b1cb06d6 /docs/cstr_api.md
parent0f257a1065f551e437199307d21cfc4f9e5415ea (diff)
downloadSTC-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/cstr_api.md')
-rw-r--r--docs/cstr_api.md13
1 files changed, 7 insertions, 6 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);