summaryrefslogtreecommitdiffhomepage
path: root/include/stc
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2022-12-20 12:17:32 +0100
committerTyge Løvset <[email protected]>2022-12-20 12:17:32 +0100
commit1778629d92849af84239c4b8c1940ed76fd87b8a (patch)
treecbe600a280aee2405836c66413e234de071bb231 /include/stc
parent21817cae767d72e6007150b639f9365e35502173 (diff)
downloadSTC-modified-1778629d92849af84239c4b8c1940ed76fd87b8a.tar.gz
STC-modified-1778629d92849af84239c4b8c1940ed76fd87b8a.zip
Renamed (reverted) cstr_new(lit) => cstr_lit(lit). Old name is deprecated (supported for now).
Diffstat (limited to 'include/stc')
-rw-r--r--include/stc/alt/cstr.h2
-rw-r--r--include/stc/cstr.h4
2 files changed, 4 insertions, 2 deletions
diff --git a/include/stc/alt/cstr.h b/include/stc/alt/cstr.h
index 37eaa318..ecb9c9fb 100644
--- a/include/stc/alt/cstr.h
+++ b/include/stc/alt/cstr.h
@@ -68,7 +68,7 @@ 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_INIT(csview){self->str, _cstr_p(self)->size}; }
-#define cstr_new(literal) \
+#define cstr_lit(literal) \
cstr_from_n(literal, c_strlen_lit(literal))
STC_INLINE cstr cstr_from(const char* str)
{ return cstr_from_n(str, strlen(str)); }
diff --git a/include/stc/cstr.h b/include/stc/cstr.h
index a0dd1adc..6f774135 100644
--- a/include/stc/cstr.h
+++ b/include/stc/cstr.h
@@ -70,9 +70,11 @@ STC_API char* _cstr_internal_move(cstr* self, size_t pos1, size_t pos2);
/**************************** PUBLIC API **********************************/
-#define cstr_new(literal) cstr_from_n(literal, c_strlen_lit(literal))
+#define cstr_lit(literal) cstr_from_n(literal, c_strlen_lit(literal))
#define cstr_NULL (c_INIT(cstr){{{0}, 0}})
#define cstr_toraw(self) cstr_str(self)
+#define cstr_new(lit) cstr_lit(lit) /* [deprecated] */
+#define cstr_null cstr_NULL /* [deprecated] */
STC_API char* cstr_reserve(cstr* self, size_t cap);
STC_API void cstr_shrink_to_fit(cstr* self);