diff options
| author | Tyge Løvset <[email protected]> | 2021-02-22 19:44:59 +0100 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2021-02-22 19:44:59 +0100 |
| commit | 36872c10c9041c0a46b3d205ca04380cb55ab283 (patch) | |
| tree | 08010c929ec7b37d909d7ff0b3398dc94cd1cbb7 /docs/cmap_api.md | |
| parent | 2da0a2c2d5fa154ea0151156b4e35a1ac8d50bc4 (diff) | |
| download | STC-modified-36872c10c9041c0a46b3d205ca04380cb55ab283.tar.gz STC-modified-36872c10c9041c0a46b3d205ca04380cb55ab283.zip | |
Renamed c_plain_... to c_trivial_... internal functions.
Diffstat (limited to 'docs/cmap_api.md')
| -rw-r--r-- | docs/cmap_api.md | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/docs/cmap_api.md b/docs/cmap_api.md index 0c1a2b97..26724bfd 100644 --- a/docs/cmap_api.md +++ b/docs/cmap_api.md @@ -79,15 +79,16 @@ cmap_X_iter_t cmap_X_end(cmap_X* self); void cmap_X_next(cmap_X_iter_t* it); cmap_X_mapped_t* cmap_X_itval(cmap_X_iter_t it); ``` -``` -uint64_t c_default_hash(const void *data, size_t len); +```c +uint64_t c_default_hash(const void *data, size_t len); // bytewise hash uint64_t c_default_hash32(const void* data, size_t len=4); uint64_t c_default_hash64(const void* data, size_t len=8); int c_default_equals(const RawKey* a, const RawKey* b); -void c_plain_del(Type* val); -Value c_no_clone(Type val); -Value c_plain_fromraw(RawType raw); -RawType c_plain_toraw(Type* val); +int c_trivial_equals(const RawKey* a, const RawKey* b); // bitwise +Type c_no_clone(Type val); +Type c_trivial_fromraw(Type val); // plain copy +Type c_trivial_toraw(Type* val); +void c_trivial_del(Type* val); // does nothing ``` ## Types @@ -199,8 +200,8 @@ Demonstrate cmap with plain-old-data key type Vec3i and int as mapped type: cmap typedef struct { int x, y, z; } Vec3i; -using_cmap(v3, Vec3i, int, c_plain_equals, // compare Vec3i bitwise - c_default_hash); // hash Vec3i bitwise. +using_cmap(v3, Vec3i, int, c_trivial_equals, // bitwise equals + c_default_hash); // bytewise hash int main() { |
