summaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-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);