diff options
| author | Tyge Løvset <[email protected]> | 2021-08-28 15:49:42 +0200 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2021-08-28 15:49:42 +0200 |
| commit | 28bf4ac92625b2ec7c4ddade9c14a4363ebd2681 (patch) | |
| tree | 580ec2fa435464e18505a9bb0b30720bde2340ca /docs | |
| parent | 4c9ad3e584feff277800e1dfe49ae470e3c4a9c4 (diff) | |
| download | STC-modified-28bf4ac92625b2ec7c4ddade9c14a4363ebd2681.tar.gz STC-modified-28bf4ac92625b2ec7c4ddade9c14a4363ebd2681.zip | |
Breaking change cstr and csview renames in order to improve consistency:
cstr_equals() => cstr_equalto()
cstr_compare_ref() => cstr_compare()
cstr_equals_ref() => cstr_equals()
cstr_hash_ref() => cstr_hash()
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/cmap_api.md | 2 | ||||
| -rw-r--r-- | docs/cstr_api.md | 13 | ||||
| -rw-r--r-- | docs/csview_api.md | 8 |
3 files changed, 12 insertions, 11 deletions
diff --git a/docs/cmap_api.md b/docs/cmap_api.md index ea9efb39..7467974f 100644 --- a/docs/cmap_api.md +++ b/docs/cmap_api.md @@ -275,7 +275,7 @@ static int Viking_equals(const Viking* a, const Viking* b) { } static uint32_t Viking_hash(const Viking* a, int ignored) { - return cstr_hash(a->name) ^ (cstr_hash(a->country) >> 15); + return cstr_hash(&a->name) ^ (cstr_hash(&a->country) >> 15); } static void Viking_del(Viking* v) { diff --git a/docs/cstr_api.md b/docs/cstr_api.md index adf57209..1acceec2 100644 --- a/docs/cstr_api.md +++ b/docs/cstr_api.md @@ -58,15 +58,15 @@ void cstr_replace_all(cstr* self, const char* find, const char* replace) void cstr_erase(cstr* self, size_t pos); void cstr_erase_n(cstr* self, size_t pos, size_t n); -bool cstr_equals(cstr s, const char* str); -bool cstr_equals_s(cstr s, cstr s2); +bool cstr_equalto(cstr s, const char* str); +bool cstr_equalto_s(cstr s, cstr s2); size_t cstr_find(cstr s, const char* needle); size_t cstr_find_n(cstr s, const char* needle, size_t pos, size_t nmax); bool cstr_contains(cstr s, const char* needle); bool cstr_starts_with(cstr s, const char* str); bool cstr_ends_with(cstr s, const char* str); -bool cstr_iequals(cstr s, const char* str); // prefix i = case-insensitive +bool cstr_iequalto(cstr s, const char* str); // prefix i = case-insensitive size_t cstr_ifind_n(cstr s, const char* needle, size_t pos, size_t nmax); bool cstr_icontains(cstr s, const char* needle); bool cstr_istarts_with(cstr s, const char* str); @@ -91,12 +91,13 @@ Note that all methods with arguments `(..., const char* str, size_t n)`, `n` mus ```c const char* cstr_toraw(const cstr* self); -int cstr_compare_ref(const cstr *s1, const cstr *s2); -bool cstr_equals_ref(const cstr *s1, const cstr *s2); +int cstr_compare(const cstr *s1, const cstr *s2); +bool cstr_equals(const cstr *s1, const cstr *s2); +bool cstr_hash(const cstr *s, ...); int c_rawstr_compare(const char** x, const char** y); bool c_rawstr_equals(const char** x, const char** y); -uint64_t c_rawstr_hash(const char* const* x, size_t ignored); +uint64_t c_rawstr_hash(const char* const* x, ...); int c_strncasecmp(const char* str1, const char* str2, size_t n); char* c_strnstrn(const char* str, const char* needle, size_t slen, size_t nlen); diff --git a/docs/csview_api.md b/docs/csview_api.md index 70bc9b41..dfca37c5 100644 --- a/docs/csview_api.md +++ b/docs/csview_api.md @@ -45,7 +45,7 @@ csview csview_slice(csview sv, intptr_t p1, intptr_t p2); // negative p csview csview_first_token(csview sv, csview sep); // see split example below. csview csview_next_token(csview sv, csview sep, csview token); -bool csview_equals(csview sv, csview sv2); +bool csview_equalto(csview sv, csview sv2); size_t csview_find(csview sv, csview needle); bool csview_contains(csview sv, csview needle); bool csview_starts_with(csview sv, csview sub); @@ -78,9 +78,9 @@ bool cstr_ends_with_v(cstr s, csview sub); ``` #### Helper methods ```c -int csview_compare_ref(const csview* x, const csview* y); -bool csview_equals_ref(const csview* x, const csview* y); -uint64_t csview_hash_ref(const csview* x, size_t ignored); +int csview_compare(const csview* x, const csview* y); +bool csview_equals(const csview* x, const csview* y); +uint64_t csview_hash(const csview* x, ...); ``` ## Types |
