From a2aa14cc91ccbd42cd1188c6fac6126a38d0de77 Mon Sep 17 00:00:00 2001 From: Tyge Løvset Date: Sat, 11 Sep 2021 22:58:58 +0200 Subject: Fixed docs for newstyle. --- docs/csptr_api.md | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'docs/csptr_api.md') diff --git a/docs/csptr_api.md b/docs/csptr_api.md index 10d3bb77..a7f37481 100644 --- a/docs/csptr_api.md +++ b/docs/csptr_api.md @@ -21,13 +21,16 @@ See the c++ classes [std::shared_ptr](https://en.cppreference.com/w/cpp/memory/s ## 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_csptr(X, Value); -using_csptr(X, Value, valueCompare); -using_csptr(X, Value, valueCompare, valueDel); ``` -The macro `using_csptr()` must be instantiated in the global scope. `X` is a type tag name and will affect the names of all csptr types and methods. E.g. declaring `using_csptr(v4, Vec4)`, `X` should be replaced by `v4` in all of the following documentation. +`X` should be replaced by the value of i_tag in all of the following documentation. ## Methods @@ -79,6 +82,7 @@ void Person_del(Person* p) { c_del(cstr, &p->name, &p->last); } + using_csptr(person, Person, c_no_compare, Person_del); int main() { -- cgit v1.2.3