summaryrefslogtreecommitdiffhomepage
path: root/docs/cmap_api.md
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2021-09-09 08:49:56 +0200
committerTyge Løvset <[email protected]>2021-09-09 08:49:56 +0200
commit4e21ca6fa936d99d82ad2cda0fc50d7302736362 (patch)
treec136cec0b78950cc78345e51d4bc6a13c835e79a /docs/cmap_api.md
parent52cb5b409447d5c5c3b799b64315dd48fdd445ef (diff)
downloadSTC-modified-4e21ca6fa936d99d82ad2cda0fc50d7302736362.tar.gz
STC-modified-4e21ca6fa936d99d82ad2cda0fc50d7302736362.zip
Fix c_rawstr_hash docs.
Diffstat (limited to 'docs/cmap_api.md')
-rw-r--r--docs/cmap_api.md12
1 files changed, 8 insertions, 4 deletions
diff --git a/docs/cmap_api.md b/docs/cmap_api.md
index eda16e58..32ae2d1f 100644
--- a/docs/cmap_api.md
+++ b/docs/cmap_api.md
@@ -72,12 +72,16 @@ cmap_X_value_t cmap_X_value_clone(cmap_X_value_t val);
cmap_X_rawvalue_t cmap_X_value_toraw(cmap_X_value_t* pval);
```
```c
+int c_rawstr_compare(const char* const* a, const char* const* b);
+bool c_rawstr_equals(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_string_hash(const char* str); // uses c_default_hash()
-uint64_t c_default_hash32(const void* data, size_t); // key one 32bit int
-uint64_t c_default_hash64(const void* data, size_t); // key one 64bit int
+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 RawKey* a, const RawKey* b); // the == operator
int c_memcmp_equals(const RawKey* a, const RawKey* b); // uses memcmp
+
Type c_no_clone(Type val);
Type c_default_fromraw(Type val); // plain copy
Type c_default_toraw(Type* val);
@@ -334,7 +338,7 @@ static int RViking_equals(const RViking* r1, const RViking* r2) {
}
static uint32_t RViking_hash(const RViking* r, int ignored) {
- return c_string_hash(r->name) ^ (c_string_hash(r->country) >> 15);
+ return c_rawstr_hash(&r->name) ^ (c_rawstr_hash(&r->country) >> 15);
}
static Viking Viking_fromR(RViking r) {return (Viking){cstr_from(r.name), cstr_from(r.country)};}