summaryrefslogtreecommitdiffhomepage
path: root/include/stc/csview.h
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 /include/stc/csview.h
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 'include/stc/csview.h')
-rw-r--r--include/stc/csview.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/include/stc/csview.h b/include/stc/csview.h
index 53f08dbb..4cbe1ee2 100644
--- a/include/stc/csview.h
+++ b/include/stc/csview.h
@@ -96,10 +96,10 @@ STC_INLINE csview cstr_substr(const cstr* self, intptr_t pos, size_t n)
{ return csview_substr(csview_from_s(self), pos, n); }
STC_INLINE csview cstr_slice(const cstr* self, intptr_t p1, intptr_t p2)
{ return csview_slice(csview_from_s(self), p1, p2); }
-STC_INLINE cstr* cstr_assign_sv(cstr* self, csview sv)
- { return cstr_assign_n(self, sv.str, sv.size); }
-STC_INLINE cstr* cstr_append_sv(cstr* self, csview sv)
- { return cstr_append_n(self, sv.str, sv.size); }
+STC_INLINE csview cstr_assign_sv(cstr* self, csview sv)
+ { return c_make(csview){cstr_assign_n(self, sv.str, sv.size), sv.size}; }
+STC_INLINE void cstr_append_sv(cstr* self, csview sv)
+ { cstr_append_n(self, sv.str, sv.size); }
STC_INLINE void cstr_insert_sv(cstr* self, size_t pos, csview sv)
{ cstr_replace_n(self, pos, 0, sv.str, sv.size); }
STC_INLINE void cstr_replace_sv(cstr* self, csview sub, csview with)