From 89424a2ff3a46dbd82a6954f97a25f973e981c98 Mon Sep 17 00:00:00 2001 From: Tyge Løvset Date: Wed, 1 Jun 2022 21:43:30 +0200 Subject: Renamed cstr_replace() => cstr_replace_at(), and cstr_replace_one() => cstr_replace(self, start, search, replace). --- include/stc/alt/cstr.h | 2 +- include/stc/cstr.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/stc/alt/cstr.h b/include/stc/alt/cstr.h index 32dec09d..da3776bd 100644 --- a/include/stc/alt/cstr.h +++ b/include/stc/alt/cstr.h @@ -102,7 +102,7 @@ STC_INLINE void cstr_insert(cstr* self, const size_t pos, const char* st { cstr_replace_n(self, pos, 0, str, strlen(str)); } STC_INLINE void cstr_insert_s(cstr* self, const size_t pos, cstr s) { cstr_replace_n(self, pos, 0, s.str, _cstr_p(&s)->size); } -STC_INLINE void cstr_replace(cstr* self, const size_t pos, const size_t len, const char* str) +STC_INLINE void cstr_replace_at(cstr* self, const size_t pos, const size_t len, const char* str) { cstr_replace_n(self, pos, len, str, strlen(str)); } STC_INLINE void cstr_replace_s(cstr* self, const size_t pos, const size_t len, cstr s) { cstr_replace_n(self, pos, len, s.str, _cstr_p(&s)->size); } diff --git a/include/stc/cstr.h b/include/stc/cstr.h index 1bf58a18..19dc0d67 100644 --- a/include/stc/cstr.h +++ b/include/stc/cstr.h @@ -317,10 +317,10 @@ STC_INLINE void cstr_replace_n(cstr* self, size_t pos, size_t len, const char* r memcpy(d + pos, repl, n); } -STC_INLINE void cstr_replace(cstr* self, size_t pos, size_t len, const char* repl) +STC_INLINE void cstr_replace_at(cstr* self, size_t pos, size_t len, const char* repl) { cstr_replace_n(self, pos, len, repl, strlen(repl)); } -STC_INLINE size_t cstr_replace_one(cstr* self, size_t pos, const char* search, const char* repl) { +STC_INLINE size_t cstr_replace(cstr* self, size_t pos, const char* search, const char* repl) { pos = cstr_find_from(*self, pos, search); if (pos == cstr_npos) return pos; -- cgit v1.2.3