diff options
| author | Tyge Løvset <[email protected]> | 2022-04-25 17:12:17 +0200 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2022-04-25 17:12:17 +0200 |
| commit | 72b40c6f5bbfbf11eba112a42ca5536c4c8e7d8f (patch) | |
| tree | c05896fb7bd57855b517f316a8c284127a1f2778 /include/stc | |
| parent | 09f08e7ac65624d63f1eb04fba2317a2e0b2b0b7 (diff) | |
| download | STC-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.h | 4 |
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; }
|
