diff options
| author | Tyge Løvset <[email protected]> | 2021-10-29 17:02:39 +0200 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2021-10-29 17:02:39 +0200 |
| commit | ead0b1d0c6cc724e7f2d7eb2ed9273dd7a18935f (patch) | |
| tree | c83eac9187b020e8510e3ee11e982a29f0c29152 /docs/cmap_api.md | |
| parent | 9708235ec4147d2c0428c9ae5186fad452b116ad (diff) | |
| download | STC-modified-ead0b1d0c6cc724e7f2d7eb2ed9273dd7a18935f.tar.gz STC-modified-ead0b1d0c6cc724e7f2d7eb2ed9273dd7a18935f.zip | |
Swapped .._equals() and _equalto() functions for consistency
Diffstat (limited to 'docs/cmap_api.md')
| -rw-r--r-- | docs/cmap_api.md | 16 |
1 files changed, 8 insertions, 8 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 |
