From 1778629d92849af84239c4b8c1940ed76fd87b8a Mon Sep 17 00:00:00 2001 From: Tyge Løvset Date: Tue, 20 Dec 2022 12:17:32 +0100 Subject: Renamed (reverted) cstr_new(lit) => cstr_lit(lit). Old name is deprecated (supported for now). --- include/stc/alt/cstr.h | 2 +- include/stc/cstr.h | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'include/stc') 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); -- cgit v1.2.3