diff options
| author | Tyge Løvset <[email protected]> | 2021-05-25 23:22:18 +0200 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2021-05-25 23:22:18 +0200 |
| commit | 3fbc5727832c0687d97a218e85d93857aadcea1c (patch) | |
| tree | 7e931a16c2ebe5fe35e6bb9bf8769b2332cb2806 /include | |
| parent | eeddeeea0df1db189da3915fd46c0c5e9f3baa2c (diff) | |
| download | STC-modified-3fbc5727832c0687d97a218e85d93857aadcea1c.tar.gz STC-modified-3fbc5727832c0687d97a218e85d93857aadcea1c.zip | |
Replaced csview cstr_trimmed(cstr s, left, right) with: cstr* cstr_trim(cstr* self, left, right);
Diffstat (limited to 'include')
| -rw-r--r-- | include/stc/cstr.h | 2 | ||||
| -rw-r--r-- | include/stc/csview.h | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/include/stc/cstr.h b/include/stc/cstr.h index 54ec993b..695385a2 100644 --- a/include/stc/cstr.h +++ b/include/stc/cstr.h @@ -80,6 +80,8 @@ STC_INLINE cstr cstr_clone(cstr s) { return cstr_from_n(s.str, _cstr_rep(&s)->size); }
STC_INLINE cstr cstr_substr(cstr s, size_t pos, size_t n)
{ return cstr_from_n(s.str + pos, n); }
+STC_INLINE cstr* cstr_trim(cstr* self, size_t left, size_t right)
+ { return cstr_assign_n(self, self->str + left, _cstr_rep(self)->size - left - right); }
STC_INLINE void cstr_clear(cstr* self)
{ self->str[_cstr_rep(self)->size = 0] = '\0'; }
STC_INLINE cstr* cstr_assign(cstr* self, const char* str)
diff --git a/include/stc/csview.h b/include/stc/csview.h index 990104f1..c851cf31 100644 --- a/include/stc/csview.h +++ b/include/stc/csview.h @@ -96,8 +96,6 @@ STC_INLINE cstr cstr_from_v(csview sv) { return cstr_from_n(sv.str, sv.size); }
STC_INLINE csview cstr_to_v(const cstr* self)
{ return c_make(csview){self->str, _cstr_rep(self)->size}; }
-STC_INLINE csview cstr_trimmed(cstr s, size_t left, size_t right)
- { return csview_trimmed(c_sv(s), left, right); }
STC_INLINE cstr* cstr_assign_v(cstr* self, csview sv)
{ return cstr_assign_n(self, sv.str, sv.size); }
STC_INLINE cstr* cstr_append_v(cstr* self, csview sv)
|
