diff options
| author | Tyge Løvset <[email protected]> | 2021-02-21 17:03:36 +0100 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2021-02-21 17:03:36 +0100 |
| commit | c609469b3eac08cc369f30a54cc737a3d9cadc3b (patch) | |
| tree | 903c2dfbeb14b1be52fab7fd174cf6ba91560a08 /docs/cmap_api.md | |
| parent | 6f2807ac42a42d42aea9b34c89b0cbbd5755fe49 (diff) | |
| download | STC-modified-c609469b3eac08cc369f30a54cc737a3d9cadc3b.tar.gz STC-modified-c609469b3eac08cc369f30a54cc737a3d9cadc3b.zip | |
Internal restructure. Added bsearch() to cvec.
Diffstat (limited to 'docs/cmap_api.md')
| -rw-r--r-- | docs/cmap_api.md | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/docs/cmap_api.md b/docs/cmap_api.md index 77e4d523..0114a365 100644 --- a/docs/cmap_api.md +++ b/docs/cmap_api.md @@ -18,16 +18,16 @@ using_cmap(X, Key, Mapped, keyEqualsRaw, keyHashRaw, mappedDestroy, mappedFromRa using_cmap_keyarg(X, Key, Mapped, keyEquals, keyHash, keyDestroy); using_cmap_keyarg(X, Key, Mapped, keyEqualsRaw, keyHashRaw, keyDestroy, keyFromRaw, keyToRaw, RawKey); -using_cmap_strkey(X, Mapped); // cmap(str, cstr, Mapped, ...) +using_cmap_strkey(X, Mapped); // using_cmap(str, cstr, Mapped, ...) using_cmap_strkey(X, Mapped, mappedDestroy); using_cmap_strkey(X, Mapped, mappedDestroy, mappedFromRaw, mappedToRaw, RawMapped); -using_cmap_strval(X, Key); // cmap(str, Key, cstr, ...) +using_cmap_strval(X, Key); // using_cmap(str, Key, cstr, ...) using_cmap_strval(X, Key, keyEquals, keyHash); using_cmap_strval(X, Key, keyEquals, keyHash, keyDestroy); using_cmap_strval(X, Key, keyEqualsRaw, keyHashRaw, keyDestroy, keyFromRaw, keyToRaw, RawKey); -using_cmap_str() // cmap(str, cstr, cstr, ...) +using_cmap_str() // using_cmap(str, cstr, cstr, ...) ``` The `using_cmap()` macro family must be instantiated in the global scope. Default values are given above for args not specified. `X` is a type tag name and @@ -289,13 +289,11 @@ static inline int vikingraw_equals(const VikingRaw* rx, const VikingRaw* ry) { static inline Viking viking_fromRaw(VikingRaw raw) { // note: parameter is by value Viking vk = {cstr_from(raw.name), cstr_from(raw.country)}; return vk; } - static inline VikingRaw viking_toRaw(Viking* vk) { VikingRaw raw = {vk->name.str, vk->country.str}; return raw; } // With this in place, we use the using_cmap_keyarg() macro to define {Viking -> int} hash map type: - using_cmap_keyarg(vk, Viking, int, vikingraw_equals, vikingraw_hash, viking_del, viking_fromRaw, viking_toRaw, VikingRaw); |
