summaryrefslogtreecommitdiffhomepage
path: root/include/stc
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2022-04-25 17:12:17 +0200
committerTyge Løvset <[email protected]>2022-04-25 17:12:17 +0200
commit72b40c6f5bbfbf11eba112a42ca5536c4c8e7d8f (patch)
treec05896fb7bd57855b517f316a8c284127a1f2778 /include/stc
parent09f08e7ac65624d63f1eb04fba2317a2e0b2b0b7 (diff)
downloadSTC-modified-72b40c6f5bbfbf11eba112a42ca5536c4c8e7d8f.tar.gz
STC-modified-72b40c6f5bbfbf11eba112a42ca5536c4c8e7d8f.zip
Some maintainance. Updated sso_bench.cpp
Diffstat (limited to 'include/stc')
-rw-r--r--include/stc/alt/cstr.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/stc/alt/cstr.h b/include/stc/alt/cstr.h
index 437ce5f9..06f8eae1 100644
--- a/include/stc/alt/cstr.h
+++ b/include/stc/alt/cstr.h
@@ -65,12 +65,14 @@ STC_API bool cstr_getdelim(cstr *self, int delim, FILE *stream);
STC_API void cstr_replace_all(cstr* self, const char* find, const char* repl);
STC_INLINE cstr cstr_init() { return cstr_null; }
+STC_INLINE const char* cstr_str(const cstr* self) { return self->str; }
#define cstr_toraw(self) (self)->str
+STC_INLINE csview cstr_sv(const cstr* self)
+ { return c_make(csview){self->str, _cstr_p(self)->size}; }
#define cstr_new(literal) \
cstr_from_n(literal, c_strlen_lit(literal))
STC_INLINE cstr cstr_from(const char* str)
{ return cstr_from_n(str, strlen(str)); }
-STC_INLINE const char* cstr_str(const cstr* self) { return self->str; }
STC_INLINE char* cstr_data(cstr* self) { return self->str; }
STC_INLINE size_t cstr_size(cstr s) { return _cstr_p(&s)->size; }
STC_INLINE size_t cstr_length(cstr s) { return _cstr_p(&s)->size; }