summaryrefslogtreecommitdiffhomepage
path: root/include/stc/cstr.h
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2023-01-27 15:09:59 +0100
committerTyge Løvset <[email protected]>2023-01-27 15:09:59 +0100
commit8c81c9642b5f7564f06654562d929703f2d2dd0a (patch)
tree05a33a34d339dad8fc5a909443b6c616cb5b800d /include/stc/cstr.h
parent5c1b1616f5a20a54c32e57b0bea49f366441356b (diff)
downloadSTC-modified-8c81c9642b5f7564f06654562d929703f2d2dd0a.tar.gz
STC-modified-8c81c9642b5f7564f06654562d929703f2d2dd0a.zip
(Reverted) c_COMPOUND() to c_LITERAL().
Diffstat (limited to 'include/stc/cstr.h')
-rw-r--r--include/stc/cstr.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/include/stc/cstr.h b/include/stc/cstr.h
index b500065e..04091968 100644
--- a/include/stc/cstr.h
+++ b/include/stc/cstr.h
@@ -71,7 +71,7 @@ STC_API char* _cstr_internal_move(cstr* self, size_t pos1, size_t pos2);
/**************************** PUBLIC API **********************************/
#define cstr_lit(literal) cstr_from_n(literal, crawstr_len(literal))
-#define cstr_NULL (c_COMPOUND(cstr){{{0}, 0}})
+#define cstr_NULL (c_LITERAL(cstr){{{0}, 0}})
#define cstr_toraw(self) cstr_str(self)
STC_API char* cstr_reserve(cstr* self, size_t cap);
@@ -90,12 +90,12 @@ STC_API cstr cstr_replace_sv(csview sv, csview search, csview repl, unsigned
STC_INLINE cstr_buf cstr_buffer(cstr* s) {
return cstr_is_long(s)
- ? c_COMPOUND(cstr_buf){s->lon.data, cstr_l_size(s), cstr_l_cap(s)}
- : c_COMPOUND(cstr_buf){s->sml.data, cstr_s_size(s), cstr_s_cap};
+ ? c_LITERAL(cstr_buf){s->lon.data, cstr_l_size(s), cstr_l_cap(s)}
+ : c_LITERAL(cstr_buf){s->sml.data, cstr_s_size(s), cstr_s_cap};
}
STC_INLINE csview cstr_sv(const cstr* s) {
- return cstr_is_long(s) ? c_COMPOUND(csview){s->lon.data, cstr_l_size(s)}
- : c_COMPOUND(csview){s->sml.data, cstr_s_size(s)};
+ return cstr_is_long(s) ? c_LITERAL(csview){s->lon.data, cstr_l_size(s)}
+ : c_LITERAL(csview){s->sml.data, cstr_s_size(s)};
}
STC_INLINE cstr cstr_init(void)
@@ -222,11 +222,11 @@ STC_INLINE csview cstr_u8_chr(const cstr* self, size_t u8idx) {
STC_INLINE cstr_iter cstr_begin(const cstr* self) {
csview sv = cstr_sv(self);
- if (!sv.size) return c_COMPOUND(cstr_iter){NULL};
- return c_COMPOUND(cstr_iter){.u8 = {{sv.str, utf8_chr_size(sv.str)}}};
+ if (!sv.size) return c_LITERAL(cstr_iter){NULL};
+ return c_LITERAL(cstr_iter){.u8 = {{sv.str, utf8_chr_size(sv.str)}}};
}
STC_INLINE cstr_iter cstr_end(const cstr* self) {
- (void)self; return c_COMPOUND(cstr_iter){NULL};
+ (void)self; return c_LITERAL(cstr_iter){NULL};
}
STC_INLINE void cstr_next(cstr_iter* it) {
it->ref += it->u8.chr.size;