From 52cb5b409447d5c5c3b799b64315dd48fdd445ef Mon Sep 17 00:00:00 2001 From: Tyge Løvset Date: Thu, 9 Sep 2021 08:28:10 +0200 Subject: Updated examples in docs. --- docs/csset_api.md | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'docs/csset_api.md') diff --git a/docs/csset_api.md b/docs/csset_api.md index d308fefd..8bf83a17 100644 --- a/docs/csset_api.md +++ b/docs/csset_api.md @@ -8,18 +8,16 @@ See the c++ class [std::set](https://en.cppreference.com/w/cpp/container/set) fo ## 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 - -using_csset(X, Key); -using_csset(X, Key, keyCompare); -using_csset(X, Key, keyCompare, keyDel, keyClone = c_no_clone); -using_csset(X, Key, keyCompareRaw, keyDel, keyFromRaw, keyToRaw, RawKey, flag); - -using_csset_str(); // using_csset(str, cstr, cstr_del, cstr_from, cstr_str, const char*, c_true) ``` -The macro `using_csset()` must be instantiated in the global scope. `X` is a type tag name and -will affect the names of all csset types and methods. E.g. declaring `using_csset(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 @@ -69,10 +67,10 @@ csset_X_value_t csset_X_value_clone(csset_X_value_t val); ## Example ```c -#include #include -using_csset_str(); +#define i_key_str +#include int main () { -- cgit v1.2.3