summaryrefslogtreecommitdiffhomepage
path: root/docs/cstack_api.md
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2021-03-24 14:29:44 +0100
committerTyge Løvset <[email protected]>2021-03-24 14:29:44 +0100
commitb1b19bc2e5a2732e59583184bfa18a34052d5ae1 (patch)
treee800bc0645b4de5b2116c223e99aa23fd79e66ce /docs/cstack_api.md
parentc96dc0a43037dd14cd0e2539c988a343d99cc728 (diff)
downloadSTC-modified-b1b19bc2e5a2732e59583184bfa18a34052d5ae1.tar.gz
STC-modified-b1b19bc2e5a2732e59583184bfa18a34052d5ae1.zip
Cleanup in documentation.
Diffstat (limited to 'docs/cstack_api.md')
-rw-r--r--docs/cstack_api.md14
1 files changed, 8 insertions, 6 deletions
diff --git a/docs/cstack_api.md b/docs/cstack_api.md
index 83e95199..9d644b5c 100644
--- a/docs/cstack_api.md
+++ b/docs/cstack_api.md
@@ -20,7 +20,7 @@ affect the names of all cstack types and methods. E.g. declaring `using_cstack(i
All cstack definitions and prototypes are available by including a single header file.
```c
-#include "stc/cstack.h" /* includes default underlying implementation header cvec.h */
+#include <stc/cstack.h> /* includes default underlying implementation header cvec.h */
```
## Methods
@@ -61,22 +61,24 @@ cstack_X_value_t cstack_X_value_clone(cstack_X_value_t val);
## Example
```c
+#include <stc/cstack.h>
#include <stdio.h>
-#include "stc/cstack.h"
using_cvec(i, int);
using_cstack(i, cvec_i);
int main() {
- cstack_i stack = cstack_i_init();
+ cstack_i S = cstack_i_init();
for (int i=0; i < 100; ++i)
- cstack_i_push(&stack, i*i);
+ cstack_i_push(&S, i*i);
for (int i=0; i < 90; ++i)
- cstack_i_pop(&stack);
+ cstack_i_pop(&S);
- printf("top: %d\n", *cstack_i_top(&stack));
+ printf("top: %d\n", *cstack_i_top(&S));
+
+ cstack_i_del(&S);
}
```
Output: