summaryrefslogtreecommitdiffhomepage
path: root/docs/csptr_api.md
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2021-09-11 22:58:58 +0200
committerTyge Løvset <[email protected]>2021-09-11 22:58:58 +0200
commita2aa14cc91ccbd42cd1188c6fac6126a38d0de77 (patch)
tree843baa1eba7abae70b54326ca898607eedbc5e76 /docs/csptr_api.md
parent658019e1e53ad1ccbca5c623b7199c445eab8b86 (diff)
downloadSTC-modified-a2aa14cc91ccbd42cd1188c6fac6126a38d0de77.tar.gz
STC-modified-a2aa14cc91ccbd42cd1188c6fac6126a38d0de77.zip
Fixed docs for newstyle.
Diffstat (limited to 'docs/csptr_api.md')
-rw-r--r--docs/csptr_api.md14
1 files changed, 9 insertions, 5 deletions
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 <stc/csptr.h>
-
-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() {