diff options
| author | Tyge Løvset <[email protected]> | 2021-09-09 08:28:10 +0200 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2021-09-09 08:28:10 +0200 |
| commit | 52cb5b409447d5c5c3b799b64315dd48fdd445ef (patch) | |
| tree | ef1a26d5d0265b84a37e36907a4674beb94448f0 /docs/cset_api.md | |
| parent | 180cc60feebea8126e1c2012092782b53e164648 (diff) | |
| download | STC-modified-52cb5b409447d5c5c3b799b64315dd48fdd445ef.tar.gz STC-modified-52cb5b409447d5c5c3b799b64315dd48fdd445ef.zip | |
Updated examples in docs.
Diffstat (limited to 'docs/cset_api.md')
| -rw-r--r-- | docs/cset_api.md | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/docs/cset_api.md b/docs/cset_api.md index dc628750..fc12c5bd 100644 --- a/docs/cset_api.md +++ b/docs/cset_api.md @@ -7,18 +7,16 @@ A **cset** is an associative container that contains a set of unique objects of ## Header file and declaration
```c
+#define i_tag
+#define i_val // required
+#define i_cmp // required if i_val is a struct
+#define i_valdel
+#define i_valfrom
+#define i_valto
+#define i_valraw
#include <stc/cset.h>
-
-using_cset(X, Key);
-using_cset(X, Key, keyEquals, keyHash);
-using_cset(X, Key, keyEquals, keyHash, keyDel, keyClone = c_no_clone);
-using_cset(X, Key, keyEqualsRaw, keyHashRaw, keyDel, keyFromRaw, keyToRaw, RawKey, flag);
-
-using_cset_str(); // using_cset(str, cstr, c_rawstr_equals, c_rawstr_hash, cstr_del, ...)
```
-The macro `using_cset()` must be instantiated in the global scope. `X` is a type tag name and
-will affect the names of all cset types and methods. E.g. declaring `using_cset(i, int);`, `X` should
-be replaced by `i` in all of the following documentation.
+`X` should be replaced by the value of i_tag in all of the following documentation.
## Methods
@@ -72,10 +70,10 @@ cset_X_value_t cset_X_value_clone(cset_X_value_t val); ## Example
```c
-#include <stc/cset.h>
#include <stc/cstr.h>
-using_cset_str();
+#define i_key_str
+#include <stc/cset.h>
int main ()
{
|
