diff options
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/cmap_api.md | 16 | ||||
| -rw-r--r-- | docs/csptr_api.md | 1 | ||||
| -rw-r--r-- | docs/cstr_api.md | 8 | ||||
| -rw-r--r-- | docs/csview_api.md | 4 |
4 files changed, 14 insertions, 15 deletions
diff --git a/docs/cmap_api.md b/docs/cmap_api.md index 628e982a..f8b24704 100644 --- a/docs/cmap_api.md +++ b/docs/cmap_api.md @@ -82,14 +82,14 @@ Helpers: uint64_t c_strhash(const char *str); // utility function int c_rawstr_compare(const char* const* a, const char* const* b); -bool c_rawstr_equals(const char* const* a, const char* const* b); +bool c_rawstr_equalto(const char* const* a, const char* const* b); uint64_t c_rawstr_hash(const char* const* strp, ...); uint64_t c_default_hash(const void *data, size_t len); // key any trivial type uint64_t c_default_hash32(const void* data, size_t is4); // key one 32bit int uint64_t c_default_hash64(const void* data, size_t is8); // key one 64bit int -int c_default_equals(const i_keyraw* a, const i_keyraw* b); // the == operator -int c_memcmp_equals(const i_keyraw* a, const i_keyraw* b); // uses memcmp +bool c_default_equalto(const i_keyraw* a, const i_keyraw* b); // the == operator +bool c_memcmp_equalto(const i_keyraw* a, const i_keyraw* b); // uses memcmp Type c_no_clone(Type val); Type c_default_fromraw(Type val); // plain copy @@ -203,7 +203,7 @@ typedef struct { int x, y, z; } Vec3i; #define i_key Vec3i #define i_val int -#define i_cmp c_memcmp_equals // bitwise compare, and use c_default_hash +#define i_cmp c_memcmp_equalto // bitwise compare, and use c_default_hash #define i_tag vi #include <stc/cmap.h> @@ -273,7 +273,7 @@ typedef struct { cstr country; } Viking; -static int Viking_equals(const Viking* a, const Viking* b) { +static bool Viking_equalto(const Viking* a, const Viking* b) { return cstr_equals_s(a->name, b->name) && cstr_equals_s(a->country, b->country); } @@ -287,7 +287,7 @@ static void Viking_del(Viking* v) { #define i_key Viking #define i_val int -#define i_equ Viking_equals +#define i_equ Viking_equalto #define i_hash Viking_hash #define i_del Viking_del #define i_tag vk @@ -346,7 +346,7 @@ typedef struct { const char* country; } RViking; -static int RViking_equals(const RViking* r1, const RViking* r2) +static bool RViking_equalto(const RViking* r1, const RViking* r2) { return !strcmp(r1->name, r2->name) && !strcmp(r1->country, r2->country); } static uint32_t RViking_hash(const RViking* r, int ignored) @@ -362,7 +362,7 @@ static RViking Viking_toR(const Viking* v) #define i_val int #define i_keydel Viking_del #define i_keyraw RViking -#define i_equ RViking_equals +#define i_equ RViking_equalto #define i_hash RViking_hash #define i_keyfrom Viking_fromR #define i_keyto Viking_toR diff --git a/docs/csptr_api.md b/docs/csptr_api.md index 60825152..ba85ba8c 100644 --- a/docs/csptr_api.md +++ b/docs/csptr_api.md @@ -52,7 +52,6 @@ void csptr_X_reset_with(csptr_X* self, i_val val); // make and as void csptr_X_reset_from(csptr_X* self, i_val* p); // create csptr from p. int csptr_X_compare(const csptr_X* x, const csptr_X* y); -bool csptr_X_equals(const csptr_X* x, const csptr_X* y); ``` ## Types and constants diff --git a/docs/cstr_api.md b/docs/cstr_api.md index 4b1c959f..acea7b6f 100644 --- a/docs/cstr_api.md +++ b/docs/cstr_api.md @@ -60,8 +60,8 @@ 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_equalto(cstr s, const char* str); -bool cstr_equalto_s(cstr s, cstr s2); +bool cstr_equals(cstr s, const char* str); +bool cstr_equals_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); @@ -86,11 +86,11 @@ Note that all methods with arguments `(..., const char* str, size_t n)`, `n` mus #### Helper methods: ```c int cstr_compare(const cstr *s1, const cstr *s2); -bool cstr_equals(const cstr *s1, const cstr *s2); +bool cstr_equalto(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); +bool c_rawstr_equalto(const char** x, const char** y); uint64_t c_rawstr_hash(const char* const* x, ...); uint64_t c_strhash(const char* str); diff --git a/docs/csview_api.md b/docs/csview_api.md index 4295e4e9..4d80692d 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_equalto(csview sv, csview sv2); +bool csview_equals(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); @@ -79,7 +79,7 @@ bool cstr_ends_with_v(cstr s, csview sub); #### Helper methods ```c int csview_compare(const csview* x, const csview* y); -bool csview_equals(const csview* x, const csview* y); +bool csview_equalto(const csview* x, const csview* y); uint64_t csview_hash(const csview* x, ...); ``` ## Types |
