summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2021-01-20 11:48:05 +0100
committerTyge Løvset <[email protected]>2021-01-20 11:48:05 +0100
commit6332a8a0db0533c7c7bb56f69064a5ce03e62b4a (patch)
treea20981410d8144b624727ef2f5930c4d19a9c19c
parent9af33149569e14ffcac0150ce694bcf0af7baac5 (diff)
parentccc1d95b6276739c4e56d27635e586407646b0fa (diff)
downloadSTC-modified-6332a8a0db0533c7c7bb56f69064a5ce03e62b4a.tar.gz
STC-modified-6332a8a0db0533c7c7bb56f69064a5ce03e62b4a.zip
Merge branch 'master' of https://github.com/tylo-work/C99Containers into master
-rw-r--r--docs/cmap_api.md18
-rw-r--r--docs/csmap_api.md12
2 files changed, 15 insertions, 15 deletions
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);
diff --git a/docs/csmap_api.md b/docs/csmap_api.md
index 27fd22c6..9259df62 100644
--- a/docs/csmap_api.md
+++ b/docs/csmap_api.md
@@ -71,17 +71,17 @@ 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);
-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);