diff options
Diffstat (limited to 'docs/cmap_api.md')
| -rw-r--r-- | docs/cmap_api.md | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/docs/cmap_api.md b/docs/cmap_api.md index 76fbda92..998146a7 100644 --- a/docs/cmap_api.md +++ b/docs/cmap_api.md @@ -38,7 +38,7 @@ See the c++ class [std::unordered_map](https://en.cppreference.com/w/cpp/contain #define i_tag // alternative typename: cmap_{i_tag}. i_tag defaults to i_val #define i_hash_functor // advanced, see examples/functor.c for similar usage. #define i_eq_functor // advanced, see examples/functor.c for similar usage. -#define i_ssize // default int32_t. If defined, table expand 2x (else 1.5x) +#define i_ssize // internal; default int32_t. If defined, table expand 2x (else 1.5x) #include <stc/cmap.h> ``` `X` should be replaced by the value of `i_tag` in all of the following documentation. @@ -47,20 +47,20 @@ See the c++ class [std::unordered_map](https://en.cppreference.com/w/cpp/contain ```c cmap_X cmap_X_init(void); -cmap_X cmap_X_with_capacity(i_ssize cap); +cmap_X cmap_X_with_capacity(intptr_t cap); 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 -bool cmap_X_reserve(cmap_X* self, i_ssize size); +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 bool cmap_X_empty(const cmap_X* self ); -i_ssize cmap_X_size(const cmap_X* self); -i_ssize cmap_X_capacity(const cmap_X* self); // buckets * max_load_factor -i_ssize cmap_X_bucket_count(const cmap_X* self); // num. of allocated buckets +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_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 @@ -74,7 +74,8 @@ cmap_X_result cmap_X_insert_or_assign(cmap_X* self, i_key key, i_val map 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_or_assign(cmap_X* self, i_keyraw rkey, i_valraw rmapped); // always update rmapped +cmap_X_result cmap_X_emplace_or_assign(cmap_X* self, i_keyraw rkey, i_valraw rmapped); // always update +cmap_X_result cmap_X_put(cmap_X* self, i_keyraw rkey, i_valraw rmapped); // emplace_or_assign() alias int 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 |
