diff options
| author | Tyge Løvset <[email protected]> | 2020-12-01 08:04:01 +0100 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2020-12-01 08:04:01 +0100 |
| commit | 200a539df68c321eb8678cc1d35a75832c2b738b (patch) | |
| tree | 614c03e622ecec868d6dec5fd2e1cd6c0c170cfb /docs/cset_api.md | |
| parent | 8488839e40a85e9c13bbcc6eaf6fba5564b3d678 (diff) | |
| download | STC-modified-200a539df68c321eb8678cc1d35a75832c2b738b.tar.gz STC-modified-200a539df68c321eb8678cc1d35a75832c2b738b.zip | |
Small fixes, and changed tag parameter name to X.
Diffstat (limited to 'docs/cset_api.md')
| -rw-r--r-- | docs/cset_api.md | 78 |
1 files changed, 39 insertions, 39 deletions
diff --git a/docs/cset_api.md b/docs/cset_api.md index 88a735bd..5e24a56e 100644 --- a/docs/cset_api.md +++ b/docs/cset_api.md @@ -9,7 +9,7 @@ This describes the API of the unordered set type **cset**. ```c
#define using_cset_str()
-#define using_cset(T, Key, keyEqualsRaw=c_default_equals,
+#define using_cset(X, Key, keyEqualsRaw=c_default_equals,
keyHashRaw=c_default_hash16,
keyDestroy=c_default_del,
RawKey=Key,
@@ -17,8 +17,8 @@ This describes the API of the unordered set type **cset**. keyFromRaw=c_default_from_raw)
```
The macro `using_cset()` can be instantiated with 2, 4, 5, or 8 arguments in the global scope.
-Default values are given above for args not specified. `T` is a type tag name and
-will affect the names of all cset types and methods. E.g. declaring `using_cset(my, int);`, `T` should
+Default values are given above for args not specified. `X` is a type tag name and
+will affect the names of all cset types and methods. E.g. declaring `using_cset(my, int);`, `X` should
be replaced by `my` in all of the following documentation.
`using_cset_str()` is a predefined macro for `using_cset(str, cstr_t, ...)`.
@@ -27,21 +27,21 @@ be replaced by `my` in all of the following documentation. | Type name | Type definition | Used to represent... |
|:---------------------|:--------------------------------------|:-----------------------------------|
-| `cset_T` | `struct {` | The cset type |
-| | ` cset_T_value_t* table; | |
+| `cset_X` | `struct {` | The cset type |
+| | ` cset_X_value_t* table;` | |
| | ` uint8_t* _hashx;` | |
| | ` ...;` | |
| | `}` | |
-| `cset_T_key_t` | `Key` | The cset key type |
-| `cset_T_mapped_t` | `Mapped` | cset mapped type |
-| `cset_T_value_t` | `Key` | The cset value type |
-| `cset_T_result_t` | `struct {` | Result of insert/emplace |
-| | ` cset_T_value_t* first;` | |
-| | ` bool second;` /* inserted */ | |
+| `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_result_t` | `struct {` | Result of insert/emplace |
+| | ` cset_X_value_t* first;` | |
+| | ` bool second; /* inserted */` | |
| | `}` | |
-| `cset_T_input_t` | `cset_T_value_t` | cset input type |
-| `cset_T_iter_t` | `struct {` | cset iterator |
-| | ` cset_T_value_t* val;` | |
+| `cset_X_input_t` | `cset_X_value_t` | cset input type |
+| `cset_X_iter_t` | `struct {` | cset iterator |
+| | ` cset_X_value_t* val;` | |
| | ` ...;` | |
| | `}` | |
@@ -67,41 +67,41 @@ All cset definitions and prototypes may be included in your C source file by inc ### Construction
-The interface for cset_T:
+The interface for cset_X:
```c
-cset_T cset_T_init(void);
-cset_T cset_T_with_capacity(size_t cap);
-void cset_T_set_load_factors(cset_T* self, float max, float shrink);
+cset_X cset_X_init(void);
+cset_X cset_X_with_capacity(size_t cap);
+void cset_X_set_load_factors(cset_X* self, float max, float shrink);
-void cset_T_clear(cset_T* self);
-void cset_T_reserve(cset_T* self, size_t size);
-void cset_T_swap(cset_T* a, cset_T* b);
+void cset_X_clear(cset_X* self);
+void cset_X_reserve(cset_X* self, size_t size);
+void cset_X_swap(cset_X* a, cset_X* b);
-void cset_T_del(cset_T* self);
+void cset_X_del(cset_X* self);
-bool cset_T_empty(cset_T m);
-size_t cset_T_size(cset_T m);
-size_t cset_T_bucket_count(cset_T m);
-size_t cset_T_capacity(cset_T m);
+bool cset_X_empty(cset_X m);
+size_t cset_X_size(cset_X m);
+size_t cset_X_bucket_count(cset_X m);
+size_t cset_X_capacity(cset_X m);
-void cset_T_push_n(cset_T* self, const cset_T_input_t in[], size_t size);
+void cset_X_push_n(cset_X* self, const cset_X_input_t in[], size_t size);
-cset_T_result_t cset_T_emplace(cset_T* self, cset_T_rawkey_t rawKey);
-cset_T_result_t cset_T_insert(cset_T* self, cset_T_rawkey_t rawKey);
+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);
-size_t cset_T_erase(cset_T* self, cset_T_rawkey_t rawKey);
-void cset_T_erase_entry(cset_T* self, cset_T_key_t* key);
-cset_T_iter_t cset_T_erase_at(cset_T* self, cset_T_iter_t pos);
+size_t cset_X_erase(cset_X* self, cset_X_rawkey_t rawKey);
+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_T_value_t* cset_T_find(const cset_T* self, cset_T_rawkey_t rawKey);
-bool cset_T_contains(const cset_T* self, cset_T_rawkey_t rawKey);
+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_T_iter_t cset_T_begin(cset_T* self);
-cset_T_iter_t cset_T_end(cset_T* self);
-void cset_T_next(cset_T_iter_t* it);
-cset_T_mapped_t* cset_T_itval(cset_T_iter_t it);
+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_T_bucket(const cset_T* self, const cset_T_rawkey_t* rawKeyPtr);
+cset_bucket_t cset_X_bucket(const cset_X* self, const cset_X_rawkey_t* rawKeyPtr);
uint32_t c_default_hash16(const void *data, size_t len);
uint32_t c_default_hash32(const void* data, size_t len);
|
