From dcf7ba8a098251bf2af7c71d61f7d8af0662fd12 Mon Sep 17 00:00:00 2001 From: Tyge Løvset <60263450+tylov@users.noreply.github.com> Date: Wed, 20 Jan 2021 11:02:00 +0100 Subject: Update csmap_api.md --- docs/csmap_api.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'docs') diff --git a/docs/csmap_api.md b/docs/csmap_api.md index 27fd22c6..6974d603 100644 --- a/docs/csmap_api.md +++ b/docs/csmap_api.md @@ -71,12 +71,12 @@ size_t csmap_X_size(csmap_X m); void csmap_X_push_n(csmap_X* self, const csmap_X_rawvalue_t arr[], size_t size); -csmap_X_result_t csmap_X_emplace(csmap_X* self, RawKey rkey, RawMapped rmapped); -csmap_X_result_t csmap_X_insert(csmap_X* self, csmap_X_rawvalue_t rval); +csmap_X_result_t csmap_X_emplace(csmap_X* self, RawKey rkey, RawMapped rmapped); // no change if rkey in map +csmap_X_result_t csmap_X_insert(csmap_X* self, csmap_X_rawvalue_t rval); // same csmap_X_result_t csmap_X_insert_or_assign(csmap_X* self, RawKey rkey, RawMapped rmapped); -csmap_X_result_t csmap_X_put(csmap_X* self, RawKey rkey, RawMapped rmapped); -csmap_X_result_t csmap_X_put_mapped(csmap_X* self, RawKey rkey, Mapped mapped); -csmap_X_mapped_t* csmap_X_at(const csmap_X* self, RawKey rkey); +csmap_X_result_t csmap_X_put(csmap_X* self, RawKey rkey, RawMapped rmapped); // same as insert_or_assign() +csmap_X_result_t csmap_X_put_mapped(csmap_X* self, RawKey rkey, Mapped mapped); // same +csmap_X_mapped_t* csmap_X_at(const csmap_X* self, RawKey rkey); // rkey must be in map. size_t csmap_X_erase(csmap_X* self, RawKey rkey); csmap_X_iter_t csmap_X_erase_at(csmap_X* self, csmap_X_iter_t pos); -- cgit v1.2.3 From ec06cd3dd8b2755a50933b44b939f862e75201ab Mon Sep 17 00:00:00 2001 From: Tyge Løvset <60263450+tylov@users.noreply.github.com> Date: Wed, 20 Jan 2021 11:08:30 +0100 Subject: Update csmap_api.md --- docs/csmap_api.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/csmap_api.md b/docs/csmap_api.md index 6974d603..9259df62 100644 --- a/docs/csmap_api.md +++ b/docs/csmap_api.md @@ -81,7 +81,7 @@ csmap_X_mapped_t* csmap_X_at(const csmap_X* self, RawKey rkey); size_t csmap_X_erase(csmap_X* self, RawKey rkey); csmap_X_iter_t csmap_X_erase_at(csmap_X* self, csmap_X_iter_t pos); -csmap_X_value_t* csmap_X_find(const csmap_X* self, RawKey rkey); +csmap_X_value_t* csmap_X_find(const csmap_X* self, RawKey rkey); // NULL if not found csmap_X_value_t* csmap_X_find_it(const csmap_X* self, RawKey rkey, csmap_X_iter_t* out); bool csmap_X_contains(const csmap_X* self, RawKey rkey); -- cgit v1.2.3 From ccc1d95b6276739c4e56d27635e586407646b0fa Mon Sep 17 00:00:00 2001 From: Tyge Løvset <60263450+tylov@users.noreply.github.com> Date: Wed, 20 Jan 2021 11:23:26 +0100 Subject: Update cmap_api.md --- docs/cmap_api.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'docs') diff --git a/docs/cmap_api.md b/docs/cmap_api.md index c0fb81d2..a21bd732 100644 --- a/docs/cmap_api.md +++ b/docs/cmap_api.md @@ -51,7 +51,7 @@ using_cmap(str, cstr_t, cstr_t, cstr_del, ...) // uses char* as "raw" types | `cmap_X_key_t` | `Key` | The key type | | `cmap_X_mapped_t` | `Mapped` | The mapped type | | `cmap_X_value_t` | `struct { Key first; Mapped second; }` | The value type | -| `cmap_X_rawvalue_t` | `struct { RawKey first; RawMapped second; }` | RawKey + RawVal type | +| `cmap_X_rawvalue_t` | `struct { RawKey first; RawMapped second; }` | RawKey + RawMapped type | | `cmap_X_result_t` | `struct { cmap_X_value_t first; bool second; }` | Result of insert/put/emplace | | `cmap_X_iter_t` | `struct { cmap_X_value_t *ref; ... }` | Iterator type | @@ -85,23 +85,23 @@ void cmap_X_del(cmap_X* self); bool cmap_X_empty(cmap_X m); size_t cmap_X_size(cmap_X m); -size_t cmap_X_bucket_count(cmap_X m); -size_t cmap_X_capacity(cmap_X m); +size_t cmap_X_bucket_count(cmap_X m); // num. of allocated buckets +size_t cmap_X_capacity(cmap_X m); // buckets * max_load_factor void cmap_X_push_n(cmap_X* self, const cmap_X_rawvalue_t arr[], size_t size); -cmap_X_result_t cmap_X_emplace(cmap_X* self, RawKey rkey, RawMapped rmapped); -cmap_X_result_t cmap_X_insert(cmap_X* self, cmap_X_rawvalue_t rval); +cmap_X_result_t cmap_X_emplace(cmap_X* self, RawKey rkey, RawMapped rmapped); // no change if rkey in map +cmap_X_result_t cmap_X_insert(cmap_X* self, cmap_X_rawvalue_t rval); // same, but takes rawvalue param cmap_X_result_t cmap_X_insert_or_assign(cmap_X* self, RawKey rkey, RawMapped rmapped); -cmap_X_result_t cmap_X_put(cmap_X* self, RawKey rkey, RawMapped rmapped); -cmap_X_result_t cmap_X_put_mapped(cmap_X* self, RawKey rkey, Mapped mapped); -cmap_X_mapped_t* cmap_X_at(const cmap_X* self, RawKey rkey); +cmap_X_result_t cmap_X_put(cmap_X* self, RawKey rkey, RawMapped rmapped); // same as insert_or_assign() +cmap_X_result_t cmap_X_put_mapped(cmap_X* self, RawKey rkey, Mapped mapped); // same, but takes Mapped param +cmap_X_mapped_t* cmap_X_at(const cmap_X* self, RawKey rkey); // rkey must be in map size_t cmap_X_erase(cmap_X* self, RawKey rkey); void cmap_X_erase_entry(cmap_X* self, cmap_X_value_t* entry); cmap_X_iter_t cmap_X_erase_at(cmap_X* self, cmap_X_iter_t pos); -cmap_X_value_t* cmap_X_find(const cmap_X* self, RawKey rkey); +cmap_X_value_t* cmap_X_find(const cmap_X* self, RawKey rkey); // NULL if not found bool cmap_X_contains(const cmap_X* self, RawKey rkey); cmap_X_iter_t cmap_X_begin(cmap_X* self); -- cgit v1.2.3