summaryrefslogtreecommitdiffhomepage
path: root/docs/cmap_api.md
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2023-02-01 10:12:22 +0100
committerTyge Løvset <[email protected]>2023-02-01 10:12:22 +0100
commita8998a52082f86a71bf152c5baa9ebc005871142 (patch)
treee231d86dba26d1495b893432fde7db17ac3eac08 /docs/cmap_api.md
parent6ce6ef3307e52db5813d3c8d6a2cba52df06daf8 (diff)
downloadSTC-modified-a8998a52082f86a71bf152c5baa9ebc005871142.tar.gz
STC-modified-a8998a52082f86a71bf152c5baa9ebc005871142.zip
Update docs formatting and README.md
Diffstat (limited to 'docs/cmap_api.md')
-rw-r--r--docs/cmap_api.md40
1 files changed, 20 insertions, 20 deletions
diff --git a/docs/cmap_api.md b/docs/cmap_api.md
index 7b8fbb8f..8e5a53d9 100644
--- a/docs/cmap_api.md
+++ b/docs/cmap_api.md
@@ -53,32 +53,32 @@ cmap_X cmap_X_clone(cmap_x map);
void cmap_X_clear(cmap_X* self);
void cmap_X_copy(cmap_X* self, const cmap_X* other);
-float cmap_X_max_load_factor(const cmap_X* self); // default: 0.85f
+float cmap_X_max_load_factor(const cmap_X* self); // default: 0.85f
bool cmap_X_reserve(cmap_X* self, intptr_t size);
void cmap_X_shrink_to_fit(cmap_X* self);
-void cmap_X_drop(cmap_X* self); // destructor
+void cmap_X_drop(cmap_X* self); // destructor
intptr_t cmap_X_size(const cmap_X* self);
-intptr_t cmap_X_capacity(const cmap_X* self); // buckets * max_load_factor
+intptr_t cmap_X_capacity(const cmap_X* self); // buckets * max_load_factor
bool cmap_X_empty(const cmap_X* self );
-intptr_t cmap_X_bucket_count(const cmap_X* self); // num. of allocated buckets
+intptr_t cmap_X_bucket_count(const cmap_X* self); // num. of allocated buckets
-const cmap_X_mapped* cmap_X_at(const cmap_X* self, i_keyraw rkey); // rkey must be in map
-cmap_X_mapped* cmap_X_at_mut(cmap_X* self, i_keyraw rkey); // mutable at
-const cmap_X_value* cmap_X_get(const cmap_X* self, i_keyraw rkey); // const get
-cmap_X_value* cmap_X_get_mut(cmap_X* self, i_keyraw rkey); // mutable get
+const cmap_X_mapped* cmap_X_at(const cmap_X* self, i_keyraw rkey); // rkey must be in map
+cmap_X_mapped* cmap_X_at_mut(cmap_X* self, i_keyraw rkey); // mutable at
+const cmap_X_value* cmap_X_get(const cmap_X* self, i_keyraw rkey); // const get
+cmap_X_value* cmap_X_get_mut(cmap_X* self, i_keyraw rkey); // mutable get
bool cmap_X_contains(const cmap_X* self, i_keyraw rkey);
-cmap_X_iter cmap_X_find(const cmap_X* self, i_keyraw rkey); // find element
+cmap_X_iter cmap_X_find(const cmap_X* self, i_keyraw rkey); // find element
-cmap_X_result cmap_X_insert(cmap_X* self, i_key key, i_val mapped); // no change if key in map
-cmap_X_result cmap_X_insert_or_assign(cmap_X* self, i_key key, i_val mapped); // always update mapped
-cmap_X_result cmap_X_push(cmap_X* self, cmap_X_value entry); // similar to insert
+cmap_X_result cmap_X_insert(cmap_X* self, i_key key, i_val mapped); // no change if key in map
+cmap_X_result cmap_X_insert_or_assign(cmap_X* self, i_key key, i_val mapped); // always update mapped
+cmap_X_result cmap_X_push(cmap_X* self, cmap_X_value entry); // similar to insert
-cmap_X_result cmap_X_emplace(cmap_X* self, i_keyraw rkey, i_valraw rmapped); // no change if rkey in map
+cmap_X_result cmap_X_emplace(cmap_X* self, i_keyraw rkey, i_valraw rmapped); // no change if rkey in map
cmap_X_result cmap_X_emplace_or_assign(cmap_X* self, i_keyraw rkey, i_valraw rmapped); // always update rmapped
-intptr_t cmap_X_erase(cmap_X* self, i_keyraw rkey); // return 0 or 1
-cmap_X_iter cmap_X_erase_at(cmap_X* self, cmap_X_iter it); // return iter after it
+intptr_t cmap_X_erase(cmap_X* self, i_keyraw rkey); // return 0 or 1
+cmap_X_iter cmap_X_erase_at(cmap_X* self, cmap_X_iter it); // return iter after it
void cmap_X_erase_entry(cmap_X* self, cmap_X_value* entry);
cmap_X_iter cmap_X_begin(const cmap_X* self);
@@ -91,13 +91,13 @@ cmap_X_raw cmap_X_value_toraw(cmap_X_value* pval);
```
Helpers:
```c
-uint64_t c_default_hash(const X *obj); // macro, calls cfasthash(obj, sizeof *obj)
-uint64_t cstrhash(const char *str); // string hash funcion, uses strlen()
-uint64_t cfasthash(const void *data, intptr_t len); // base hash function
+uint64_t c_default_hash(const X *obj); // macro, calls cfasthash(obj, sizeof *obj)
+uint64_t cstrhash(const char *str); // string hash funcion, uses strlen()
+uint64_t cfasthash(const void *data, intptr_t len); // base hash function
// equalto template parameter functions:
-bool c_default_eq(const i_keyraw* a, const i_keyraw* b); // *a == *b
-bool c_memcmp_eq(const i_keyraw* a, const i_keyraw* b); // !memcmp(a, b, sizeof *a)
+bool c_default_eq(const i_keyraw* a, const i_keyraw* b); // *a == *b
+bool c_memcmp_eq(const i_keyraw* a, const i_keyraw* b); // !memcmp(a, b, sizeof *a)
```
## Types