summaryrefslogtreecommitdiffhomepage
path: root/docs/cstack_api.md
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2021-09-09 08:28:10 +0200
committerTyge Løvset <[email protected]>2021-09-09 08:28:10 +0200
commit52cb5b409447d5c5c3b799b64315dd48fdd445ef (patch)
treeef1a26d5d0265b84a37e36907a4674beb94448f0 /docs/cstack_api.md
parent180cc60feebea8126e1c2012092782b53e164648 (diff)
downloadSTC-modified-52cb5b409447d5c5c3b799b64315dd48fdd445ef.tar.gz
STC-modified-52cb5b409447d5c5c3b799b64315dd48fdd445ef.zip
Updated examples in docs.
Diffstat (limited to 'docs/cstack_api.md')
-rw-r--r--docs/cstack_api.md22
1 files changed, 12 insertions, 10 deletions
diff --git a/docs/cstack_api.md b/docs/cstack_api.md
index 3d9ecd4f..0bb5138b 100644
--- a/docs/cstack_api.md
+++ b/docs/cstack_api.md
@@ -8,14 +8,17 @@ See the c++ class [std::stack](https://en.cppreference.com/w/cpp/container/stack
## Header file and declaration
```c
-#include <stc/cstack.h> /* includes default underlying implementation header cvec.h */
-
-using_cstack(X, ctype)
+#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/cstack.h>
```
-The macro `using_cstack()` must be instantiated in the global scope. **cstack** uses normally
-a **cvec_X** or **cdeq_X** type as underlying implementation, given as `ctype`. `X` is a type tag name and will
-affect the names of all cstack types and methods. E.g. declaring `using_cstack(i, cvec_i);`,
-`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
@@ -54,12 +57,11 @@ cstack_X_value_t cstack_X_value_clone(cstack_X_value_t val);
## Example
```c
+#define i_tag i
+#define i_val int
#include <stc/cstack.h>
#include <stdio.h>
-using_cvec(i, int);
-using_cstack(i, cvec_i);
-
int main() {
cstack_i S = cstack_i_init();