summaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2022-06-01 21:43:30 +0200
committerTyge Løvset <[email protected]>2022-06-01 21:43:30 +0200
commit89424a2ff3a46dbd82a6954f97a25f973e981c98 (patch)
tree2b72d8066cebaa580c3686bf477456e10d3e37fc /include
parent239276667b547dc795678cf3ac3c28c5ccf72532 (diff)
downloadSTC-modified-89424a2ff3a46dbd82a6954f97a25f973e981c98.tar.gz
STC-modified-89424a2ff3a46dbd82a6954f97a25f973e981c98.zip
Renamed cstr_replace() => cstr_replace_at(), and cstr_replace_one() => cstr_replace(self, start, search, replace).
Diffstat (limited to 'include')
-rw-r--r--include/stc/alt/cstr.h2
-rw-r--r--include/stc/cstr.h4
2 files changed, 3 insertions, 3 deletions
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;