diff options
| author | Tyge Løvset <[email protected]> | 2020-12-01 09:07:58 +0100 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2020-12-01 09:07:58 +0100 |
| commit | 1a48e4b33f6d658bc167723a87cf0a399375e89c (patch) | |
| tree | de35dac591e30074dd247ba65704945bfe75605c /docs/cset_api.md | |
| parent | 200a539df68c321eb8678cc1d35a75832c2b738b (diff) | |
| download | STC-modified-1a48e4b33f6d658bc167723a87cf0a399375e89c.tar.gz STC-modified-1a48e4b33f6d658bc167723a87cf0a399375e89c.zip | |
Fixed docs, some minor changes in cstr.h and cmap.h as well.
Diffstat (limited to 'docs/cset_api.md')
| -rw-r--r-- | docs/cset_api.md | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/docs/cset_api.md b/docs/cset_api.md index 5e24a56e..92d6afe4 100644 --- a/docs/cset_api.md +++ b/docs/cset_api.md @@ -1,6 +1,4 @@ -# Introduction
-
-UNDER CONSTRUCTION!
+# Container type cset
This describes the API of the unordered set type **cset**.
@@ -32,15 +30,15 @@ be replaced by `my` in all of the following documentation. | | ` uint8_t* _hashx;` | |
| | ` ...;` | |
| | `}` | |
-| `cset_X_key_t` | `Key` | The cset key type |
-| `cset_X_mapped_t` | `Mapped` | cset mapped type |
-| `cset_X_value_t` | `Key` | The cset value type |
+| `cset_X_rawkey_t` | `RawKey` | The raw key type |
+| `cset_X_key_t` | `Key` | The key type |
+| `cset_X_value_t` | `Key` | The value type |
| `cset_X_result_t` | `struct {` | Result of insert/emplace |
| | ` cset_X_value_t* first;` | |
| | ` bool second; /* inserted */` | |
| | `}` | |
-| `cset_X_input_t` | `cset_X_value_t` | cset input type |
-| `cset_X_iter_t` | `struct {` | cset iterator |
+| `cset_X_input_t` | `cset_X_rawkey_t` | The input type (rawkey) |
+| `cset_X_iter_t` | `struct {` | Iterator type |
| | ` cset_X_value_t* val;` | |
| | ` ...;` | |
| | `}` | |
@@ -54,14 +52,13 @@ be replaced by `my` in all of the following documentation. | `cset_size(set)` | Get set size |
| `cset_capacity(set)` | Get set capacity |
| `c_try_emplace(self, ctype, key, val)` | Emplace if key exist |
-| `c_insert_items(self, ctype, array)` | Insert literals list |
## Header file
All cset definitions and prototypes may be included in your C source file by including a single header file.
```c
-#include "stc/cset.h" or "stc/cmap.h"
+#include "stc/cset.h"
```
## Methods
@@ -86,22 +83,22 @@ size_t cset_X_capacity(cset_X m); void cset_X_push_n(cset_X* self, const cset_X_input_t in[], size_t size);
-cset_X_result_t cset_X_emplace(cset_X* self, cset_X_rawkey_t rawKey);
-cset_X_result_t cset_X_insert(cset_X* self, cset_X_rawkey_t rawKey);
+cset_X_result_t cset_X_emplace(cset_X* self, RawKey rkey);
+cset_X_result_t cset_X_insert(cset_X* self, RawKey rkey);
-size_t cset_X_erase(cset_X* self, cset_X_rawkey_t rawKey);
+size_t cset_X_erase(cset_X* self, RawKey rkey);
void cset_X_erase_entry(cset_X* self, cset_X_key_t* key);
cset_X_iter_t cset_X_erase_at(cset_X* self, cset_X_iter_t pos);
-cset_X_value_t* cset_X_find(const cset_X* self, cset_X_rawkey_t rawKey);
-bool cset_X_contains(const cset_X* self, cset_X_rawkey_t rawKey);
+cset_X_value_t* cset_X_find(const cset_X* self, RawKey rkey);
+bool cset_X_contains(const cset_X* self, RawKey rkey);
cset_X_iter_t cset_X_begin(cset_X* self);
cset_X_iter_t cset_X_end(cset_X* self);
void cset_X_next(cset_X_iter_t* it);
cset_X_mapped_t* cset_X_itval(cset_X_iter_t it);
-cset_bucket_t cset_X_bucket(const cset_X* self, const cset_X_rawkey_t* rawKeyPtr);
+cset_bucket_t cset_X_bucket(const cset_X* self, const cset_X_rawkey_t* rkeyPtr);
uint32_t c_default_hash16(const void *data, size_t len);
uint32_t c_default_hash32(const void* data, size_t len);
|
